From 973b1a46b4ddb65776e084eb74f472397b2935fd Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 17 2020 22:15:41 +0000 Subject: gperf-3.1 base --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..184c7ce --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Douglas C. Schmidt +Bruno Haible diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..d1926b7 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3926 @@ +2017-01-02 Marcel Schaible + + * gperf-3.1 released. + +2016-12-29 Bruno Haible + + Make autogen.sh more user-friendly. + * autogen.sh: Emit a message at the end, if everything succeeded. + +2016-12-03 Bruno Haible + + Make Makefile.devel more useful for the users of the released tarball. + * Makefile.devel (totally-clean): New target. + * autogen.sh: Invoke it and 'all'. + +2016-11-27 Bruno Haible + + Fix build with mingw. + * README.windows: Augment PATH for mingw, so that it finds libstdc++. + +2016-11-27 Bruno Haible + + Assume the available C compiler supports ANSI C. Remove K&R C cruft. + * lib/getopt.h: Assume 'const' is defined. Use ANSI C prototypes. + * lib/getopt.c: Assume 'const' is defined. Use ANSI C prototypes. + Include . Declare strcmp and strlen. + * lib/getopt1.c: Assume 'const' and NULL are defined. Use ANSI C + prototypes. + * lib/getopt.h.patch: Remove file. + * lib/getopt.c.patch: Remove file. + * lib/Makefile.in (SOURCE_FILES): Remove them. + * tests/jstest*.gperf: Assume 'const' is defined. + * tests/test.c: Use ANSI C prototypes. + (in_word_set): Fix prototype. + * tests/test2.c: Use ANSI C prototypes. + (in_word_set): Fix prototype. + Reported by Erik Johansson at . + +2016-11-26 Bruno Haible + + Drop the inline specifiers from the generated lookup function. + It's not adequate because + - this lookup function is quite large in fact, not worth inlining, + - with gcc -O0, it leads to link errors, see + + - the hash function is 'static', the lookup function is non-static, + but references from non-static inline functions to static functions + and variables are forbidden, see ISO C 99 section 6.7.4.(3). + * src/output.cc (Output::output_lookup_function): Don't emit an inline + specifier. + * tests/*.exp: Update. + Reported by Sebastian Freundt and Sergii Strelkovskyi + at . + +2016-11-26 Bruno Haible + + Change mailing list address to . + * src/output.cc (Output::output): Change bug report address to + . + * src/options.cc (Options::long_usage): Likewise. + * README: Likewise. + * doc/gperf.texi (Contributors): Likewise. + * tests/*.{c,exp,out}: Update. + Reported by Eric Blake + at . + +2016-11-26 Bruno Haible + + Change the 'len' parameter type to 'size_t'. + * src/output.cc (output_upperlower_strncmp, output_upperlower_memcmp, + Output::output_hash_function, Output::output_lookup_function, + Output::output): Emit declarations with 'size_t len' instead of + 'unsigned int len'. + * tests/*.exp: Update. + * doc/gperf.texi (Output Format): Change declarations of 'hash' and + 'in_word_set'. + * NEWS: Mention the change. + Reported by Pedro Giffuni + at . + +2016-11-26 Bruno Haible + + Use proper 'ar' program when cross-compiling or when AR is specified. + * lib/configure.ac (AR): Determine through AC_CHECK_TOOL. + * lib/Makefile.in (AR): Use value determined by 'configure'. + Reported by György Andrasek + at . + +2016-11-26 Bruno Haible + + Avoid 'warning: cast from pointer to integer of different size' + in output code on 64-bit native Windows platforms. + * src/output.cc (output_keyword_entry): Cast pointer to 'size_t', + not to 'long', before casting it further to 'int'. + * tests/*.exp: Update. + Reported at . + +2016-11-26 Bruno Haible + + Don't use 'register' storage-class specifier in C++ output code. + * src/output.cc (register_scs): New variable. + (Output::Output): Initialize it. + (output_upperlower_strcmp, output_upperlower_strncmp, + output_upperlower_memcmp, Output::output_hash_function, + Output::output_lookup_function_body, Output::output_lookup_function): + Use it. + Reported at . + +2016-11-26 Bruno Haible + + Avoid 'warning: use of old-style cast' in output code. + * src/output.h (Output::output_asso_values_index): New method + declaration. + * src/output.cc (Output::output_asso_values_index): New method, + extracted from Output::output_asso_values_ref. + (Output::output_asso_values_ref): Use it. In C++ mode, emit C++ style + cast syntax. + Reported at . + +2016-11-26 Bruno Haible + + Avoid 'warning: implicit conversion changes signedness' in output code. + * src/output.cc (Output::output_lookup_function_body): Emit declaration + of 'key' as 'unsigned int', not 'int'. Optimize comparison accordingly. + * tests/*.exp: Update. + Reported at . + +2016-11-26 Bruno Haible + + Avoid 'warning: implicit conversion changes signedness' in output code. + * src/output.cc (Output::output_hash_function): Emit declaration of + 'hval' as 'unsigned int', not 'int'. + * tests/*.exp: Update. + Reported at . + +2016-11-25 Bruno Haible + + Fix g++ -Wall warnings. + * src/search.cc (Search::prepare, Search::find_positions, + Search::optimize): Add braces in 'if (...) for (...)', to pacify + g++ 4.6.3 warnings "suggest explicit braces to avoid ambiguous 'else'" + (although there is no 'else'!). + +2016-11-25 Bruno Haible + + Fix typo in autogen.sh, introduced on 2012-07-01. + * autogen.sh: Fix typo. + +2016-11-25 Bruno Haible + + Fix "make check" error on Mac OS X. + * tests/Makefile.in (POSTPROCESS_FOR_MINGW): Run 'sed' in the C locale. + This fixes an error "sed: RE error: illegal byte sequence" on Mac OS X + when producing languages.out. + Reported at . + +2016-11-23 Bruno Haible + + Update installation instructions for Windows. + * README.windows: Assume a 64-bit Windows. Explain both 32-bit and + 64-bit builds. Revamp instructions for the MS Visual C/C++ tool chain + and for Cygwin. + +2016-11-23 Bruno Haible + + Drop the nickname "woe32". + * README.windows: Renamed from README.woe32. + * Makefile.in (SOURCE_FILES): Update. + +2016-11-19 Bruno Haible + + doc: Prepare for possible use of GNU texi2any. + * doc/Makefile.in (TEXI2ANY): New variable. + (gperf_0.html): New rule. + +2016-11-19 Bruno Haible + + doc: Don't generate Postscript-formatted doc by default. + * doc/Makefile.in (all): Don't depend on 'ps'. + +2014-10-15 Eric Blake + + doc: fix invalid use of @itemx + * doc/gperf.texi (Output Details): Use correct macro. + +2012-07-01 Bruno Haible + + Fix "make clean" with MSVC. + With MSVC 9, a program is created together with a .manifest file. + * src/Makefile.in (clean): Remove also the .manifest file. + * tests/Makefile.in (clean): Remove also the .manifest files. + +2012-07-01 Bruno Haible + + Update expected test results. + * tests/test-6.exp: Expect to see --constants-prefix option. + +2012-07-01 Bruno Haible + + Fix compilation error with MSVC. + * src/output.cc: Include config.h. + (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros, copied from + src/search.cc. + (output_constant): Use them. + +2012-07-01 Bruno Haible + + Remove old infrastructure for building with MSVC. + * autogen.sh: Don't remove src/config.h.msvc. + * Makefile.devel (src/config.h.msvc): Remove rule. + (all): Don't depend on it. + * src/Makefile.in (GENERATED_FILES): Remove config.h.msvc. + * src/.gitignore: Remove config.h.msvc. + * Makefile.msvc: Remove file. + * Makefile.in (SOURCE_FILES): Remove Makefile.msvc. + +2012-07-01 Bruno Haible + + Support for building with MSVC much like for Unix. + * autogen.sh: Fetch also 'compile' and 'ar-lib'. + * Makefile.in (IMPORTED_FILES): Add build-aux/compile, build-aux/ar-lib. + * build-aux/.gitignore: Ignore also 'compile' and 'ar-lib'. + * lib/Makefile.in: Use $(OBJEXT) where suitable. + * README.woe32: Change instructions for compiling with MSVC. + +2012-07-01 Bruno Haible + + Move build infrastructure files to build-aux/. + * autogen.sh: Copy install-sh and mkinstalldirst into build-aux/. + * configure.ac: Invoke AC_CONFIG_AUX_DIR. + * Makefile.in (IMPORTED_FILES): Update. + (distdir): Create subdirectories as needed. + * doc/Makefile.in (MKINSTALLDIRS): Update. + * src/Makefile.in (MKINSTALLDIRS): Update. + * .gitgnore: Remove install-sh, mkinstalldirs. + * build-aux/.gitignore: New file. + +2012-07-01 Bruno Haible + + Distribute install-sh. + * autogen.sh: Fetch also install-sh. + * Makefile.in (IMPORTED_FILES): Add install-sh. + * configure.ac: Remove hack with AC_CONFIG_AUX_DIR_DEFAULT. + * .gitignore: Add install-sh. + +2012-07-01 Bruno Haible + + Remove files distributed via gnulib from version control. + * autogen.sh: Fetch mkinstalldirs from the gnulib repository. + * mkinstalldirs: Remove file. + * .gitignore: Add mkinstalldirs. + +2012-07-01 Bruno Haible + + Remove autotools generated files from version control. + * autogen.sh: New file. + * configure: Remove file. + * lib/configure: Remove file. + * src/configure: Remove file. + * tests/configure: Remove file. + * doc/configure: Remove file. + * src/config.h.in: Remove file. + * src/config.h.msvc: Remove file. + * src/config.h_vms: Remove file. + * .gitignore: Ignore configure. + * lib/.gitignore: New file. + * src/.gitignore: New file. + * tests/.gitignore: New file. + * doc/.gitignore: Ignore configure. + +2012-07-01 Bruno Haible + + Turn doc/gperf.1 into a distributed built file. + * doc/gperf.1: Remove file. + * Makefile.devel (doc/gperf.1): Remove rule. + (all): Don't depend on it. + * doc/Makefile.in (man, gperf.1, gperf.1-update): New rules. + (all): Depend on man. + (distdir): Depend on gperf.1-update. + (GENERATED_FILES): Remove gperf.1. + (DISTRIBUTED_BUILT_FILES): Add gperf.1. + * doc/.gitignore: Add gperf.1. + * configure (AC_INIT): Rely on doc/gperf.texi, not doc/gperf.1. + * doc/configure (AC_INIT): Rely on gperf.texi, not gperf.1. + +2012-07-01 Bruno Haible + + Remove distributed built files from version control. + * doc/.gitignore: New file. + * doc/gperf.info: Remove file. + * doc/gperf.dvi: Remove file. + * doc/gperf.ps: Remove file. + * doc/gperf.pdf: Remove file. + * doc/gperf.html: Remove file. + * doc/gperf_toc.html, doc/gperf_[0-9].html, doc/gperf_[0-9][0-9].html: + Remove files. + +2012-07-01 Bruno Haible + + Allow editor backup files in git checkouts. + * .gitignore: New file. + +2012-07-01 Bruno Haible + + Create tarballs through an Automake-like "make dist" command. + * Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES, + DISTRIBUTED_BUILT_FILES, DISTFILES): New macros. + (distdir): New rule. + (PACKAGE, VERSION, TAR, GZIP): New macros. + (dist): New rule. + * doc/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES, + DISTRIBUTED_BUILT_FILES, DISTFILES): New macros. + (distdir): New rule. + * lib/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES, + DISTRIBUTED_BUILT_FILES, DISTFILES): New macros. + (distdir): New rule. + * src/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES, + DISTRIBUTED_BUILT_FILES, DISTFILES): New macros. + (distdir): New rule. + * tests/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES, + DISTRIBUTED_BUILT_FILES, DISTFILES): New macros. + (distdir): New rule. + +2012-04-28 Bruno Haible + + * configure: Regenerated with autoconf-2.69. + * doc/configure: Likewise. + * lib/configure: Likewise. + * src/configure: Likewise. + * tests/configure: Likewise. + +2011-01-16 Bruno Haible + + * src/options.cc (Options::parse_options): Bump copyright year. + + New option --constants-prefix. + * src/options.h (Options): Add member functions get_constants_prefix, + set_constants_prefix. Add member _constants_prefix. + * src/options.icc (Options::get_constants_prefix): New functions. + * src/options.cc (DEFAULT_CONSTANTS_PREFIX): New constant. + (Options::long_usage): Document --constants-prefix option. + (Options::Options): Initialize _constants_prefix member. + (Options::set_constants_prefix): New function. + (long_options): Add --constants-prefix option. + (Options::parse_options): Handle --constants-prefix option. + * src/input.cc (Input::read_input): Handle %define constants-prefix + declaration. + * src/output.cc (output_constant): New function. + (Output::output_constants): Invoke it. + (Output::output_lookup_function_body): Prefix each reference to a + constant with the constants prefix. + * doc/gperf.texi: Bump copyright year. + (Gperf Declarations): Document %define constants-prefix. + (Controlling Identifiers): New section. + (Output Details): Document --constants-prefix option. + * NEWS: Mention the changes. + Reported by Julian Zubek . + +2011-01-16 Bruno Haible + + * configure: Regenerated with autoconf-2.68. + * doc/configure: Likewise. + * lib/configure: Likewise. + * src/configure: Likewise. + * tests/configure: Likewise. + +2010-07-31 Bruno Haible + + * configure: Regenerated with autoconf-2.67. + * doc/configure: Likewise. + * lib/configure: Likewise. + * src/configure: Likewise. + * tests/configure: Likewise. + +2010-07-04 Bruno Haible + + * configure: Regenerated with autoconf-2.66. + * doc/configure: Likewise. + * lib/configure: Likewise. + * src/configure: Likewise. + * tests/configure: Likewise. + * src/config.h.in: Likewise. + * src/config.h.msvc: Likewise. + * src/config.h_vms: Likewise. + +2010-03-30 Bruno Haible + + Modernize README.woe32. + * README.woe32: Mention the mingw and Cygwin environments. + +2009-12-22 Eric Blake (tiny change) + + Avoid gcc warnings on Cygwin. + * lib/getopt.c (_getopt_internal): Add braces. Fix indentation. + * tests/smtp.gperf: Cast arguments of functions. + * tests/test2.c: Include . + +2009-12-22 Bruno Haible + + Avoid g++ warnings. + * src/options.cc (Options::print_options): Add parentheses. + * src/output.cc (Output::output_lookup_array): Cast fprintf argument. + +2009-12-22 Bruno Haible + + Support CPPFLAGS as mandated by GNU standards. + * lib/Makefile.in (CPPFLAGS): Use autoconf determined value. + * src/Makefile.in (CPPFLAGS): Likewise. + * tests/Makefile.in (CPPFLAGS): Likewise. + (check-c, check-ada, check-modula3, check-pascal, check-lang-utf8, + test.$(OBJEXT), check-lang-ucs2, test2.$(OBJEXT), check-smtp): Use + CPPFLAGS when compiling a .c file. + (VALIDATE): Pass also CPPFLAGS. + * tests/validate: Use CPPFLAGS when compiling a C or C++ file. + +2009-12-20 Bruno Haible + + * doc/gperf.info: Regenerated. + * doc/gperf*.html: Likewise. + * doc/gperf.dvi: Likewise. + * doc/gperf.ps: Likewise. + * doc/gperf.pdf: Likewise. + * tests/*.exp: Update. + + Change the default language to ANSI-C. + * src/options.cc (Options::long_usage): Mention new default language. + (Options::Options): Change default of _option_word. + (Options::set_language): Change fallback. + * doc/gperf.texi (Gperf Declarations, Output Language): Mention new + default language. + * NEWS: Mention the change. + Reported by Albert Cahalan . + + * src/version.cc (version_string): Bump to 3.1. + * doc/gperf.texi: Bump version. + +2009-12-20 Bruno Haible + + Allow processing the tests with parallel make. + * tests/Makefile.in (check-link-c, check-link-c++): Remove rules. + (test.$(OBJEXT), test2.$(OBJEXT)): New rules. + (check-c): Add commands for building cout. Depend on test.$(OBJEXT). + (check-ada, check-modula3, check-pascal, check-lang-utf8): Depend on + test.$(OBJEXT). + (check-lang-ucs2): Depend on test2.$(OBJEXT). + Reported by Bryan Østergaard . + +2009-02-01 Brendan Kehoe + + * gperf-3.0.4 released. + * src/version.cc: Bump to 3.0.4. + * tests/*.exp: Bump to 3.0.4 in header. + * doc/gperf.1: Regenerate with gperf 3.0.4. + * doc/gperf.texi: Adjust version. + + * doc/texinfo.tex: Update to copy from texinfo-4.13. + +2009-02-01 Bruno Haible + + * tests/Makefile.in (LDFLAGS, OBJEXT, EXEEXT): New variables. + (check-link-c, check-ada, check-modula3, check-pascal, check-lang-utf8, + check-lang-ucs2): Use OBJEXT and LDFLAGS. + (check-smtp): Use LDFLAGS. + (clean): Use EXEEXT as suffix of programs to be removed. + + * aclocal.m4 (CL_PROG_INSTALL): Fix detection of broken AIX installbsd + program. + + * tests/Makefile.in (clean): Remove *.dSYM directories left over by gcc + on MacOS X 10.5. + + * src/options.cc (Options::parse_options): Bump copyright year. + +2009-01-19 Bruno Haible + + Don't include the length in the hash function if all keywords have the + same length. + * src/search.h (Search): Add _hash_includes_len field. + * src/search.cc (Search::prepare): Initialize it. + (Search::count_duplicates_tuple, Search::count_duplicates_multiset, + Search::prepare_asso_values, Search::find_asso_values, + Search::compute_hash): Use it instead of !option[NOLENGTH]. + * src/output.h (Output): New field _hash_includes_len. Add it as + constructor argument. + * src/output.cc (Output::Output): Add hash_includes_len argument. + (Output::output_hash_function): Use _hash_includes_len instead of + !option[NOLENGTH]. + * src/main.cc (main): Pass _hash_includes_len from Search to Output. + * tests/permut2.exp: Updated expected test result. + * tests/permut3.exp: Likewise. + * tests/permutc2.exp: Likewise. + Reported by Behdad Esfahbod . + +2009-01-14 Bruno Haible + + * configure.ac: More consistent m4 quoting. + * src/configure.ac: Likewise. + * lib/configure.ac: Likewise. + * tests/configure.ac: Likewise. + * doc/configure.ac: Likewise. + +2009-01-01 Bruno Haible + + * doc/gperf.texi (Gperf Declarations): Mention the C99 standard. + +2008-08-23 Bruno Haible + + * doc/gperf.texi (Output Copyright): Reword more carefully. + Suggested by Paul Jarc . + +2008-08-23 Bruno Haible + + * doc/gperf.texi (Output Copyright): Adjust for GPLv3. + +2008-08-23 Bruno Haible + + All source files are now under GPLv3+. + * COPYING: Replace with GPLv3. + * **/configure.ac, **/Makefile.*, **/*.h, **/*.c, **/*.cc, **/*.icc: + Change copyright notice to GPLv3+. + * src/options.cc (Options::parse_options): Update --version output + accordingly. + * doc/gperf.texi: Reference the GPLv3. + * doc/gpl-3.0.texi: New file, copied from the gnulib git repository. + * doc/gpl.texinfo: Remove file. + * doc/Makefile.in: Update. + +2008-05-06 Bruno Haible + + * doc/gperf.texi: Set @firstparagraphindent. + (Bibliography): Don't indent the entries. + +2008-05-06 Bruno Haible + + * doc/gperf.texi (Output Copyright): New section. + Reported by Mike Ingrassia and + Karice McIntyre . + +2008-04-06 Bruno Haible + + * tests/Makefile.in: Use "LC_ALL=C tr" instead of "tr". + +2007-09-08 Bruno Haible + + Change generated code to avoid a warning by GCC 4.2 that the meaning + of __inline will be changed (!). + * src/output.cc (Output::output_lookup_function): Emit the inline + marker also for gcc-4.2 in c99 mode. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + Reported by Jim Meyering . + +2007-09-08 Bruno Haible + + Allow creating the HTML documentation with texi2html or makeinfo. + * doc/texi2html: New file, from GNU gettext. + * doc/Makefile.in (TEXI2HTML): Invoke it. + (gperf.html, gperf_toc.html): Don't pass option -expandinfo. + * doc/gperf.texi (makeinfo): New variable. + (dircategory, direntry): Enclose in @ifinfo. + (Table of Contents): Move to the beginning except in TeX mode. + +2007-04-30 Brendan Kehoe + + * gperf-3.0.3 released. + * src/version.cc: Bump to 3.0.3. + * tests/*.exp: Bump to 3.0.3 in header. + * doc/gperf.1: Regenerate with gperf 3.0.3. + +2007-04-06 Bruno Haible + + Improve support for mingw. + * tests/Makefile.in (check-c, check-ada, check-modula3, check-pascal, + check-lang-utf8, check-lang-ucs2): Remove '\r' from output before diff. + (POSTPROCESS_FOR_MINGW): New variable. + (check-test): Use it to postprocess output before diff. + +2007-04-04 Bruno Haible + + Support for newer GNU standards. + * doc/configure.ac (mandir): Remove assignment. + * doc/Makefile.in (datarootdir): New variable. + (docdir, dvidir, psdir, pdfdir, htmldir): Use value determined by + autoconf. + * configure.ac: Require autoconf >= 2.60. + * doc/configure.ac: Likewise. + * lib/configure.ac: Likewise. + * src/configure.ac: Likewise. + * tests/configure.ac: Likewise. + * configure: Regenerated with autoconf-2.61. + * doc/configure: Likewise. + * lib/configure: Likewise. + * src/configure: Likewise. + * tests/configure: Likewise. + * src/config.h.in: Likewise. + * src/config.h.msvc: Likewise. + * src/config.h_vms: Likewise. + +2007-04-04 Bruno Haible + + * doc/Makefile.in (MAKEINFO): Disable also the LC_MESSAGES and LC_ALL + environment variables. + +2007-04-04 Bruno Haible + + * configure.ac: Renamed from configure.in. + * doc/configure.ac: Renamed from doc/configure.in. + * lib/configure.ac: Renamed from lib/configure.in. + * src/configure.ac: Renamed from src/configure.in. + * tests/configure.ac: Renamed from tests/configure.in. + * Makefile.devel: Update. + * INSTALL: Update. + +2007-03-31 Bruno Haible + + * tests/test.c (in_word_set): New declaration. + * tests/test2.c (in_word_set): Likewise. + +2007-03-31 Bruno Haible + + * src/options.cc (Options::parse_options): Bump copyright year. + +2007-03-31 Bruno Haible + + * doc/gperf.texi: Fix typo. + +2007-03-31 Bruno Haible + + Change generated code after the meaning of __inline is changed in + GCC 4.3. + * src/output.cc (Output::output_lookup_function): Emit an inline + marker that also works with gcc-4.3 in c99 or gnu99 mode. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + Reported by Bruce Korb . + +2006-06-29 Brendan Kehoe + + * gperf-3.0.2 released. + + * doc/Makefile.in (all): No longer depend on dvi. + +2006-01-22 Brendan Kehoe + + * doc/gperf.texi: Update copyright to be 1989-2006. + (UPDATED): Change to 22 January 2006. + * doc/gperf.1 (TH): Fix date. + * configure.in: Update copyright years. + * configure: Regenerate. + * src/Makefile.in: Update copyright years. + + * doc/gperf.{dvi,ps,pdf}: Regenerated by manually invoking tex + instead of trying to use texi2dvi, whose run of etex ends up + actually always running pdfetex, thus always recreating gperf.pdf. + +2006-01-13 Brendan Kehoe + + * NEWS: Add note about #line directive fix. + * doc/gperf.1: Regenerate with Makefile.devel. + + * doc/gperf.texi (UPDATED): Correct to be today. + * doc: Regenerated by doing make in a configured tree. + Requires makeinfo, texi2dvi, texi2pdf, and texi2html. + + * configure.in: Add AC_OBJEXT and AC_EXEEXT. + * lib/Makefile.in (OBJEXT): Define for subst. + (OBJECTS): Use $(OBJEXT) instead of '.o'. + * src/Makefile.in: Make dependencies use $(OBJEXT). + (OBJEXT, EXEEXT): Define for subst. + (TARGETPROG): Add $(EXEEXT). + (OBJECTS): Use $(OBJEXT) instead of '.o'. + (clean): Remove *.$(OBJEXT) instead of *.o. + +2006-01-13 Bruno Haible + + Fix #line directives for filenames containing backslashes. + * src/output.cc (output_line_directive): New function. + (output_keyword_entry, Output::output): Use it. + Reported by Alexander . + + * src/options.cc (Options::parse_options): Update years in --version + output. + +2005-08-29 Brendan Kehoe + + * src/keyword.cc: Tweak comment to avoid nesting. + +2005-08-27 Bruno Haible + + Fix missing ranlib detection when cross-compiling. + * aclocal.m4 (CL_PROG_RANLIB): Remove macro. + * lib/configure.in: Use AC_PROG_RANLIB instead of CL_PROG_RANLIB. + +2005-07-30 Bruno Haible + + * src/version.cc: Bump version number to 3.0.2. + * doc/gperf.texi: Likewise. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + +2005-07-30 Bruno Haible + + * src/positions.h: Add forward declarations of friend classes. + Needed for compilation with g++ 4.0. + +2004-08-22 Bruno Haible + + * tests/Makefile.in (check-lang-syntax): Add test for the + --length-table-name option. + * tests/test-6.exp: Update. + +2004-08-21 Bruce Lilly + + * src/input.cc (Input::read_input): Accept length-table-name + declaration. + * src/options.h (Options::get_lengthtable_name, + Options::set_lengthtable_name): New declarations. + (Options): Add field _lengthtable_name. + * src/options.icc (Options::get_lengthtable_name): New inline method. + * src/options.cc (DEFAULT_LENGTHTABLE_NAME): New constant. + (Options::long_usage): Document --length-table-name option. + (Options::Options): Initialize _lengthtable_name field. + (Options::~Options): Update. + (Options::set_lengthtable_name): New method. + (long_options): Add option --length-table-name. + (Options::parse_options): Implement --length-table-name option. + * src/output.cc (Output::output_keylength_table, output_switch_case, + Output::output_lookup_function_body): Use option.get_lengthtable_name. + * doc/gperf.texi (Gperf Declarations): Document %define + length-table-name. + (Output Details): Document --length-table-name option. + +2003-06-12 Bruno Haible + + * gperf-3.0.1 released. + + * src/version.cc: Bump version number to 3.0.1. + * doc/gperf.texi: Likewise. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + +2003-05-31 Bruno Haible + + * doc/gperf.texi (User-supplied Struct): Mention the possibility of an + abbreviated struct declaration. + * src/input.cc (Input::read_input): Support struct declarations of the + form "struct foo;". + * tests/incomplete.gperf: New file. + * tests/incomplete.exp: New file. + * tests/Makefile.in (check-test): Check incomplete.gperf too. + Reported by Rob Leslie . + +2003-05-20 Bruno Haible + + * doc/Makefile.in (gperf.ps): Don't use $< in a target rule. + +2003-05-27 Bruno Haible + + * Makefile.vms (CC): Correct value. + (getopt.obj, getopt1.obj, getline.obj, hash.obj): Don't set + HAVE_CONFIG_H. + +2003-05-17 Bruno Haible + + * Makefile.msvc (DEBUGFLAGS): New variable. + (gperf.exe): Use it, and MFLAGS too. + +2003-05-08 Bruno Haible + + * gperf-3.0 released. + +2003-05-07 Bruno Haible + + * src/version.cc: Bump version number to 3.0. + * doc/gperf.texi: Likewise. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/java.exp, + tests/languages.exp, tests/modula2.exp, tests/objc.exp, + tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp, + tests/test-4.exp: Update. + + * src/configure.in: Fix AC_INIT argument. + + * Makefile.devel (configure, lib/configure, src/configure, + tests/configure, doc/configure): Use the newest autoconf. + (src/config.h.in): Use the newest autoheader. + +2003-05-03 Bruno Haible + + * doc/gperf.texi: Use two spaces as sentence separator, as recommended + by the texinfo manual. + +2003-04-12 Bruno Haible + + * doc/configure.in (mandir): Change default value. + * doc/Makefile.in (docdir): Use datadir instead of prefix. + * Makefile.msvc (datadir): New variable. + (mandir, docdir): Use it instead of prefix. + (install, installdirs): Update. + * Makefile.vms (datadir): New variable. + (mandir, docdir): Use it instead of prefix. + (install, installdirs): Update. + +2003-04-12 Bruno Haible + + * README.vms: New file. + * Makefile.vms: New file. + * Makefile.devel (src/config.h_vms): New rule. + (all): Depend on it. + +2003-03-19 Bruno Haible + + * src/input.cc (Input::read_input): Ignore comments at the beginning + of the declarations section. + * doc/gperf.texi (Controls for GNU indent): New section. + Reported by Bruce Lilly . + +2003-03-19 Bruno Haible + + * src/output.cc (Output::output_hash_function): Avoid lint warning if + not all arguments of the hash function are used. Avoid lint warning + for fallthrough in switch. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/java.exp, tests/languages.exp, + tests/modula2.exp, tests/objc.exp: All /*FALLTHROUGH*/ to expected + output. + Reported by Bruce Lilly . + +2003-03-01 Bruno Haible + + * src/options.h (Options::set_initializer_suffix): New declaration. + * src/options.cc (Options::set_initializer_suffix): New method. + * src/input.cc (Input::read_input): Recognize %define + initializer-suffix. + * doc/gperf.texi (Gperf Declarations): Document %define + initializer-suffix. + * NEWS: Update. + +2003-02-26 Bruno Haible + + * Makefile.msvc: New file. + * README.woe32: New file. + * Makefile.devel (all): Depend on src/config.h.msvc. + (src/config.h.msvc): New rule. + +2003-01-07 Bruno Haible + + * src/input.h (Input::_charset_dependent): New field. + * src/input.cc (Input::read_input): Also set _charset_dependent. + * src/main.cc (main): Pass _charset_dependent from Input to Output. + * src/output.h (Output::Output): Add charset_dependent argument. + (Output::_charset_dependent): New field. + * src/output.cc (Output::Output): Add charset_dependent argument. + (Output::output): Provoke a compilation error if the execution + character set doesn't match the expectations. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/java.exp, + tests/languages.exp, tests/modula2.exp, tests/objc.exp, + tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp, + tests/test-4.exp: Update. + + * src/options.cc (Options::long_usage): Change bug report address to + . + * tests/test-6.exp: Update. + + * src/output.cc (USE_DOWNCASE_TABLE): New macro. + (output_upperlower_table): New function. + (output_upperlower_strcmp, output_upperlower_strncmp, + output_upperlower_memcmp): Emit gperf_downcase array accesses. + (Output::output): Call output_upperlower_table. + * tests/permutc2.exp: Update. + + * src/keyword-list.icc (KeywordExt_List::rest): Use a portable cast. + (Only in GCC a cast of an lvalue is an lvalue.) + +2003-01-01 Bruno Haible + + * src/options.cc (Options::parse_options): Update copyright year. + + * doc/gperf.texi (@author): Add me. + + * src/options.h (NULLSTRINGS): New enum value. + (Options::get_stringpool_name, Options::set_stringpool_name): New + method declarations. + (Options::_stringpool_name): New field. + * src/options.icc (Options::get_stringpool_name): New method. + * src/options.cc (DEFAULT_STRINGPOOL_NAME): New variable. + (Options::long_usage): Document -Q and --null-strings. + (Options::Options): Initialize _stringpool_name. + (Options::~Options): Output _stringpool_name, NULLSTRINGS values too. + (Options::set_stringpool_name): New method. + (long_options): Add options --string-pool-name, --null-strings. + (Options::parse_options): Implement options -P, -Q and --null-strings. + * src/input.cc (Input::read_input): Recognize declarations %pic, + %define string-pool-name, %null-strings. + * src/output.h (Output::output_string_pool, + Output::output_lookup_pools): New method declarations. + (Output::_wordlist_eltype): New field. + * src/output.cc (Output::output_keylength_table): Trivial + simplification. + (Output::output_string_pool): New method. + (output_keyword_entry): Add stringpool_index argument. For SHAREDLIB, + use struct offsets. + (output_keyword_blank_entries): For SHAREDLIB, use -1 instead of "". + (Output::output_keyword_table): Use _wordlist_eltype instead of + _struct_tag. Compute stringpool_index for output_keyword_entry. + (Output::output_lookup_pools): New method. + (Output::output_lookup_function_body): Use _wordlist_eltype instead of + _struct_tag. For SHAREDLIB, use "+ stringpool" to convert offsets to + strings. Use "o >= 0" to test for nonempty table entry. + (Output::output_lookup_function): Call output_lookup_pools. + (Output::output): Initialize _wordlist_eltype. Call + output_lookup_pools. + * tests/jstest4.gperf: New file. + * tests/test-6.exp: Update. + * tests/Makefile.in (check-lang-syntax): Drop test of -p. Add tests of + -P and -Q. + * doc/gperf.texi (User-supplied Struct): Mention that first field has + to be of type 'int' if -P is given. + (Gperf Declarations): Document %pic, %define string-pool-name, + %null-strings. + (Output Details): Update description of option -P. Document options -Q + and --null-strings. + + * tests/Makefile.in (check-link-c, check-ada, check-pascal, + check-test): Omit option -p. + * tests/c-parse.exp: Regenerated. + * tests/chill.exp: Regenerated. + * tests/cplusplus.exp: Regenerated. + * tests/gpc.exp: Regenerated. + * tests/java.exp: Regenerated. + * tests/objc.exp: Regenerated. + * tests/test-4.exp: Regenerated. + + * src/output.cc (Output::output_lookup_function_body): Omit the + multicompare code section and its variables when it is not used. + * tests/chill.exp: Regenerated. + + * src/output.c (Output_Compare::output_firstchar_comparison): New + method. + (Output_Compare_Strcmp::output_comparison, + Output_Compare_Strncmp::output_comparison, + Output_Compare_Memcmp::output_comparison): Use it. + * tests/permutc2.exp: Update. + + * tests/smtp.gperf: New file, based on a contribution by Bruce Lilly. + * tests/Makefile.in (check-smtp): New rule. + (check): Depend on it. + (clean): Update. + +2002-12-12 Bruno Haible + + * src/search.h (Search::init_selchars_tuple, + Search::count_duplicates_tuple): Add alpha_unify argument. + (Search::count_duplicates_tuple): New method declaration. + * src/search.cc (Search::init_selchars_tuple, + Search::count_duplicates_tuple): Add alpha_unify argument. + (Search::find_positions): Update. + (Search::count_duplicates_tuple): New method. + (Search::count_duplicates_multiset): Free temp alpha_unify vector. + (Search::find_alpha_inc): Call count_duplicates_tuple. + + * src/configure.in: Add test for stack-allocated variable-size arrays. + * src/config.h.in: Regenerated. + * src/search.cc: Include config.h. + (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros. + (Search::find_alpha_inc, Search::count_possible_collisions, + Search::find_asso_values): Use them. + * src/Makefile.in (search.o): Depend on config.h. + + * src/search.h (Search::keyword_list_length, Search::max_key_length, + Search::get_max_keysig_size, Search::prepare): Remove declarations. + (Search::prepare): Renamed from Search::preprepare. + (Search::_max_selchars_length): New field. + * src/search.cc (Search::prepare): Renamed from Search::preprepare. + (Search::prepare_asso_values): Merged with old Search::prepare. + Initialize _max_selchars_length. + (Search::keyword_list_length): Remove function. Use _list_len instead. + (Search::max_key_length): Remove function. Use _max_key_len instead. + (Search::get_max_keysig_size): Remove function. Use + _max_selchars_length instead. + (Search::count_possible_collisions, Search::find_asso_values): Update. + (Search::find_good_asso_values): Call just prepare_asso_values. + (Search::~Search): Update. + + * src/output.h (Output::output_asso_values_ref): New declaration. + * src/output.cc (char_to_index): Remove variable. + (Output::output_asso_values_ref): New function. + (Output::output_hash_function): Use it. + (Output::output): Update. + + * src/positions.h (Positions::is_useall, Positions::set_useall, + Positions::iterator, Positions::reviterator): New method declarations. + (Positions::_useall): New field. + (PositionIterator): Make constructor private. Add a constructor and a + copy constructor. + (PositionIterator::remaining): New declaration. + (PositionReverseIterator): Make constructor private. Add a constructor + and a copy constructor. + (PositionReverseIterator::remaining): New declaration. + (PositionReverseIterator::_minindex): New field. + * src/positions.icc (Positions::Positions): Initialize _useall. + (Positions::operator=): Likewise. + (Positions::is_useall, Positions::set_useall): New methods. + (Positions::sort): Do nothing if _useall is set. + (Positions::iterator, Positions::reviterator): New methods. + (PositionIterator::PositionIterator): New constructor. + (PositionIterator::remaining): New method. + (PositionReverseIterator::PositionReverseIterator): New constructor. + (PositionReverseIterator::next): Use _minindex as bound. + (PositionReverseIterator::remaining): New method. + * src/positions.cc (Positions::add, Positions::remove): Reset the + useall flag. + (Positions::print): Handle the useall case. + * src/options.h (ALLCHARS): Remove. + * src/options.cc (Options::~Options): Update. + (Options::parse_options): Use Positions::set_useall(). + * src/keyword.h (KeywordExt::init_selchars_tuple, + KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low): + Remove use_all_chars argument. + * src/keyword.cc (KeywordExt::init_selchars_low): Remove use_all_chars + argument. Tell the position iterator to stop at _allchars_length. + Remove special case code for -k'*'. + (KeywordExt::init_selchars_tuple, KeywordExt::init_selchars_multiset): + Remove use_all_chars argument. + * src/search.h (Search::init_selchars_tuple): Remove use_all_chars + argument. + (Search::init_selchars_multiset): Likewise. + * src/search.cc (Search::init_selchars_tuple): Remove use_all_chars + argument. + (Search::count_duplicates_tuple, Search::find_positions): Update. + (Search::compute_alpha_unify): Remove special case code for -k'*'. + (Search::init_selchars_multiset): Remove use_all_chars argument. + (Search::count_duplicates_multiset): Update. + (Search::find_alpha_inc): Remove special case code for -k'*'. + (Search::prepare): Update. + (Search::get_max_keysig_size): Update. + * src/output.cc (Output::output_hash_function): Remove special case + code for -k'*'. + * tests/chill.exp: Regenerated. + +2002-12-11 Bruno Haible + + Change the positions to be 0-based, instead of 1-based. + * src/positions.h (Positions::LASTCHAR): Set to -1. + (Positions::MAX_SIZE): New constant. + (Positions::pointer): Change return type. + (Positions::_positions): Change element type. + (PositionIterator::EOS, PositionReverseIterator::EOS): Set to -2. + * src/positions.icc (Positions::pointer): Change return type. + (Positions::sort): Update. + * src/positions.cc (Positions::contains, Positions::add, + Positions::remove): Update. + (Positions::print): Update. Fix off-by-one bug. + * src/options.cc (Options::~Options): Update. + (Options::parse_options): Set BAD_VALUE to -3. Update. + * src/keyword.cc (KeywordExt::init_selchars_low): Update. + * src/search.cc (Search::find_positions, Search::compute_alpha_unify, + Search::find_alpha_inc): Update. + * src/output.cc (Output::output_hash_function): Update. Don't emit + a 'case' statement right after 'default:'. + * tests/c-parse.exp: Regenerated. + * tests/charsets.exp: Regenerated. + * tests/cplusplus.exp: Regenerated. + * tests/java.exp: Regenerated. + * tests/languages.exp: Regenerated. + * tests/modula2.exp: Regenerated. + * tests/objc.exp: Regenerated. + +2002-12-10 Bruno Haible + + * src/options.h: Reorder enum values. + (Options::short_usage, Options::long_usage): Make static. + * src/options.cc (Options::short_usage); No longer print a monster + usage line. + (Options::print_options): Improve output of options like + --key-positions=1,2,$. + (Options::~Options): Update. + + * src/options.h (UPPERLOWER): New enum value. + * src/options.cc (Options::long_usage): Document option --ignore-case. + (Options::~Options): Update. + (long_options): Add option --ignore-case. + (Options::parse_options): Handle option --ignore-case. + * src/input.cc (Input::read_input): Recognize option %ignore-case. + * src/keyword.h (KeywordExt::init_selchars_tuple, + KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low): + Add alpha_unify argument. + * src/keyword.cc (KeywordExt::init_selchars_low): Add alpha_unify + argument. + (KeywordExt::init_selchars_tuple): Add alpha_unify argument. + (KeywordExt::init_selchars_multiset): Add alpha_unify argument. + * src/search.h (Search::compute_alpha_size, + Search::compute_alpha_unify): New declarations. + (Search::init_selchars_multiset): Add alpha_unify argument. + (Search::_alpha_unify): New field. + * src/search.cc (Search::compute_alpha_size, + Search::compute_alpha_unify): New functions. + (Search::init_selchars_tuple): Update. + (Search::find_positions): Temporarily set _alpha_unify. Perform a + case insensitive comparison if needed. + (Search::init_selchars_multiset): Add alpha_unify argument. + (Search::count_duplicates_multiset): Call compute_alpha_unify. + (Search::find_alpha_inc): Temporarily set _alpha_unify. At the end, + set _alpha_size and _alpha_unify. + (Search::prepare): Update. Don't compute _alpga_size here. + (Search::optimize): Propagate unified asso_values. + (Search::~Search) Delete _alpha_unify. + * src/output.cc (output_upperlower_strcmp, output_upperlower_strncmp, + output_upperlower_memcmp): New functions. + (Output_Compare_Strcmp::output_comparison, + Output_Compare_Strncmp::output_comparison, + Output_Compare_Memcmp::output_comparison): Use the case-insensitive + comparison function if --ignore-case was given. + (Output::output): Emit the auxiliary case-insensitive comparison + function if needed. + * tests/permutc2.gperf, tests/permutc2.exp: New files. + * tests/Makefile.in (check-test): Also check permutc2.gperf. + * tests/test-6.exp: Update. + * doc/gperf.texi (Gperf Declarations): Document %ignore-case. + (Input Details): Document option --ignore-case. + * NEWS: Update. + + * src/search.cc (Search::optimize): Fill unused asso_values[] entries + with a large value. + * src/output.h (Output::Output): Remove occurrences argument. + (Output::_occurrences): Remove field. + * src/output.cc (Output::Output): Remove occurrences argument. + (Output::output_hash_function): Ignore _occurrences. + * src/main.cc (main): Don't pass the _occurrences to Output. + + * src/search.cc (Search::preprepare): Exit if keywords contain + out-of-range characters. + + * src/search.cc (for): Define so as to avoid errors with old compilers. + + * src/options.h (SHAREDLIB): New enum value. + * src/options.cc (Options::short_usage): Mention option -P. + (Options::long_usage): Document option -P. + (long_options): Add option --pic. + (Options::parse_options): Handle option -P/--pic. + * src/output.cc (output_keyword_blank_entries): When SHAREDLIB is + specified, emit NULL pointers instead of "". + (Output::output_lookup_function_body): When SHAREDLIB is specified + and SWITCH and DUP and not specified, test the table entry against + NULL before the string comparison. + * tests/test-6.exp: Update. + * doc/gperf.texi (Output Details): Document option -P. + * NEWS: Update. + Suggested by Ulrich Drepper. + +2002-12-08 Bruno Haible + + * tests/permut2.gperf, tests/permut2.exp: New files. + * tests/permut3.gperf, tests/permut3.exp: New files. + * tests/charsets.gperf: New file, from Bruce Lilly. + * tests/charsets.exp: New file. + * tests/languages.gperf: New file, from Bruce Lilly. + * tests/languages.exp: New file. + * Makefile.in (check-test): Test them all. + + Completely new asso_values search algorithm. + * src/search.h (Search::compute_occurrence, Search::clear_determined, + Search::set_determined, Search::already_determined, Search::reorder): + Remove functions. + (Search::init_asso_values, Search::sort_by_occurrence, + Search::compute_occurrence, Search::sort_by_occurrence, + Search::has_collisions, Search::collision_prior_to): Remove functions. + (Search::compute_partition, Search::count_possible_collisions, + Search::unchanged_partition): New method declarations. + (Search::_determined): Remove field. + * src/search.cc (Search::prepare): Don't initialize _determined. + (Search::compute_occurrence, greater_by_occurrence, + Search::clear_determined, Search::set_determined, + Search::already_determined, Search::reorder): Remove functions. + (Search::init_asso_values, compute_disjoint_union, + Search::sort_by_occurrence, Search::compute_occurrence, + Search::sort_by_occurrence, Search::has_collisions, + Search::collision_prior_to): Remove functions. + (StackEntry): Remove class. + (EquivalenceClass, Step): New classes. + (equals, Search::compute_partition, delete_partition, + Search::count_possible_collisions, Search::unchanged_partition): New + functions. + (Search::find_asso_values): Completely rewritten. + (Search::find_good_asso_values): Don't call reorder(). + (Search::~Search): Don't free _determined. + * src/keyword.h (KeywordExt::_occurrence): Remove field. + * src/options.h (ORDER, FAST, OPT_CHOICE): Remove enum values. + (Options::_iterations): Remove field. + * src/options.icc (Options::get_iterations): Remove method. + * src/options.cc (Options::long_usage): Remove mention of -f and -o. + (Options::Options): Don't initialize _iterations. + (Options::~Options): Update. + (Options::parse_options): Do nothing for options -f, -o, -O. + * doc/gperf.texi: (Contributors): Update. + (Algorithmic Details): Remove options -f and -o. Update description + of option -s. + * tests/c-parse.exp, tests/chill.exp, tests/cplusplus.exp, + tests/gpc.exp, tests/java.exp, tests/modula2.exp, tests/objc.exp, + tests/test-4.exp): Regenerated, smaller than before. + * tests/test-6.exp: Update. + * NEWS: Update. + +2002-12-08 Bruno Haible + + * src/search.h (Search::_alpha_size): Change type to 'unsigned int'. + (Search::_asso_value_max): Likewise. + * src/search.cc (Search::prepare_asso_values): Update. + (Search::init_asso_values): Update. + (Search::~Search): Update. + * src/output.h (Output::Output): Change alpha_size type to + 'unsigned int'. + (Output::_alpha_size): Change type to 'unsigned int'. + * src/output.cc (Output::Output): Change alpha_size type to + 'unsigned int'. + (Output::output_hash_function): Update. + +2002-12-07 Bruno Haible + + * src/options.h (OPT_CHOICE): New enum value. + * src/options.cc (Options::~Options): Update. + (long_options): New option --optimized-collision-resolution. + (Options::parse_options): Accept option -O. + * src/search.h (Search::sort_by_occurrence): Change argument to + 'unsigned int'. + (Search::compute_occurrence, Search::sort_by_occurrence): New method + declarations. + * src/search.cc (Search::sort_by_occurrence): Change argument to + 'unsigned int'. + (Search::compute_occurrence, Search::sort_by_occurrence): New methods. + (Search::find_asso_values): Implement OPT_CHOICE. More debugging + output. + + * src/search.cc (Search::prepare_asso_values) [DEBUG]: Also print + the keyword list in order. + (Search::find_asso_values) [DEBUG]: Upon failure, print the union_set. + + * src/options.h (Options::get_size_multiple): Change return type to + float. + (Options::_size_multiple): Change type to float. + * src/options.icc (Options::get_size_multiple): Change return type to + float. + * src/options.cc (Options::long_usage): Update description of option + -s. + (Options::~Options): Update. + (Options::parse_options): For option -s, accept a fraction. + * src/search.cc (Search::prepare_asso_values): Use get_size_multiple + as it is. + * tests/test-6.exp: Update. + * doc/gperf.texi (Algorithmic Details): Update description of option + -s. + +2002-12-04 Bruno Haible + + Improve debugging output. + * src/hash-table.h (Hash_Table::dump): New method. + * src/hash-table.cc (Hash_Table::dump): New method, extracted from + destructor. + (Hash_Table::~Hash_Table): No longer print the contents. + * src/positions.h (PositionReverseIterator): New class. + * src/positions.icc (PositionReverseIterator::PositionReverseIterator, + PositionReverseIterator::next): New methods. + * src/search.cc (Search::find_positions): If debugging, print the + result. + (Search::find_alpha_inc): If debugging, print the result. + (Search::prepare): Explicitly dump the hash table's contents here. + + Portability fixes. + * src/positions.h (Positions::LASTCHAR, Positions::MAX_KEY_POS, + PositionIterator::EOS): Define as compile-time constants using enum. + * src/bool-array.cc (Bool_Array::~Bool_Array): Remove const qualifier + of pointer to be deleted. + * src/input.cc (Input::~Input): Likewise. + * src/keyword.cc (KeywordExt::delete_selchars): Likewise. + * src/main.cc (main): Likewise. + * src/hash-table.cc (Hash_Table::~Hash_Table): Limit scope of 'for' + variables. + * src/search.cc (Search::prepare_asso_values): Use a static_cast to + convert from time_t to long. This is possible because ISO C 99 says + time_t is a numeric type. + +2002-11-20 Bruno Haible + + * src/search.cc (Search::find_asso_values): Avoid gcc warnings about + uninitialized variables. + + Implement backtracking. + * src/search.h (Search::has_collisions): Renamed from + Search::less_collisions. Return a boolean. + * src/search.cc (Search::has_collisions): Renamed from + Search::less_collisions. Return a boolean. + (StackEntry): Remove field _collisions_so_far. + (Search::find_asso_values): Backtrack when encountering an unresolved + collision. Assume collisions_so_far is always zero. + (Search::optimize): Exit if there are accidental duplicates at the end. + * src/output.cc (Output::num_hash_values): Simply return the list + length. + (Output::output_keylength_table): Remove handling of accidental + duplicates. + (Output::output_keyword_table, Output::output_lookup_array): Likewise. + (output_switch_case, output_switches): Likewise. + * doc/gperf.texi (Algorithmic Details): Adjust description of options + -D, -f, -o, -r. + (Bugs): Remove note about missing backtracking. + (Projects): Likewise. + +2002-11-19 Bruno Haible + + Prepare for backtracking. + * src/search.h (Search::try_asso_value, Search::change_some_asso_value): + Remove declarations. + (Search::less_collisions, Search::collision_prior_to): New declarations. + (Search::_fewest_collisions, Search::_union_set, Search::_num_done): + Remove fields. + * src/search.cc (Search::prepare_asso_values): Don't initialize + _union_set. + (Search::try_asso_value, Search::change_some_asso_value): Remove + methods. + (Search::less_collisions, Search::collision_prior_to): New methods. + (StackEntry): New class. + (Search::find_asso_values): Reorganized to use pseudo-recursion. + (Search::~Search): Don't free _union_set. + + * src/search.h (Search::find_good_asso_values): New declaration. + * src/search.cc: Add comments about the basic structure of the + algorithm. + (Search::find_positions): Move the option[POSITIONS] test to here. + (Search::find_good_asso_values): New method, extracted from + Search::optimize. + (Search::optimize): Remove option[POSITIONS] test. Call + find_good_asso_values. + +2002-11-17 Bruno Haible + + * src/options.cc (Options::parse_options): Include copyright notice + and authors in --version output. + + Avoid artificial duplicates. + * src/keyword.h (KeywordExt::init_selchars_tuple): New declaration. + (KeywordExt::init_selchars_multiset): Renamed from + KeywordExt::init_selchars. + (KeywordExt::init_selchars_low): New declaration. + * src/keyword.cc (KeywordExt::init_selchars_low): Renamed from + KeywordExt::init_selchars. Add alpha_inc argument. Remove sorting. + (KeywordExt::init_selchars_tuple): New method. + (KeywordExt::init_selchars_multiset): New method, replaces + KeywordExt::init_selchars. + * src/search.h (Search::init_selchars_tuple): Renamed from + Search::init_selchars. + (Search::count_duplicates_tuple): Renamed from Search::count_duplicates. + (Search::init_selchars_multiset, Search::count_duplicates_multiset, + Search::find_alpha_inc): New declarations. + (Search::_alpha_inc): New field. + (Search::_alpha_size, Search::_occurrences, Search::_asso_values, + Search::_determined): Make non-const. + * src/search.cc (Search::Search): Don't initialize _key_positions, + _alpha_size, _occurrences, _asso_values, _determined here. + (Search::init_selchars_tuple): Renamed from Search::init_selchars. + (Search::count_duplicates_tuple): Renamed from Search::count_duplicates. + (Search::find_positions): Update. + (Search::init_selchars_multiset, Search::count_duplicates_multiset, + Search::find_alpha_inc): New methods. + (Search::prepare): Move preprepare, find_positions calls away. + Initialize _alpha_size, _occurrences, _asso_values, _determined here. + (Search::optimize): Call preprepare, find_positions here. Initialize + _key_positions here. + (Search::~Search): Deallocate _alpha_inc. + * src/output.cc (Output::Output): Add alpha_inc argument. + (Output::output_hash_function): Use _alpha_inc. + * src/output.h (Output::Output): Add alpha_inc argument. + (Output::_alpha_inc): New field. + * src/main.cc (main): Pass _alpha_inc from Search to Output. + * tests/chill.exp: Update. + * doc/gperf.texi (Algorithmic Details): Remove description of + artificial duplicates. + + * src/keyword.h (KeywordExt::_selchars): Change type to + 'const unsigned int *'. + * src/keyword.cc (sort_char_set): Change argument type to + 'unsigned int *'. + (KeywordExt::init_selchars): Update. + * src/search.h (Search::sort_by_occurrence): Change argument type to + 'unsigned int *'. + (Search::try_asso_value): Change argument type to 'unsigned int'. + (Search::_union_set): Change type to 'unsigned int *'. + * src/search.cc (Search::prepare, Search::compute_occurrence, + Search::set_determined, Search::already_determined, + Search::prepare_asso_values, Search::compute_hash): Update. + (compute_disjoint_union): Change argument types to 'unsigned int *'. + (Search::sort_by_occurrence): Likewise. + (Search::try_asso_value): Change argument type to 'unsigned int'. + (Search::change_some_asso_value, Search::~Search): Update. + * src/hash-table.cc (Hash_Table::~Hash_Table, Hash_Table::equal, + Hash_Table::insert): Update. + + * src/positions.h: New file, extracted from options.h. + * src/positions.icc: New file, extracted from options.icc. + * src/positions.cc: New file, extracted from options.cc. + * src/options.h: Include positions.h. Move classes Positions and + PositionsIterator away. + * src/options.icc: Move classes Positions and PositionsIterator away. + * src/options.cc: Move class Positions away. + * src/keyword.cc: Include positions.h instead of options.h. + * src/output.h: Include positions.h instead of options.h. + * src/search.h: Include positions.h instead of options.h. + * src/Makefile.in (OBJECTS): Add positions.o. + (POSITIONS_H): New variable. + (OPTIONS_H, SEARCH_H, OUTPUT_H, keyword.o): Use it. + (positions.o): New rule. + + * src/options.h (POSITIONS): New enum value. + (Positions::Positions): New copy constructor. + (Positions::operator=, Positions::contains, Position::add, + Positions::remove, Positions::print): New method declaration. + (Options::get_max_keysig_size): Remove method. + * src/options.icc (Positions::Positions): New copy constructor. + (Positions::operator=): New method. + (Options::get_max_keysig_size): Remove method. + * src/options.cc (Options::Options): Initialize _key_positions + trivially. + (Options::parse_options): Option -k sets POSITIONS. + (Positions::contains, Positions::add, Positions::remove, + Positions::print): New methods. + * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field + width explicitly, instead of using Options::get_max_keysig_size. + * src/keyword.h (KeywordExt::init_selchars): Add arguments + use_all_chars, positions. + (KeywordExt::delete_selchars): New declaration. + * src/keyword.cc (KeywordExt::init_selchars): Add arguments + use_all_chars, positions. Remove error message if there are no key + positions. + (KeywordExt::delete_selchars): New method. + * src/search.h: Include options.h. + (Search::preprepare, Search::init_selchars, Search::delete_selchars, + Search::count_duplicates, Search::find_positions): New declarations. + (Search::_key_positions): New field. + * src/search.cc (Search::Search): Initialize _key_positions. + (Search::preprepare, Search::init_selchars, Search::delete_selchars, + Search::count_duplicates, Search::find_positions): New functions. + (Search::prepare): Call preprepare and find_positions. Tweak error + message. + (Search::get_max_keysig_size): Use _key_positions instead of + option.get_key_positions(). + (Search::optimize): Tweak error message. + * src/output.h: Include options.h. + (Output::Output): Add Positions argument. + (Output::_key_positions): New field. + * src/output.cc (Output::Output): Add Positions argument. + (Output::output_hash_function): Omit the table if there are no + positions at all. Use _key_positions instead of + option.get_key_positions(). + (Output::output): Output the computed positions as a comment. + * src/main.cc (main): Pass the Positions from Searcher to Output. + * src/Makefile.in (SEARCH_H, OUTPUT_H): Include OPTIONS_H. + * tests/Makefile.in (check-test): Pass key positions explicitly. + * tests/gpc.exp: Update. + * tests/test-4.exp: Update. + * doc/gperf.texi (Algorithmic Details): Mention that -k is not needed + usually. + +2002-11-16 Bruno Haible + + * src/options.h (Options::get_slot_name): Renamed from + Options::get_key_name. + (Options::set, Options::set_language, Options::set_total_switches, + Options::set_function_name, Options::set_slot_name, + Options::set_class_name, Options::set_hash_name, + Options::set_wordlist_name, Options::set_delimiters): New method + declarations. + (Options::_language): New field. + (Options::_slot_name): Renamed from Options::_key_name. + * src/options.icc (Options::set): New method. + (Options::get_slot_name): Renamed from Options::get_key_name. + * src/options.cc (DEFAULT_FUNCTION_NAME): Renamed from DEFAULT_NAME. + (DEFAULT_SLOT_NAME): Renamed from DEFAULT_NAME. + (Options::Options): Initialize _language. Update. + (Options::~Options): Update. + (Options::set_language, Options::set_total_switches, + Options::set_function_name, Options::set_slot_name, + Options::set_class_name, Options::set_hash_name, + Options::set_wordlist_name, Options::set_delimiters): New methods. + (Options::parse_options): Call set_language. Update. + * src/input.cc (is_declaration, is_declaration_with_arg, + is_define_declaration): New functions. + (Input::read_input): Accept %DECL declarations. + * src/output.cc (Output::output_lookup_function_body): Update. + * doc/gperf.texi (Declarations): Add new subnodes. + (User-supplied Struct, Gperf Declarations, C Code Inclusion): New + nodes. + (Keywords, Output Format, Binary Strings, Options): Mention % + declarations as being equivalent to the command line options. + + * src/options.cc (Options::long_usage): Rename options -H, -N, -l, -G. + (long_options): Add --hash-function-name, --lookup-function-name, + --compare-lengths. + * doc/gperf.texi (Output Details): Rename options -H, -N, -l, -G. + * tests/test-6.exp: Update. + + * src/options.cc (DEFAULT_DELIMITERS): Remove newline. + * src/options.cc (Options::long_usage): Change default --delimiters. + * doc/gperf.texi (Input Details): Likewise. + * tests/test-6.exp: Update. + + * doc/gperf.texi: Move description of option -l from section + Algorithmic Details to section Output Details. + * src/options.cc (Options::long_usage): Likewise. + * tests/test-6.exp: Update. + +2002-11-12 Bruno Haible + + * src/options.h (Output::get_output_file_name): New method. + (Output::_output_file_name): New field. + * src/options.icc (Options::get_output_file_name): New method. + * src/options.cc (Options::long_usage): Document option --output-file. + (Options::Options): Initialize _output_file_name. + (long_options): Add --output-file. + (Options::parse_options): Handle it. + * src/main.cc (main): Open the output file if given by name. + * doc/gperf.texi (Output File): New section. + * tests/test-6.exp: Update. + +2002-11-10 Bruno Haible + + * src/input.cc (pretty_input_file_name): New function. + (read_input): Use it in all error and warning messages. + + * src/keyword.h (Keyword::_lineno): New field. + * src/input.h (Input::_struct_decl_lineno): New field. + * src/input.cc (Input::read_input): Set _struct_decl_lineno. Fill + each keyword's _lineno field. + * src/main.cc (main): Pass _struct_decl_lineno from Input to Output. + * src/output.h (Output::Output) Add struct_decl_lineno argument. + (Output::_struct_decl_lineno): New field. + * src/output.cc (Output::Output) Add struct_decl_lineno argument. + (output_keyword_entry): Emit #line directive before table entry. + (Output::output): Emit #line directive before _struct_decl. + + Fix memory leaks. + * src/keyword.h (empty_string): New declaration. + * src/keyword.cc (empty_string): New variable. + * src/input.h (Input::_input): Make public. + (Input::_input_end): New field. + * src/input.cc (read_input): When removing leading whitespace from + struct_decl, reallocate it. For rest, use empty_string instead of "". + Set _input_end. + (Input::~Input): Delete _struct_decl, _struct_tag, _return_type. + * src/search.cc (Search::prepare): When removing an element from + the keyword list, delete the list node. + (Search::~Search): Delete _occurrences, _asso_values. + * src/main.cc (main): Between Search::~Search and Input::~Input, + destroy the keyword list. + + Rewrite the input routines. + * src/input.h: Don't include read-line.h. + (Input): Don't inherit from class Read_Line. + (Input::read_keys, Input::strcspn, Input::set_output_types, + Input::get_array_type, Input::save_include_src, + Input::get_special_input): Remove declarations. + (Input::read_input): New declaration. + (Input::_struct_decl): Renamed from Input::_array_type. + (Input::_verbatim_declarations): Renamed from Input::_include_src. + (Input::_verbatim_code): Replaces Input::_additional_code. + * src/input.cc: Completely rewritten. + * src/output.h (Output::Output): Update the verbatim_* arguments. + (Output::_struct_decl): Renamed from Output::_array_type. + (Output::_verbatim_declarations): Renamed from Output::_include_src. + (Output::_verbatim_code): Replaces Output::_additional_code. + * src/output.cc (Output::Output): Update the verbatim_* arguments. + (Output::output): Output the verbatim_* code pieces with #line. + * src/main.cc (main): Call Input::read_input instead of + Input::read_keys. Update Output::Output arguments. + * src/read-line.h: Remove file. + * src/read-line.cc, src/read-line.icc: Remove files. + * src/Makefile.in (OBJECTS): Remove read-line.o. + (READ_LINE_H): Remove variable. + (INPUT_H): Update. + (read-line.o): Remove rule. + * doc/gperf.texi (Declarations): Correct the example. + (Keywords): Mention that lines starting with % are forbidden here. + * tests/c-parse.exp: Update. + * tests/cplusplus.exp: Update. + * tests/gpc.exp: Update. + * tests/java.exp: Update. + * tests/objc.exp: Update. + * tests/test-4.exp: Update. + + * src/options.h (Options::get_input_file_name): New declaration. + (Options::_input_file_name): New field. + * src/options.icc (Options::get_input_file_name): New method. + * src/options.cc (Options::Options): Initialize _input_file_name. + (Options::parse_options): Don't open input file, only store it in + _input_file_name. + * src/main.cc (main): Open input file here. + Print an error message upon write error on the output file. + + Upgrade to autoconf-2.52. + * configure.in: Use AC_CONFIG_SUBDIRS instead of AC_OUTPUT_SUBDIRS. + * Makefile.devel (configure, lib/configure, src/configure, + tests/configure, doc/configure): Use autoconf-2.52. + +2002-11-09 Bruno Haible + + * doc/gperf.texi: Talk about "bytes" instead of "characters". Talk + about "keywords", not "keys". Talk about "input file", not "keyfile". + (@menu): Fix a menu entry. + (Contributors): Don't mention cperf. + (Motivation): Fix an off-by-one error in the definition of "minimal". + Mention GNU Java. Recommend http URL instead of anonymous ftp. + (Search Structures): Mention GNU Java. + (Output Format): Drop reference to node 'Implementation'. + (Output Details): Talk about "slot-name" instead of "key name". + (Algorithmic Details): Talk about "selected byte positons", not + "key positions". Upper limit is now 255. Explain a third reason + why duplicates can occur. Describe negative effects of + --occurrence-sort. + (Implementation): Remove chapter. + +2002-11-07 Bruno Haible + + * src/bool-array.cc (Bool_Array::~Bool_Array): Free _storage_array. + * src/search.cc (Search::~Search): Free _union_set, _determined. + + * tests/Makefile.in (check-test): Don't redirect stderr. + +2002-11-05 Bruno Haible + + * src/keyword-list.h (mergesort_list): New declarations. + * src/keyword-list.cc (Keyword_Comparison): New type. + (merge, mergesort_list): New functions, moved here from search.cc. + * src/search.h (Search::merge, Search::merge_sort): Remove methods. + (Search::_occurrence_sort, Search::_hash_sort): Remove fields. + * src/search.cc (Search::merge, Search::merge_sort): Remove methods. + (greater_by_occurrence, less_by_hash_value): New functions. + (Search::reorder, Search::sort): Use mergesort_list. + +2002-11-04 Bruno Haible + + * src/options.h (Options::_asso_iterations): New field. + (Options::get_asso_iterations): New method declaration. + * src/options.icc (Options::get_asso_iterations): New method. + * src/options.cc (Options::short_usage): Mention j and m. + (Options::long_usage): Document option -m. + (Options::Options): Initialize _asso_iterations. + (Options::~Options): Print _asso_iterations too. + (long_options): Add --multiple-iterations. + (Options::parse_options): Handle option -m. + * src/keyword-list.h (copy_list, delete_list): New declarations. + * src/keyword-list.cc (copy_list, delete_list): New functions. + * src/search.h (Search::_initial_asso_value, Search::_jump): New fields. + * src/search.cc (Search::prepare_asso_values): Initialize + _initial_asso_value and _jump here. + (Search::init_asso_values): Use _initial_asso_value. + (Search::try_asso_value): Use _jump. + (Search::optimize): If option -m was given, iterate over different + values for _initial_asso_value and _jump. + * doc/gperf.texi (Algorithmic Details): Document option -m. + * tests/test-6.exp: Update. + +2002-11-03 Bruno Haible + + Bug fix: When option -j 0 was used without option -r, the output was + not random. + * src/search.h (Search::prepare_asso_values): New method declaration. + * src/search.cc (Search::prepare_asso_values): New method, extracted + from Search::init_asso_values. Call srand also when "-j 0" was given. + (Search::optimize): Call prepare_asso_values(). + + * src/hash-table.h (Hash_Table::_ignore_length, Hash_Table::equal): + Declare as const. + * src/hash-table.cc (Hash_Table::equal): Declare as const. + * src/input.h (Input::_factory): Declare as const. + * src/keyword-list.h (Keyword_List::first, KeywordExt_List::first): + Declare as const. + * src/keyword-list.icc (Keyword_List::first, KeywordExt_List::first): + Declare as const. + * src/output.h (Output::num_hash_values, Output::output_constants, + Output::output_hash_function, Output::output_keylength_table, + Output::output_keyword_table, Output::output_lookup_array, + Output::output_lookup_tables, Output::output_lookup_function_body, + Output::output_lookup_function, Output::_array_type, + Output::_additional_code, Output::_include_src, Output::_total_keys, + Output::_total_duplicates, Output::_max_key_len, Output::_min_key_len): + Declare as const. + * src/output.cc (Output::num_hash_values, Output::output_constants, + Output::output_hash_function, Output::output_keylength_table, + Output::output_keyword_table, Output::output_lookup_array, + Output::output_lookup_tables, Output::output_lookup_function_body, + Output::output_lookup_function): Declare as const. + * src/search.h (Search::merge, Search::merge_sort, + Search::compute_occurrence, Search::already_determined, + Search::keyword_list_length, Search::max_key_length, + Search::get_max_keysig_size, Search::compute_hash, + Search::sort_by_occurrence): Declare as const. + * src/search.cc (Search::merge, Search::merge_sort, + Search::compute_occurrence, Search::already_determined, + Search::keyword_list_length, Search::max_key_length, + Search::get_max_keysig_size, Search::compute_hash, + Search::sort_by_occurrence): Declare as const. + + * src/output.cc (Output::output): Set char_to_index to a cast in all + cases. Avoids gcc warnings on the generated code. + + * src/output.cc (Output_Enum): Prepend an underscore to field names. + (Output_Expr1): Likewise. + (Output::output_hash_function): Simplify the special case for "-k 1,$". + + * src/search.h (Search::init_asso_values, Search::find_asso_values): + New declarations. + (Search::try_asso_value): Renamed from Search::affects_prev. + (Search::change_some_asso_value): Renamed from Search::change. + (Search::set_asso_max, Search::get_asso_max): Remove methods. + (Search::_union_set): New field. + * src/search.cc (Search::init_asso_values): New method, extracted + from Search::optimize. + (Search::try_asso_value): Renamed from Search::affects_prev. Take the + iteration count as argument. + (Search::change_some_asso_value): Renamed from Search::change. Don't + make union_set static. Don't increment _fewest_collisions here. + (Search::find_asso_values): New method, extracted from + Search::optimize. + (Search::optimize); Update. + + * src/search.h (Search::compute_hash): Renamed from Search::hash. + (Search::compute_disjoint_union): Remove declaration. + (Search::sort_by_occurrence): Renamed from Search::sort_set. + * src/search.cc (Search::compute_hash): Renamed from Search::hash. + (compute_disjoint_union): Renamed from Search::compute_disjoint_union. + (Search::sort_by_occurrence): Renamed from Search::sort_set. + (Search::change): Simplify loop. + + * src/search.h (Search::clear_determined): New declaration. + * src/search.cc (Search::clear_determined): New method. + (Search::already_determined): Optimize. + (Search::reorder): Even when the next keyword after the current one + is completely determined, move all determined keywords after the + current one. + + Compute the occurrences after removal of duplicates, not before. + * src/keyword.h (KeywordExt::init_selchars): Remove occurrences + argument. + * src/keyword.cc (KeywordExt::init_selchars): Likewise. + * src/search.cc (Search::prepare): Reorder the code. Compute the + occurrences after removal of duplicates. + (Search::merge_sort): Optimize the loop. + (Search::compute_occurrence): Renamed from Search::get_occurrence. + * src/search.h (Search::compute_occurrence): Renamed from + Search::get_occurrence. + * tests/chill.exp: Regenerated. + + Bug fix: The hash table could fail to detect duplicates, between + keywords of different length, when option -n (option[NOLENGTH]) was + given. + * src/hash-table.h (Hash_Table::Hash_Table): Pass table size, not + vector and vector size as arguments. + (Hash_Table::_log_size): New field. + (Hash_Table::equal): New declaration. + * src/hash-table.cc (size_factor): New variable. + (Hash_Table::Hash_Table): Pass table size, not vector and vector size + as arguments. Allocate the vector here. + (Hash_Table::~Hash_Table): Deallocate the vector here. + (Hash_Table::equal): New function. + (Hash_Table::insert): Use it. Don't use item->_allchars_length for the + increment if _ignore_length is true. + * src/search.cc (TABLE_MULTIPLE): Remove variable. + (Search::prepare): Update. + +2002-11-02 Bruno Haible + + Provide documentation also in PDF format. + * doc/Makefile.in (pdfdir, TEXI2PDF): New variables. + (all): Depend on pdf. + (pdf, gperf.pdf): New rules. + (maintainer-clean): Remove the PDF file. + + * src/keyword-list.icc: New file, extracted from keyword-list.h. + * src/keyword-list.h: Include keyword-list.icc. Move inline methods + to there. + * src/keyword-list.cc: Include keyword-list.icc. + * src/Makefile.in (KEYWORD_LIST_H): Add keyword-list.icc. + + * lib/hashpjw.h (hashpjw): Change argument type to 'unsigned char *'. + * lib/hash.cc (hashpjw): Likewise. + * src/keyword.icc: New file. + * src/keyword.h: Include keyword.icc. + (KeywordExt::_selchars): Change type to 'unsigned char *'. + * src/keyword.cc: Include keyword.icc. + (Keyword::Keyword, KeywordExt::KeywordExt): Move to keyword.icc. + (sort_char_set): Change argument type to 'unsigned char *'. + (KeywordExt::init_selchars): Update. + * src/search.h (Search::compute_disjoint_union): Change argument types + to 'unsigned char *'. + (Search::sort_set): Likewise. + (Search::affects_prev): Change argument type to 'unsigned char'. + * src/search.cc (Search::prepare): Initialize _duplicate_link here. + (Search::get_occurrence, Search::set_determined, + Search::already_determined, Search::hash): Update. + (Search::compute_disjoint_union): Change argument types to + 'unsigned char *'. + (Search::sort_set): Likewise. + (Search::affects_prev): Change argument type to 'unsigned char'. + (Search::change): Update. + * src/Makefile.in (KEYWORD_H): Add keyword.icc. + + * src/options.cc (Options::parse_options): Fix error message. + + * src/read-line.h (Read_Line::Read_Line): Make FILE* argument + mandatory. Move body to read-line.icc. + * src/read-line.icc (Read_Line::Read_Line): New constructor. + * src/input.h (Input::Input): Add FILE* argument. + * src/input.cc (Input::Input): Likewise. + * src/main.cc (main): Pass stdin to Input constructor. + + * src/options.h (DEFAULTCHARS): Remove. + (Positions::MAX_KEY_POS): Set to 255. + (Positions::_positions): Increase array size. + (PositionIterator::EOS): Set to -1. + (PositionIterator::_index): Change type to 'unsigned int'. + * src/options.icc (Positions::Positions): Don't store + PositionIterator::EOS. + (PositionIterator::next): Produce PositionIterator::EOS here. + * src/options.cc (Options::long_usage): Use MAX_KEY_POS, not + MAX_KEY_POS-1. + (PositionStringParser): Rename field _size to _in_range. Rename + field _curr_value to _range_curr_value. Rename field _upper_bound + to _range_upper_bound. + (PositionStringParser::nextPosition): Comments. + (Options::Options): Update. + (Options::~Options): Update. + (long_options): Use NULL, not 0. + (Options::parse_options): Set BAD_VALUE to -2; -1 is now EOS. Bug fix: + Check against array overflow when more than MAX_KEY_POS positions are + given. Don't store PositionIterator::EOS. + Check against extra arguments before opening the input file. + * src/output.cc (Output::output_hash_function): Change test which + was for option[DEFAULTCHARS]. + * tests/test-6.exp: Update. + + * src/options.h (Options::get_delimiters): Renamed from + Options::get_delimiter. + * src/options.icc (Options::get_delimiters): Renamed from + Options::get_delimiter. + * src/input.cc (Input::read_keys): Update. + + Bug fix. + * src/options.cc (Options::print_options): Escape backquote inside + double-quoted strings. + + Bug fix. + * src/keyword.cc (KeywordExt::init_selchars): Avoid comparison with + uninitialized member variable. Found with 'valgrind'. + + * src/version.cc: Include version.h. + * src/Makefile.in (OBJECTS): Reorder. + (KEYWORD_H, KEYWORD_LIST_H, INPUT_H, SEARCH_H, OUTPUT_H): New + variables. + (HASH_TABLE_H): Update. + (options.o, read-line.o, keyword.o, keyword-list.o, input.o, search.o, + output.o, main.o): Update dependencies. + + * src/vectors.h: Remove file. + * src/vectors.cc: Remove file. + * src/search.h: Don't include vectors.h. + (Search): Don't inherit from Vectors. New fields _alpha_size, + _occurrences, _asso_values. + (Search::_determined, Search::get_occurrence, Search::set_determined, + Search::already_determined, Search::hash, Search::sort_set): Make + nonstatic. + * src/search.cc (Search::Search): Initialize _alpha_size, _occurrences, + _asso_values, _determined. + (Search::optimize, Search::~Search): Update. + * src/output.h: Don't include vectors.h. + (Output): Remove field _v. New fields _alpha_size, _occurrences, + _asso_values. + (Output::Output): Replace Vectors* argument with alpha_size, + occurrences, asso_values. + * src/output.cc (Output::Output): Replace Vectors* argument with + alpha_size, occurrences, asso_values. + (Output::output_hash_function): Update. + * src/main.cc (main): Don't set Vectors::ALPHA_SIZE. + Pass _alpha_size, _occurrences, _asso_values from Search to Output. + * src/keyword.h: Don't include vectors.h. + * src/Makefile.in (OBJECTS): Remove vectors.o. + (VECTORS_H): Remove variable. + (vectors.o): Remove rule. + + * src/search.h: New file, combines src/key-list.h, src/gen-perf.h. + * src/search,cc: New file, combines src/key-list.cc, src/gen-perf.cc. + * src/key-list.h: Remove file. + * src/key-list.cc: Remove file. + * src/gen-perf.h: Remove file. + * src/gen-perf.cc: Remove file. + * src/main.cc (KeywordExt_Factory): Moved here from gen-perf.cc. + (main): Inline some code from gen-perf.cc. + * src/keyword.h (KeywordExt::init_selchars): Take the occurrences + vector as argument. + * src/keyword.cc (KeywordExt::init_selchars): Take the occurrences + vector as argument. + * src/input.cc (Input::set_output_types): Initialize _array_type, + _return_type, _struct_tag. + (Input::read_keys): Initialize _additional_code. + * src/Makefile.in (OBJECTS): Add search.o. + Remove key-list.o, gen-perf.o. + (KEY_LIST_H, GEN_PERF_H): Remove variables. + (gen-perf.o, key-list.o): Remove rules. + (search.o): New rule. + + * *, */*: Update copyright notice to GPL version 2. + + * src/keyword-list.h (Keyword_List): New class. + (KeywordExt_List): Inherit from it. + * src/keyword-list.cc (Keyword_List::Keyword_List): New constructor. + (KeywordExt_List::KeywordExt_List): Update. + * src/input.h (Input::Input): Add Keyword_Factory argument. + (Input::_factory): New field. + (Input::_head): Change type to Keyword_List*. + (Input::parse_line): New declaration. + * src/input.cc (Input::Input): New constructor. + (Input::parse_line): Renamed from parse_line. Use the _factory. + (Input::read_keys): Update. + * src/key-list.cc (KeywordExt_Factory): New class. + (Key_List::read_keys): Pass a KeywordExt_Factory as Input constructor + argument. + + Avoid g++ -Wold-style-cast warnings. + * src/bool-array.icc: Use new-style casts. + * src/gen-perf.cc: Likewise. + * src/input.cc: Likewise. + * src/key-list.cc: Likewise. + * src/keyword.cc: Likewise. + * src/options.cc: Likewise. + * src/output.cc: Likewise. + * src/hash-table.cc: Likewise. Remove (char *) cast in memset argument. + + * src/keyword-list.h (KeywordExt_List): Don't inherit from KeywordExt. + (KeywordExt_List::KeywordExt_List): Take a KeywordExt* as argument. + (KeywordExt_List::_car): New field. + (KeywordExt_List::first): Use it. + * src/keyword-list.cc (KeywordExt_List::KeywordExt_List): Take a + KeywordExt* as argument. + * src/input.cc (parse_line): Create the KeywordExt separately. + + Start using bool. + * src/bool-array.h (Bool_Array::set_bit): Change return type to bool. + * src/bool-array.icc (Bool_Array::set_bit): Likewise. + * src/gen-perf.h (Gen_Perf::affects_prev): Likewise. + * src/gen-perf.cc (Gen_Perf::affects_prev): Likewise. + * src/hash-table.h (Hash_Table::_ignore_length): Change type to bool. + (Hash_Table::Hash_Table): Change 3rd argument type to bool. + * src/hash-table.cc (Hash_Table::Hash_Table): Likewise. + * src/input.h (Input::_additional_code): Change type to bool. + * src/input.cc (Input::read_keys): Update. + * src/key-list.h (Key_List::_occurrence_sort, Key_List::_hash_sort, + Key_List::_additional_code): Change type to bool. + (Key_List::_determined): Change element type to bool. + (Key_List::already_determined): Change return type to bool. + * src/key-list.cc (Key_List::_determined): Change element type to bool. + (Key_List::set_determined): Update. + (Key_List::already_determined): Change return type to bool. + (Key_List::reorder, Key_List::sort, Key_List::Key_List): Update. + * src/options.h (Positions::sort): Change return type to bool. + (Options::operator[]): Likewise. + * src/options.icc (Positions::sort): Change return type to bool. + (Options::operator[]): Likewise. + * src/output.h (Output::Output): Change 5th argument type to bool. + (Output::_additional_code): Change type to bool. + * src/output.cc (Output::Output): Change 5th argument type to bool. + +2002-10-16 Bruno Haible + + * src/*.h: Align all member names at column 24. + +2002-10-15 Bruno Haible + + * src/input.h: New file. + * src/input.cc: New file, extracted from key-list.cc. + * src/key-list.h (Key_List): Don't inherit from Read_Line. + (Key_List::get_special_input, + Key_List::save_include_src, Key_List::get_array_type, + Key_List::strcspn, Key_List::set_output_types): Remove methods. + * src/key-list.cc (Key_List::get_special_input, + Key_List::save_include_src, Key_List::get_array_type, + Key_List::strcspn, Key_List::set_output_types, parse_line): Move to + src/input.cc. + (Key_List::read_keys): Use Input::read_keys. + (Key_List::Key_List): Update. + * src/gen-perf.cc: Update. + * src/Makefile.in (OBJECTS): Add input.o. + (input.o): New rule. + +2002-10-14 Bruno Haible + + * src/options.cc: Don't include "vector.h". + (Options::parse_options): Don't initialize Vectors::ALPHA_SIZE here. + * src/vectors.cc (Vectors::ALPHA_SIZE): Don't initialize here. + * src/gen-perf.cc (Gen_Perf::Gen_Perf): Initialize Vectors::ALPHA_SIZE. + + * src/options.h (Positions): New class. + (PositionIterator): New class. + (Options::parse_options): Renamed from Options::operator(). + (Options::get_asso_max, Options::set_asso_max): Move to class Key_List. + (Options::reset, Options::get): Remove, replaced by class + PositionIterator. + (Options::get_initial_asso_value): Renamed from Options::initial_value. + (Options::key_sort): Remove, replaced by Positions::sort. + (Options): Make all fields and methods non-static. + * src/options.icc (Positions::Positions, Positions::operator[], + Positions::get_size, Positions::pointer, Positions::set_size, + Positions::sort, PositionIterator::PositionIterator, + PositionIterator::next): New methods. + (Options::get_initial_asso_value): Renamed from Options::initial_value. + (Options::get_size_multiple): New method. + (Options::get_key_positions): New method. + (Options::get_max_keysig_size): Implement using _key_positions. + * src/options.cc (Options::long_usage): Split big string into small + pieces. + (PositionStringParser): Prefix field names with _. + (Options::Options): Update. + (Options::~Options): Fix explanation of of _size_multiple. Don't print + _key_positions if it is effectively ignored. + (Options::parse_options): Renamed from Options::operator(). Update. + * src/key-list.h (Key_List): New field _size. New methods get_asso_max, + set_asso_max, get_max_keysig_size. + * src/key-list.cc (Key_List::read_keys): Don't make side effects on + options. + (Key_List::dump): Use Key_List::get_max_keysig_size() instead of + Options::get_max_keysig_size(). + (Key_List::get_max_keysig_size): New function. + * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field + width on the fly if option[ALLCHARS]. + * src/gen-perf.cc (Gen_Perf::Gen_Perf): Update, + Use Options::get_size_multiple() instead of Options::get_asso_max(). + Use Key_List::get_asso_max() instead of Options::get_asso_max(). Use + Key_List::get_max_keysig_size() instead of + Options::get_max_keysig_size(). + (Gen_Perf::affects_prev): Likewise. + (Gen_Perf::change): Likewise. + * src/keyword.cc: Update. + * src/main.cc: Update. + * src/output.cc: Update. + * tests/test-6.exp: Update. + +2002-10-13 Bruno Haible + + * src/bool-array.*: Some polishing. + + * src/options.h (Options::operator=, Options::operator!=): Remove + unused methods. + * src/options.icc (Options::operator=, Options::operator!=): Remove. + + * src/*.h: Prefix all field names with _. + * src/*.cc, src/*.icc: Update. + + * src/*: Simplify declarations of functions without arguments. + +2002-10-04 Bruno Haible + + * src/output.h: New file, extracted from key-list.h. + * src/output.cc: New file, extracted from key-list.cc. + * src/key-list.h (Key_List): Make some fields protected. Move output + routines to src/output.h. + * src/key-list.cc: Move output routines to src/output.cc. + * src/gen-perf.cc (Gen_Perf::doit_all): Use class Output. + * src/Makefile.in (OBJECTS): Add output.o. + (output.o): New rule. + +2002-10-03 Bruno Haible + + * src/iterator.h: Remove file. + * src/iterator.cc: Remove file. + * src/options.cc: (PositionStringParser): New class, taken from old + iterator.cc. + * src/Makefile.in (OBJECTS): Remove iterator.o. + (ITERATOR_H): Remove variable. + (iterator.o): Remove rule. + + * src/keyword-list.h: New file. + * src/keyword-list.cc: New file. + * src/list-node.h: Remove file. + * src/list-node.cc: Remove file. + * src/keyword.h (KeywordExt::init_selchars): New declaration. + * src/keyword.cc (sort_char_set, KeywordExt::init_selchars): New, from + old list-node.cc. + * src/gen-perf.cc: Replace List_Node by KeywordExt or KeywordExt_List, + as appropriate. + * src/hash-table.h: Likewise. + * src/key-list.h: Likewise. + * src/key-list.cc: Likewise. + * src/Makefile.in (OBJECTS): Remove list-node.o, add keyword-list.o. + (LIST_NODE_H): Remove macro. + (list-node.o): Remove rule. + (keyword-list.o): New rule. + + * src/keyword.h (KeywordExt): New class. + * src/keyword.cc (KeywordExt): New constructor. + * src/list-node.h (List_Node): Inherit from KeywordExt. + * src/list-node.cc: Update. + * src/gen-perf.cc: Update. + * src/hash-table.cc: Update. + * src/key-list.cc: Update. + (output_keyword_entry): Change argument type to KeywordExt*. + + * src/keyword.h: New file. + * src/keyword.cc: New file. + * src/list-node.h (List_Node): Extend Keyword. + * src/list-node.cc: Update. + * src/gen-perf.cc: Update. + * src/hash-table.cc: Update. + * src/key-list.cc: Update. + * src/Makefile.in (OBJECTS): Add keyword.o. + (keyword.o): New rule. + + * src/key-list.cc (Key_List::read_keys): Allocate the memory for the + hash table using 'new'. + (Key_List::output_lookup_array): Allocate the memory for the duplicates + array using 'new'. + * src/options.h (LARGE_STACK_ARRAYS): Remove definition. + * src/main.cc (main): Remove setrlimit call. + * src/configure.in: Don't test for unistd.h, sys/time.h, + sys/resource.h, getrlimit, setrlimit. + + * src/bool-array.h (Bool_Array): Make all members non-static. + Add an argument to the constructor. Remove init(), rename reset() to + clear(), rename find() to set_bit(). + * src/bool-array.icc: Move init() code into the constructor. + Rename reset() to clear(), rename find() to set_bit(). + * src/gen-perf.h (Gen_Perf): Add collision_detector member. + * src/gen-perf.cc: Update. + + * src/gen-perf.h (Gen_Perf::doit_all): Renamed from + Gen_Perf::operator (). + * src/gen-perf.cc (Gen_Perf::doit_all): Renamed from + Gen_Perf::operator (). + * src/main.cc: Update. + + * src/read-line.h (Read_Line::read_next_line): Renamed from + Read_Line::get_line. + * src/read-line.icc: Likewise. + * src/read-line.cc: Update. + * src/key-list.cc: Update. + + * lib/getline.h: New file. + * lib/getline.cc: New file. + * lib/Makefile.in (OBJECTS): Add getline.o. + (getline.o): New rule. + * src/read-line.h (Read_Line::readln_aux): Remove declaration. + * src/read-line.cc (Read_Line::readln_aux): Remove function. + * src/read-line.icc (Read_Line::get_line): Use ::get_line. + * src/options.h (LARGE_STACK): Remove macro. + + * src/bool-array.h (STORAGE_TYPE): Remove type. + Use 'unsigned int' instead of STORAGE_TYPE. + * src/bool-array.cc: Likewise. + * src/bool-array.icc: Likewise. + * src/gen-perf.cc: Likewise. + + * src/new.cc: Remove file. + * src/Makefile.in (OBJECTS): Remove new.o. + (new.o): Remove rule. + * src/configure.in: Remove test for HAVE_THROW_DECL. + * acconfig.h: Remove file. + + * src/trace.h: Remove file. + * src/trace.cc: Remove file. + * src/Makefile.in (OBJECTS): Remove trace.o. + (TRACE_H): Remove variable. + (trace.o): Remove rule. + Update all dependencies. + * src/bool-array.h, src/bool-array.cc, src/bool-array.icc: Don't use T. + * src/gen-perf.cc: Likewise. + * src/hash-table.cc: Likewise. + * src/iterator.cc: Likewise. + * src/key-list.cc: Likewise. + * src/list-node.cc: Likewise. + * src/main.cc: Likewise. + * src/new.cc: Likewise. + * src/options.h, src/options.cc, src/options.icc: Likewise. + * src/read-line.h, src/read-line.cc, src/read-line.icc: Likewise. + + * tests/Makefile.in: Use gperf option -I, to avoid gcc-3.x warnings. + * tests/test.c: Don't use gets(), to avoid warnings. + +2001-08-02 Bruno Haible + + * doc/gperf.texi: Change bug report address to . + * README: Updated. + +2000-12-18 Bruno Haible + + * src/configure.in: Add check for rand() in libm. Needed for BeOS. + * src/Makefile.in (LIBS): Use @GPERF_LIBM@ instead of hardwiring -lm. + +2000-11-20 Bruno Haible + + * doc/help2man: Update to version 1.23. + +2000-09-26 Bruno Haible + + * gperf-2.7.2 released. + + * doc/gperf.texi: Add a second bug report address + . + * README: Updated. + +2000-08-28 Bruno Haible + + * lib/getopt.h (struct option): Use "const" also when compiling in + C++ mode. Avoids warnings from Sun CC and HP-UX aCC. + + * doc/Makefile.in (docdir): Change from $(datadir)/doc/@PACKAGE@ to + $(prefix)/doc/@PACKAGE@, following the newest GNU standards. + +2000-08-20 Bruno Haible + + * src/version.cc: Bump version number to 2.7.2. + * doc/gperf.texi: Likewise. + + * doc/texinfo.tex: Update to post-texinfo-4.0 version. @code in the + title page now chooses a larger font. The overall layout of the + text is denser. + + * AUTHORS: New file. + + * tests/Makefile.in (all): Add check-lang-utf8 and check-lang-ucs2. + (check-lang-utf8, check-lang-ucs2): New targets. + (clean): Remove lu8out and lu2out. + * tests/lang-utf8.gperf, tests/lang-utf8.exp: New files. + * tests/lang-ucs2.gperf, tests/test2.c, tests/lang-ucs2.in, + tests/lang-ucs2.exp: New files. + + Allow the use of embedded NULs in keys. + * lib/hash.h (hashpjw): Add a length argument. + * lib/hash.cc (hashpjw): Likewise. Don't stop when encountering a NUL + character. + * src/hash-table.h (Hash_Table constructor): Add ignore_len argument. + (Hash_Table::ignore_length): New field. + (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove + ignore_length argument. + * src/hash-table.cc (NIL): Remove macro. + (Hash_Table constructor): Add ignore_len argument. Use it to + initialize ignore_length. + (Hash_Table destructor): Specify explicit length of char_set and + key. + (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove + ignore_length argument. Pass explicit length to hashpjw. Compare + char_set using memcmp, not strcmp. + * src/list-node.h (List_Node): Rename field length to key_length. + New field char_set_length. + (List_Node constructor): Accept key and rest, not the entire line. + * src/list-node.cc (List_Node constructor): Accept key and rest, not + the entire line. Don't NUL terminate key and char_set. Specify + explicit length of key. Initialize char_set_length field. + * src/key-list.cc: Include . + (parse_line): New function. + (Key_List::read_keys): Call parse_line instead of new List_Node. + Pass option[NOLENGTH] to Hash_Table constructor, not + Hash_Table::insert. Specify explicit length of key and char_set. + (Key_List::get_occurrence): Use explicit length of char_set. + (Key_List::set_determined): Likewise. + (Key_List::already_determined): Likewise. + (output_string): Add length argument. Output unprintable characters + using octal escape sequence. + (output_keyword_entry): Use explicit length of key. + (Key_List::output_lookup_array): Specify explicit length of key. + (output_switch_case): Likewise. + (Key_List::dump): Likewise. + * src/gen-perf.h (Gen_Perf::compute_disjoint_union): Add two length + arguments. + * src/gen-perf.cc (Gen_Perf::compute_disjoint_union): Likewise. Don't + stop when encountering NUL characters. Don't NUL terminate the + result. + (Gen_Perf::hash): Use explicit length of char_set. + (Gen_Perf::change): Specify explicit length of key. + * doc/gperf.texi: Document it. + + * doc/help2man: New file, help2man version 1.022. + * Makefile.devel (all): Add doc/gperf.1. + (doc/gperf.1): New target. + * doc/gperf.1: Automatically generated. + + * mkinstalldirs: New file, from automake-1.4, grep-2.4.1, guile-1.4, + libtool-1.3.3, make-3.79.1, tar-1.13. + * src/Makefile.in (MKINSTALLDIRS): New variable. + (install, installdirs): Use it instead of mkdir. + * doc/Makefile.in (MKINSTALLDIRS): New variable. + (install, installdirs): Use it instead of mkdir. + + * INSTALL: Update. + +2000-08-19 Bruno Haible + + * src/key-list.cc (Output_Compare_Memcmp): New class. + (Key_List::output_lookup_function): When option -l is given, use + memcmp instead of strcmp or strncmp. + + * doc/gperf.texi: The bug report address is . + The download address is ftp.gnu.org. Remove mention of -a and -g + options (now nops). Explain effect of -c option. + + * doc/configure.in (PACKAGE): New variable. + * doc/Makefile.in (datadir, docdir): New variables. + (dvidir, htmldir): Change values. + (install, installdirs): Update. + + * src/configure.in: Rename cache variable gp_cxx_throw_decl to + gp_cv_cxx_throw_decl. + + * src/key-list.cc (Key_List::output_hash_function): When outputting + __inline, take advantage of C++ compilers which have inline. + + * src/key-list.cc (Output_Compare_Strncmp::output_comparison): + After the call to strncmp, verify that expr2 is not longer than + `len'. + Reported by Carlo Wood . + + * src/key-list.cc (Key_List::output_lookup_function_body): Avoid + emitting the loop for dealing with duplicates if + total_duplicates == 0. + + * src/key-list.cc (Key_List::read_keys): Don't accept an empty key. + + * src/Makefile.in (install, installdirs, uninstall): Respect + $(DESTDIR). + * doc/Makefile.in (install, installdirs, uninstall): Likewise. + + * src/options.cc (Options::print_options): Escape the arguments which + contain special characters. + + * tests/c-parse.gperf: Updated from gcc-2.95.2/gcc/c-parse.gperf. + * tests/objc.gperf: New file, from gcc-2.95.2/gcc/objc/objc.gperf. + * tests/chill.gperf: New file, from gcc-2.95.2/gcc/ch/gperf. + * tests/cplusplus.gperf: New file, from gcc-2.95.2/gcc/cp/gxx.gperf. + * tests/gplus.gperf: Remove file. + * tests/java.gperf: New file, from gcc-2.95.2/gcc/java/keyword.gperf. + * tests/Makefile: Check them all. + * tests/c-parse.exp: Renamed from tests/test-1.exp. + * tests/modula2.exp: Renamed from tests/test-2.exp. + * tests/cplusplus.exp: Renamed from tests/test-3.exp. + * tests/gpc.exp: Renamed from tests/test-5.exp. + + * src/key-list.cc (output_switch_case): Add trailing semicolon to + lengthptr assignment line. Fixes bug with -D and -S. + From Reini Urban . Also reported by + David Hunter. + * tests/Makefile.in (check-lang-syntax): Perform each test with -D + once without and once with duplicates. + + * src/key-list.cc (output_keyword_entry): Avoid outputting a struct + initializer of the form {"key",}. + + * src/iterator.cc: Don't include . + From Michael Deutschmann . + + * tests/Makefile.in (VALIDATE, check-lang-syntax): Use $(srcdir) where + appropriate. + Reported by Andreas Schwab . + + * tests/validate: Don't run -traditional tests by default. + + * src/main.cc (main): Check for write error on stdout before returning. + + * src/Makefile.in (LDFLAGS): New definition, to catch the value given + at configure time. + + Make the structure initializers customizable. Based on a patch by + Kaveh R. Ghazi . + * src/options.h (Options::get_initializer_suffix, + Options::initializer_suffix): New declarations. + * src/options.icc (Options::get_initializer_suffix): New function. + * src/options.cc (DEFAULT_INITIALIZER_SUFFIX): New constant. + (Options::initializer_suffix): New variable. + (Options::short_usage): Document option "-F". + (Options::long_usage): Document option "-F". + (Options constructor): Initialize initializer_suffix. + (Options destructor): Dump initializer_suffix. + (long_options): Add option "-F". + (Options::operator()): Accept option "-F". Sets initializer_suffix. + * src/key-list.cc (output_keyword_blank_entries): Output + initializer_suffix. + * doc/gperf.texi: Document option "-F". + + * COPYING: Replace with GPL version 2 (with new FSF address and Y2K + safe year format). + + * doc/gpl.texinfo: New file. + * doc/gperf.texi: Document it. + * doc/Makefile.in (gperf.info, gperf.dvi, gperf.html, gperf_toc.html): + Update dependencies. + + * doc/Makefile.in (MAKEINFO): Unset LANG while running makeinfo. + +1998-05-20 Bruno Haible + + * doc/Makefile.in (gperf.dvi, clean): Remove gperf.cps. + (install, installdirs, uninstall): Don't install gperf.dvi. The + info and HTML documentations are sufficient for on-line use, and + users who wish to print the documentation (in PS or DVI format) + can do this directly off the source distribution. + (DVIPS): Use "-D600" instead of "-Pljfour", for portability. + +1998-05-20 Akim Demaille + + * doc/gperf.texi: Many modifications: + (Output Format): Declare `hash' and `in_word_set' as functions. + (Concept Index): New section. + (Title page): Use standard presentation. + (Top): Use @top instead of @unnumbered so that automatic master + update works. + (Motivation): Avoid spaces in @var. + (Options): Use the standard name ``Invoking ...''. + (Options): Declare also the long form of the options. + (Options): Remove redundant @itemize when @table is used. + +1998-05-08 Andreas Schwab + + * aclocal.m4 (CL_PROG_INSTALL): Set cl_cv_path_install, not + ac_cv_path_install. + +Sat May 2 13:20:54 1998 Bruno Haible + + * gperf-2.7 released. + +Sat May 2 12:31:51 1998 Bruno Haible + + * src/version.cc (version_string): Remove the "(C++ version)" suffix. + It's redundant: the early C versions of gperf are called cperf. + Reported by Karl Berry. + * src/option.cc (Options::operator()): Trim the output of "gperf -v". + +Thu Apr 16 13:22:16 1998 Bruno Haible + + * lib/Makefile.in, src/Makefile.in: Don't use $(TARGET_ARCH). + Solaris "make" sets it to a value not understood by "cc". + +Wed Apr 15 23:52:14 1998 Bruno Haible + + * lib/Makefile.in, src/Makefile.in: Don't use implicit rules. Don't + use $<. AIX "make" and OSF/1 "make" have problems with both. + * src/gen-perf.cc, src/key-list.cc: Cast free() argument to char*, + otherwise it doesn't compile on SunOS 4. + * src/key-list.h: Declare structs outside of other declarations, + needed for OSF/1 cxx 5.5. + * lib/getopt.h: Use prototypes if __STDC__ || __cplusplus. + Don't give a prototype for getopt(), to avoid error on SunOS 4. + * lib/getopt.c: Declare strncmp, to avoid warnings. + +Tue Apr 14 23:24:07 1998 Bruno Haible + + * lib/GetOpt.{h,cc}: Remove files. + * lib/getopt.{h,c}, lib/getopt1.c: New files, from GNU libc. + * lib/configure.in (AC_INIT): Search for hash.cc, not GetOpt.cc. + * lib/Makefile.in (OBJECTS): Remove GetOpt.o, add getopt.o, getopt1.o. + (getopt.o, getopt1.o, hash.o): Use explicit building rules. Some + "make"s don't support to have both implicit rules for "%.o : %.c" + and "%.o : %.cc" in the same Makefile. + * lib/hash.{h,cc}: Remove #pragma; there are no templates here. + * src/option.h (Options::usage): Remove. + (Options::short_usage, Options::long_usage): Declare. + * src/option.cc (Options::usage): Remove. + (Options::short_usage, Options::long_usage): New functions. + (long_options): New array. + (Options::operator()): Use getopt_long instead of GetOpt::operator(), + change all references to GetOpt members. + + * src/std-err.{h,cc}: Remove files. + * src/gen-perf.cc, src/key-list.cc, list-node.cc, new.cc, options.cc: + Call fprintf(stderr) instead of Std_Err::report_error(). + * src/key-list.h, src/list-node.h, src/options.h: Don't use class + Std_Err any more. + * src/option.cc (program_name): New variable. + * src/Makefile.in: Remove STD_ERR_H. + (OBJECTS): Remove std-err.o. + +Mon Mar 23 01:03:35 1998 Bruno Haible + + * aclocal.m4, {lib,src,tests}/configure.in: Remove CL_CC_WORKS and + CL_CXX_WORKS, already contained in autoconf 2.12. + + * src/gen-perf.cc, src/key-list.cc: Move some code from + Gen_Perf::Gen_Perf() to Key_List::output(). + * src/Makefile.in: Update dependencies. + + * src/options.{h,cc}: Remove option "-p". + * src/key-list.cc (Key_List::set_output_types): Rewrite. + (default_array_type, default_return_type): Remove. + * src/key-list.cc: Adjust "const" handling. + + With option "-t" [TYPE], don't emit wrong code if there is no + space before the struct's opening brace. + +Sun Mar 22 16:59:15 1998 Bruno Haible + + * src/key-list.{h,cc}: Completely reorganized the output routines. + Rewrote from scratch the output_switch() function. Use classes + (Output_Constants, Output_Expr, Output_Compare) for abstraction. + In particular: + + Don't emit trailing whitespace and spurious blank lines. + + Adjust indentation of the arrays. + + Don't emit commas at the end of array initializers and + struct initializers. + + With option "-l" [LENTABLE], compare the length before + fetching the word from memory. + + With option "-S" [SWITCH], emit the comparison code just once, + not once in every switch statement. + + With option "-S" [SWITCH], choose the right switch statement + through a binary search, not a linear search. + + With option "-S" [SWITCH], emit straightforward comparisons + instead of switch statements with just one "case" label. + + With options "-S -p -t" [SWITCH, POINTER, TYPE], don't emit + spurious empty elements at the beginning of the wordlist array. + + With option "-D" [DUP] and not option "-S" [SWITCH], if there + is no more room for duplicate entries in the lookup array, + don't call `assert (i != 0)'. Instead, make the array larger :-) + + With option "-D" [DUP], if there are no duplicates, don't + automatically fall back to the non-"-D" algorithm. If the user + wants the non-"-D" algorithm, he can just not specify "-D". + + With option "-D" [DUP] and either options "-p -t" [POINTER, TYPE] + or not option "-S" [SWITCH], don't emit spurious empty elements + at the beginning of the wordlist array. + + With option "-D" [DUP], simplify the detection and processing + of duplicate entries in the lookup array. + + With options "-D -l" [DUP, LENTABLE] and not option "-S" [SWITCH], + don't forget to emit the lengthtable array. + + With options "-D -l -S" [DUP, LENTABLE, SWITCH], don't forget to + compare the lengths before comparing the strings. + + * src/gen-perf.cc: No need to include . + * src/options.cc: Likewise. + + * src/options.cc: Don't use `errno' after freopen failed. + * src/std-err.cc: `report_error' doesn't call strerror(errno) any + more. No need to include and . + + * tests/Makefile.in (check-*): Any difference between .exp and .out + is a failure. Don't ignore whitespace differences. + + * tests/Makefile.in (check-lang-syntax): Add some more checks. + +Fri Mar 20 00:54:54 1998 Bruno Haible + + * tests/jscript.gperf: Renamed from tests/javascript.gperf, because + of Minix and SVR2 14-character filename limit. + * src/key-list.cc (output_string): New function. + (Key_List::output_switch, Key_List::output_keyword_table): Call it. + + * src/options.{h,icc,cc} (get_wordlist_name): New function. Add + option -W. + * src/key-list.cc (Key_List::output_switch, + Key_List::output_keyword_table, Key_List::output_lookup_function): + Use it. + Patch from William Bader . + + * src/version.cc: Bump version number directly from 2.5 to 2.7, + because Schmidt's last release from 1991 carries version number 2.6. + +Tue Jul 30 00:02:39 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu) + + * Fixed a small bug in the Key_List::output_keyword_table routine + that caused an extra newline to be printed if there where no + leading blank entries... (who cares, right?!) + +Mon Jul 29 22:05:40 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu) + + * Modified the handling of the -E (emit enums rather than + #defines) option in conjunction with the -G option. Now, if -G + and -E are given the enums are generated outside the lookup + function, rather than within it! + +Mon Apr 8 18:17:04 1991 Doug Schmidt (schmidt at net4.ics.uci.edu) + + * Yucko, there was a bug in the handling of -c (and of course the + new -I command in key-list.cc). Apparently when I added the + super-duper hack that provided support for duplicate keys I + forgot to update the strcmp output... + +Mon Mar 9 02:19:04 1998 Bruno Haible + + * Moved the documentation to doc/, put the stuff borrowed from + libg++ into lib/. + * Rewrote all Makefile.in's for better compliance with GNU standards. + * Autoconf based configuration. Rewrote all configure.in's. Added + aclocal.m4, with macros from CLISP and CLN. Added Makefile.devel. + * src/depend: Removed. Dependencies are now in src/Makefile.in. + + * src/bool-array.icc: New file, contains inline functions, from both + src/bool-array.h and src/bool-array.cc. + * src/options.icc: New file, contains inline functions, from both + src/options.h and src/options.cc. + * src/read-line.icc: New file, contains inline functions, from both + src/read-line.h and src/read-line.cc. + + * src/bool-array.h: Don't include . + * src/bool-array.cc: Include . + * src/gen-perf.cc: No need to include . Don't include + <_G_config.h>. + * src/hash-table.cc: Don't include and . Include + and lib/hash.h instead. + * src/iterator.cc: Don't include . + * src/key-list.cc: Don't include . Include and + instead. + * src/list-node.cc: Don't include . Include instead. + Remove `index' hack. + * src/main.cc: Don't include <_G_config.h>. + * src/new.cc: Don't include . Include instead. + * src/options.cc: Don't include . Include and + instead. + * src/read-line.cc: Don't include . Include + instead. + * src/std-err.cc: Don't include . Include (for Irix). + * src/vectors.h: No need to include . + * src/version.cc: No need to include . + + * src/bool-array.h: Change `STORAGE_TYPE' from int to unsigned int. + * src/bool-array.{h,cc}: Change type of `Bool_Array::size' from int + to unsigned int. + * src/bool-array.{h,cc}: Change type of `Bool_Array::init' argument + from STORAGE_TYPE to unsigned int. + * src/gen-perf.{h,cc}: Change two `Gen_Perf::compute_disjoint_union' + argument types from `char *' to `const char *'. + * src/iterator.h: Change type of `Iterator::str' and argument of + `Iterator::Iterator' from `char *' to `const char *'. + * src/iterator.cc: Cast to `unsigned char' before calling `isdigit'. + * src/key-list.{h,cc}: Change type of `Key_List::array_type', + `Key_List::return_type', `Key_List::struct_tag', + `Key_List::include_src', `default_array_type', `default_return_type' + and return type of `Key_List::get_array_type', + `Key_List::get_special_input', `Key_List::save_include_src' from + `char *' to `const char *'. + * src/key-list.cc: Change "pretty gross" assignment. + * src/key-list.cc: Don't use `alloca', HP-UX CC lacks it. + * lib/GetOpt.cc: Likewise. + * src/key-list.cc (merge): Use iteration instead of recursion. + * src/list-node.{h,cc}: Change type of `List_Node::key', + `List_Node::rest', `List_Node::char_set' from `char *' to + `const char *'. + * src/new.cc: Don't use BUFSIZ. Conditionalize the throw() declaration. + * src/read-line.h: Don't use BUFSIZ. + * src/read-line.cc: Make CHUNK_SIZE a constant, and use allocate the + buffers on the stack by default. Use memcpy for copying buffers. + Include . + * src/read-line.icc (get_line): Use iteration instead of tail recursion. + Don't call ungetc(EOF,stdin). + * src/std-err.{h,cc}: Change type of `Std_Err::program_name' and of + argument `Std_Err::report_error' from `char *' to `const char *'. + * src/std-err.cc: `report_error' doesn't call `exit' any more. All + callers changed to do that themselves. + * src/trace.h: Make constructor/destructor calls non-inline. + + * src/key-list.cc (output_hash_function): If option[CPLUSPLUS], + always make the hash function inline. + (output): Declare the hash function inline, with the right name. + * src/options.{h,cc}, src/gen-perf.cc, src/key-list.cc: Remove + options -g, making it on by default. Remove option -a. Instead, + introduce "-L KR-C", "-L C", "-L ANSI-C", "-L C++". + * src/options.{h,cc}, src/key-list.cc: Add option -I. + * src/key-list.cc: Don't emit "const" if compiling in mode "-L KR-C". + * src/key-list.cc: Don't emit a comma at the end of an enum list. + * src/main.cc: Remove COUNT_TIME code. + * src/vectors.h, src/key-list.cc, src/options.cc, src/list-node.cc: + ALPHA_SIZE defaults to 256 now. Add option -7. + + * tests/javascript.gperf: New file. + * tests/jstest*.gperf, tests/validate: New tests. + +Sat Jan 31 01:38:11 1998 Alexandre Oliva + + * src/Makefile.in ($(TARGETPROG)): Add $(CFLAGS). + +Wed Jan 28 01:56:00 1998 Manfred Hollstein + + * configure.in (package_makefile_rules_frag): New and + redirect stderr from ${srcdir}/config.shared to + ${package_makefile_rules_frag}. + * src/configure.in: Ditto. + * tests/configure.in: Ditto. + +Fri Jan 23 08:00:41 1998 H.J. Lu (hjl@gnu.org) + + * gperf.texi (@ichapter): Changed to @chapter. + +Wed Jan 14 09:16:48 1998 H.J. Lu (hjl@gnu.org) + + * src/key-list.cc, src/key-list.h (Key_List::strcspn): Don't + define if strcspn is defined. + +Fri Jan 24 13:23:47 1997 Mike Stump + + * src/new.cc (operator delete): Add the exception specification. + +Mon Feb 5 19:29:16 1996 Per Bothner + + * src/read-line.cc (Read_Line::readln_aux): Handle EOF if last line + has a length which is an exact multiple of CHUNK_SIZE. (Used to throw + away the line's contents.) From Bruno Haible . + * src/Makefile.in ($(TARGETPROG)): Add -lm to link line. + +Tue Jun 11 13:43:50 1996 Brendan Kehoe + + * src/list-node.cc (List_Node): Reorder init of nodes to + match declaration order. + * src/hash-table.cc (Hash_Table): Likewise. + +Tue Oct 10 16:37:28 1995 Mike Stump + + * src/new.cc: Since malloc/delete are not paired, we cannot call + free. + +Wed Jan 4 12:40:14 1995 Per Bothner + + * src/Makefile.in ($(TARGETPROG)): Link with $(LDFLAGS). + Patch from John Interrante . + +Sat Nov 5 19:12:48 1994 Jason Merrill (jason@phydeaux.cygnus.com) + + * src/Makefile.in (LIBS): Remove. + +Tue Oct 18 17:51:14 1994 Per Bothner + + * src/std-err.cc: Use stderror, instead of the non-standard + sys_nerr and sys_errlist. + +Sat Sep 17 22:02:13 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * src/key-list.cc (output_hash_function): + Patch from William Bader . + +Fri Jul 15 09:38:11 1994 Per Bothner (bothner@cygnus.com) + + * src/std-err.cc: #include , and only declare + extern int errno if errno is not a macro. + +Mon May 30 17:29:34 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in (src_all, install): Make sure to add '/' after + `pwd` in $rootme, as expected by FLAGS_TO_PASS. + +Wed May 11 00:47:22 1994 Jason Merrill (jason@deneb.cygnus.com) + + Make libg++ build with gcc -ansi -pedantic-errors + * src/options.h: Lose commas at end of enumerator lists. + +Sun Dec 5 19:16:40 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * src/hash-table.cc (Hash_Table::~Hash_Table): Don't pass an + argument to fprintf, since it's not expecting one. + +Fri Nov 26 19:03:18 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * src/list-node.cc: #undef index, for the sake of broken NeXT, + +Thu Nov 4 11:16:03 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in (install): Use INSTALL_DATA for gperf.1. + +Mon Oct 25 18:40:51 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * src/key-list.cc (Key_List::read_keys): Use POW macro + to increase hash table size to power of 2. + + * options.h (LARGE_STACK_ARRAYS): New flag. Defaults to zero. + * gen-perf.cc, key-list.cc, read-line.cc: + Only stack-allocate large arrays if LARGE_STACK_ARRAYS is set. + * main.cc (main): Only call setrlimit (RLIMIT_STACK, ...) + if LARGE_STACK_ARRAYS. + +Mon Oct 4 17:45:08 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * src/gen-perf.cc: Always use ANSI rand/srand instead of BSDisms. + +Wed Aug 18 12:19:53 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in (src_all): Make less verbose output. + +Fri May 28 14:01:18 1993 Per Bothner (bothner@rtl.cygnus.com) + + * src/gen-perf.cc (Gen_Perf::change): Don't use gcc-specific + 2-operand conditional expression. + * src/key-list.cc (Key_List::output_lookup_array): + Don't use variable-size stack arrays, unless compiled by g++. + +Tue May 4 14:08:44 1993 Per Bothner (bothner@cygnus.com) + + Changes (mostly from Peter Schauer) to permit compilation + using cfront 3.0 and otherwise be ARM-conforming. + * src/key-list.h: class Key_List must use public derivation + of base class Std_Err (because Gen_Perf::operator() in gen-perf.cc + calls Std_Err::report_error). + * src/gen-perf.cc (Gen_Perf::affects_prev), src/hash-table.cc + (Hash_Table::operator()): Don't use gcc-specific 2-operand + conditional expression. + * src/iterator.cc (Iterator::operator()): Don't use gcc-specific + range construct in case label. + * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys), + src/gen-perf.cc (Gen_Perf::operator(), src/read-line.cc + (Read_Line::readln_aux): If not gcc, don't allocate + variable-sized arrays on stack. + * src/new.cc (operator new): Argument type should be size_t. + * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys), + new/cc (::operator new): Don't use non-standard >?= operator. + +Tue Apr 27 20:11:30 1993 Per Bothner (bothner@cygnus.com) + + * src/Makefile.in: Define TARGETPROG, and use it. + +Mon Apr 19 00:29:18 1993 Per Bothner (bothner@cygnus.com) + + * Makefile.in, configure.in: Re-vamped configure scheme. + * gperf.texinfo: Renamed to gperf.texi. + * src/bool-array.{h,cc}: ANSIfy bzero->memset. + +Sat Jan 30 20:21:28 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * tests/Makefile.in (mostlyclean): Also delete aout, cout, m3out, + pout, and preout. + +Tue Dec 29 08:58:17 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: pass $(FLAGS_TO_PASS) to all calls to make. + (FLAGS_TO_PASS): added INSTALL, INSTALL_DATA, INSTALL_PROGRAM. + +Mon Dec 21 18:46:46 1992 Per Bothner (bothner@rtl.cygnus.com) + + * tests/expected.* renamed to *.exp to fit in 14 chars. + * tests/Makefile.in: Update accordingly. + Also rename output.* to *.out. + * src/Makefile.in (clean): Remove gperf program. + +Wed Dec 9 14:33:34 1992 Per Bothner (bothner@cygnus.com) + + * src/hash-table.cc, src/bool-array.h: ANSIfy bzero->memset. + +Thu Dec 3 19:34:12 1992 Per Bothner (bothner@cygnus.com) + + * Makefile.in (distclean, realclean): Don't delete + Makefile before recursing. + +Fri Nov 6 13:41:49 1992 Per Bothner (bothner@rtl.cygnus.com) + + * key-list.{h,cc}: Remove MAX_INT (and similar) constant + fields from Key_List class, and use INT_MAX (etc) from limits.h. + * key-list.{h,cc}, options.{h,cc}, vectors.h: Removed all + uses of initialized const fields, as they are non-standard + - and their use was easy to do away with. Mostly, just + made the constants static non-fields in the .cc file. + +Mon Nov 2 13:10:11 1992 Per Bothner (bothner@cygnus.com) + + * tests/Makefile.in: When generating cinset.c, don't pass -C, + since -C assumes an ANSI compiler. Add the -C flag (with -a) + when generating test.out.3 instead. + * tests/expected.out.3: Update accordingly. + +Wed Aug 12 11:47:54 1992 Per Bothner (bothner@cygnus.com) + + * Makefile.in: Factor out common flags into $(FLAGS_TO_PASS). + * Makefile.in: 'install-info' depends on gperf.info. + +Mon Aug 10 11:39:52 1992 Ian Lance Taylor (ian@dumbest.cygnus.com) + + * Makefile.in, src/Makefile.in: always create installation + directories. + +Mon Jul 20 15:33:21 1992 Mike Stump (mrs@cygnus.com) + + * src/new.cc (operator new): Add cast from void * to char *, + since it is not a standard conversion. + +Wed Jun 17 16:25:30 1992 Per Bothner (bothner@rtl.cygnus.com) + + * src/gen-perf.cc: #include <_G_config.h> for _G_SYSV. + * src/key-list.cc: alloca() hair. + * src/main.cc (main): Only call getrlimit if _G_HAVE_SYS_RESOURCE. + * Makefile,in, {src,test}/Makefile.in: Fix *clean rules. + +Fri May 29 13:21:13 1992 Per Bothner (bothner@rtl.cygnus.com) + + * src/gen-perf.cc: Replace USG -> _G_SYSV. + +Thu May 14 13:58:36 1992 Per Bothner (bothner@rtl.cygnus.com) + + * src/Makefile.in: Don't pass obsolete flag -DUNLIMIT_STACK. + * tests/Makefile.in (clean): Fix. + +Sat Mar 7 00:03:56 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * gperf.texinfo: added menu item hook. + +Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed traces of namesubdir, + -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced + copyrights to '92, changed some from Cygnus to FSF. + +Sun Jan 26 19:21:58 1992 Per Bothner (bothner at cygnus.com) + + * tests/Makefile.in: Use re-directed stdin instead of file + name in argv. This allows us to remove the filename + from the output, the expected output, and hence the diffs. + (Note that the input file is in $(srcdir), which we cannot + place in the expected out files.) + * tests/expected.out.[1235]: Edit out input filename, + to match new output. + +Thu Jun 28 16:17:27 1990 Doug Schmidt (schmidt at brilliant) + + * Wow, first fix on the new job! There was a dumb error + in Key_List::output_lookup_function, where I printed the + string "&wordlist[key]" instead of the correct "&wordlist[index]". + + * Added a couple of #ifdefs for USG support. + +Sun Jun 3 17:16:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Updated the version number to 2.5 and sent to Doug Lea for release + with the latest GNU libg++. + + * Changed the error handling when a keyword file cannot be opened + (now calls perror). + +Wed May 30 14:49:40 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Instrumented the source code with trace statements automagically + inserted using my new automated trace instrumentation tool! + +Wed May 9 11:47:41 1990 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Really fixed the previous bug. Turns out that a small amount + of logic had to be duplicated to handle static links that occur + as part of dynamic link chains. What a pain!!! + +Tue May 8 23:11:44 1990 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Fixed a stupid bug in Key_List::output_lookup_array that was + causing incorrect counts to be generated when there were both + static and dynamic links occurring for the same hash value. + Also simplified the code that performs the logic in this routine. + +Mon Apr 30 17:37:24 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Fixed stupid bug in Key_List::output_lookup_array that was + making the generated lookup[] array contain `chars' even + when the values stored in the chars are greater than 127! + + * Changed the behavior of the -G (global table) option so that it + will output the `length[]' array in the global scope along with + the `word_list[]' array. + + * Fixed a stupid bug in Key_List::output_lookup_function that + would always output the complicated `duplicate-handling' lookup + logic, even when there were no duplicates in the input! + + * Yikes, had to modify a bunch of stuff in key-list.cc to correctly + handle duplicate entries. Changed the generated code so that + the MIN_HASH_VALUE is no longer subtracted off when calculating + the hash value for a keyword. This required changing some other + code by substituting MAX_HASH_VALUE for TOTAL_KEYS in several places. + Finally, this means that the generated tables may contain leading + null entries, but I suppose it is better to trade-off space to get + faster performance... + +Mon Mar 26 13:08:43 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Updated version number to 2.4 to reflect the latest changes. + + * Changed the main program so that it always prints out gperf's + execution timings to the generated output file. + +Sun Mar 25 12:39:30 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Added the -Z option so that users can specify the name of the + generated class explicitly. Updated documentation to reflect + this change. + + * Modified the generated C++ class interface so that the functions + are declared static (to remove the overhead of passing the `this' + pointer). This means that operator()() can no longer be used, + since it only works on non-static member functions. + Also changed things so that there is no constructor (why waste + the extra call, when it doesn't do anything, eh?) + + * Modified the behavior of Key_List::output when the -L C++ option + is enabled. Previously the code generated use const data members + to record MIN_WORD_LENGTH, MIN_HASH_VALUE, etc. However, as + pointed out by James Clark this may result in suboptimal behavior + on the part of C++ compilers that can't inline these values. + Therefore, the new behavior is identical to what happens with + -L C, i.e., either #defines or function-specific enums are used. + Why sacrifice speed for some abstract notion of `code purity?' ;-) + +Tue Mar 6 18:17:42 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Added the -E option that defines constant values using an enum + local to the lookup function rather than with #defines. This + also means that different lookup functions can reside in the + same file. Thanks to James Clark (jjc@ai.mit.edu). + +Sat Mar 3 20:19:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Added a special case to key_list::output_switch that doesn't + generate extra comparisons when the `-S' is given an argument + of 1 (the normal case). This should speed up the generated + code output a tad... + +Fri Feb 23 14:21:28 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Renamed all instances of member function get_keysig_size + to get_max_keysig_size, since this is more precise... + + * Changed all occurrences of charset to keysig (stands for ``key + signature'') to reflect the new naming convention used in the + USENIX paper. + +Thu Feb 22 11:28:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Changed the name of the generated associated values table from + asso_value to asso_values to reflect conventions in the USENIX + C++ paper. + +Thu Feb 15 23:29:03 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Updated the gperf.texinfo file to fix some formatting problems + that had crept in since last time. + +Wed Feb 14 23:27:24 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Fixed stupid bug in key-list.cc (get_special_input), wher + gperf replaced each '%' with the succeeding character. + + * Added support for multiple target language generation. Currently + handled languages are C and C++, with C as the default. Updated + documentation and option handler to reflect the changes. + + * Added a global destructor to new.cc and removed the #ifdef, since + the bloody thing now works with libg++. + +Mon Feb 14 13:00:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Found out that my gperf paper was accepted at the upcoming + USENIX C++ Conference in San Francisco. Yow! + +Tue Jan 30 09:00:29 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * #ifdef'd out the new.cc memory allocator, since there are + problems with this and the libg++ stuff. + + * Changed key-list.h so that class Vectors is a public (rather + than private) base class for class Key_List. The previous + form was illegal C++, but wasn't being caught by the old + g++ compiler. Should work now... ;-) + +Sun Dec 10 14:08:23 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added several changes from rfg@ics.uci.edu. These changes + help to automate the build process. + +Wed Nov 15 15:49:33 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Removed conditional compilation for GATHER_STATISTICS. There's + really no good reason to avoid collecting this info at run-time, + since that section of code is *hardly* the bottleneck... ;-) + + * Simplified the C output routines in Key_List::set_output_types + and Key_List::output_keyword_table a bit in order to + speed-up and clean up the code generation. + + * Modified function Key_List::get_special_input so that it does + not try to `delete' a buffer that turned out to be too short. + This is important since the new memory management scheme + does not handle deletions. However, adding a small amount of + garbage won't hurt anything, since we generally don't do this + operation more than a couple times *at most*! + + * Created a new file (new.cc) which includes my own overloaded + operator new. This function should dramatically reduce the + number of calls to malloc since it grabs large chunks and + doles them out in small pieces. As a result of this change + the class-specific `operator new' was removed from class List_Node. + +Tue Nov 14 21:45:30 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Continued to refine the great hack. The latest trick is to + try and replace most uses of dynamic memory (i.e., calls to + new) with uses of gcc dynamic arrays (i.e., an alloca solution). + This makes life much easier for the overall process-size, since + it reduces the amount of overhead for memory management. As a + side-effect from this change there is no reason to have the + Bool_Array::dispose member function, so it's outta here! + + * Fixed a stupid bug that was an disaster waiting to happen... + Instead of making the boolean array large enough to index + max_hash_value it was only large enough to index max_hash_value + - 1. Once again, an off-by-one mistake in C/C++!!!! + +Mon Nov 13 19:38:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added the final great hack! This allows us to generate hash tables + for near-perfect hash functions that contain duplicates, *without* + having to use switch statements! Since many compilers die on large + switch statements this feature is essential. Furthermore, it appears + that the generated code is often *smaller* than that put out by + compilers, even though a large, sparse array must be created. + Here's the general idea: + + a. Generate the wordlist as a contiguous block of keywords, + just as before when using a switch statement. This + wordlist *must* be sorted by hash value. + + b. Generate the lookup array, which is an array of signed + {chars,shorts,ints}, (which ever allows full coverage of + the wordlist dimensions). If the value v, where v = + lookup[hash(str,len)], is >= 0 and < TOTAL_KEYWORDS, then we + simply use this result as a direct access into the wordlist + array to snag the keyword for comparison. + + c. Otherwise, if v is < -TOTAL_KEYWORDS or > TOTAL_KEYWORDS + this is an indication that we'll need to search through + some number of duplicates hash values. Using a hash + linking scheme we'd then index into a different part of + the hash table that provides the starting index and total + length of the duplicate entries to find via linear search! + +Sun Nov 12 13:48:10 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Simplified Key_List::output_min_max considerably by recognizing + that since the keyword list was already sorted by hash value finding + the min and max values is trivial! + + * Improved the debugging diagnostics considerably in classes Key_List, + Hash_Table, and Gen_Perf. + + * Modified the `-s' option so that a negative argument is now + interpreted to mean `allow the maximum associated value to be + about x times *smaller* than the number of input keys.' This + should help prevent massive explosion of generated hash table + size for large keysets. + +Sat Nov 11 11:31:13 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added a field in class Key_List that counts the total number + of duplicate keywords, both static and dynamic. + + * Added a new member function Bool_Array that deletes the dynamic + memory allocated to Bool_Array::storage_array. This space may + be needed for subsequent options, so it made sense to free it as + soon as possible... + + * Renamed file/class Alpha_Vectors to Vectors, to avoid problems + with 14 character length filenames on SYSV. Also changed file + adapredefined.gperf to adadefs.gperf in the ./tests directory. + + * Modified class Options by changing the member function + Options::total_positions to Options::get_charset_size and + Options::set_charset_size. These two routines now either return + the total charset size *or* the length of the largest keyword + if the user specifies the -k'*' (ALLCHARS) option. This change + cleans up client code. + + * Merged all the cperf changes into gperf. + + * Made sure to explicitly initialize perfect.fewest_collisions to + 0. + + * Cleaned up some loose ends noticed by Nels Olson. + 1. Removed `if (collisions <= perfect.fewest_collisions)' + from Gen_Perf::affects_prev since it was superfluous. + 2. Removed the fields best_char_value and best_asso_value + from Gen_Perf. There were also unnecessary. + 3. Fixed a braino in the Bool_Array::bool_array_reset + function. Since iteration numbers can never be zero + the `if (bool_array.iteration_number++ == 0)' must be + `if (++bool_array.iteration_number == 0).' + 4. Modified Std_Err::report_error so that it correctly handles + "%%". + + * It is important to note that -D no longer enables -S. + There is a good reason for this change, which will become + manifested in the next release... (suspense!). + + * Made some subtle changes to Key_List::print_switch so that if finally + seems to work correctly. Needs more stress testing, however... + + * Made a major change to the Key_List::print_switch function. + The user can now specify the number of switch statements to generate + via an argument to the -S option, i.e., -S1 means `generate 1 + switch statement with all keywords in it,' -S2 means generate + 2 switch statements with 1/2 the elements in each one, etc. + Hopefully this will fix the problem with C compilers not being + able to generate code for giant switch statements (but don't + hold your breath!) + + * Changed Key_List::length function to Key_List::keyword_list_length. + + * Added a feature to main.c that prints out the starting wall-clock + time before the program begins and prints out the ending wall-clock + time when the program is finished. + + * Added the GATHER_STATISTICS code in hash-table.c so we can + keep track of how well double hashing is doing. Eventually, + GATHER_STATISTICS will be added so that all instrumentation + code can be conditionally compiled in. + + * Fixed a stupid bug in Key_List::print_switch routine. This + was necessary to make sure the generated switch statement worked + correctly when *both* `natural,' i.e., static links and dynamic + links, i.e., unresolved duplicates, hash to the same value. + + * Modified Bool_Array::~Bool_Array destructor so that + it now frees the bool_array.storage_array when it is no longer + needed. Since this array is generally very large it makes sense + to return the memory to the freelist when it is no longer in use. + + * Changed the interface to constructor Hash_Table::Hash_Table. This + constructor now passed a pointer to a power-of-two sized buffer that + serve as storage for the hash table. Although this weakens information + hiding a little bit it greatly reduces dynamic memory fragmentation, + since we can now obtain the memory via a call to alloca, rather + than malloc. This change modified Key_List::read_keys calling + interface. + + * Since alloca is now being used more aggressively a conditional + compilation section was added in main.c. Taken from GNU GCC, + this code gets rid of any avoidable limit on stack size so that + alloca does not fail. It is only used if the -DRLIMIT_STACK + symbol is defined when gperf is compiled. + + * Added warnings in option.c so that user's would be informed + that -r superceeds -i on the command-line. + + * Rewrote Gen_Perf::affects_prev. First, the code structure + was cleaned up considerably (removing the need for a dreaded + goto!). Secondly, a major change occurred so that Gen_Perf::affects_prev + returns FALSE (success) when fewest_hits gets down to whatever + it was after inserting the previous key (instead of waiting for + it to reach 0). In other words, it stops trying if it can + resolve the new collisions added by a key, even if there are + still other old, unresolved collisions. This modification was + suggested by Nels Olson and seems to *greatly* increase the + speed of gperf for large keyfiles. Thanks Nels! + + * In a similar vein, inside the Gen_Perf::change routine + the variable `perfect.fewest_collisions is no longer initialized + with the length of the keyword list. Instead it starts out at + 0 and is incremented by 1 every time change () is called. + The rationale for this behavior is that there are times when a + collision causes the number of duplicates (collisions) to + increase by a large amount when it would presumably just have + gone up by 1 if none of the asso_values were changed. That is, + at the beginning of change(), you could initialize fewest_hits + to 1+(previous value of fewest_hits) instead of to the number of + keys. Thanks again, Nels. + + * Replaced alloca with new in the Gen_Perf::change function. + This should eliminate some overhead at the expense of a little + extra memory that is never reclaimed. + + * Renamed Gen_Perf::merge_sets to Gen_Perf::compute_disjoint_union + to reflect the change in behavior. + + * Added the -e option so users can supply a string containing + the characters used to separate keywords from their attributes. + The default behavior is ",\n". + + * Removed the char *uniq_set field from LIST_NODE and modified + uses of uniq_set in perfect.c and keylist.c. Due to changes + to Gen_Perf::compute_disjoint_sets this field was no longer + necessary, and its removal makes the program smaller and + potentially faster. + + * Added lots of changes/fixes suggested by Nels Olson + (umls.UUCP!olson@mis.ucsf.edu). In particular: + 1. Changed Bool_Array so that it would dynamically create + an array of unsigned shorts rather than ints if the + LO_CAL symbol was defined during program compilation. + This cuts the amount of dynamic memory usage in half, + which is important for large keyfile input. + 2. Added some additional debugging statements that print extra + info to stderr when the -d option is enabled. + 3. Fixed a really stupid bug in Key_List::print_switch + A right paren was placed at the wrong location, which broke + strlen (). + 4. Fixed a subtle problem with printing case values when keylinks + appear. The logic failed to account for the fact that there + can be keylinks *and* regular node info also! + 5. Changed the behavior of Key_List::read_keys so that it would + honor -D unequivocally, i.e., it doesn't try to turn off dup + handling if the user requests it, even if there are no + immediate links in the keyfile input. + 6. Modified the -j option so that -j 0 means `try random values + when searching for a way to resolve collisions.' + 7. Added a field `num_done' to the Gen_Perf struct. This is used + to report information collected when trying to resolve + hash collisions. + 8. Modified the merge_sets algorithm to perform a disjoint + union of two multisets. This ensures that subsequent + processing in Gen_Perf::affect_prev doesn't + waste time trying to change an associated value that is + shared between two conflicting keywords. + 9. Modified Gen_Perf::affects_prev so that it doesn't try + random jump values unless the -j 0 option is enabled. + 10. Fixed a silly bug in Gen_Perf::change. This problem caused + gperf to seg fault when the -k* option was given and the + keyfile file had long keywords. + +Sun Oct 29 00:18:55 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Modified class-specific new operations for Read_Line and + List_Node so they don't fail if SIZE is larger than twice + the previous buffer size. Note we double buffer size + everytime the previous buffer runs out, as a heuristic + to reduce future calls to malloc. + +Sun Oct 22 13:49:43 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Updated gperf version number to 2.0. Send to Doug Lea for + incorporation into the long-awaited `official' libg++ 1.36 + release! + + * Thanks to Nels Olson a silly bug in Gen_Perf::change () + was fixed. This problem caused gperf to seg fault when + the -k* option was given and the keyfile file had long + keywords. + + * Modified Key_List::print_hash_function so that it output + max_hash_value + 1 (rather than just max_hash_value) for + any associated value entries that don't correspond to + keyword charset characters. This should speed up rejection + of non-keyword strings a little in some cases. + +Sat Oct 21 19:28:36 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Fixed Key_List::print_hash_function so that it no longer output + things like `return 0 + ...' Although this probably gets + optimized away by even the worst C compilers there isn't any + point tempting fate... ;-) + + * Fixed class List_Node's constructor so that it wouldn't a priori + refuse to consider trying to hash keys whose length is less + than the smallest user-specified key position. It turns out + this is not a problem unless the user also specifies the -n + (NOLENGTH) option, in which case such keys most likely + don't have a prayer of being hashed correctly! + + * Changed the name of the generated lookup table from `Hash_Table' + to `asso_value' to be consistent with the gperf paper. + +Tue Oct 17 14:19:48 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added a flag GATHER_STATISTICS in the Makefile. If defined + during compilation this turns on certain collection facilities + that track the performance of gperf during its execution. In + particular, I want to see how many collisions occur for the + double hashing Hash_Table. + + * Added a safety check so that we don't screw up if the total + number of `resets' of the Bool_Array exceeds MAX_INT. Since + this number is around 2^31 it is unlikely that this would ever + occur for most input, but why take the risk? + + * Changed the behavior for the -a (ANSI) option so that the + generated prototypes use int rather than size_t for the LEN + parameter. It was too ugly having to #include all + over the place... + +Mon Oct 16 11:00:35 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Continued to work on the gperf paper for the USENIX C++ + conference. At some point this will be merged back into + the gperf documentation... + +Sat Oct 14 20:29:43 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Added a majorly neat hack to Bool_Array, suggested by rfg. + The basic idea was to throw away the Ullman array technique. + The Ullman array was used to remove the need to reinitialize all + the Bool_Array elements to zero everytime we needed to determine + whether there were duplicate hash values in the keyword list. + The current trick uses an `iteration number' scheme, which takes + about 1/3 the space and reduces the overall program running a + time by about 20 percent for large input! The hack works as + follows: + + 1. Dynamically allocation 1 boolean array of size k. + 2. Initialize the boolean array to zeros, and consider the first + iteration to be iteration 1. + 2. Then on all subsequent iterations we `reset' the bool array by + kicking the iteration count by 1. + 3. When it comes time to check whether a hash value is currently + in the boolean array we simply check its index location. If + the value stored there is *not* equal to the current iteration + number then the item is clearly *not* in the set. In that + case we assign the iteration number to that array's index + location for future reference. Otherwise, if the item at + the index location *is* equal to the iteration number we've + found a duplicate. No muss, no fuss! + +Mon Oct 2 12:30:54 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Changed some consts in options.h to enumerals, since g++ + doesn't seem to like them at the moment! + +Sat Sep 30 12:55:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Fixed a stupid bug in Key_List::print_hash_function that manifested + itself if the `-k$' option was given (i.e., only use the key[length] + character in the hash function). + + * Added support for the -C option. This makes the contents of + all generated tables `readonly'. + + * Changed the handling of generated switches so that there is + only one call to str[n]?cmp. This *greatly* reduces the size of + the generated assembly code on all compilers I've seen. + + * Fixed a subtle bug that occurred when the -l and -S option + was given. Code produced looked something like: + + if (len != key_len || !strcmp (s1, resword->name)) return resword; + + which doesn't make any sense. Clearly, this should be: + + if (len == key_len && !strcmp (s1, resword->name)) return resword; + +Tue Sep 26 10:36:50 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Changed class Read_Line's definition so that it no longer + needs to know about the buffering scheme used to speed up + dynamic memory allocation of input keywords and their + associated attributes. This means that operator new is no longer + a friend of Read_Line. + +Mon Sep 25 23:17:10 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Decided that Obstacks had too much overhead, so they were + removed in favor of super-efficient, low-overhead buffered + storage allocation hacks in Read_Line and List_Node. + + * No longer try to inline functions that g++ complains about + (Key_List::Merge and Key_List::Merge_Sort). + +Sun Sep 24 13:11:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Changed classes Read_Line and List_Node to use Obstacks in order + to cache memory allocation for keyword strings and List_Nodes. + + * Continued to experiment with inheritance schemes. + + * Added a new file `alpha.h', that declares static data shared + (i.e., inherited) between classes List_Node and Key_List. + +Tue Sep 12 16:14:41 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Made numerous changes to incorporate multiple inheritance in + gperf. + +Wed Aug 16 23:04:08 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added the -DCOMPILER_FIXED flag to the ./src/Makefile. This + implies that people trying to compile gperf need to have a + working version of the new g++ compiler (1.36.0). + + * Removed some extra spaces that were being added in the generated + C code. + +Mon Jul 24 17:09:46 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Fixed PRINT_HASH_FUNCTION and PRINT_LOOKUP_FUNCTION in keylist.c + so that the generated functions take an unsigned int length argument. + If -a is enabled the prototype is (const char *str, size_t len). + +Fri Jul 21 13:06:15 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Fixed a typo in PRINT_KEYWORD_TABLE in keylist.cc that prevented + the indentation from working correctly. + + * Fixed a horrible typo in PRINT_KEYWORD_TABLE in keylist.cc + that prevented links from being printed correctly. + +Tue Jul 18 16:04:31 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Fixed up readline.cc and readline.h so that they work OK + with g++ compilers that aren't completely up-to-date. + If symbol COMPILER_FIXED is defined then the behavior + that works on my more recent version of g++ is enabled. + +Sun Jul 9 17:53:28 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Changed the ./tests subdirectory Makefile so that it + uses $(CC) instead of gcc. + +Sun Jul 2 21:52:15 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Fixed a number of subtle bugs that occurred when -S was + combined with various and sundry options. + + * Added the -G option, that makes the generated keyword table + a global static variable, rather than hiding it inside + the lookup function. This allows other functions to directly + access the contents in this table. + + * Added the "#" feature, that allows comments inside the keyword + list from the input file. Comment handling takes place in readline.c. + This simplifies the code and reduces the number of malloc calls. + + * Also added the -H option (user can give the name of the hash + function) and the -T option (prevents the transfer of the type decl + to the output file, which is useful if the type is already defined + elsewhere). + +Thu Jun 22 20:39:39 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Modified many classes so that they would inherit Std_Err as + a base class. This makes things more abstract... + +Fri Jun 16 14:23:00 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Modified the -f (FAST) option. This now takes an argument. + The argument corresponds to the number of iterations used + to resolve collisions. -f 0 uses the length of the + keyword list (which is what -f did before). This makes + life much easier when dealing with large keyword files. + +Tue Jun 6 17:53:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added the -c (comparison) option. Enabling this + will use the strncmp function for string comparisons. + The default is to use strcmp. + + * Fixed a typo in key_list.cc (PRINT_SWITCH). This caused + faulty C code to be generated when the -D, -p, and -t + options were all enabled. + +Thu May 25 14:07:21 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Once again, changed class Read_Line to overload global operator + new. Hopefully, this will work...! + +Sun May 21 01:51:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Modified Key_List::print_hash_function () so that it properly + formats the associated values in the hash table according to + the maximum number of digits required to represent the largest + value. + + * Removed the named return value from class Hash_Table's + operator (), since this causes a seg fault when -O is enabled. + No sense tripping subtle g++ bugs if we don't have to.... ;-) + + * Removed the operator new hack from Read_Line, since this seemed + to create horrible bus error problems. + + * Changed many class member functions and data members to be `static', + if they don't manipulate this! + +Fri May 12 23:06:56 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Changed class Std_Err to use static member functions, a la + Ada or Modula 2. This eliminates the need for an explicit + error-handler class object. + + * Added the ``named return value'' feature to Hash_Table::operator () + and Bool_Array::operator [], just for the heck of it.... ;-) + + * Changed the previous hack in Read_Line so that we now use + the overloaded global `new' instead of NEW_STRING! + +Wed May 3 17:36:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Updated to version 1.7. This reflects the recent major changes + and the new C port. + + * Modified the GNU getopt.cc routine to have a class-based interface. + + * Fixed a typo in Perfect.cc ~Perfect that prevented the actual maximum + hash table size from being printed (maybe the stream classes + weren't so bad after all.... ;-). + + * Added support for the -f option. This generates the perfect + hash function ``fast.'' It reduces the execution time of + gperf, at the cost of minimizing the range of hash values. + +Tue May 2 16:23:29 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Added an efficiency hack to Read_Line. Instead of making + a call to operator NEW (a.k.a. malloc) for each input string + a new member function NEW_STRING stores a large buffer from + which new strings are carved out, growing the buffer if + necessary. It might be useful to add this throughout the + program.... + + * Removed all unnecessary calls to DELETE. If the program is about + to exit it is silly to waste time freeing memory. + + * Added the GNU getopt program to the distribution. This makes + GPERF portable to systems that don't include getopt in libc. + + * Added a strcspn member to class Key_List. This also increases + portability. + + * Added the get_include_src function from keylist.c as a member + function in class Key_List. Hopefully every function is + now associated with a class. This aids abstraction and + modularity. + + * Ported gperf to C. From now on both K&R C and GNU G++ versions + will be supported. There will be two ChangeLog files, one + for each version of the program. + +Mon May 1 16:41:45 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Fixed a bug with -k'*'. This now prints out *all* the cases + up to the length of the longest word in the keyword set. + +Sun Apr 30 12:15:25 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Removed all use of the stream classes. Too ugly, slow, and + not handled by the c++-mode formatter.... + + * Modified the handling of links (i.e., keywords that have + identical hash values as other keywords). This should + speed up hash function generation for keyword sets with + many duplicate entries. The trick is to treat duplicate + values as equivalence classes, so that each set of duplicate + values is represented only once in the main list processing. + + * Fixed some capitialization typos and indentations mistakes in + Key_List::print_hash_function. + +Sat Apr 29 12:04:03 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Fixed a typo/logico in Key_List::print_switch that prevented + the last keyword in the keyword list to be print out. This + requires further examination..... + + * Fixed a stupid bug in List_Node::List_node. If the -k'*' option + was enabled the KEY_SET string wasn't getting terminated with + '\0'! + +Fri Apr 28 12:38:35 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Renamed strexp.h and strexp.cc to iterator.h and iterator.cc. + Also changed the strexp class to iterator. Continued to work + on style... + + * Updated the version number to 1.6. This reflects all the + recent changes. + +Thu Apr 27 00:14:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added the -D option that properly handles keyword sets that + contain duplicate hash values. + + * Continued the stylistic changes. Added the #pragma once + directive to all the *.h files. Removed all #defines and + replaced them with static consts. Also moved the key_sort + routine from options.cc into the options class as a + member function. + +Mon Apr 3 13:26:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) + + * Made massive stylistic changes to bring source code into + conformance with GNU style guidelines. + +Thu Mar 30 23:28:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Fixed up the output routines so that they generate code + corresponding to the GNU style guidelines. + +Sat Mar 11 13:12:37 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Fixed Stderr constructors so that they wouldn't try to + use the base class initializer syntax for the static + class variable Program_Name. G++ 1.34 is stricter in + enforcing the rules! + +Fri Mar 10 11:24:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Removed -v and ``| more'' from the Makefile to keep rfg happy... + +Thu Mar 2 12:37:30 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Sent latest GNU gperf version 1.5 to Doug Lea for inclusion + into libg++ 1.34. Note that there is a small bug with + the new %{ ... %} source inclusion facility, since it doesn't + understand comments and will barf if %{ or %} appear nested + inside the outermost delimiters. This is too trivial of + a defect to fix at the moment... + +Tue Feb 28 11:19:58 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added the -K option, which allows the user to provide a + alternative name for the keyword structure component. + The default is still ``name.'' + + * Added the LEX and YACC-like ability to include arbitrary + text at the beginning of the generated C source code output. + This required two new functions Get_Special_Input, + Key_List::Save_Include_Src; + + * Fixed memory allocation bug in Key_List::Set_Types. + Variable Return_Type needs 1 additional location + to store the "*" if the -p option is used. + + * Added code to NULL terminate both Struct_Tag and Return_Type, + *after* the strncpy (stupid mistake). + +Mon Feb 27 14:39:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added a new option -N. This allows the user to specify the + name to be used for the generated lookup function. The + default name is still ``in_word_set.'' This makes it + possible to completely automate the perfect hash function + generation process! + +Mon Feb 20 23:33:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Corrected the Hash_Table::operator () function so that + *it* is responsible for deciding when a new key has the + same signature as a previously seen key. The key length + information is now used internally to this function to + decide whether to add to the hash table those keys with + the same key sets, but different lengths. Before, this + was handled by the Key_List::Read_Keys function. However, + this failed to work for certain duplicate keys, since + they weren't being entered into the hash table properly. + +Sun Feb 19 16:02:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Modified class Options by moving the enum Option_Type out + of the class. This is to satisfy the new enumeration + scope rules in C++. + +Sun Jan 15 15:12:09 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Incremented the version number upto 1.4 to reflect the new + options that affect the generated code. Send the new + distribution off to Michael for use with g++ 1.33. + + * Added a fix to Key_List::Read_Keys so that it checks for links + properly when the -n option is used. Previously, it didn't + catch obvious links, which caused it to spend large amount + of time searching for a solution that could never occur! + + * Modified the Key_List data structure to record *both* the + minimum and the maximum key lengths. This information + is now computed in Key_List::Read_Keys, and thus + Key_List::Print_Min_Max doesn't need to bother. + + * Modifed the key position iterator scheme in options.cc to + eliminate the need for member function Options::Advance. + Now, the Options::Get function performs the advancement + automatically, obviating the need for an extra function call. + + * Added the new function Options::Print_Options, to print out + the user-specified command line options to generated C + output file. + + * Added a new function, Key_List::Print_Keylength_Table, + which creates a table of lengths for use in speeding + up the keyword search. This also meant that a new + option, -l (LENTABLE) is recognized. It controls + whether the length table is printed and the comparison + made in the generated function ``in_word_set.'' + + * Added a comment at the top of the generated C code + output file that tells what version of gperf was used. + Next, I'll also dump out the command line options + as a comment too. Thanks to Michael Tiemann for the + feedback on this. + + * Fixed the -n option to make it work correctly with + other parts of the program (most notably the Perfect::Hash + function and the computation of minimum and maximum lengths. + +Fri Jan 13 21:25:27 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Realized the the need to add a test that will enable + optimziation of the generated C code in the ``hash'' function + by checking whether all the requested key positions are + guaranteed to exist due to the comparison in `in_word_set.'' + I'll put this in soon.... + +Thu Jan 12 20:09:21 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Added pascal, modula3, and modula2 tests inputs to the + Makefile + + * Recognised that there is a bug with the -n option. However + I'm too busy to fix it properly, right now. The problem + is that the generated #define end up being 0, since that's + my hack to make -n work. This needs complete rethinking! + +Tue Jan 10 00:08:16 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Added a new option, -n, that instructs gperf to not use the + length of an identifier when computing the hash functions. + I'm not sure how useful this is! + + * Retransmitted the distribution to rocky.oswego.edu. Hopefully, + this will work! + + * Began fixing the indentation and capitalization to conform + to the GNU coding guidelines. + +Mon Jan 9 22:23:18 1989 Doug Schmidt (schmidt at pompe.ics.uci.edu) + + * Fixed horrible bug in Read_Line::Readln_Aux. This was + a subtle and pernicous off-by-1 error, that overwrote + past the last character of the input string buffer. I + think this fault was killing the vax! + + * Yow, fixed an oversight in List_Node::List_Node, where the + pointer field Next was uninitialized. Luckily, the new routine + seems to return 0 filled objects the first time through! + +Sun Jan 8 13:43:14 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Modified the ``key linked'' diagnostic in Key_List::Read_Keys + to be more helpful and easy to read. + + * Fixed the List_Node::List_Node so that it would ignore trailing + fields if the -t option was not enabled. + + * Moved the List_Node declarations out of keylist.h and + into a file of its own, called listnode.cc and listnode.h + Made Set_Sort a member function of class List_Node. + + * Massively updated the documentation in the gperf.texinfo file. + + * Polished off the major revision to the print functions, + added a few new tests in the Makefile to check for the + validity of the program and ftp'ed the entire distribution + off to Doug Lea for libg++. ( changed it to + 1.3 to reflect the major changes with the generated + C code ). + + * Fixed Key_List::Print_Switch to deal with the -p and -t options. + This meant that the ``still-born'' function Key_List:: + Print_Type_Switch was superflous, so I removed it. + Also, removed the restriction in Option that the -p and + -t options couldn't be used simultaneously. + + * Modified List_Node::List_Node, to perform only 1 call to + ``new'' when dynamically allocating memory for the Key_Set + and the Uniq_Set. + +Sat Jan 7 14:10:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) + + * Fixed a big bug with the new policy of nesting the + wordlist inside of generated function ``in_word_set.'' + I'd forgotten to declare the wordlist array as static! + ( arrgh ). + + * Added a new function Key_List::Set_Types, that figures out + the return type for generated function ``in_word_set,'' + the user-defined ``struct tag,'' if one is used, and also + formates the array type for the static local array. + + * Changed the print routines to take advantage of the + new -p option. + + * Began adding the hooks to allow the return of a pointer + to a user defined struct location from the generated + ``in_word_set'' function instead of the current 0 or 1 + return value. Created function Key_List::Print_Type_Switch + and added option -p to class Option, allowing the user to + request generation of the aforementioned pointers returned + instead of booleans. + + * Put in checks in class Option to make sure that -S and -t + options are not used simultaneously. This restriction + will be removed in subsequent releases, once I decide on + a clean way to implement it. + + * Sent version 1.2 to Doug Lea for possible inclusion into + the libg++ distribution. + + * Moved the static word_list array inside the generated function + in_word_set. This supports better data hiding. + + * Added a texinfo file, gperf.texinfo + + * Revised the Makefile to cleanup the droppings from texinfo + and changed the name of gperf.cc and gperf.h to perfect.cc + and perfect.h. + +Fri Jan 6 13:04:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) + + * Implemented the switch statement output format. Much better + for large datasets in terms of space used. + + * Added new functions to break up the Key_List::Output function. + Functions added were Key_List::Print_Switch, Key_List::Print_Min_Max, + Key_List::Print_Keyword_Table, Key_List::Print_Hash_Function, + and Key_List::Print_Lookup_Function. This simplifies the + big mess in Key_List::Output considerably! + + * Added switch statement option to Options, which potentially + trades time for space in the generated lookup code. + +Thu Jan 5 22:46:34 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) + + * Released version 1.1 + + * Fixed a bug with Gperf::Merge_Set, it was skipping letters shared + between the Set_1 and Set_2. + + * Added the optimal min/max algorithm in Key_List::Output. This + runs in O ( 3n/2 ), rather than O ( 2n ) time. + + * Changed Gperf::Sort_Set to use insertion sort, rather than + bubble sort. + + * Added a check in Key_List::Output for the special case where + the keys used are 1,$. It is possible to generate more + efficient C code in this case. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..5a151a2 --- /dev/null +++ b/INSTALL @@ -0,0 +1,230 @@ +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.ac' is used to create `configure' by a program +called `autoconf'. You only need `configure.ac' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. 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 a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +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. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases. You +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' 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. + +Particular Systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in order +to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On AIX 3, the C include files by default don't define some necessary +prototype declarations. If GNU CC is not installed, it is recommended to +use the following options: + + ./configure CC="xlc -D_ALL_SOURCE" + + On BeOS, user installed software goes in /boot/home/config, not +/usr/local. It is recommended to use the following options: + + ./configure --prefix=/boot/home/config + +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.devel b/Makefile.devel new file mode 100644 index 0000000..fc65a93 --- /dev/null +++ b/Makefile.devel @@ -0,0 +1,42 @@ +# This is the developer's makefile, not the user's makefile. +# Don't use it unless you know exactly what you do! + +SHELL = /bin/sh +MAKE = make + +all : configures src/config.h.in src/config.h_vms + +CONFIGURES = configure lib/configure src/configure tests/configure doc/configure + +configures : $(CONFIGURES) + +configure : configure.ac aclocal.m4 + autoconf -I . + +lib/configure : lib/configure.ac aclocal.m4 + cd lib && autoconf -I .. + +src/configure : src/configure.ac aclocal.m4 + cd src && autoconf -I .. + +tests/configure : tests/configure.ac aclocal.m4 + cd tests && autoconf -I .. + +doc/configure : doc/configure.ac aclocal.m4 + cd doc && autoconf -I .. + +check-configures : $(CONFIGURES) + set -e; for f in $(CONFIGURES); do bash -x -n $$f; done + +src/config.h.in : src/configure.ac aclocal.m4 + cd src && autoheader -I .. + +src/config.h_vms : src/config.h.in + cp src/config.h.in src/config.h_vms + +totally-clean : force + rm -f $(CONFIGURES) + rm -f src/config.h.in src/config.h_vms + +force : + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..705f2a5 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,104 @@ +# Makefile for gperf + +# Copyright (C) 1989, 1992, 1993, 1998, 2002, 2012, 2016 Free Software Foundation, Inc. +# Written by Douglas C. Schmidt +# and Bruno Haible . +# +# This file is part of GNU GPERF. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#### Start of system configuration section. #### + +# Programs used by "make": +RM = rm -f +@SET_MAKE@ + +#### End of system configuration section. #### + +SHELL = /bin/sh + +all : force + cd @subdir@; $(MAKE) all + +install : force + cd @subdir@; $(MAKE) install + +installdirs : force + cd @subdir@; $(MAKE) installdirs + +uninstall : force + cd @subdir@; $(MAKE) uninstall + +check : force + cd @subdir@; $(MAKE) check + +mostlyclean : force + cd @subdir@; $(MAKE) mostlyclean + +clean : force + cd @subdir@; $(MAKE) clean + +distclean : force + cd @subdir@; if test -f Makefile; then $(MAKE) distclean; fi + $(RM) config.status config.log config.cache Makefile + +maintainer-clean : force + cd @subdir@; if test -f Makefile; then $(MAKE) maintainer-clean; fi + $(RM) config.status config.log config.cache Makefile + +# List of source files. +SOURCE_FILES = \ + README README.windows README.vms NEWS AUTHORS \ + configure.ac aclocal.m4 Makefile.in Makefile.vms \ + Makefile.devel ChangeLog +# List of distributed files imported from other packages. +IMPORTED_FILES = \ + COPYING INSTALL \ + build-aux/install-sh build-aux/mkinstalldirs \ + build-aux/compile build-aux/ar-lib +# List of distributed files generated by autotools or Makefile.devel. +GENERATED_FILES = configure +# List of distributed files generated by "make". +DISTRIBUTED_BUILT_FILES = +# List of distributed files. +DISTFILES = $(SOURCE_FILES) $(IMPORTED_FILES) $(GENERATED_FILES) $(DISTRIBUTED_BUILT_FILES) + +distdir : $(DISTFILES) + for file in $(DISTFILES); do \ + if test -f $$file; then dir='.'; else dir='$(srcdir)'; fi; \ + destdir=`echo '$(distdir)'/$$file | sed -e 's|//*[^/]*$$||'`; \ + test -d "$$destdir" || mkdir "$$destdir"; \ + cp -p $$dir/$$file '$(distdir)'/$$file || exit 1; \ + done + subdir=@subdir@; test -d '$(distdir)'/$$subdir || mkdir '$(distdir)'/$$subdir; cd $$subdir; $(MAKE) distdir distdir='$(distdir)'/$$subdir + +# Creating a distribution tarball. +PACKAGE = gperf +VERSION = `sed -n -e 's/.*version_string = "\(.*\)".*/\1/p' < src/version.cc` +TAR = tar +GZIP = gzip + +dist : force + tmpdistdir=$(PACKAGE)-$(VERSION); \ + abstmpdistdir=`pwd`/$$tmpdistdir; \ + rm -rf $$tmpdistdir $$tmpdistdir.tar $$tmpdistdir.tar.gz \ + && mkdir $$tmpdistdir \ + && $(MAKE) distdir distdir="$$abstmpdistdir" \ + && $(TAR) chof $$tmpdistdir.tar --owner=root --group=root $$tmpdistdir \ + && $(GZIP) -9 $$tmpdistdir.tar \ + && rm -rf $$tmpdistdir + +force : + diff --git a/Makefile.vms b/Makefile.vms new file mode 100644 index 0000000..3776337 --- /dev/null +++ b/Makefile.vms @@ -0,0 +1,177 @@ +# -*- Makefile -*- for gperf on VMS using the MMS utility + +# Copyright (C) 2003 Free Software Foundation, Inc. +# Written by Bruno Haible . +# +# This file is part of GNU GPERF. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#### Start of system configuration section. #### + +# Directories used by "make install": +prefix = SYS$DATA:[ +exec_prefix = $(prefix) +datadir = $(prefix).share +bindir = $(exec_prefix).bin +mandir = $(datadir).man +man1dir = $(mandir).man1 +docdir = $(datadir).doc.gperf + +# Programs used by "make": + +CC = cc +CXX = cxx + +# These flags affect binary compatibility. GNU gperf does not need them, +# but other packages do. +ABIFLAGS = /name=(as_is,short) /float=ieee + +WARN_CFLAGS = /warning + +OPTIMFLAGS = /optimize + +CFLAGS = $(ABIFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) +CXXFLAGS = $(ABIFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) +DEFS = "VMS=1","HAVE_CONFIG_H=1" + +INCLUDES = /include=([],[.lib],[.src]) + +LN = copy +RM = delete + +# Programs used by "make install": +INSTALL = copy +INSTALL_PROGRAM = copy +INSTALL_DATA = copy + +#### End of system configuration section. #### + +LIB_OBJECTS = [.lib]getopt.obj,[.lib]getopt1.obj,[.lib]getline.obj,[.lib]hash.obj +SRC_OBJECTS = [.src]version.obj,[.src]positions.obj,[.src]options.obj,[.src]keyword.obj,[.src]keyword-list.obj,[.src]input.obj,[.src]bool-array.obj,[.src]hash-table.obj,[.src]search.obj,[.src]output.obj,[.src]main.obj +OBJECTS = $(LIB_OBJECTS),$(SRC_OBJECTS) + +all : gperf.exe + write sys$output "Nothing else to be done for 'all'." + +[.src]config.h : [.src]config.h_vms + $(LN) [.src]config.h_vms [.src]config.h + +[.lib]getopt.obj : [.lib]getopt.c + $(CC) $(INCLUDES) $(CFLAGS) /define=("VMS=1") [.lib]getopt.c /obj=[.lib]getopt.obj + +[.lib]getopt1.obj : [.lib]getopt1.c + $(CC) $(INCLUDES) $(CFLAGS) /define=("VMS=1") [.lib]getopt1.c /obj=[.lib]getopt1.obj + +[.lib]getline.obj : [.lib]getline.cc + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=("VMS=1") [.lib]getline.cc /obj=[.lib]getline.obj + +[.lib]hash.obj : [.lib]hash.cc + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=("VMS=1") [.lib]hash.cc /obj=[.lib]hash.obj + +# Dependencies. +CONFIG_H = [.src]config.h +VERSION_H = [.src]version.h +POSITIONS_H = [.src]positions.h,[.src]positions.icc +OPTIONS_H = [.src]options.h,[.src]options.icc,$(POSITIONS_H) +KEYWORD_H = [.src]keyword.h,[.src]keyword.icc +KEYWORD_LIST_H = [.src]keyword-list.h,[.src]keyword-list.icc,$(KEYWORD_H) +INPUT_H = [.src]input.h,$(KEYWORD_LIST_H) +BOOL_ARRAY_H = [.src]bool-array.h,[.src]bool-array.icc,$(OPTIONS_H) +HASH_TABLE_H = [.src]hash-table.h,$(KEYWORD_H) +SEARCH_H = [.src]search.h,$(KEYWORD_LIST_H),$(POSITIONS_H),$(BOOL_ARRAY_H) +OUTPUT_H = [.src]output.h,$(KEYWORD_LIST_H),$(POSITIONS_H) + +[.src]version.obj : [.src]version.cc,$(VERSION_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]version.cc /obj=[.src]version.obj + +[.src]positions.obj : [.src]positions.cc,$(POSITIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]positions.cc /obj=[.src]positions.obj + +[.src]options.obj : [.src]options.cc,$(OPTIONS_H),$(VERSION_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]options.cc /obj=[.src]options.obj + +[.src]keyword.obj : [.src]keyword.cc,$(KEYWORD_H),$(POSITIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]keyword.cc /obj=[.src]keyword.obj + +[.src]keyword-list.obj : [.src]keyword-list.cc,$(KEYWORD_LIST_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]keyword-list.cc /obj=[.src]keyword-list.obj + +[.src]input.obj : [.src]input.cc,$(INPUT_H),$(OPTIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]input.cc /obj=[.src]input.obj + +[.src]bool-array.obj : [.src]bool-array.cc,$(BOOL_ARRAY_H),$(OPTIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]bool-array.cc /obj=[.src]bool-array.obj + +[.src]hash-table.obj : [.src]hash-table.cc,$(HASH_TABLE_H),$(OPTIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]hash-table.cc /obj=[.src]hash-table.obj + +[.src]search.obj : [.src]search.cc,$(SEARCH_H),$(OPTIONS_H),$(HASH_TABLE_H),$(CONFIG_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]search.cc /obj=[.src]search.obj + +[.src]output.obj : [.src]output.cc,$(OUTPUT_H),$(OPTIONS_H),$(VERSION_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]output.cc /obj=[.src]output.obj + +[.src]main.obj : [.src]main.cc,$(OPTIONS_H),$(INPUT_H),$(SEARCH_H),$(OUTPUT_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) /define=($(DEFS)) [.src]main.cc /obj=[.src]main.obj + +gperf.exe : $(OBJECTS) + link /executable=gperf.exe $(OBJECTS) + +install : all force + create /directory $(prefix)] + create /directory $(exec_prefix)] + create /directory $(bindir)] + $(INSTALL_PROGRAM) gperf.exe $(bindir)]gperf.exe + create /directory $(datadir)] + create /directory $(mandir)] + create /directory $(man1dir)] + $(INSTALL_DATA) [.doc]gperf.1 $(man1dir)]gperf.1 + create /directory $(datadir).doc] + create /directory $(docdir)] + $(INSTALL_DATA) [.doc]gperf.html $(docdir)]gperf.html + +installdirs : force + create /directory $(prefix)] + create /directory $(exec_prefix)] + create /directory $(bindir)] + create /directory $(datadir)] + create /directory $(mandir)] + create /directory $(man1dir)] + create /directory $(datadir).doc] + create /directory $(docdir)] + +uninstall : force + $(RM) $(bindir)]gperf.exe; + $(RM) $(man1dir)]gperf.1; + $(RM) $(docdir)]gperf.html; + +check : all + write sys$output "Nothing else to be done for 'check'." + +mostlyclean : clean + write sys$output "Nothing else to be done for 'mostlyclean'." + +clean : + $(RM) [.lib]*.obj;* + $(RM) [.src]*.obj;* + $(RM) gperf.exe;* + $(RM) [.src]config.h;* + +distclean : clean + write sys$output "Nothing else to be done for 'distclean'." + +maintainer-clean : distclean + write sys$output "Nothing else to be done for 'maintainer-clean'." + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..f3abd0e --- /dev/null +++ b/NEWS @@ -0,0 +1,106 @@ +New in 3.1: +* The generated C code is now in ANSI-C by default. If you want to support + pre-ANSI-C compilers, you need to provide the option --language=C on the + command line or %language=C in the source file. +* The 'len' parameter of the hash function and of the lookup function is now + of type 'size_t' instead of 'unsigned int'. This makes it safe to call these + functions with strings of length > 4 GB, on 64-bit machines. +* Added option --constants-prefix. +* Added declaration %define constants-prefix. + +New in 3.0.4: + +* gperf is now licensed under the GPL version 3 or newer. +* The generated C code gives less warnings with gcc-4.2.x in c99 or gnu99 mode. + +New in 3.0.3: + +* The generated C code is compatible with gcc-4.3.x in c99 or gnu99 mode. + +New in 3.0.2: + +* Compiles with g++-4.0.x. +* Added option --length-table-name. +* Added declaration %define length-table-name. +* Fixed #line directives for filenames containing backslashes. + +New in 3.0.1: + +* Bug fix. + +New in 3.0: + +* Added option --output that allows to specify the output file name. +* Some options have been renamed: + --hash-fn-name=NAME --> --hash-function-name=NAME + --lookup-fn-name=NAME --> --lookup-function-name=NAME + --compare-strlen --> --compare-lengths + --global --> --global-table + The older variants are still supported for backward compatibility. +* The following options can now be specified inside the input file: + %delimiters=DELIMITER-LIST + %struct-type + %ignore-case + %language=LANGUAGE-NAME + %define slot-name NAME + %define initializer-suffix INITIALIZERS + %define hash-function-name NAME + %define lookup-function-name NAME + %define class-name NAME + %7bit + %compare-lengths + %compare-strncmp + %readonly-tables + %enum + %includes + %global-table + %pic + %define string-pool-name NAME + %null-strings + %define word-array-name NAME + %switch=COUNT + %omit-struct-type +* When the option -k is not given, the default key positions are now + computed depending on the set of keywords. +* If the input file is given by name, the output file will now contain + #line directives referring to the input file. +* Some keyword sets containing permutations, like { "xy", "yx", "xz", "zx" } + or { "abc", "acb", "bca", "cab" }, are now handled by gperf without + requiring the option -D. +* The generated table is usually much smaller than it was with earlier + versions of gperf. +* Added option -m/--multiple-iterations that allows to further reduce the + size of the generated table. +* When the search for a good hash function is not immediately successful, + the table's size will grow as needed. Earlier versions of gperf bailed + out with an "Internal error, duplicate hash code value". +* The options -f/--fast and -o/--occurrence-sort have no effect any more. +* Added options -P/--pic and --null-strings that optimize the generated code + for use in shared libraries. -P/--pic does a perfect optimization but may + require some small code changes (see the documentation for details), whereas + --null-strings does only a half-hearted optimization but works without + needing any change to surrounding code. +* Added option --ignore-case that produces a case independent lookup function. +* Bug fixes. + +New in 2.7.2: + +* Keywords may now be enclosed in double quotes; this permits the use of + '#', ',', space or NUL inside keywords. +* Bug fixes. + +New in 2.7.1: + +* Added option "-F" for gcc. + +New in 2.7: + +* gperf is now a stand-alone package, untied from libg++. +* Autoconfiguring. +* Removed the "-a" and "-g" options, extended the "-L" option instead. +* Removed the "-p" option, it is the default. +* Added long options ("--help", "--version" etc.). +* 8-bit cleanliness is now the default; use "-7" to get the old behaviour. +* Compiles with any C++ compiler. +* Numerous small improvements. + diff --git a/README b/README new file mode 100644 index 0000000..1351f81 --- /dev/null +++ b/README @@ -0,0 +1,28 @@ +This is GNU gperf. It is a program that generates perfect hash +functions for sets of key words. A perfect hash function is: + + A hash function and a data structure that allows + recognition of a key word in a set of words using + exactly 1 probe into the data structure. + +The doc/gperf.html file explains how the program works, the form of +the input, what options are available, and hints on choosing the best +options for particular key words set. + +See the file NEWS for a list of major changes in the current release. + +See the file INSTALL for compilation and installation instructions. + +Output from the GPERF program is used to recognize reserved words in +the GNU C, GNU C++, and GNU Pascal compilers, as well as with the GNU +indent program. + +For general documentation on the coding and usage standards +this distribution follows, see the GNU standards document +ftp://ftp.gnu.org/pub/gnu/standards.*, especially the 'Makefile +Conventions', 'Configuration', and 'User Interfaces' sections. + +Mail suggestions and bug reports to . When +reporting bugs, please include in the subject line the package name +and version (output of 'gperf --version') for which you found a problem. + diff --git a/README.vms b/README.vms new file mode 100644 index 0000000..6408f46 --- /dev/null +++ b/README.vms @@ -0,0 +1,9 @@ +Installation on VMS: + +- Build instructions: + + $ mms /description=Makefile.vms + +- Installation: + + $ mms /description=Makefile.vms install diff --git a/README.windows b/README.windows new file mode 100644 index 0000000..ecda548 --- /dev/null +++ b/README.windows @@ -0,0 +1,262 @@ +Installation on Microsoft Windows: + +There are three ways to create binaries of this package for Microsoft Windows: +1) Native binaries, built using the mingw tool chain. +2) Native binaries, built using the MS Visual C/C++ tool chain. +3) Binaries for the Cygwin environment. + +=============================================================================== +1) Native binaries, built using the mingw tool chain. + + I recommend to use the Cygwin environment as the development environment + and mingw only as the target (runtime, deployment) environment. + For this, you need to install + * Cygwin (from https://cygwin.com/), + * some packages available from the Cygwin package installer: + make + * the mingw cross-compilation tools and runtime package, available from + the Cygwin package installer (setup-x86_64.exe): + - for creating 32-bit binaries: packages + mingw64-i686-gcc-core, + mingw64-i686-gcc-g++, + mingw64-i686-headers, + mingw64-i686-runtime + - for creating 64-bit binaries: packages + mingw64-x86_64-gcc-core, + mingw64-x86_64-gcc-g++, + mingw64-x86_64-headers, + mingw64-x86_64-runtime + + Building 32-bit binaries for mingw is achieved through the following + preparation, configure, and build commands: + + PATH=/usr/local/mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH + export PATH + ./configure --host=i686-w64-mingw32 --prefix=/usr/local/mingw32 \ + CC=i686-w64-mingw32-gcc \ + CXX=i686-w64-mingw32-g++ \ + CPPFLAGS="-I/usr/local/mingw32/include -Wall" \ + LDFLAGS="-L/usr/local/mingw32/lib" + make + make check + + Building 64-bit binaries for mingw is achieved through the following + preparation, configure, and build commands: + + PATH=/usr/local/mingw64/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH + export PATH + ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/mingw64 \ + CC=x86_64-w64-mingw32-gcc \ + CXX=x86_64-w64-mingw32-g++ \ + CPPFLAGS="-I/usr/local/mingw64/include -Wall" \ + LDFLAGS="-L/usr/local/mingw64/lib" + make + make check + + Installation: + + make install + +=============================================================================== +2) Native binaries, built using the MS Visual C/C++ tool chain. + + Note that binaries created with MSVC have a distribution constraint: They + depend on a closed-source library ('msvcr90.dll' for MSVC 9.0, + 'vcruntime140.dll' for MSVC 14.0, and so on) which is not normally part of + a Windows installation. + You cannot distribute 'vcruntime*.dll' with the binaries - this would be a + violation of the GPL and of the Microsoft EULA. + You can distribute the binaries without including 'vcruntime*.dll'. Users + who don't have this library on their system will require to pull some files + (api-ms-win*.dll) through the Windows Update mechanism, see + https://support.microsoft.com/en-us/kb/2999226 . + + This recipe requires MS Visual C/C++ 9.0 or newer. + You don't need the Visual Studio IDE, just the C/C++ tool chain. + As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from + http://landinghub.visualstudio.com/visual-cpp-build-tools (it's the file + visualcppbuildtools_full.exe). + + This recipe requires also a Cygwin environment (with 'bash', the common POSIX + commands, and 'make') as a build environment. Building with 'nmake' is not + supported. + For this, you need to install + * Cygwin (from https://cygwin.com/), + * some packages available from the Cygwin package installer: + make + + You also need the scripts 'ar-lib' and 'compile' from + http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD + http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD + respectively. + They may also be included in this package, in directory 'build-aux/'. + Save them; the instructions below assume that you stored them in $HOME/msvc/. + Make them executable: + chmod a+x ar-lib compile + + Start a bash (from Cygwin). + + Make sure that the MSVC tools ("cl" etc.) are found in PATH and the + environment variables INCLUDE and LIB are set appropriately. + In a typical MSVC 9.0 installation, it can be achieved by running + C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat + In a typical MSVC 14.0 installation on Windows 10, it can be achieved + - for creating 32-bit binaries: through the following bash commands: + + # Set environment variables for using MSVC 14, + # for creating native 32-bit Windows executables. + + # Windows C library headers and libraries. + WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt' + WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\' + INCLUDE="${WindowsCrtIncludeDir};$INCLUDE" + LIB="${WindowsCrtLibDir}x86;$LIB" + + # Windows API headers and libraries. + WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\' + WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\' + INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE" + LIB="${WindowsSdkLibDir}x86;$LIB" + + # Visual C++ tools, headers and libraries. + VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0' + VCINSTALLDIR="${VSINSTALLDIR}"'\VC' + PATH=`cygpath -u "${VCINSTALLDIR}"`/bin:"$PATH" + INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}" + LIB="${VCINSTALLDIR}"'\lib;'"${LIB}" + + export INCLUDE LIB + + - for creating 64-bit binaries: through the following bash commands: + + # Set environment variables for using MSVC 14, + # for creating native 64-bit Windows executables. + + # Windows C library headers and libraries. + WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt' + WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\' + INCLUDE="${WindowsCrtIncludeDir};$INCLUDE" + LIB="${WindowsCrtLibDir}x64;$LIB" + + # Windows API headers and libraries. + WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\' + WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\' + INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE" + LIB="${WindowsSdkLibDir}x64;$LIB" + + # Visual C++ tools, headers and libraries. + VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0' + VCINSTALLDIR="${VSINSTALLDIR}"'\VC' + PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH" + INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}" + LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}" + + export INCLUDE LIB + + Building 32-bit binaries with MSVC is achieved through the following + preparation, configure, and build commands: + + PATH=/usr/local/msvc32/bin:$PATH + export PATH + + win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0 + win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0 + win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0 + win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0 + + ./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \ + CC="$HOME/msvc/compile cl -nologo" \ + CFLAGS="-MD" \ + CXX="$HOME/msvc/compile cl -nologo" \ + CXXFLAGS="-MD" \ + CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc32/include" \ + LDFLAGS="-L/usr/local/msvc32/lib" \ + LD="link" \ + NM="dumpbin -symbols" \ + STRIP=":" \ + AR="$HOME/msvc/ar-lib lib" \ + RANLIB=":" + make + make check + + Building 64-bit binaries with MSVC is achieved through the following + preparation, configure, and build commands: + + PATH=/usr/local/msvc64/bin:$PATH + export PATH + + win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0 + win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0 + win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0 + win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0 + + ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \ + CC="$HOME/msvc/compile cl -nologo" \ + CFLAGS="-MD" \ + CXX="$HOME/msvc/compile cl -nologo" \ + CXXFLAGS="-MD" \ + CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \ + LDFLAGS="-L/usr/local/msvc64/lib" \ + LD="link" \ + NM="dumpbin -symbols" \ + STRIP=":" \ + AR="$HOME/msvc/ar-lib lib" \ + RANLIB=":" + make + make check + + Installation: + + make install + +=============================================================================== +3) Binaries for the Cygwin environment. + + The generic instructions in the INSTALL file apply. But here are more + specific ones. + + You need to install + * Cygwin (from https://cygwin.com/), + * some packages available from the Cygwin package installer: + make + * the Cygwin [cross-]compilation tools package, available from + the Cygwin package installer (setup-x86_64.exe): + - for creating 32-bit binaries: packages + cygwin32-gcc-core, + cygwin32-gcc-g++, + cygwin32 + - for creating 64-bit binaries: packages + gcc-core, + gcc-g++ + + Building 32-bit binaries for Cygwin is achieved through the following + preparation, configure, and build commands: + + PATH=/usr/local/cygwin32/bin:/usr/i686-pc-cygwin/sys-root/usr/bin:$PATH + export PATH + ./configure --host=i686-pc-cygwin --prefix=/usr/local/cygwin32 \ + CC=i686-pc-cygwin-gcc \ + CXX=i686-pc-cygwin-g++ \ + CPPFLAGS="-I/usr/local/cygwin32/include -Wall" \ + LDFLAGS="-L/usr/local/cygwin32/lib" + make + make check + + Building 64-bit binaries for Cygwin is achieved through the following + preparation, configure, and build commands: + + PATH=/usr/local/cygwin64/bin:$PATH + export PATH + ./configure --host=x86_64-pc-cygwin --prefix=/usr/local/cygwin64 \ + CC=x86_64-pc-cygwin-gcc \ + CXX=x86_64-pc-cygwin-g++ \ + CPPFLAGS="-I/usr/local/cygwin64/include -Wall" \ + LDFLAGS="-L/usr/local/cygwin64/lib" + make + make check + + Installation: + + make install + +=============================================================================== diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..41598df --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,69 @@ +AC_PREREQ(2.12) + +AC_DEFUN(CL_PROG_INSTALL, +[dnl This is mostly copied from AC_PROG_INSTALL. +# 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 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +AC_MSG_CHECKING(for a BSD compatible install) +if test -z "$INSTALL"; then +AC_CACHE_VAL(cl_cv_path_install, +[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + if test $ac_prog = installbsd && + strings $ac_dir/$ac_prog | grep src/bos >/dev/null 2>&1; then + # AIX installbsd doesn't work without option "-g". + : + else + cl_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" + # As a last resort, use cp. + test -z "$cl_cv_path_install" && cl_cv_path_install="cp" +])dnl + INSTALL="$cl_cv_path_install" +fi +dnl We do special magic for INSTALL instead of AC_SUBST, to get +dnl relative paths right. +AC_MSG_RESULT($INSTALL) +AC_SUBST(INSTALL)dnl +# 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)' +AC_SUBST(INSTALL_PROGRAM)dnl +if test -z "$INSTALL_DATA"; then + case "$INSTALL" in + cp | */cp ) INSTALL_DATA='$(INSTALL)' ;; + * ) INSTALL_DATA='$(INSTALL) -m 644' ;; + esac +fi +AC_SUBST(INSTALL_DATA)dnl +]) + diff --git a/build-aux/ar-lib b/build-aux/ar-lib new file mode 100755 index 0000000..467a1af --- /dev/null +++ b/build-aux/ar-lib @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010-2015, 2017 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 100755 index 0000000..0360b79 --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2016-01-11.22; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/mkinstalldirs b/build-aux/mkinstalldirs new file mode 100755 index 0000000..a31ce6d --- /dev/null +++ b/build-aux/mkinstalldirs @@ -0,0 +1,162 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2016-01-11.22; # UTC + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the 'mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because '.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..2c68ba2 --- /dev/null +++ b/configure @@ -0,0 +1,3054 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org 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_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &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= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="doc/gperf.texi" +enable_option_checking=no +ac_subst_vars='LTLIBOBJS +LIBOBJS +subdirs +SET_MAKE +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 +' + ac_precious_vars='build_alias +host_alias +target_alias' +ac_subdirs_all='lib src tests doc' + +# 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}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +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/PACKAGE] + --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 + + cat <<\_ACEOF + +Report bugs to the package provider. +_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 +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +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 $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in build-aux "$srcdir"/build-aux; 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 build-aux \"$srcdir\"/build-aux" "$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. + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + + + +subdirs="$subdirs lib src tests doc" + + +extrasub="$extrasub"' +/@subdir@/{ +h +g +s/@subdir@/lib/ +p +g +s/@subdir@/src/ +p +g +s/@subdir@/tests/ +p +g +s/@subdir@/doc/ +p +d +} +' +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.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. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_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 + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --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 + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_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 +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + 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 + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -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=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_sub_configure_args " '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + $as_echo "$ac_msg" >&6 + 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 + + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 + fi + + cd "$ac_popdir" + done +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5fb4099 --- /dev/null +++ b/configure.ac @@ -0,0 +1,52 @@ +dnl autoconf configuration for gperf + +dnl Copyright (C) 1998, 2002, 2003, 2005-2007, 2009-2010, 2012 Free Software Foundation, Inc. +dnl Written by Douglas C. Schmidt +dnl and Bruno Haible . +dnl +dnl This file is part of GNU GPERF. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . + +AC_PREREQ([2.60]) +AC_INIT([doc/gperf.texi]) +AC_CONFIG_AUX_DIR([build-aux]) + +AC_PROG_MAKE_SET +AC_OBJEXT +AC_EXEEXT + +AC_CONFIG_SUBDIRS([lib src tests doc]) + +dnl This piece of sed script replaces every line containing '@subdir@' +dnl by several consecutive lines, each referencing one subdir. +extrasub="$extrasub"' +/@subdir@/{ +h +g +s/@subdir@/lib/ +p +g +s/@subdir@/src/ +p +g +s/@subdir@/tests/ +p +g +s/@subdir@/doc/ +p +d +} +' +AC_OUTPUT([Makefile]) diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..37b488d --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,196 @@ +# Makefile for gperf/doc + +# Copyright (C) 1998, 2000, 2002-2003, 2007, 2012, 2016 Free Software Foundation, Inc. +# Written by Douglas C. Schmidt +# and Bruno Haible . +# +# This file is part of GNU GPERF. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#### Start of system configuration section. #### + +# Directories used by "make": +srcdir = @srcdir@ + +# Directories used by "make install": +prefix = @prefix@ +local_prefix = /usr/local +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +datadir = @datadir@ +infodir = @infodir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +docdir = @docdir@ +dvidir = @dvidir@ +psdir = @psdir@ +pdfdir = @pdfdir@ +htmldir = @htmldir@ + +# Programs used by "make": +RM = rm -f +@SET_MAKE@ + +# Programs used by "make" if you have changed the documentation files: +TEX = tex +TEXI2DVI = texi2dvi +DVIPS = dvips -D600 +TEXI2PDF = texi2pdf +MAKEINFO = LANG= LC_MESSAGES= LC_ALL= LANGUAGE= makeinfo +TEXI2HTML = perl $(srcdir)/texi2html +TEXI2ANY = texi2any + +# Programs used by "make install": +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = $(SHELL) $(srcdir)/../build-aux/mkinstalldirs + +#### End of system configuration section. #### + +SHELL = /bin/sh + +VPATH = $(srcdir) + +all : info pdf html man + + +info : $(srcdir)/gperf.info + +$(srcdir)/gperf.info : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi + cd $(srcdir) && $(MAKEINFO) --no-split gperf.texi + + +dvi : $(srcdir)/gperf.dvi + +$(srcdir)/gperf.dvi : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi + cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps + cd $(srcdir) && $(TEXI2DVI) gperf.texi + cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps + + +ps : $(srcdir)/gperf.ps + +$(srcdir)/gperf.ps : $(srcdir)/gperf.dvi + $(DVIPS) -o $@ $(srcdir)/gperf.dvi + + +pdf : $(srcdir)/gperf.pdf + +$(srcdir)/gperf.pdf : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi + cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps + cd $(srcdir) && $(TEXI2PDF) gperf.texi + cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps + + +html : gperf.html gperf_toc.html + +# We still prefer texi2html over texi2any because it includes the titlepage. + +gperf.html : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi + cd $(srcdir) && $(TEXI2HTML) -number -monolithic gperf.texi +# cd $(srcdir) && $(TEXI2ANY) --html --no-headers --no-split gperf.texi + +gperf_toc.html : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi + cd $(srcdir) && $(RM) gperf_*.html + cd $(srcdir) && $(TEXI2HTML) -number -split_chapter gperf.texi + +gperf_0.html : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi + cd $(srcdir) && $(TEXI2ANY) --html --no-headers --split=chapter --no-node-files -o . gperf.texi + + +man : gperf.1 + +gperf.1 gperf.1-update : + ./help2man --name='generate a perfect hash function from a key set' --section=1 ../src/gperf > gperf.1 + +gperf.1-update : force + + +install : all force + $(MKINSTALLDIRS) $(DESTDIR)$(infodir) + $(INSTALL_DATA) $(srcdir)/gperf.info $(DESTDIR)$(infodir)/gperf.info + $(MKINSTALLDIRS) $(DESTDIR)$(man1dir) + $(INSTALL_DATA) $(srcdir)/gperf.1 $(DESTDIR)$(man1dir)/gperf.1 +# $(MKINSTALLDIRS) $(DESTDIR)$(dvidir) +# $(INSTALL_DATA) $(srcdir)/gperf.dvi $(DESTDIR)$(dvidir)/gperf.dvi +# $(MKINSTALLDIRS) $(DESTDIR)$(psdir) +# $(INSTALL_DATA) $(srcdir)/gperf.ps $(DESTDIR)$(psdir)/gperf.ps +# $(MKINSTALLDIRS) $(DESTDIR)$(pdfdir) +# $(INSTALL_DATA) $(srcdir)/gperf.pdf $(DESTDIR)$(pdfdir)/gperf.pdf + $(MKINSTALLDIRS) $(DESTDIR)$(htmldir) + $(INSTALL_DATA) $(srcdir)/gperf.html $(DESTDIR)$(htmldir)/gperf.html + +installdirs : force + $(MKINSTALLDIRS) $(DESTDIR)$(infodir) + $(MKINSTALLDIRS) $(DESTDIR)$(man1dir) +# $(MKINSTALLDIRS) $(DESTDIR)$(dvidir) +# $(MKINSTALLDIRS) $(DESTDIR)$(psdir) +# $(MKINSTALLDIRS) $(DESTDIR)$(pdfdir) + $(MKINSTALLDIRS) $(DESTDIR)$(htmldir) + +uninstall : force + $(RM) $(DESTDIR)$(infodir)/gperf.info + $(RM) $(DESTDIR)$(man1dir)/gperf.1 +# $(RM) $(DESTDIR)$(dvidir)/gperf.dvi +# $(RM) $(DESTDIR)$(psdir)/gperf.ps +# $(RM) $(DESTDIR)$(pdfdir)/gperf.pdf + $(RM) $(DESTDIR)$(htmldir)/gperf.html + +check : all + +mostlyclean : clean + +clean : force + $(RM) *~ *.aux *.toc *.cp *.fn *.ky *.pg *.tp *.vr *.my *.log *.cps core + +distclean : clean + $(RM) config.status config.log config.cache Makefile + +maintainer-clean : distclean + $(RM) *.info *.dvi *.ps *.pdf *.html + +# List of source files. +SOURCE_FILES = \ + configure.ac Makefile.in \ + gperf.texi +# List of distributed files imported from other packages. +IMPORTED_FILES = \ + gpl-3.0.texi \ + texinfo.tex texi2html \ + help2man +# List of distributed files generated by autotools or Makefile.devel. +GENERATED_FILES = \ + configure +# List of distributed files generated by "make". +DISTRIBUTED_BUILT_FILES = \ + gperf.info \ + gperf.dvi \ + gperf.ps \ + gperf.pdf \ + gperf.html \ + gperf_toc.html gperf_[0-9].html gperf_[0-9][0-9].html \ + gperf.1 +# List of distributed files. +DISTFILES = $(SOURCE_FILES) $(IMPORTED_FILES) $(GENERATED_FILES) $(DISTRIBUTED_BUILT_FILES) + +distdir : gperf.1-update $(DISTFILES) + for file in $(DISTFILES); do \ + if test -f $$file; then dir='.'; else dir='$(srcdir)'; fi; \ + cp -p $$dir/$$file '$(distdir)'/$$file || exit 1; \ + done + +force : + diff --git a/doc/configure b/doc/configure new file mode 100755 index 0000000..eb0becd --- /dev/null +++ b/doc/configure @@ -0,0 +1,2921 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org 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_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &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= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="gperf.texi" +ac_subst_vars='LTLIBOBJS +LIBOBJS +INSTALL_DATA +INSTALL_PROGRAM +INSTALL +SET_MAKE +PACKAGE +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 +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# 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}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +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/PACKAGE] + --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 + + cat <<\_ACEOF + +Report bugs to the package provider. +_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 +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +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 $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +PACKAGE=gperf + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# 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 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +{ $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 ${cl_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + if test $ac_prog = installbsd && + strings $ac_dir/$ac_prog | grep src/bos >/dev/null 2>&1; then + # AIX installbsd doesn't work without option "-g". + : + else + cl_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" + # As a last resort, use cp. + test -z "$cl_cv_path_install" && cl_cv_path_install="cp" + +fi + INSTALL="$cl_cv_path_install" +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)' +if test -z "$INSTALL_DATA"; then + case "$INSTALL" in + cp | */cp ) INSTALL_DATA='$(INSTALL)' ;; + * ) INSTALL_DATA='$(INSTALL) -m 644' ;; + esac +fi + + ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.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. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_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 + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --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 + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_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 +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/doc/configure.ac b/doc/configure.ac new file mode 100644 index 0000000..174747f --- /dev/null +++ b/doc/configure.ac @@ -0,0 +1,35 @@ +dnl autoconf configuration for gperf/doc + +dnl Copyright (C) 1998, 2000, 2002-2003, 2007, 2009, 2012 Free Software Foundation, Inc. +dnl Written by Douglas C. Schmidt +dnl and Bruno Haible . +dnl +dnl This file is part of GNU GPERF. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . + +AC_PREREQ([2.60]) +AC_INIT([gperf.texi]) +PACKAGE=gperf +AC_SUBST([PACKAGE]) +AC_PROG_MAKE_SET +dnl +dnl checks for programs +dnl +CL_PROG_INSTALL + dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM +dnl +dnl That's it. +dnl +AC_OUTPUT([Makefile]) diff --git a/doc/gperf.1 b/doc/gperf.1 new file mode 100644 index 0000000..06ad12f --- /dev/null +++ b/doc/gperf.1 @@ -0,0 +1,220 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. +.TH GPERF "1" "January 2017" "GNU gperf 3.1" FSF +.SH NAME +gperf \- generate a perfect hash function from a key set +.SH SYNOPSIS +.B gperf +[\fIOPTION\fR]... [\fIINPUT-FILE\fR] +.SH DESCRIPTION +GNU 'gperf' generates perfect hash functions. +.PP +If a long option shows an argument as mandatory, then it is mandatory +for the equivalent short option also. +.SS "Output file location:" +.HP +\fB\-\-output\-file\fR=\fIFILE\fR Write output to specified file. +.PP +The results are written to standard output if no output file is specified +or if it is -. +.SS "Input file interpretation:" +.TP +\fB\-e\fR, \fB\-\-delimiters\fR=\fIDELIMITER\-LIST\fR +Allow user to provide a string containing delimiters +used to separate keywords from their attributes. +Default is ",". +.TP +\fB\-t\fR, \fB\-\-struct\-type\fR +Allows the user to include a structured type +declaration for generated code. Any text before %% +is considered part of the type declaration. Key +words and additional fields may follow this, one +group of fields per line. +.TP +\fB\-\-ignore\-case\fR +Consider upper and lower case ASCII characters as +equivalent. Note that locale dependent case mappings +are ignored. +.SS "Language for the output code:" +.TP +\fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\-NAME\fR +Generates code in the specified language. Languages +handled are currently C++, ANSI-C, C, and KR-C. The +default is ANSI-C. +.SS "Details in the output code:" +.TP +\fB\-K\fR, \fB\-\-slot\-name\fR=\fINAME\fR +Select name of the keyword component in the keyword +structure. +.TP +\fB\-F\fR, \fB\-\-initializer\-suffix\fR=\fIINITIALIZERS\fR +Initializers for additional components in the keyword +structure. +.TP +\fB\-H\fR, \fB\-\-hash\-function\-name\fR=\fINAME\fR +Specify name of generated hash function. Default is +\&'hash'. +.TP +\fB\-N\fR, \fB\-\-lookup\-function\-name\fR=\fINAME\fR +Specify name of generated lookup function. Default +name is 'in_word_set'. +.TP +\fB\-Z\fR, \fB\-\-class\-name\fR=\fINAME\fR +Specify name of generated C++ class. Default name is +\&'Perfect_Hash'. +.TP +\fB\-7\fR, \fB\-\-seven\-bit\fR +Assume 7-bit characters. +.TP +\fB\-l\fR, \fB\-\-compare\-lengths\fR +Compare key lengths before trying a string +comparison. This is necessary if the keywords +contain NUL bytes. It also helps cut down on the +number of string comparisons made during the lookup. +.TP +\fB\-c\fR, \fB\-\-compare\-strncmp\fR +Generate comparison code using strncmp rather than +strcmp. +.TP +\fB\-C\fR, \fB\-\-readonly\-tables\fR +Make the contents of generated lookup tables +constant, i.e., readonly. +.TP +\fB\-E\fR, \fB\-\-enum\fR +Define constant values using an enum local to the +lookup function rather than with defines. +.TP +\fB\-I\fR, \fB\-\-includes\fR +Include the necessary system include file +at the beginning of the code. +.TP +\fB\-G\fR, \fB\-\-global\-table\fR +Generate the static table of keywords as a static +global variable, rather than hiding it inside of the +lookup function (which is the default behavior). +.TP +\fB\-P\fR, \fB\-\-pic\fR +Optimize the generated table for inclusion in shared +libraries. This reduces the startup time of programs +using a shared library containing the generated code. +.TP +\fB\-Q\fR, \fB\-\-string\-pool\-name\fR=\fINAME\fR +Specify name of string pool generated by option \fB\-\-pic\fR. +Default name is 'stringpool'. +.TP +\fB\-\-null\-strings\fR +Use NULL strings instead of empty strings for empty +keyword table entries. +.TP +\fB\-\-constants\-prefix\fR=\fIPREFIX\fR +Specify prefix for the constants like TOTAL_KEYWORDS. +.TP +\fB\-W\fR, \fB\-\-word\-array\-name\fR=\fINAME\fR +Specify name of word list array. Default name is +\&'wordlist'. +.TP +\fB\-\-length\-table\-name\fR=\fINAME\fR +Specify name of length table array. Default name is +\&'lengthtable'. +.TP +\fB\-S\fR, \fB\-\-switch\fR=\fICOUNT\fR +Causes the generated C code to use a switch +statement scheme, rather than an array lookup table. +This can lead to a reduction in both time and space +requirements for some keyfiles. The COUNT argument +determines how many switch statements are generated. +A value of 1 generates 1 switch containing all the +elements, a value of 2 generates 2 tables with 1/2 +the elements in each table, etc. If COUNT is very +large, say 1000000, the generated C code does a +binary search. +.TP +\fB\-T\fR, \fB\-\-omit\-struct\-type\fR +Prevents the transfer of the type declaration to the +output file. Use this option if the type is already +defined elsewhere. +.SS "Algorithm employed by gperf:" +.TP +\fB\-k\fR, \fB\-\-key\-positions\fR=\fIKEYS\fR +Select the key positions used in the hash function. +The allowable choices range between 1-255, inclusive. +The positions are separated by commas, ranges may be +used, and key positions may occur in any order. +Also, the meta-character '*' causes the generated +hash function to consider ALL key positions, and $ +indicates the "final character" of a key, e.g., +$,1,2,4,6-10. +.TP +\fB\-D\fR, \fB\-\-duplicates\fR +Handle keywords that hash to duplicate values. This +is useful for certain highly redundant keyword sets. +.TP +\fB\-m\fR, \fB\-\-multiple\-iterations\fR=\fIITERATIONS\fR +Perform multiple choices of the \fB\-i\fR and \fB\-j\fR values, +and choose the best results. This increases the +running time by a factor of ITERATIONS but does a +good job minimizing the generated table size. +.TP +\fB\-i\fR, \fB\-\-initial\-asso\fR=\fIN\fR +Provide an initial value for the associate values +array. Default is 0. Setting this value larger helps +inflate the size of the final table. +.TP +\fB\-j\fR, \fB\-\-jump\fR=\fIJUMP\-VALUE\fR +Affects the "jump value", i.e., how far to advance +the associated character value upon collisions. Must +be an odd number, default is 5. +.TP +\fB\-n\fR, \fB\-\-no\-strlen\fR +Do not include the length of the keyword when +computing the hash function. +.TP +\fB\-r\fR, \fB\-\-random\fR +Utilizes randomness to initialize the associated +values table. +.TP +\fB\-s\fR, \fB\-\-size\-multiple\fR=\fIN\fR +Affects the size of the generated hash table. The +numeric argument N indicates "how many times larger +or smaller" the associated value range should be, +in relationship to the number of keys, e.g. a value +of 3 means "allow the maximum associated value to +be about 3 times larger than the number of input +keys". Conversely, a value of 1/3 means "make the +maximum associated value about 3 times smaller than +the number of input keys". A larger table should +decrease the time required for an unsuccessful +search, at the expense of extra table space. Default +value is 1. +.SS "Informative output:" +.TP +\fB\-h\fR, \fB\-\-help\fR +Print this message. +.TP +\fB\-v\fR, \fB\-\-version\fR +Print the gperf version number. +.TP +\fB\-d\fR, \fB\-\-debug\fR +Enables the debugging option (produces verbose +output to the standard error). +.SH AUTHOR +Written by Douglas C. Schmidt and Bruno Haible. +.SH "REPORTING BUGS" +Report bugs to . +.SH COPYRIGHT +Copyright \(co 1989-2017 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +The full documentation for +.B gperf +is maintained as a Texinfo manual. If the +.B info +and +.B gperf +programs are properly installed at your site, the command +.IP +.B info gperf +.PP +should give you access to the complete manual. diff --git a/doc/gperf.dvi b/doc/gperf.dvi new file mode 100644 index 0000000..28c064c Binary files /dev/null and b/doc/gperf.dvi differ diff --git a/doc/gperf.html b/doc/gperf.html new file mode 100644 index 0000000..0e80e69 --- /dev/null +++ b/doc/gperf.html @@ -0,0 +1,2572 @@ + + + + + +Perfect Hash Function Generator + + +

User's Guide to gperf 3.1

+

The GNU Perfect Hash Function Generator

+

Edition 3.1, 26 November 2016

+
Douglas C. Schmidt
+
Bruno Haible
+

+


+

Table of Contents

+ +


+ +

+Copyright (C) 1989-2016 Free Software Foundation, Inc. + +

+ +

+Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +

+

+Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +section entitled “GNU General Public License” is included +exactly as in the original, and provided that the entire resulting +derived work is distributed under the terms of a permission notice +identical to this one. + +

+

+Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that the section entitled “GNU General Public License” may be +included in a translation approved by the author instead of in the +original English. + +

+ + + +

GNU GENERAL PUBLIC LICENSE

+

+Version 3, 29 June 2007 + +

+ + +
+Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+ + +

1.0 Preamble

+ +

+The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +

+

+The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program--to make sure it remains +free software for all its users. We, the Free Software Foundation, +use the GNU General Public License for most of our software; it +applies also to any other work released this way by its authors. You +can apply it to your programs, too. + +

+

+When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +

+

+To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. + +

+

+For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, +receive or can get the source code. And you must show them these +terms so they know their rights. + +

+

+Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +

+

+For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +

+

+Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. + +

+

+Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. + +

+

+The precise terms and conditions for copying, distribution and +modification follow. + +

+ +

1.1 TERMS AND CONDITIONS

+ + +
    +
  1. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a “modified version” of +the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based +on the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays “Appropriate Legal Notices” to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +
  2. Source Code. + +The “source code” for a work means the preferred form of the work for +making modifications to it. “Object code” means any non-source form +of a work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +
  3. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +
  4. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +
  5. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +
  6. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + + +
      +
    1. + +The work must carry prominent notices stating that you modified it, +and giving a relevant date. + +
    2. + +The work must carry prominent notices stating that it is released +under this License and any conditions added under section 7. This +requirement modifies the requirement in section 4 to “keep intact all +notices”. + +
    3. + +You must license the entire work, as a whole, under this License to +anyone who comes into possession of a copy. This License will +therefore apply, along with any applicable section 7 additional terms, +to the whole of the work, and all its parts, regardless of how they +are packaged. This License gives no permission to license the work in +any other way, but it does not invalidate such permission if you have +separately received it. + +
    4. + +If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your work +need not make them do so. +
    + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +
  7. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + + +
      +
    1. + +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium customarily +used for software interchange. + +
    2. + +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a written +offer, valid for at least three years and valid for as long as you +offer spare parts or customer support for that product model, to give +anyone who possesses the object code either (1) a copy of the +Corresponding Source for all the software in the product that is +covered by this License, on a durable physical medium customarily used +for software interchange, for a price no more than your reasonable +cost of physically performing this conveying of source, or (2) access +to copy the Corresponding Source from a network server at no charge. + +
    3. + +Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is +allowed only occasionally and noncommercially, and only if you +received the object code with such an offer, in accord with subsection +6b. + +
    4. + +Convey the object code by offering access from a designated place +(gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to copy +the object code is a network server, the Corresponding Source may be +on a different server (operated by you or a third party) that supports +equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. +Regardless of what server hosts the Corresponding Source, you remain +obligated to ensure that it is available for as long as needed to +satisfy these requirements. + +
    5. + +Convey the object code using peer-to-peer transmission, provided you +inform other peers where the object code and Corresponding Source of +the work are being offered to the general public at no charge under +subsection 6d. + +
    + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +“normally used” refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +
  8. Additional Terms. + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + + +
      +
    1. + +Disclaiming warranty or limiting liability differently from the terms +of sections 15 and 16 of this License; or + +
    2. + +Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices +displayed by works containing it; or + +
    3. + +Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or + +
    4. + +Limiting the use for publicity purposes of names of licensors or +authors of the material; or + +
    5. + +Declining to grant rights under trademark law for use of some trade +names, trademarks, or service marks; or + +
    6. + +Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with +contractual assumptions of liability to the recipient, for any +liability that these contractual assumptions directly impose on those +licensors and authors. +
    + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +
  9. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +
  10. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +
  11. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +
  12. Patents. + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is “discriminatory” if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +
  13. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey +a covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree +to terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +
  14. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +
  15. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If +the Program does not specify a version number of the GNU General +Public License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +
  16. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +
  17. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +
  18. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +
+ + +

1.2 END OF TERMS AND CONDITIONS

+ + +

1.3 How to Apply These Terms to Your New Programs

+ +

+If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +

+

+To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. + +

+ +
+one line to give the program's name and a brief idea of what it does.
+Copyright (C) year name of author
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see http://www.gnu.org/licenses/.
+
+ +

+Also add information on how to contact you by electronic and paper mail. + +

+

+If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + +

+ +
+program Copyright (C) year name of author
+This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type ‘show c’ for details.
+
+ +

+The hypothetical commands ‘show w’ and ‘show c’ should show +the appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an “about box”. + +

+

+You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +http://www.gnu.org/licenses/. + +

+

+The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use +the GNU Lesser General Public License instead of this License. But +first, please read http://www.gnu.org/philosophy/why-not-lgpl.html. + +

+ + +

Contributors to GNU gperf Utility

+ + +
    +
  • + + +The GNU gperf perfect hash function generator utility was +written in GNU C++ by Douglas C. Schmidt. The general +idea for the perfect hash function generator was inspired by Keith +Bostic's algorithm written in C, and distributed to net.sources around +1984. The current program is a heavily modified, enhanced, and extended +implementation of Keith's basic idea, created at the University of +California, Irvine. Bugs, patches, and suggestions should be reported +to <bug-gperf@gnu.org>. + +
  • + +Special thanks is extended to Michael Tiemann and Doug Lea, for +providing a useful compiler, and for giving me a forum to exhibit my +creation. + +In addition, Adam de Boor and Nels Olson provided many tips and insights +that greatly helped improve the quality and functionality of gperf. + +
  • + +Bruno Haible enhanced and optimized the search algorithm. He also rewrote +the input routines and the output routines for better reliability, and +added a testsuite. +
+ + + +

2 Introduction

+ +

+gperf is a perfect hash function generator written in C++. It +transforms an n element user-specified keyword set W into a +perfect hash function F. F uniquely maps keywords in +W onto the range 0..k, where k >= n-1. If k += n-1 then F is a minimal perfect hash function. +gperf generates a 0..k element static lookup table and a +pair of C functions. These functions determine whether a given +character string s occurs in W, using at most one probe into +the lookup table. + +

+

+gperf currently generates the reserved keyword recognizer for +lexical analyzers in several production and research compilers and +language processing tools, including GNU C, GNU C++, GNU Java, GNU Pascal, +GNU Modula 3, and GNU indent. Complete C++ source code for gperf is +available from http://ftp.gnu.org/pub/gnu/gperf/. +A paper describing gperf's design and implementation in greater +detail is available in the Second USENIX C++ Conference proceedings +or from http://www.cs.wustl.edu/~schmidt/resume.html. + +

+ + +

3 Static search structures and GNU gperf

+

+ + +

+

+A static search structure is an Abstract Data Type with certain +fundamental operations, e.g., initialize, insert, +and retrieve. Conceptually, all insertions occur before any +retrievals. In practice, gperf generates a static array +containing search set keywords and any associated attributes specified +by the user. Thus, there is essentially no execution-time cost for the +insertions. It is a useful data structure for representing static +search sets. Static search sets occur frequently in software system +applications. Typical static search sets include compiler reserved +words, assembler instruction opcodes, and built-in shell interpreter +commands. Search set members, called keywords, are inserted into +the structure only once, usually during program initialization, and are +not generally modified at run-time. + +

+

+Numerous static search structure implementations exist, e.g., +arrays, linked lists, binary search trees, digital search tries, and +hash tables. Different approaches offer trade-offs between space +utilization and search time efficiency. For example, an n element +sorted array is space efficient, though the average-case time +complexity for retrieval operations using binary search is +proportional to log n. Conversely, hash table implementations +often locate a table entry in constant time, but typically impose +additional memory overhead and exhibit poor worst case performance. + +

+

+ +Minimal perfect hash functions provide an optimal solution for a +particular class of static search sets. A minimal perfect hash +function is defined by two properties: + +

+ +
    +
  • + +It allows keyword recognition in a static search set using at most +one probe into the hash table. This represents the “perfect” +property. +
  • + +The actual memory allocated to store the keywords is precisely large +enough for the keyword set, and no larger. This is the +“minimal” property. +
+ +

+For most applications it is far easier to generate perfect hash +functions than minimal perfect hash functions. Moreover, +non-minimal perfect hash functions frequently execute faster than +minimal ones in practice. This phenomena occurs since searching a +sparse keyword table increases the probability of locating a “null” +entry, thereby reducing string comparisons. gperf's default +behavior generates near-minimal perfect hash functions for +keyword sets. However, gperf provides many options that permit +user control over the degree of minimality and perfection. + +

+

+Static search sets often exhibit relative stability over time. For +example, Ada's 63 reserved words have remained constant for nearly a +decade. It is therefore frequently worthwhile to expend concerted +effort building an optimal search structure once, if it +subsequently receives heavy use multiple times. gperf removes +the drudgery associated with constructing time- and space-efficient +search structures by hand. It has proven a useful and practical tool +for serious programming projects. Output from gperf is currently +used in several production and research compilers, including GNU C, GNU +C++, GNU Java, GNU Pascal, and GNU Modula 3. The latter two compilers are +not yet part of the official GNU distribution. Each compiler utilizes +gperf to automatically generate static search structures that +efficiently identify their respective reserved keywords. + +

+ + +

4 High-Level Description of GNU gperf

+ +

+The perfect hash function generator gperf reads a set of +“keywords” from an input file (or from the standard input by +default). It attempts to derive a perfect hashing function that +recognizes a member of the static keyword set with at most a +single probe into the lookup table. If gperf succeeds in +generating such a function it produces a pair of C source code routines +that perform hashing and table lookup recognition. All generated C code +is directed to the standard output. Command-line options described +below allow you to modify the input and output format to gperf. + +

+

+By default, gperf attempts to produce time-efficient code, with +less emphasis on efficient space utilization. However, several options +exist that permit trading-off execution time for storage space and vice +versa. In particular, expanding the generated table size produces a +sparse search structure, generally yielding faster searches. +Conversely, you can direct gperf to utilize a C switch +statement scheme that minimizes data space storage size. Furthermore, +using a C switch may actually speed up the keyword retrieval time +somewhat. Actual results depend on your C compiler, of course. + +

+

+In general, gperf assigns values to the bytes it is using +for hashing until some set of values gives each keyword a unique value. +A helpful heuristic is that the larger the hash value range, the easier +it is for gperf to find and generate a perfect hash function. +Experimentation is the key to getting the most from gperf. + +

+ + +

4.1 Input Format to gperf

+

+ + + + +You can control the input file format by varying certain command-line +arguments, in particular the ‘-t’ option. The input's appearance +is similar to GNU utilities flex and bison (or UNIX +utilities lex and yacc). Here's an outline of the general +format: + +

+ +
+declarations
+%%
+keywords
+%%
+functions
+
+ +

+Unlike flex or bison, the declarations section and +the functions section are optional. The following sections describe the +input format for each section. + +

+ +

+It is possible to omit the declaration section entirely, if the ‘-t’ +option is not given. In this case the input file begins directly with the +first keyword line, e.g.: + +

+ +
+january
+february
+march
+april
+...
+
+ + + +

4.1.1 Declarations

+ +

+The keyword input file optionally contains a section for including +arbitrary C declarations and definitions, gperf declarations that +act like command-line options, as well as for providing a user-supplied +struct. + +

+ + + +

4.1.1.1 User-supplied struct

+ +

+If the ‘-t’ option (or, equivalently, the ‘%struct-type’ declaration) +is enabled, you must provide a C struct as the last +component in the declaration section from the input file. The first +field in this struct must be of type char * or const char * +if the ‘-P’ option is not given, or of type int if the option +‘-P’ (or, equivalently, the ‘%pic’ declaration) is enabled. +This first field must be called ‘name’, although it is possible to modify +its name with the ‘-K’ option (or, equivalently, the +‘%define slot-name’ declaration) described below. + +

+

+Here is a simple example, using months of the year and their attributes as +input: + +

+ +
+struct month { char *name; int number; int days; int leap_days; };
+%%
+january,   1, 31, 31
+february,  2, 28, 29
+march,     3, 31, 31
+april,     4, 30, 30
+may,       5, 31, 31
+june,      6, 30, 30
+july,      7, 31, 31
+august,    8, 31, 31
+september, 9, 30, 30
+october,  10, 31, 31
+november, 11, 30, 30
+december, 12, 31, 31
+
+ +

+ +Separating the struct declaration from the list of keywords and +other fields are a pair of consecutive percent signs, ‘%%’, +appearing left justified in the first column, as in the UNIX utility +lex. + +

+

+If the struct has already been declared in an include file, it can +be mentioned in an abbreviated form, like this: + +

+ +
+struct month;
+%%
+january,   1, 31, 31
+...
+
+ + + +

4.1.1.2 Gperf Declarations

+ +

+The declaration section can contain gperf declarations. They +influence the way gperf works, like command line options do. +In fact, every such declaration is equivalent to a command line option. +There are three forms of declarations: + +

+ +
    +
  1. + +Declarations without argument, like ‘%compare-lengths’. + +
  2. + +Declarations with an argument, like ‘%switch=count. + +
  3. + +Declarations of names of entities in the output file, like +‘%define lookup-function-name name. +
+ +

+When a declaration is given both in the input file and as a command line +option, the command-line option's value prevails. + +

+

+The following gperf declarations are available. + +

+
+ +
‘%delimiters=delimiter-list +
+ +Allows you to provide a string containing delimiters used to +separate keywords from their attributes. The default is ",". This +option is essential if you want to use keywords that have embedded +commas or newlines. + +
‘%struct-type’ +
+ +Allows you to include a struct type declaration for generated +code; see above for an example. + +
‘%ignore-case’ +
+ +Consider upper and lower case ASCII characters as equivalent. The string +comparison will use a case insignificant character comparison. Note that +locale dependent case mappings are ignored. + +
‘%language=language-name +
+ +Instructs gperf to generate code in the language specified by the +option's argument. Languages handled are currently: + +
+ +
‘KR-C’ +
+Old-style K&R C. This language is understood by old-style C compilers and +ANSI C compilers, but ANSI C compilers may flag warnings (or even errors) +because of lacking ‘const’. + +
‘C’ +
+Common C. This language is understood by ANSI C compilers, and also by +old-style C compilers, provided that you #define const to empty +for compilers which don't know about this keyword. + +
‘ANSI-C’ +
+ANSI C. This language is understood by ANSI C (C89, ISO C90) compilers, +ISO C99 compilers, and C++ compilers. + +
‘C++’ +
+C++. This language is understood by C++ compilers. +
+ +The default is ANSI-C. + +
‘%define slot-name name +
+ +This declaration is only useful when option ‘-t’ (or, equivalently, the +‘%struct-type’ declaration) has been given. +By default, the program assumes the structure component identifier for +the keyword is ‘name’. This option allows an arbitrary choice of +identifier for this component, although it still must occur as the first +field in your supplied struct. + +
‘%define initializer-suffix initializers +
+ +This declaration is only useful when option ‘-t’ (or, equivalently, the +‘%struct-type’ declaration) has been given. +It permits to specify initializers for the structure members following +slot-name in empty hash table entries. The list of initializers +should start with a comma. By default, the emitted code will +zero-initialize structure members following slot-name. + +
‘%define hash-function-name name +
+ +Allows you to specify the name for the generated hash function. Default +name is ‘hash’. This option permits the use of two hash tables in +the same file. + +
‘%define lookup-function-name name +
+ +Allows you to specify the name for the generated lookup function. +Default name is ‘in_word_set’. This option permits multiple +generated hash functions to be used in the same application. + +
‘%define class-name name +
+ +This option is only useful when option ‘-L C++’ (or, equivalently, +the ‘%language=C++’ declaration) has been given. It +allows you to specify the name of generated C++ class. Default name is +Perfect_Hash. + +
‘%7bit’ +
+ +This option specifies that all strings that will be passed as arguments +to the generated hash function and the generated lookup function will +solely consist of 7-bit ASCII characters (bytes in the range 0..127). +(Note that the ANSI C functions isalnum and isgraph do +not guarantee that a byte is in this range. Only an explicit +test like ‘c >= 'A' && c <= 'Z'’ guarantees this.) + +
‘%compare-lengths’ +
+ +Compare keyword lengths before trying a string comparison. This option +is mandatory for binary comparisons (see section 4.3 Use of NUL bytes). It also might +cut down on the number of string comparisons made during the lookup, since +keywords with different lengths are never compared via strcmp. +However, using ‘%compare-lengths’ might greatly increase the size of the +generated C code if the lookup table range is large (which implies that +the switch option ‘-S’ or ‘%switch’ is not enabled), since the length +table contains as many elements as there are entries in the lookup table. + +
‘%compare-strncmp’ +
+ +Generates C code that uses the strncmp function to perform +string comparisons. The default action is to use strcmp. + +
‘%readonly-tables’ +
+ +Makes the contents of all generated lookup tables constant, i.e., +“readonly”. Many compilers can generate more efficient code for this +by putting the tables in readonly memory. + +
‘%enum’ +
+ +Define constant values using an enum local to the lookup function rather +than with #defines. This also means that different lookup functions can +reside in the same file. Thanks to James Clark <jjc@ai.mit.edu>. + +
‘%includes’ +
+ +Include the necessary system include file, <string.h>, at the +beginning of the code. By default, this is not done; the user must +include this header file himself to allow compilation of the code. + +
‘%global-table’ +
+ +Generate the static table of keywords as a static global variable, +rather than hiding it inside of the lookup function (which is the +default behavior). + +
‘%pic’ +
+ +Optimize the generated table for inclusion in shared libraries. This +reduces the startup time of programs using a shared library containing +the generated code. If the ‘%struct-type’ declaration (or, +equivalently, the option ‘-t’) is also given, the first field of the +user-defined struct must be of type ‘int’, not ‘char *’, because +it will contain offsets into the string pool instead of actual strings. +To convert such an offset to a string, you can use the expression +‘stringpool + o, where o is the offset. The string pool +name can be changed through the ‘%define string-pool-name’ declaration. + +
‘%define string-pool-name name +
+ +Allows you to specify the name of the generated string pool created by +the declaration ‘%pic’ (or, equivalently, the option ‘-P’). +The default name is ‘stringpool’. This declaration permits the use of +two hash tables in the same file, with ‘%pic’ and even when the +‘%global-table’ declaration (or, equivalently, the option ‘-G’) +is given. + +
‘%null-strings’ +
+ +Use NULL strings instead of empty strings for empty keyword table entries. +This reduces the startup time of programs using a shared library containing +the generated code (but not as much as the declaration ‘%pic’), at the +expense of one more test-and-branch instruction at run time. + +
‘%define constants-prefix prefix +
+ +Allows you to specify a prefix for the constants TOTAL_KEYWORDS, +MIN_WORD_LENGTH, MAX_WORD_LENGTH, and so on. This option +permits the use of two hash tables in the same file, even when the option +‘-E’ (or, equivalently, the ‘%enum’ declaration) is not given or +the option ‘-G’ (or, equivalently, the ‘%global-table’ declaration) +is given. + +
‘%define word-array-name name +
+ +Allows you to specify the name for the generated array containing the +hash table. Default name is ‘wordlist’. This option permits the +use of two hash tables in the same file, even when the option ‘-G’ +(or, equivalently, the ‘%global-table’ declaration) is given. + +
‘%define length-table-name name +
+ +Allows you to specify the name for the generated array containing the +length table. Default name is ‘lengthtable’. This option permits the +use of two length tables in the same file, even when the option ‘-G’ +(or, equivalently, the ‘%global-table’ declaration) is given. + +
‘%switch=count +
+ +Causes the generated C code to use a switch statement scheme, +rather than an array lookup table. This can lead to a reduction in both +time and space requirements for some input files. The argument to this +option determines how many switch statements are generated. A +value of 1 generates 1 switch containing all the elements, a +value of 2 generates 2 tables with 1/2 the elements in each +switch, etc. This is useful since many C compilers cannot +correctly generate code for large switch statements. This option +was inspired in part by Keith Bostic's original C program. + +
‘%omit-struct-type’ +
+ +Prevents the transfer of the type declaration to the output file. Use +this option if the type is already defined elsewhere. +
+ + + +

4.1.1.3 C Code Inclusion

+ +

+ + +Using a syntax similar to GNU utilities flex and bison, it +is possible to directly include C source text and comments verbatim into +the generated output file. This is accomplished by enclosing the region +inside left-justified surrounding ‘%{’, ‘%}’ pairs. Here is +an input fragment based on the previous example that illustrates this +feature: + +

+ +
+%{
+#include <assert.h>
+/* This section of code is inserted directly into the output. */
+int return_month_days (struct month *months, int is_leap_year);
+%}
+struct month { char *name; int number; int days; int leap_days; };
+%%
+january,   1, 31, 31
+february,  2, 28, 29
+march,     3, 31, 31
+...
+
+ + + +

4.1.2 Format for Keyword Entries

+ +

+The second input file format section contains lines of keywords and any +associated attributes you might supply. A line beginning with ‘#’ +in the first column is considered a comment. Everything following the +‘#’ is ignored, up to and including the following newline. A line +beginning with ‘%’ in the first column is an option declaration and +must not occur within the keywords section. + +

+

+The first field of each non-comment line is always the keyword itself. It +can be given in two ways: as a simple name, i.e., without surrounding +string quotation marks, or as a string enclosed in double-quotes, in +C syntax, possibly with backslash escapes like \" or \234 +or \xa8. In either case, it must start right at the beginning +of the line, without leading whitespace. +In this context, a “field” is considered to extend up to, but +not include, the first blank, comma, or newline. Here is a simple +example taken from a partial list of C reserved words: + +

+ +
+# These are a few C reserved words, see the c.gperf file 
+# for a complete list of ANSI C reserved words.
+unsigned
+sizeof
+switch
+signed
+if
+default
+for
+while
+return
+
+ +

+Note that unlike flex or bison the first ‘%%’ marker +may be elided if the declaration section is empty. + +

+

+Additional fields may optionally follow the leading keyword. Fields +should be separated by commas, and terminate at the end of line. What +these fields mean is entirely up to you; they are used to initialize the +elements of the user-defined struct provided by you in the +declaration section. If the ‘-t’ option (or, equivalently, the +‘%struct-type’ declaration) is not enabled +these fields are simply ignored. All previous examples except the last +one contain keyword attributes. + +

+ + +

4.1.3 Including Additional C Functions

+ +

+The optional third section also corresponds closely with conventions +found in flex and bison. All text in this section, +starting at the final ‘%%’ and extending to the end of the input +file, is included verbatim into the generated output file. Naturally, +it is your responsibility to ensure that the code contained in this +section is valid C. + +

+ + +

4.1.4 Where to place directives for GNU indent.

+ +

+If you want to invoke GNU indent on a gperf input file, +you will see that GNU indent doesn't understand the ‘%%’, +‘%{’ and ‘%}’ directives that control gperf's +interpretation of the input file. Therefore you have to insert some +directives for GNU indent. More precisely, assuming the most +general input file structure + +

+ +
+declarations part 1
+%{
+verbatim code
+%}
+declarations part 2
+%%
+keywords
+%%
+functions
+
+ +

+you would insert ‘*INDENT-OFF*’ and ‘*INDENT-ON*’ comments +as follows: + +

+ +
+/* *INDENT-OFF* */
+declarations part 1
+%{
+/* *INDENT-ON* */
+verbatim code
+/* *INDENT-OFF* */
+%}
+declarations part 2
+%%
+keywords
+%%
+/* *INDENT-ON* */
+functions
+
+ + + +

4.2 Output Format for Generated C Code with gperf

+

+ + +

+

+Several options control how the generated C code appears on the standard +output. Two C functions are generated. They are called hash and +in_word_set, although you may modify their names with a command-line +option. Both functions require two arguments, a string, char * +str, and a length parameter, int len. Their default +function prototypes are as follows: + +

+

+

+
Function: unsigned int hash (const char * str, size_t len) +
+By default, the generated hash function returns an integer value +created by adding len to several user-specified str byte +positions indexed into an associated values table stored in a +local static array. The associated values table is constructed +internally by gperf and later output as a static local C array +called ‘hash_table’. The relevant selected positions (i.e. indices +into str) are specified via the ‘-k’ option when running +gperf, as detailed in the Options section below (see section 5 Invoking gperf). +
+ +

+

+

+
Function: in_word_set (const char * str, size_t len) +
+If str is in the keyword set, returns a pointer to that +keyword. More exactly, if the option ‘-t’ (or, equivalently, the +‘%struct-type’ declaration) was given, it returns +a pointer to the matching keyword's structure. Otherwise it returns +NULL. +
+ +

+

+If the option ‘-c’ (or, equivalently, the ‘%compare-strncmp’ +declaration) is not used, str must be a NUL terminated +string of exactly length len. If ‘-c’ (or, equivalently, the +‘%compare-strncmp’ declaration) is used, str must +simply be an array of len bytes and does not need to be NUL +terminated. + +

+

+The code generated for these two functions is affected by the following +options: + +

+
+ +
‘-t’ +
+
‘--struct-type’ +
+Make use of the user-defined struct. + +
‘-S total-switch-statements +
+
‘--switch=total-switch-statements +
+ +Generate 1 or more C switch statement rather than use a large, +(and potentially sparse) static array. Although the exact time and +space savings of this approach vary according to your C compiler's +degree of optimization, this method often results in smaller and faster +code. +
+ +

+If the ‘-t’ and ‘-S’ options (or, equivalently, the +‘%struct-type’ and ‘%switch’ declarations) are omitted, the default +action +is to generate a char * array containing the keywords, together with +additional empty strings used for padding the array. By experimenting +with the various input and output options, and timing the resulting C +code, you can determine the best option choices for different keyword +set characteristics. + +

+ + +

4.3 Use of NUL bytes

+

+ + +

+

+By default, the code generated by gperf operates on zero +terminated strings, the usual representation of strings in C. This means +that the keywords in the input file must not contain NUL bytes, +and the str argument passed to hash or in_word_set +must be NUL terminated and have exactly length len. + +

+

+If option ‘-c’ (or, equivalently, the ‘%compare-strncmp’ +declaration) is used, then the str argument does not need +to be NUL terminated. The code generated by gperf will only +access the first len, not len+1, bytes starting at str. +However, the keywords in the input file still must not contain NUL +bytes. + +

+

+If option ‘-l’ (or, equivalently, the ‘%compare-lengths’ +declaration) is used, then the hash table performs binary +comparison. The keywords in the input file may contain NUL bytes, +written in string syntax as \000 or \x00, and the code +generated by gperf will treat NUL like any other byte. +Also, in this case the ‘-c’ option (or, equivalently, the +‘%compare-strncmp’ declaration) is ignored. + +

+ + +

4.4 Controlling Identifiers

+ +

+The identifiers of the functions, tables, and constants defined by the code +generated by gperf can be controlled through gperf declarations +or the equivalent command-line options. This is useful for three purposes: + +

+ +
    +
  • + +Esthetics of the generated code. + +For this purpose, just use the available declarations or options at will. + +
  • + +Controlling the exported identifiers of a library. + +Assume you include code generated by gperf in a library, and to +avoid collisions with other libraries, you want to ensure that all exported +identifiers of this library start with a certain prefix. + +By default, the only exported identifier is the lookup function. You can +therefore use the option ‘-N’ (or, equivalently, the +‘%define lookup-function-name’ declaration). + +When you use the option ‘-L C++’ (or, equivalently, the +‘%language=C++’ declaration), the only exported entity is a class. +You control its name through the option ‘-Z’ (or, equivalently, the +‘%define class-name’ declaration). + +
  • + +Allowing multiple gperf generated codes in a single compilation unit. + +Assume you invoke gperf multiple times, with different input files, +and want the generated code to included from the same source file. In this +case, you have to customize not only the exported identifiers, but also the +names of functions with ‘static’ scope, types, and constants. + +By default, you will have to deal with the lookup function, the hash +function, and the constants. You should therefore use the option ‘-N’ +(or, equivalently, the ‘%define lookup-function-name’ declaration), +the option ‘-H’ (or, equivalently, the +‘%define hash-function-name’ declaration), and the option +‘--constants-prefix’ (or, equivalently, the +‘%define constants-prefix’ declaration). + +If you use the option ‘-G’ (or, equivalently, the ‘%global-table’ +declaration), you will also have to deal with the word array, the length +table if present, and the string pool if present. This means: You should +use the option ‘-W’ (or, equivalently, the +‘%define word-array-name’ declaration). If you use the option +‘-l’ (or, equivalently, the ‘%compare-lengths’ declaration), you +should use the option ‘--length-table-name’ (or, equivalently, the +‘%define length-table-name’ declaration). If you use the option +‘-P’ (or, equivalently, the ‘%pic’ declaration), you should use +the option ‘-Q’ (or, equivalently, the ‘%define string-pool-name’ +declaration). +
+ + + +

4.5 The Copyright of the Output

+

+ + +

+

+gperf is under GPL, but that does not cause the output produced +by gperf to be under GPL. The reason is that the output contains +only small pieces of text that come directly from gperf's source +code -- only about 7 lines long, too small for being significant --, and +therefore the output is not a “work based on gperf” (in the +sense of the GPL version 3). + +

+

+On the other hand, the output produced by gperf contains +essentially all of the input file. Therefore the output is a +“derivative work” of the input (in the sense of U.S. copyright law); +and its copyright status depends on the copyright of the input. For most +software licenses, the result is that the the output is under the same +license, with the same copyright holder, as the input that was passed to +gperf. + +

+ + +

5 Invoking gperf

+ +

+There are many options to gperf. They were added to make +the program more convenient for use with real applications. “On-line” +help is readily available via the ‘--help’ option. Here is the +complete list of options. + +

+ + + +

5.1 Specifying the Location of the Output File

+ +
+ +
‘--output-file=file +
+Allows you to specify the name of the file to which the output is written to. +
+ +

+The results are written to standard output if no output file is specified +or if it is ‘-’. + +

+ + +

5.2 Options that affect Interpretation of the Input File

+ +

+These options are also available as declarations in the input file +(see section 4.1.1.2 Gperf Declarations). + +

+
+ +
‘-e keyword-delimiter-list +
+
‘--delimiters=keyword-delimiter-list +
+ +Allows you to provide a string containing delimiters used to +separate keywords from their attributes. The default is ",". This +option is essential if you want to use keywords that have embedded +commas or newlines. One useful trick is to use -e'TAB', where TAB is +the literal tab character. + +
‘-t’ +
+
‘--struct-type’ +
+Allows you to include a struct type declaration for generated +code. Any text before a pair of consecutive ‘%%’ is considered +part of the type declaration. Keywords and additional fields may follow +this, one group of fields per line. A set of examples for generating +perfect hash tables and functions for Ada, C, C++, Pascal, Modula 2, +Modula 3 and JavaScript reserved words are distributed with this release. + +
‘--ignore-case’ +
+Consider upper and lower case ASCII characters as equivalent. The string +comparison will use a case insignificant character comparison. Note that +locale dependent case mappings are ignored. This option is therefore not +suitable if a properly internationalized or locale aware case mapping +should be used. (For example, in a Turkish locale, the upper case equivalent +of the lowercase ASCII letter ‘i’ is the non-ASCII character +‘capital i with dot above’.) For this case, it is better to apply +an uppercase or lowercase conversion on the string before passing it to +the gperf generated function. +
+ + + +

5.3 Options to specify the Language for the Output Code

+ +

+These options are also available as declarations in the input file +(see section 4.1.1.2 Gperf Declarations). + +

+
+ +
‘-L generated-language-name +
+
‘--language=generated-language-name +
+Instructs gperf to generate code in the language specified by the +option's argument. Languages handled are currently: + +
+ +
‘KR-C’ +
+Old-style K&R C. This language is understood by old-style C compilers and +ANSI C compilers, but ANSI C compilers may flag warnings (or even errors) +because of lacking ‘const’. + +
‘C’ +
+Common C. This language is understood by ANSI C compilers, and also by +old-style C compilers, provided that you #define const to empty +for compilers which don't know about this keyword. + +
‘ANSI-C’ +
+ANSI C. This language is understood by ANSI C compilers and C++ compilers. + +
‘C++’ +
+C++. This language is understood by C++ compilers. +
+ +The default is ANSI-C. + +
‘-a’ +
+This option is supported for compatibility with previous releases of +gperf. It does not do anything. + +
‘-g’ +
+This option is supported for compatibility with previous releases of +gperf. It does not do anything. +
+ + + +

5.4 Options for fine tuning Details in the Output Code

+ +

+Most of these options are also available as declarations in the input file +(see section 4.1.1.2 Gperf Declarations). + +

+
+ +
‘-K slot-name +
+
‘--slot-name=slot-name +
+ +This option is only useful when option ‘-t’ (or, equivalently, the +‘%struct-type’ declaration) has been given. +By default, the program assumes the structure component identifier for +the keyword is ‘name’. This option allows an arbitrary choice of +identifier for this component, although it still must occur as the first +field in your supplied struct. + +
‘-F initializers +
+
‘--initializer-suffix=initializers +
+ +This option is only useful when option ‘-t’ (or, equivalently, the +‘%struct-type’ declaration) has been given. +It permits to specify initializers for the structure members following +slot-name in empty hash table entries. The list of initializers +should start with a comma. By default, the emitted code will +zero-initialize structure members following slot-name. + +
‘-H hash-function-name +
+
‘--hash-function-name=hash-function-name +
+Allows you to specify the name for the generated hash function. Default +name is ‘hash’. This option permits the use of two hash tables in +the same file. + +
‘-N lookup-function-name +
+
‘--lookup-function-name=lookup-function-name +
+Allows you to specify the name for the generated lookup function. +Default name is ‘in_word_set’. This option permits multiple +generated hash functions to be used in the same application. + +
‘-Z class-name +
+
‘--class-name=class-name +
+ +This option is only useful when option ‘-L C++’ (or, equivalently, +the ‘%language=C++’ declaration) has been given. It +allows you to specify the name of generated C++ class. Default name is +Perfect_Hash. + +
‘-7’ +
+
‘--seven-bit’ +
+This option specifies that all strings that will be passed as arguments +to the generated hash function and the generated lookup function will +solely consist of 7-bit ASCII characters (bytes in the range 0..127). +(Note that the ANSI C functions isalnum and isgraph do +not guarantee that a byte is in this range. Only an explicit +test like ‘c >= 'A' && c <= 'Z'’ guarantees this.) This was the +default in versions of gperf earlier than 2.7; now the default is +to support 8-bit and multibyte characters. + +
‘-l’ +
+
‘--compare-lengths’ +
+Compare keyword lengths before trying a string comparison. This option +is mandatory for binary comparisons (see section 4.3 Use of NUL bytes). It also might +cut down on the number of string comparisons made during the lookup, since +keywords with different lengths are never compared via strcmp. +However, using ‘-l’ might greatly increase the size of the +generated C code if the lookup table range is large (which implies that +the switch option ‘-S’ or ‘%switch’ is not enabled), since the length +table contains as many elements as there are entries in the lookup table. + +
‘-c’ +
+
‘--compare-strncmp’ +
+Generates C code that uses the strncmp function to perform +string comparisons. The default action is to use strcmp. + +
‘-C’ +
+
‘--readonly-tables’ +
+Makes the contents of all generated lookup tables constant, i.e., +“readonly”. Many compilers can generate more efficient code for this +by putting the tables in readonly memory. + +
‘-E’ +
+
‘--enum’ +
+ +Define constant values using an enum local to the lookup function rather +than with #defines. This also means that different lookup functions can +reside in the same file. Thanks to James Clark <jjc@ai.mit.edu>. + +
‘-I’ +
+
‘--includes’ +
+Include the necessary system include file, <string.h>, at the +beginning of the code. By default, this is not done; the user must +include this header file himself to allow compilation of the code. + +
‘-G’ +
+
‘--global-table’ +
+Generate the static table of keywords as a static global variable, +rather than hiding it inside of the lookup function (which is the +default behavior). + +
‘-P’ +
+
‘--pic’ +
+Optimize the generated table for inclusion in shared libraries. This +reduces the startup time of programs using a shared library containing +the generated code. If the option ‘-t’ (or, equivalently, the +‘%struct-type’ declaration) is also given, the first field of the +user-defined struct must be of type ‘int’, not ‘char *’, because +it will contain offsets into the string pool instead of actual strings. +To convert such an offset to a string, you can use the expression +‘stringpool + o, where o is the offset. The string pool +name can be changed through the option ‘--string-pool-name’. + +
‘-Q string-pool-name +
+
‘--string-pool-name=string-pool-name +
+Allows you to specify the name of the generated string pool created by +option ‘-P’. The default name is ‘stringpool’. This option +permits the use of two hash tables in the same file, with ‘-P’ and +even when the option ‘-G’ (or, equivalently, the ‘%global-table’ +declaration) is given. + +
‘--null-strings’ +
+Use NULL strings instead of empty strings for empty keyword table entries. +This reduces the startup time of programs using a shared library containing +the generated code (but not as much as option ‘-P’), at the expense +of one more test-and-branch instruction at run time. + +
‘--constants-prefix=prefix +
+ +Allows you to specify a prefix for the constants TOTAL_KEYWORDS, +MIN_WORD_LENGTH, MAX_WORD_LENGTH, and so on. This option +permits the use of two hash tables in the same file, even when the option +‘-E’ (or, equivalently, the ‘%enum’ declaration) is not given or +the option ‘-G’ (or, equivalently, the ‘%global-table’ declaration) +is given. + +
‘-W hash-table-array-name +
+
‘--word-array-name=hash-table-array-name +
+ +Allows you to specify the name for the generated array containing the +hash table. Default name is ‘wordlist’. This option permits the +use of two hash tables in the same file, even when the option ‘-G’ +(or, equivalently, the ‘%global-table’ declaration) is given. + +
‘--length-table-name=length-table-array-name +
+ +Allows you to specify the name for the generated array containing the +length table. Default name is ‘lengthtable’. This option permits the +use of two length tables in the same file, even when the option ‘-G’ +(or, equivalently, the ‘%global-table’ declaration) is given. + +
‘-S total-switch-statements +
+
‘--switch=total-switch-statements +
+ +Causes the generated C code to use a switch statement scheme, +rather than an array lookup table. This can lead to a reduction in both +time and space requirements for some input files. The argument to this +option determines how many switch statements are generated. A +value of 1 generates 1 switch containing all the elements, a +value of 2 generates 2 tables with 1/2 the elements in each +switch, etc. This is useful since many C compilers cannot +correctly generate code for large switch statements. This option +was inspired in part by Keith Bostic's original C program. + +
‘-T’ +
+
‘--omit-struct-type’ +
+Prevents the transfer of the type declaration to the output file. Use +this option if the type is already defined elsewhere. + +
‘-p’ +
+This option is supported for compatibility with previous releases of +gperf. It does not do anything. +
+ + + +

5.5 Options for changing the Algorithms employed by gperf

+ +
+ +
‘-k selected-byte-positions +
+
‘--key-positions=selected-byte-positions +
+Allows selection of the byte positions used in the keywords' +hash function. The allowable choices range between 1-255, inclusive. +The positions are separated by commas, e.g., ‘-k 9,4,13,14’; +ranges may be used, e.g., ‘-k 2-7’; and positions may occur +in any order. Furthermore, the wildcard '*' causes the generated +hash function to consider all byte positions in each keyword, +whereas '$' instructs the hash function to use the “final byte” +of a keyword (this is the only way to use a byte position greater than +255, incidentally). + +For instance, the option ‘-k 1,2,4,6-10,'$'’ generates a hash +function that considers positions 1,2,4,6,7,8,9,10, plus the last +byte in each keyword (which may be at a different position for each +keyword, obviously). Keywords +with length less than the indicated byte positions work properly, since +selected byte positions exceeding the keyword length are simply not +referenced in the hash function. + +This option is not normally needed since version 2.8 of gperf; +the default byte positions are computed depending on the keyword set, +through a search that minimizes the number of byte positions. + +
‘-D’ +
+
‘--duplicates’ +
+ +Handle keywords whose selected byte sets hash to duplicate values. +Duplicate hash values can occur if a set of keywords has the same names, but +possesses different attributes, or if the selected byte positions are not well +chosen. With the -D option gperf treats all these keywords as +part of an equivalence class and generates a perfect hash function with +multiple comparisons for duplicate keywords. It is up to you to completely +disambiguate the keywords by modifying the generated C code. However, +gperf helps you out by organizing the output. + +Using this option usually means that the generated hash function is no +longer perfect. On the other hand, it permits gperf to work on +keyword sets that it otherwise could not handle. + +
‘-m iterations +
+
‘--multiple-iterations=iterations +
+Perform multiple choices of the ‘-i’ and ‘-j’ values, and +choose the best results. This increases the running time by a factor of +iterations but does a good job minimizing the generated table size. + +
‘-i initial-value +
+
‘--initial-asso=initial-value +
+Provides an initial value for the associate values array. Default +is 0. Increasing the initial value helps inflate the final table size, +possibly leading to more time efficient keyword lookups. Note that this +option is not particularly useful when ‘-S’ (or, equivalently, +‘%switch’) is used. Also, +‘-i’ is overridden when the ‘-r’ option is used. + +
‘-j jump-value +
+
‘--jump=jump-value +
+ +Affects the “jump value”, i.e., how far to advance the associated +byte value upon collisions. Jump-value is rounded up to an +odd number, the default is 5. If the jump-value is 0 gperf +jumps by random amounts. + +
‘-n’ +
+
‘--no-strlen’ +
+Instructs the generator not to include the length of a keyword when +computing its hash value. This may save a few assembly instructions in +the generated lookup table. + +
‘-r’ +
+
‘--random’ +
+Utilizes randomness to initialize the associated values table. This +frequently generates solutions faster than using deterministic +initialization (which starts all associated values at 0). Furthermore, +using the randomization option generally increases the size of the +table. + +
‘-s size-multiple +
+
‘--size-multiple=size-multiple +
+Affects the size of the generated hash table. The numeric argument for +this option indicates “how many times larger or smaller” the maximum +associated value range should be, in relationship to the number of keywords. +It can be written as an integer, a floating-point number or a fraction. +For example, a value of 3 means “allow the maximum associated value to be +about 3 times larger than the number of input keywords”. +Conversely, a value of 1/3 means “allow the maximum associated value to +be about 3 times smaller than the number of input keywords”. Values +smaller than 1 are useful for limiting the overall size of the generated hash +table, though the option ‘-m’ is better at this purpose. + +If `generate switch' option ‘-S’ (or, equivalently, ‘%switch’) is +not enabled, the maximum +associated value influences the static array table size, and a larger +table should decrease the time required for an unsuccessful search, at +the expense of extra table space. + +The default value is 1, thus the default maximum associated value about +the same size as the number of keywords (for efficiency, the maximum +associated value is always rounded up to a power of 2). The actual +table size may vary somewhat, since this technique is essentially a +heuristic. +
+ + + +

5.6 Informative Output

+ +
+ +
‘-h’ +
+
‘--help’ +
+Prints a short summary on the meaning of each program option. Aborts +further program execution. + +
‘-v’ +
+
‘--version’ +
+Prints out the current version number. + +
‘-d’ +
+
‘--debug’ +
+Enables the debugging option. This produces verbose diagnostics to +“standard error” when gperf is executing. It is useful both for +maintaining the program and for determining whether a given set of +options is actually speeding up the search for a solution. Some useful +information is dumped at the end of the program when the ‘-d’ +option is enabled. +
+ + + +

6 Known Bugs and Limitations with gperf

+ +

+The following are some limitations with the current release of +gperf: + +

+ +
    +
  • + +The gperf utility is tuned to execute quickly, and works quickly +for small to medium size data sets (around 1000 keywords). It is +extremely useful for maintaining perfect hash functions for compiler +keyword sets. Several recent enhancements now enable gperf to +work efficiently on much larger keyword sets (over 15,000 keywords). +When processing large keyword sets it helps greatly to have over 8 megs +of RAM. + +
  • + +The size of the generate static keyword array can get extremely +large if the input keyword file is large or if the keywords are quite +similar. This tends to slow down the compilation of the generated C +code, and greatly inflates the object code size. If this +situation occurs, consider using the ‘-S’ option to reduce data +size, potentially increasing keyword recognition time a negligible +amount. Since many C compilers cannot correctly generate code for +large switch statements it is important to qualify the -S option +with an appropriate numerical argument that controls the number of +switch statements generated. + +
  • + +The maximum number of selected byte positions has an +arbitrary limit of 255. This restriction should be removed, and if +anyone considers this a problem write me and let me know so I can remove +the constraint. +
+ + + +

7 Things Still Left to Do

+ +

+It should be “relatively” easy to replace the current perfect hash +function algorithm with a more exhaustive approach; the perfect hash +module is essential independent from other program modules. Additional +worthwhile improvements include: + +

+ +
    +
  • + +Another useful extension involves modifying the program to generate +“minimal” perfect hash functions (under certain circumstances, the +current version can be rather extravagant in the generated table size). +This is mostly of theoretical interest, since a sparse table +often produces faster lookups, and use of the ‘-S’ switch +option can minimize the data size, at the expense of slightly longer +lookups (note that the gcc compiler generally produces good code for +switch statements, reducing the need for more complex schemes). + +
  • + +In addition to improving the algorithm, it would also be useful to +generate an Ada package as the code output, in addition to the current +C and C++ routines. +
+ + + +

8 Bibliography

+ +

+[1] Chang, C.C.: A Scheme for Constructing Ordered Minimal Perfect +Hashing Functions Information Sciences 39(1986), 187-195. + +

+

+[2] Cichelli, Richard J. Author's Response to “On Cichelli's Minimal Perfect Hash +Functions Method” Communications of the ACM, 23, 12(December 1980), 729. + +

+

+[3] Cichelli, Richard J. Minimal Perfect Hash Functions Made Simple +Communications of the ACM, 23, 1(January 1980), 17-19. + +

+

+[4] Cook, C. R. and Oldehoeft, R.R. A Letter Oriented Minimal +Perfect Hashing Function SIGPLAN Notices, 17, 9(September 1982), 18-27. + +

+

+[5] Cormack, G. V. and Horspool, R. N. S. and Kaiserwerth, M. +Practical Perfect Hashing Computer Journal, 28, 1(January 1985), 54-58. + +

+

+[6] Jaeschke, G. Reciprocal Hashing: A Method for Generating Minimal +Perfect Hashing Functions Communications of the ACM, 24, 12(December +1981), 829-833. + +

+

+[7] Jaeschke, G. and Osterburg, G. On Cichelli's Minimal Perfect +Hash Functions Method Communications of the ACM, 23, 12(December 1980), +728-729. + +

+

+[8] Sager, Thomas J. A Polynomial Time Generator for Minimal Perfect +Hash Functions Communications of the ACM, 28, 5(December 1985), 523-532 + +

+

+[9] Schmidt, Douglas C. GPERF: A Perfect Hash Function Generator +Second USENIX C++ Conference Proceedings, April 1990. + +

+

+[10] Schmidt, Douglas C. GPERF: A Perfect Hash Function Generator +C++ Report, SIGS 10 10 (November/December 1998). + +

+

+[11] Sebesta, R.W. and Taylor, M.A. Minimal Perfect Hash Functions +for Reserved Word Lists SIGPLAN Notices, 20, 12(September 1985), 47-53. + +

+

+[12] Sprugnoli, R. Perfect Hashing Functions: A Single Probe +Retrieving Method for Static Sets Communications of the ACM, 20 +11(November 1977), 841-850. + +

+

+[13] Stallman, Richard M. Using and Porting GNU CC Free Software Foundation, +1988. + +

+

+[14] Stroustrup, Bjarne The C++ Programming Language. Addison-Wesley, 1986. + +

+

+[15] Tiemann, Michael D. User's Guide to GNU C++ Free Software +Foundation, 1989. + +

+ + +

Concept Index

+ +

+Jump to: +& +- +a +- +b +- +c +- +d +- +f +- +h +- +i +- +j +- +k +- +m +- +n +- +s +

+

&

+ +
  • ‘%%’ +
  • ‘%7bit’ +
  • ‘%compare-lengths’ +
  • ‘%compare-strncmp’ +
  • ‘%define class-name’ +
  • ‘%define constants-prefix’ +
  • ‘%define hash-function-name’ +
  • ‘%define initializer-suffix’ +
  • ‘%define length-table-name’ +
  • ‘%define lookup-function-name’ +
  • ‘%define slot-name’ +
  • ‘%define string-pool-name’ +
  • ‘%define word-array-name’ +
  • ‘%delimiters’ +
  • ‘%enum’ +
  • ‘%global-table’ +
  • ‘%ignore-case’ +
  • ‘%includes’ +
  • ‘%language’ +
  • ‘%null-strings’ +
  • ‘%omit-struct-type’ +
  • ‘%pic’ +
  • ‘%readonly-tables’ +
  • ‘%struct-type’ +
  • ‘%switch’ +
  • ‘%{’ +
  • ‘%}’ +
  • +

    a

    + +
  • Array name, Array name +
  • +

    b

    + +
  • Bugs +
  • +

    c

    + +
  • Class name +
  • Constants definition +
  • Constants prefix +
  • Copyright +
  • +

    d

    + +
  • Declaration section +
  • Delimiters +
  • Duplicates +
  • +

    f

    + +
  • Format +
  • Functions section +
  • +

    h

    + +
  • hash +
  • hash table +
  • +

    i

    + +
  • in_word_set +
  • Initializers +
  • +

    j

    + +
  • Jump value +
  • +

    k

    + +
  • Keywords section +
  • +

    m

    + +
  • Minimal perfect hash functions +
  • +

    n

    + +
  • NUL +
  • +

    s

    + +
  • Slot name +
  • Static search structure +
  • switch, switch +
  • + +

    + +


    +This document was generated on 2 January 2017 using the +texi2html +translator version 1.52b.

    + + diff --git a/doc/gperf.info b/doc/gperf.info new file mode 100644 index 0000000..58b9676 --- /dev/null +++ b/doc/gperf.info @@ -0,0 +1,2168 @@ +This is gperf.info, produced by makeinfo version 5.2 from gperf.texi. + +INFO-DIR-SECTION Programming Tools +START-INFO-DIR-ENTRY +* Gperf: (gperf). Perfect Hash Function Generator. +END-INFO-DIR-ENTRY + + This file documents the features of the GNU Perfect Hash Function +Generator 3.1. + + Copyright (C) 1989-2016 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is included +exactly as in the original, and provided that the entire resulting +derived work is distributed under the terms of a permission notice +identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that the section entitled "GNU General Public License" +and this permission notice may be included in translations approved by +the Free Software Foundation instead of in the original English. + + +File: gperf.info, Node: Top, Next: Copying, Prev: (dir), Up: (dir) + +Introduction +************ + + This manual documents the GNU 'gperf' perfect hash function generator +utility, focusing on its features and how to use them, and how to report +bugs. + +* Menu: + +* Copying:: GNU General Public License says how you can + copy and share 'gperf'. +* Contributors:: People who have contributed to 'gperf'. +* Motivation:: The purpose of 'gperf'. +* Search Structures:: Static search structures and GNU 'gperf' +* Description:: High-level discussion of how GPERF functions. +* Options:: A description of options to the program. +* Bugs:: Known bugs and limitations with GPERF. +* Projects:: Things still left to do. +* Bibliography:: Material Referenced in this Report. + +* Concept Index:: + + +High-Level Description of GNU 'gperf' + +* Input Format:: Input Format to 'gperf' +* Output Format:: Output Format for Generated C Code with 'gperf' +* Binary Strings:: Use of NUL bytes +* Controlling Identifiers:: Avoiding collisions of identifiers +* Output Copyright:: The Copyright of the Output. + +Input Format to 'gperf' + +* Declarations:: Declarations. +* Keywords:: Format for Keyword Entries. +* Functions:: Including Additional C Functions. +* Controls for GNU indent:: Where to place directives for GNU 'indent'. + +Declarations + +* User-supplied Struct:: Specifying keywords with attributes. +* Gperf Declarations:: Embedding command line options in the input. +* C Code Inclusion:: Including C declarations and definitions. + +Invoking 'gperf' + +* Input Details:: Options that affect Interpretation of the Input File +* Output Language:: Specifying the Language for the Output Code +* Output Details:: Fine tuning Details in the Output Code +* Algorithmic Details:: Changing the Algorithms employed by 'gperf' +* Verbosity:: Informative Output + + + +File: gperf.info, Node: Copying, Next: Contributors, Prev: Top, Up: Top + +GNU GENERAL PUBLIC LICENSE +************************** + + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on + a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may convey + the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work with + that Major Component, or to implement a Standard Interface for + which an implementation is available to the public in source code + form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts + to control those activities. However, it does not include the + work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files associated + with source files for the work, and the source code for shared + libraries and dynamically linked subprograms that the work is + specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, given + its content, constitutes a covered work. This License acknowledges + your rights of fair use or other equivalent, as provided by + copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for you, + or provide you with facilities for running those works, provided + that you comply with the terms of this License in conveying all + material for which you do not control copyright. Those thus making + or running the covered works for you must do so exclusively on your + behalf, under your direction and control, on terms that prohibit + them from making any copies of your copyrighted material outside + their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention to + limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to + the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated by + you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to the + object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long as + needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is + a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or installed + by the recipient, or for the User Product in which it has been + modified or installed. Access to a network may be denied when the + modification itself materially and adversely affects the operation + of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License with + terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked + in reasonable ways as different from the original version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or conveying + under this License, you may add to a covered work material governed + by the terms of that license document, provided that the further + restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under the + third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, you do not qualify to receive new licenses + for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to possession + of the Corresponding Source of the work from the predecessor in + interest, if the predecessor has it or can get it with reasonable + efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for exercise + of rights granted under this License, and you may not initiate + litigation (including a cross-claim or counterclaim in a lawsuit) + alleging that any patent claim is infringed by making, using, + selling, offering for sale, or importing the Program or any portion + of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its contributor + version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To "grant" + such a patent license to a party means to make such an agreement or + commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under which + you make payment to the third party based on the extent of your + activity of conveying the work, and under which the third party + grants, to any of the parties who would receive the covered work + from you, a discriminatory patent license (a) in connection with + copies of the covered work conveyed by you (or copies made from + those copies), or (b) primarily for and in connection with specific + products or compilations that contain the covered work, unless you + entered into that arrangement, or that patent license was granted, + prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you + cannot convey a covered work so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, + then as a consequence you may not convey it at all. For example, + if you agree to terms that obligate you to collect a royalty for + further conveying from those to whom you convey the Program, the + only way you could satisfy both those terms and this License would + be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the Free + Software Foundation. If the Program does not specify a version + number of the GNU General Public License, you may choose any + version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type 'show c' for details. + + The hypothetical commands 'show w' and 'show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . + + +File: gperf.info, Node: Contributors, Next: Motivation, Prev: Copying, Up: Top + +Contributors to GNU 'gperf' Utility +*********************************** + + * The GNU 'gperf' perfect hash function generator utility was written + in GNU C++ by Douglas C. Schmidt. The general idea for the perfect + hash function generator was inspired by Keith Bostic's algorithm + written in C, and distributed to net.sources around 1984. The + current program is a heavily modified, enhanced, and extended + implementation of Keith's basic idea, created at the University of + California, Irvine. Bugs, patches, and suggestions should be + reported to ''. + + * Special thanks is extended to Michael Tiemann and Doug Lea, for + providing a useful compiler, and for giving me a forum to exhibit + my creation. + + In addition, Adam de Boor and Nels Olson provided many tips and + insights that greatly helped improve the quality and functionality + of 'gperf'. + + * Bruno Haible enhanced and optimized the search algorithm. He also + rewrote the input routines and the output routines for better + reliability, and added a testsuite. + + +File: gperf.info, Node: Motivation, Next: Search Structures, Prev: Contributors, Up: Top + +1 Introduction +************** + + 'gperf' is a perfect hash function generator written in C++. It +transforms an N element user-specified keyword set W into a perfect hash +function F. F uniquely maps keywords in W onto the range 0..K, where K +>= N-1. If K = N-1 then F is a _minimal_ perfect hash function. +'gperf' generates a 0..K element static lookup table and a pair of C +functions. These functions determine whether a given character string S +occurs in W, using at most one probe into the lookup table. + + 'gperf' currently generates the reserved keyword recognizer for +lexical analyzers in several production and research compilers and +language processing tools, including GNU C, GNU C++, GNU Java, GNU +Pascal, GNU Modula 3, and GNU indent. Complete C++ source code for +'gperf' is available from 'http://ftp.gnu.org/pub/gnu/gperf/'. A paper +describing 'gperf''s design and implementation in greater detail is +available in the Second USENIX C++ Conference proceedings or from +'http://www.cs.wustl.edu/~schmidt/resume.html'. + + +File: gperf.info, Node: Search Structures, Next: Description, Prev: Motivation, Up: Top + +2 Static search structures and GNU 'gperf' +****************************************** + + A "static search structure" is an Abstract Data Type with certain +fundamental operations, e.g., _initialize_, _insert_, and _retrieve_. +Conceptually, all insertions occur before any retrievals. In practice, +'gperf' generates a _static_ array containing search set keywords and +any associated attributes specified by the user. Thus, there is +essentially no execution-time cost for the insertions. It is a useful +data structure for representing _static search sets_. Static search +sets occur frequently in software system applications. Typical static +search sets include compiler reserved words, assembler instruction +opcodes, and built-in shell interpreter commands. Search set members, +called "keywords", are inserted into the structure only once, usually +during program initialization, and are not generally modified at +run-time. + + Numerous static search structure implementations exist, e.g., arrays, +linked lists, binary search trees, digital search tries, and hash +tables. Different approaches offer trade-offs between space utilization +and search time efficiency. For example, an N element sorted array is +space efficient, though the average-case time complexity for retrieval +operations using binary search is proportional to log N. Conversely, +hash table implementations often locate a table entry in constant time, +but typically impose additional memory overhead and exhibit poor worst +case performance. + + _Minimal perfect hash functions_ provide an optimal solution for a +particular class of static search sets. A minimal perfect hash function +is defined by two properties: + + * It allows keyword recognition in a static search set using at most + _one_ probe into the hash table. This represents the "perfect" + property. + * The actual memory allocated to store the keywords is precisely + large enough for the keyword set, and _no larger_. This is the + "minimal" property. + + For most applications it is far easier to generate _perfect_ hash +functions than _minimal perfect_ hash functions. Moreover, non-minimal +perfect hash functions frequently execute faster than minimal ones in +practice. This phenomena occurs since searching a sparse keyword table +increases the probability of locating a "null" entry, thereby reducing +string comparisons. 'gperf''s default behavior generates _near-minimal_ +perfect hash functions for keyword sets. However, 'gperf' provides many +options that permit user control over the degree of minimality and +perfection. + + Static search sets often exhibit relative stability over time. For +example, Ada's 63 reserved words have remained constant for nearly a +decade. It is therefore frequently worthwhile to expend concerted +effort building an optimal search structure _once_, if it subsequently +receives heavy use multiple times. 'gperf' removes the drudgery +associated with constructing time- and space-efficient search structures +by hand. It has proven a useful and practical tool for serious +programming projects. Output from 'gperf' is currently used in several +production and research compilers, including GNU C, GNU C++, GNU Java, +GNU Pascal, and GNU Modula 3. The latter two compilers are not yet part +of the official GNU distribution. Each compiler utilizes 'gperf' to +automatically generate static search structures that efficiently +identify their respective reserved keywords. + + +File: gperf.info, Node: Description, Next: Options, Prev: Search Structures, Up: Top + +3 High-Level Description of GNU 'gperf' +*************************************** + +* Menu: + +* Input Format:: Input Format to 'gperf' +* Output Format:: Output Format for Generated C Code with 'gperf' +* Binary Strings:: Use of NUL bytes +* Controlling Identifiers:: Avoiding collisions of identifiers +* Output Copyright:: The Copyright of the Output. + + The perfect hash function generator 'gperf' reads a set of "keywords" +from an input file (or from the standard input by default). It attempts +to derive a perfect hashing function that recognizes a member of the +"static keyword set" with at most a single probe into the lookup table. +If 'gperf' succeeds in generating such a function it produces a pair of +C source code routines that perform hashing and table lookup +recognition. All generated C code is directed to the standard output. +Command-line options described below allow you to modify the input and +output format to 'gperf'. + + By default, 'gperf' attempts to produce time-efficient code, with +less emphasis on efficient space utilization. However, several options +exist that permit trading-off execution time for storage space and vice +versa. In particular, expanding the generated table size produces a +sparse search structure, generally yielding faster searches. +Conversely, you can direct 'gperf' to utilize a C 'switch' statement +scheme that minimizes data space storage size. Furthermore, using a C +'switch' may actually speed up the keyword retrieval time somewhat. +Actual results depend on your C compiler, of course. + + In general, 'gperf' assigns values to the bytes it is using for +hashing until some set of values gives each keyword a unique value. A +helpful heuristic is that the larger the hash value range, the easier it +is for 'gperf' to find and generate a perfect hash function. +Experimentation is the key to getting the most from 'gperf'. + + +File: gperf.info, Node: Input Format, Next: Output Format, Prev: Description, Up: Description + +3.1 Input Format to 'gperf' +=========================== + + You can control the input file format by varying certain command-line +arguments, in particular the '-t' option. The input's appearance is +similar to GNU utilities 'flex' and 'bison' (or UNIX utilities 'lex' and +'yacc'). Here's an outline of the general format: + + declarations + %% + keywords + %% + functions + + _Unlike_ 'flex' or 'bison', the declarations section and the +functions section are optional. The following sections describe the +input format for each section. + +* Menu: + +* Declarations:: Declarations. +* Keywords:: Format for Keyword Entries. +* Functions:: Including Additional C Functions. +* Controls for GNU indent:: Where to place directives for GNU 'indent'. + + It is possible to omit the declaration section entirely, if the '-t' +option is not given. In this case the input file begins directly with +the first keyword line, e.g.: + + january + february + march + april + ... + + +File: gperf.info, Node: Declarations, Next: Keywords, Prev: Input Format, Up: Input Format + +3.1.1 Declarations +------------------ + + The keyword input file optionally contains a section for including +arbitrary C declarations and definitions, 'gperf' declarations that act +like command-line options, as well as for providing a user-supplied +'struct'. + +* Menu: + +* User-supplied Struct:: Specifying keywords with attributes. +* Gperf Declarations:: Embedding command line options in the input. +* C Code Inclusion:: Including C declarations and definitions. + + +File: gperf.info, Node: User-supplied Struct, Next: Gperf Declarations, Prev: Declarations, Up: Declarations + +3.1.1.1 User-supplied 'struct' +.............................. + + If the '-t' option (or, equivalently, the '%struct-type' declaration) +_is_ enabled, you _must_ provide a C 'struct' as the last component in +the declaration section from the input file. The first field in this +struct must be of type 'char *' or 'const char *' if the '-P' option is +not given, or of type 'int' if the option '-P' (or, equivalently, the +'%pic' declaration) is enabled. This first field must be called 'name', +although it is possible to modify its name with the '-K' option (or, +equivalently, the '%define slot-name' declaration) described below. + + Here is a simple example, using months of the year and their +attributes as input: + + struct month { char *name; int number; int days; int leap_days; }; + %% + january, 1, 31, 31 + february, 2, 28, 29 + march, 3, 31, 31 + april, 4, 30, 30 + may, 5, 31, 31 + june, 6, 30, 30 + july, 7, 31, 31 + august, 8, 31, 31 + september, 9, 30, 30 + october, 10, 31, 31 + november, 11, 30, 30 + december, 12, 31, 31 + + Separating the 'struct' declaration from the list of keywords and +other fields are a pair of consecutive percent signs, '%%', appearing +left justified in the first column, as in the UNIX utility 'lex'. + + If the 'struct' has already been declared in an include file, it can +be mentioned in an abbreviated form, like this: + + struct month; + %% + january, 1, 31, 31 + ... + + +File: gperf.info, Node: Gperf Declarations, Next: C Code Inclusion, Prev: User-supplied Struct, Up: Declarations + +3.1.1.2 Gperf Declarations +.......................... + + The declaration section can contain 'gperf' declarations. They +influence the way 'gperf' works, like command line options do. In fact, +every such declaration is equivalent to a command line option. There +are three forms of declarations: + + 1. Declarations without argument, like '%compare-lengths'. + + 2. Declarations with an argument, like '%switch=COUNT'. + + 3. Declarations of names of entities in the output file, like '%define + lookup-function-name NAME'. + + When a declaration is given both in the input file and as a command +line option, the command-line option's value prevails. + + The following 'gperf' declarations are available. + +'%delimiters=DELIMITER-LIST' + Allows you to provide a string containing delimiters used to + separate keywords from their attributes. The default is ",". This + option is essential if you want to use keywords that have embedded + commas or newlines. + +'%struct-type' + Allows you to include a 'struct' type declaration for generated + code; see above for an example. + +'%ignore-case' + Consider upper and lower case ASCII characters as equivalent. The + string comparison will use a case insignificant character + comparison. Note that locale dependent case mappings are ignored. + +'%language=LANGUAGE-NAME' + Instructs 'gperf' to generate code in the language specified by the + option's argument. Languages handled are currently: + + 'KR-C' + Old-style K&R C. This language is understood by old-style C + compilers and ANSI C compilers, but ANSI C compilers may flag + warnings (or even errors) because of lacking 'const'. + + 'C' + Common C. This language is understood by ANSI C compilers, and + also by old-style C compilers, provided that you '#define + const' to empty for compilers which don't know about this + keyword. + + 'ANSI-C' + ANSI C. This language is understood by ANSI C (C89, ISO C90) + compilers, ISO C99 compilers, and C++ compilers. + + 'C++' + C++. This language is understood by C++ compilers. + + The default is ANSI-C. + +'%define slot-name NAME' + This declaration is only useful when option '-t' (or, equivalently, + the '%struct-type' declaration) has been given. By default, the + program assumes the structure component identifier for the keyword + is 'name'. This option allows an arbitrary choice of identifier + for this component, although it still must occur as the first field + in your supplied 'struct'. + +'%define initializer-suffix INITIALIZERS' + This declaration is only useful when option '-t' (or, equivalently, + the '%struct-type' declaration) has been given. It permits to + specify initializers for the structure members following SLOT-NAME + in empty hash table entries. The list of initializers should start + with a comma. By default, the emitted code will zero-initialize + structure members following SLOT-NAME. + +'%define hash-function-name NAME' + Allows you to specify the name for the generated hash function. + Default name is 'hash'. This option permits the use of two hash + tables in the same file. + +'%define lookup-function-name NAME' + Allows you to specify the name for the generated lookup function. + Default name is 'in_word_set'. This option permits multiple + generated hash functions to be used in the same application. + +'%define class-name NAME' + This option is only useful when option '-L C++' (or, equivalently, + the '%language=C++' declaration) has been given. It allows you to + specify the name of generated C++ class. Default name is + 'Perfect_Hash'. + +'%7bit' + This option specifies that all strings that will be passed as + arguments to the generated hash function and the generated lookup + function will solely consist of 7-bit ASCII characters (bytes in + the range 0..127). (Note that the ANSI C functions 'isalnum' and + 'isgraph' do _not_ guarantee that a byte is in this range. Only an + explicit test like 'c >= 'A' && c <= 'Z'' guarantees this.) + +'%compare-lengths' + Compare keyword lengths before trying a string comparison. This + option is mandatory for binary comparisons (*note Binary + Strings::). It also might cut down on the number of string + comparisons made during the lookup, since keywords with different + lengths are never compared via 'strcmp'. However, using + '%compare-lengths' might greatly increase the size of the generated + C code if the lookup table range is large (which implies that the + switch option '-S' or '%switch' is not enabled), since the length + table contains as many elements as there are entries in the lookup + table. + +'%compare-strncmp' + Generates C code that uses the 'strncmp' function to perform string + comparisons. The default action is to use 'strcmp'. + +'%readonly-tables' + Makes the contents of all generated lookup tables constant, i.e., + "readonly". Many compilers can generate more efficient code for + this by putting the tables in readonly memory. + +'%enum' + Define constant values using an enum local to the lookup function + rather than with #defines. This also means that different lookup + functions can reside in the same file. Thanks to James Clark + ''. + +'%includes' + Include the necessary system include file, '', at the + beginning of the code. By default, this is not done; the user must + include this header file himself to allow compilation of the code. + +'%global-table' + Generate the static table of keywords as a static global variable, + rather than hiding it inside of the lookup function (which is the + default behavior). + +'%pic' + Optimize the generated table for inclusion in shared libraries. + This reduces the startup time of programs using a shared library + containing the generated code. If the '%struct-type' declaration + (or, equivalently, the option '-t') is also given, the first field + of the user-defined struct must be of type 'int', not 'char *', + because it will contain offsets into the string pool instead of + actual strings. To convert such an offset to a string, you can use + the expression 'stringpool + O', where O is the offset. The string + pool name can be changed through the '%define string-pool-name' + declaration. + +'%define string-pool-name NAME' + Allows you to specify the name of the generated string pool created + by the declaration '%pic' (or, equivalently, the option '-P'). The + default name is 'stringpool'. This declaration permits the use of + two hash tables in the same file, with '%pic' and even when the + '%global-table' declaration (or, equivalently, the option '-G') is + given. + +'%null-strings' + Use NULL strings instead of empty strings for empty keyword table + entries. This reduces the startup time of programs using a shared + library containing the generated code (but not as much as the + declaration '%pic'), at the expense of one more test-and-branch + instruction at run time. + +'%define constants-prefix PREFIX' + Allows you to specify a prefix for the constants 'TOTAL_KEYWORDS', + 'MIN_WORD_LENGTH', 'MAX_WORD_LENGTH', and so on. This option + permits the use of two hash tables in the same file, even when the + option '-E' (or, equivalently, the '%enum' declaration) is not + given or the option '-G' (or, equivalently, the '%global-table' + declaration) is given. + +'%define word-array-name NAME' + Allows you to specify the name for the generated array containing + the hash table. Default name is 'wordlist'. This option permits + the use of two hash tables in the same file, even when the option + '-G' (or, equivalently, the '%global-table' declaration) is given. + +'%define length-table-name NAME' + Allows you to specify the name for the generated array containing + the length table. Default name is 'lengthtable'. This option + permits the use of two length tables in the same file, even when + the option '-G' (or, equivalently, the '%global-table' declaration) + is given. + +'%switch=COUNT' + Causes the generated C code to use a 'switch' statement scheme, + rather than an array lookup table. This can lead to a reduction in + both time and space requirements for some input files. The + argument to this option determines how many 'switch' statements are + generated. A value of 1 generates 1 'switch' containing all the + elements, a value of 2 generates 2 tables with 1/2 the elements in + each 'switch', etc. This is useful since many C compilers cannot + correctly generate code for large 'switch' statements. This option + was inspired in part by Keith Bostic's original C program. + +'%omit-struct-type' + Prevents the transfer of the type declaration to the output file. + Use this option if the type is already defined elsewhere. + + +File: gperf.info, Node: C Code Inclusion, Prev: Gperf Declarations, Up: Declarations + +3.1.1.3 C Code Inclusion +........................ + + Using a syntax similar to GNU utilities 'flex' and 'bison', it is +possible to directly include C source text and comments verbatim into +the generated output file. This is accomplished by enclosing the region +inside left-justified surrounding '%{', '%}' pairs. Here is an input +fragment based on the previous example that illustrates this feature: + + %{ + #include + /* This section of code is inserted directly into the output. */ + int return_month_days (struct month *months, int is_leap_year); + %} + struct month { char *name; int number; int days; int leap_days; }; + %% + january, 1, 31, 31 + february, 2, 28, 29 + march, 3, 31, 31 + ... + + +File: gperf.info, Node: Keywords, Next: Functions, Prev: Declarations, Up: Input Format + +3.1.2 Format for Keyword Entries +-------------------------------- + + The second input file format section contains lines of keywords and +any associated attributes you might supply. A line beginning with '#' +in the first column is considered a comment. Everything following the +'#' is ignored, up to and including the following newline. A line +beginning with '%' in the first column is an option declaration and must +not occur within the keywords section. + + The first field of each non-comment line is always the keyword +itself. It can be given in two ways: as a simple name, i.e., without +surrounding string quotation marks, or as a string enclosed in +double-quotes, in C syntax, possibly with backslash escapes like '\"' or +'\234' or '\xa8'. In either case, it must start right at the beginning +of the line, without leading whitespace. In this context, a "field" is +considered to extend up to, but not include, the first blank, comma, or +newline. Here is a simple example taken from a partial list of C +reserved words: + + # These are a few C reserved words, see the c.gperf file + # for a complete list of ANSI C reserved words. + unsigned + sizeof + switch + signed + if + default + for + while + return + + Note that unlike 'flex' or 'bison' the first '%%' marker may be +elided if the declaration section is empty. + + Additional fields may optionally follow the leading keyword. Fields +should be separated by commas, and terminate at the end of line. What +these fields mean is entirely up to you; they are used to initialize the +elements of the user-defined 'struct' provided by you in the declaration +section. If the '-t' option (or, equivalently, the '%struct-type' +declaration) is _not_ enabled these fields are simply ignored. All +previous examples except the last one contain keyword attributes. + + +File: gperf.info, Node: Functions, Next: Controls for GNU indent, Prev: Keywords, Up: Input Format + +3.1.3 Including Additional C Functions +-------------------------------------- + + The optional third section also corresponds closely with conventions +found in 'flex' and 'bison'. All text in this section, starting at the +final '%%' and extending to the end of the input file, is included +verbatim into the generated output file. Naturally, it is your +responsibility to ensure that the code contained in this section is +valid C. + + +File: gperf.info, Node: Controls for GNU indent, Prev: Functions, Up: Input Format + +3.1.4 Where to place directives for GNU 'indent'. +------------------------------------------------- + + If you want to invoke GNU 'indent' on a 'gperf' input file, you will +see that GNU 'indent' doesn't understand the '%%', '%{' and '%}' +directives that control 'gperf''s interpretation of the input file. +Therefore you have to insert some directives for GNU 'indent'. More +precisely, assuming the most general input file structure + + declarations part 1 + %{ + verbatim code + %} + declarations part 2 + %% + keywords + %% + functions + +you would insert '*INDENT-OFF*' and '*INDENT-ON*' comments as follows: + + /* *INDENT-OFF* */ + declarations part 1 + %{ + /* *INDENT-ON* */ + verbatim code + /* *INDENT-OFF* */ + %} + declarations part 2 + %% + keywords + %% + /* *INDENT-ON* */ + functions + + +File: gperf.info, Node: Output Format, Next: Binary Strings, Prev: Input Format, Up: Description + +3.2 Output Format for Generated C Code with 'gperf' +=================================================== + + Several options control how the generated C code appears on the +standard output. Two C functions are generated. They are called 'hash' +and 'in_word_set', although you may modify their names with a +command-line option. Both functions require two arguments, a string, +'char *' STR, and a length parameter, 'int' LEN. Their default function +prototypes are as follows: + + -- Function: unsigned int hash (const char * STR, size_t LEN) + By default, the generated 'hash' function returns an integer value + created by adding LEN to several user-specified STR byte positions + indexed into an "associated values" table stored in a local static + array. The associated values table is constructed internally by + 'gperf' and later output as a static local C array called + 'hash_table'. The relevant selected positions (i.e. indices into + STR) are specified via the '-k' option when running 'gperf', as + detailed in the _Options_ section below (*note Options::). + + -- Function: in_word_set (const char * STR, size_t LEN) + If STR is in the keyword set, returns a pointer to that keyword. + More exactly, if the option '-t' (or, equivalently, the + '%struct-type' declaration) was given, it returns a pointer to the + matching keyword's structure. Otherwise it returns 'NULL'. + + If the option '-c' (or, equivalently, the '%compare-strncmp' +declaration) is not used, STR must be a NUL terminated string of exactly +length LEN. If '-c' (or, equivalently, the '%compare-strncmp' +declaration) is used, STR must simply be an array of LEN bytes and does +not need to be NUL terminated. + + The code generated for these two functions is affected by the +following options: + +'-t' +'--struct-type' + Make use of the user-defined 'struct'. + +'-S TOTAL-SWITCH-STATEMENTS' +'--switch=TOTAL-SWITCH-STATEMENTS' + Generate 1 or more C 'switch' statement rather than use a large, + (and potentially sparse) static array. Although the exact time and + space savings of this approach vary according to your C compiler's + degree of optimization, this method often results in smaller and + faster code. + + If the '-t' and '-S' options (or, equivalently, the '%struct-type' +and '%switch' declarations) are omitted, the default action is to +generate a 'char *' array containing the keywords, together with +additional empty strings used for padding the array. By experimenting +with the various input and output options, and timing the resulting C +code, you can determine the best option choices for different keyword +set characteristics. + + +File: gperf.info, Node: Binary Strings, Next: Controlling Identifiers, Prev: Output Format, Up: Description + +3.3 Use of NUL bytes +==================== + + By default, the code generated by 'gperf' operates on zero terminated +strings, the usual representation of strings in C. This means that the +keywords in the input file must not contain NUL bytes, and the STR +argument passed to 'hash' or 'in_word_set' must be NUL terminated and +have exactly length LEN. + + If option '-c' (or, equivalently, the '%compare-strncmp' declaration) +is used, then the STR argument does not need to be NUL terminated. The +code generated by 'gperf' will only access the first LEN, not LEN+1, +bytes starting at STR. However, the keywords in the input file still +must not contain NUL bytes. + + If option '-l' (or, equivalently, the '%compare-lengths' declaration) +is used, then the hash table performs binary comparison. The keywords +in the input file may contain NUL bytes, written in string syntax as +'\000' or '\x00', and the code generated by 'gperf' will treat NUL like +any other byte. Also, in this case the '-c' option (or, equivalently, +the '%compare-strncmp' declaration) is ignored. + + +File: gperf.info, Node: Controlling Identifiers, Next: Output Copyright, Prev: Binary Strings, Up: Description + +3.4 Controlling Identifiers +=========================== + + The identifiers of the functions, tables, and constants defined by +the code generated by 'gperf' can be controlled through 'gperf' +declarations or the equivalent command-line options. This is useful for +three purposes: + + * Esthetics of the generated code. + + For this purpose, just use the available declarations or options at + will. + + * Controlling the exported identifiers of a library. + + Assume you include code generated by 'gperf' in a library, and to + avoid collisions with other libraries, you want to ensure that all + exported identifiers of this library start with a certain prefix. + + By default, the only exported identifier is the lookup function. + You can therefore use the option '-N' (or, equivalently, the + '%define lookup-function-name' declaration). + + When you use the option '-L C++' (or, equivalently, the + '%language=C++' declaration), the only exported entity is a class. + You control its name through the option '-Z' (or, equivalently, the + '%define class-name' declaration). + + * Allowing multiple 'gperf' generated codes in a single compilation + unit. + + Assume you invoke 'gperf' multiple times, with different input + files, and want the generated code to included from the same source + file. In this case, you have to customize not only the exported + identifiers, but also the names of functions with 'static' scope, + types, and constants. + + By default, you will have to deal with the lookup function, the + hash function, and the constants. You should therefore use the + option '-N' (or, equivalently, the '%define lookup-function-name' + declaration), the option '-H' (or, equivalently, the '%define + hash-function-name' declaration), and the option + '--constants-prefix' (or, equivalently, the '%define + constants-prefix' declaration). + + If you use the option '-G' (or, equivalently, the '%global-table' + declaration), you will also have to deal with the word array, the + length table if present, and the string pool if present. This + means: You should use the option '-W' (or, equivalently, the + '%define word-array-name' declaration). If you use the option '-l' + (or, equivalently, the '%compare-lengths' declaration), you should + use the option '--length-table-name' (or, equivalently, the + '%define length-table-name' declaration). If you use the option + '-P' (or, equivalently, the '%pic' declaration), you should use the + option '-Q' (or, equivalently, the '%define string-pool-name' + declaration). + + +File: gperf.info, Node: Output Copyright, Prev: Controlling Identifiers, Up: Description + +3.5 The Copyright of the Output +=============================== + + 'gperf' is under GPL, but that does not cause the output produced by +'gperf' to be under GPL. The reason is that the output contains only +small pieces of text that come directly from 'gperf''s source code - +only about 7 lines long, too small for being significant -, and +therefore the output is not a "work based on 'gperf'" (in the sense of +the GPL version 3). + + On the other hand, the output produced by 'gperf' contains +essentially all of the input file. Therefore the output is a +"derivative work" of the input (in the sense of U.S. copyright law); and +its copyright status depends on the copyright of the input. For most +software licenses, the result is that the the output is under the same +license, with the same copyright holder, as the input that was passed to +'gperf'. + + +File: gperf.info, Node: Options, Next: Bugs, Prev: Description, Up: Top + +4 Invoking 'gperf' +****************** + + There are _many_ options to 'gperf'. They were added to make the +program more convenient for use with real applications. "On-line" help +is readily available via the '--help' option. Here is the complete list +of options. + +* Menu: + +* Output File:: Specifying the Location of the Output File +* Input Details:: Options that affect Interpretation of the Input File +* Output Language:: Specifying the Language for the Output Code +* Output Details:: Fine tuning Details in the Output Code +* Algorithmic Details:: Changing the Algorithms employed by 'gperf' +* Verbosity:: Informative Output + + +File: gperf.info, Node: Output File, Next: Input Details, Prev: Options, Up: Options + +4.1 Specifying the Location of the Output File +============================================== + +'--output-file=FILE' + Allows you to specify the name of the file to which the output is + written to. + + The results are written to standard output if no output file is +specified or if it is '-'. + + +File: gperf.info, Node: Input Details, Next: Output Language, Prev: Output File, Up: Options + +4.2 Options that affect Interpretation of the Input File +======================================================== + + These options are also available as declarations in the input file +(*note Gperf Declarations::). + +'-e KEYWORD-DELIMITER-LIST' +'--delimiters=KEYWORD-DELIMITER-LIST' + Allows you to provide a string containing delimiters used to + separate keywords from their attributes. The default is ",". This + option is essential if you want to use keywords that have embedded + commas or newlines. One useful trick is to use -e'TAB', where TAB + is the literal tab character. + +'-t' +'--struct-type' + Allows you to include a 'struct' type declaration for generated + code. Any text before a pair of consecutive '%%' is considered + part of the type declaration. Keywords and additional fields may + follow this, one group of fields per line. A set of examples for + generating perfect hash tables and functions for Ada, C, C++, + Pascal, Modula 2, Modula 3 and JavaScript reserved words are + distributed with this release. + +'--ignore-case' + Consider upper and lower case ASCII characters as equivalent. The + string comparison will use a case insignificant character + comparison. Note that locale dependent case mappings are ignored. + This option is therefore not suitable if a properly + internationalized or locale aware case mapping should be used. + (For example, in a Turkish locale, the upper case equivalent of the + lowercase ASCII letter 'i' is the non-ASCII character 'capital i + with dot above'.) For this case, it is better to apply an + uppercase or lowercase conversion on the string before passing it + to the 'gperf' generated function. + + +File: gperf.info, Node: Output Language, Next: Output Details, Prev: Input Details, Up: Options + +4.3 Options to specify the Language for the Output Code +======================================================= + + These options are also available as declarations in the input file +(*note Gperf Declarations::). + +'-L GENERATED-LANGUAGE-NAME' +'--language=GENERATED-LANGUAGE-NAME' + Instructs 'gperf' to generate code in the language specified by the + option's argument. Languages handled are currently: + + 'KR-C' + Old-style K&R C. This language is understood by old-style C + compilers and ANSI C compilers, but ANSI C compilers may flag + warnings (or even errors) because of lacking 'const'. + + 'C' + Common C. This language is understood by ANSI C compilers, and + also by old-style C compilers, provided that you '#define + const' to empty for compilers which don't know about this + keyword. + + 'ANSI-C' + ANSI C. This language is understood by ANSI C compilers and + C++ compilers. + + 'C++' + C++. This language is understood by C++ compilers. + + The default is ANSI-C. + +'-a' + This option is supported for compatibility with previous releases + of 'gperf'. It does not do anything. + +'-g' + This option is supported for compatibility with previous releases + of 'gperf'. It does not do anything. + + +File: gperf.info, Node: Output Details, Next: Algorithmic Details, Prev: Output Language, Up: Options + +4.4 Options for fine tuning Details in the Output Code +====================================================== + + Most of these options are also available as declarations in the input +file (*note Gperf Declarations::). + +'-K SLOT-NAME' +'--slot-name=SLOT-NAME' + This option is only useful when option '-t' (or, equivalently, the + '%struct-type' declaration) has been given. By default, the + program assumes the structure component identifier for the keyword + is 'name'. This option allows an arbitrary choice of identifier + for this component, although it still must occur as the first field + in your supplied 'struct'. + +'-F INITIALIZERS' +'--initializer-suffix=INITIALIZERS' + This option is only useful when option '-t' (or, equivalently, the + '%struct-type' declaration) has been given. It permits to specify + initializers for the structure members following SLOT-NAME in empty + hash table entries. The list of initializers should start with a + comma. By default, the emitted code will zero-initialize structure + members following SLOT-NAME. + +'-H HASH-FUNCTION-NAME' +'--hash-function-name=HASH-FUNCTION-NAME' + Allows you to specify the name for the generated hash function. + Default name is 'hash'. This option permits the use of two hash + tables in the same file. + +'-N LOOKUP-FUNCTION-NAME' +'--lookup-function-name=LOOKUP-FUNCTION-NAME' + Allows you to specify the name for the generated lookup function. + Default name is 'in_word_set'. This option permits multiple + generated hash functions to be used in the same application. + +'-Z CLASS-NAME' +'--class-name=CLASS-NAME' + This option is only useful when option '-L C++' (or, equivalently, + the '%language=C++' declaration) has been given. It allows you to + specify the name of generated C++ class. Default name is + 'Perfect_Hash'. + +'-7' +'--seven-bit' + This option specifies that all strings that will be passed as + arguments to the generated hash function and the generated lookup + function will solely consist of 7-bit ASCII characters (bytes in + the range 0..127). (Note that the ANSI C functions 'isalnum' and + 'isgraph' do _not_ guarantee that a byte is in this range. Only an + explicit test like 'c >= 'A' && c <= 'Z'' guarantees this.) This + was the default in versions of 'gperf' earlier than 2.7; now the + default is to support 8-bit and multibyte characters. + +'-l' +'--compare-lengths' + Compare keyword lengths before trying a string comparison. This + option is mandatory for binary comparisons (*note Binary + Strings::). It also might cut down on the number of string + comparisons made during the lookup, since keywords with different + lengths are never compared via 'strcmp'. However, using '-l' might + greatly increase the size of the generated C code if the lookup + table range is large (which implies that the switch option '-S' or + '%switch' is not enabled), since the length table contains as many + elements as there are entries in the lookup table. + +'-c' +'--compare-strncmp' + Generates C code that uses the 'strncmp' function to perform string + comparisons. The default action is to use 'strcmp'. + +'-C' +'--readonly-tables' + Makes the contents of all generated lookup tables constant, i.e., + "readonly". Many compilers can generate more efficient code for + this by putting the tables in readonly memory. + +'-E' +'--enum' + Define constant values using an enum local to the lookup function + rather than with #defines. This also means that different lookup + functions can reside in the same file. Thanks to James Clark + ''. + +'-I' +'--includes' + Include the necessary system include file, '', at the + beginning of the code. By default, this is not done; the user must + include this header file himself to allow compilation of the code. + +'-G' +'--global-table' + Generate the static table of keywords as a static global variable, + rather than hiding it inside of the lookup function (which is the + default behavior). + +'-P' +'--pic' + Optimize the generated table for inclusion in shared libraries. + This reduces the startup time of programs using a shared library + containing the generated code. If the option '-t' (or, + equivalently, the '%struct-type' declaration) is also given, the + first field of the user-defined struct must be of type 'int', not + 'char *', because it will contain offsets into the string pool + instead of actual strings. To convert such an offset to a string, + you can use the expression 'stringpool + O', where O is the offset. + The string pool name can be changed through the option + '--string-pool-name'. + +'-Q STRING-POOL-NAME' +'--string-pool-name=STRING-POOL-NAME' + Allows you to specify the name of the generated string pool created + by option '-P'. The default name is 'stringpool'. This option + permits the use of two hash tables in the same file, with '-P' and + even when the option '-G' (or, equivalently, the '%global-table' + declaration) is given. + +'--null-strings' + Use NULL strings instead of empty strings for empty keyword table + entries. This reduces the startup time of programs using a shared + library containing the generated code (but not as much as option + '-P'), at the expense of one more test-and-branch instruction at + run time. + +'--constants-prefix=PREFIX' + Allows you to specify a prefix for the constants 'TOTAL_KEYWORDS', + 'MIN_WORD_LENGTH', 'MAX_WORD_LENGTH', and so on. This option + permits the use of two hash tables in the same file, even when the + option '-E' (or, equivalently, the '%enum' declaration) is not + given or the option '-G' (or, equivalently, the '%global-table' + declaration) is given. + +'-W HASH-TABLE-ARRAY-NAME' +'--word-array-name=HASH-TABLE-ARRAY-NAME' + Allows you to specify the name for the generated array containing + the hash table. Default name is 'wordlist'. This option permits + the use of two hash tables in the same file, even when the option + '-G' (or, equivalently, the '%global-table' declaration) is given. + +'--length-table-name=LENGTH-TABLE-ARRAY-NAME' + Allows you to specify the name for the generated array containing + the length table. Default name is 'lengthtable'. This option + permits the use of two length tables in the same file, even when + the option '-G' (or, equivalently, the '%global-table' declaration) + is given. + +'-S TOTAL-SWITCH-STATEMENTS' +'--switch=TOTAL-SWITCH-STATEMENTS' + Causes the generated C code to use a 'switch' statement scheme, + rather than an array lookup table. This can lead to a reduction in + both time and space requirements for some input files. The + argument to this option determines how many 'switch' statements are + generated. A value of 1 generates 1 'switch' containing all the + elements, a value of 2 generates 2 tables with 1/2 the elements in + each 'switch', etc. This is useful since many C compilers cannot + correctly generate code for large 'switch' statements. This option + was inspired in part by Keith Bostic's original C program. + +'-T' +'--omit-struct-type' + Prevents the transfer of the type declaration to the output file. + Use this option if the type is already defined elsewhere. + +'-p' + This option is supported for compatibility with previous releases + of 'gperf'. It does not do anything. + + +File: gperf.info, Node: Algorithmic Details, Next: Verbosity, Prev: Output Details, Up: Options + +4.5 Options for changing the Algorithms employed by 'gperf' +=========================================================== + +'-k SELECTED-BYTE-POSITIONS' +'--key-positions=SELECTED-BYTE-POSITIONS' + Allows selection of the byte positions used in the keywords' hash + function. The allowable choices range between 1-255, inclusive. + The positions are separated by commas, e.g., '-k 9,4,13,14'; ranges + may be used, e.g., '-k 2-7'; and positions may occur in any order. + Furthermore, the wildcard '*' causes the generated hash function to + consider *all* byte positions in each keyword, whereas '$' + instructs the hash function to use the "final byte" of a keyword + (this is the only way to use a byte position greater than 255, + incidentally). + + For instance, the option '-k 1,2,4,6-10,'$'' generates a hash + function that considers positions 1,2,4,6,7,8,9,10, plus the last + byte in each keyword (which may be at a different position for each + keyword, obviously). Keywords with length less than the indicated + byte positions work properly, since selected byte positions + exceeding the keyword length are simply not referenced in the hash + function. + + This option is not normally needed since version 2.8 of 'gperf'; + the default byte positions are computed depending on the keyword + set, through a search that minimizes the number of byte positions. + +'-D' +'--duplicates' + Handle keywords whose selected byte sets hash to duplicate values. + Duplicate hash values can occur if a set of keywords has the same + names, but possesses different attributes, or if the selected byte + positions are not well chosen. With the -D option 'gperf' treats + all these keywords as part of an equivalence class and generates a + perfect hash function with multiple comparisons for duplicate + keywords. It is up to you to completely disambiguate the keywords + by modifying the generated C code. However, 'gperf' helps you out + by organizing the output. + + Using this option usually means that the generated hash function is + no longer perfect. On the other hand, it permits 'gperf' to work + on keyword sets that it otherwise could not handle. + +'-m ITERATIONS' +'--multiple-iterations=ITERATIONS' + Perform multiple choices of the '-i' and '-j' values, and choose + the best results. This increases the running time by a factor of + ITERATIONS but does a good job minimizing the generated table size. + +'-i INITIAL-VALUE' +'--initial-asso=INITIAL-VALUE' + Provides an initial VALUE for the associate values array. Default + is 0. Increasing the initial value helps inflate the final table + size, possibly leading to more time efficient keyword lookups. + Note that this option is not particularly useful when '-S' (or, + equivalently, '%switch') is used. Also, '-i' is overridden when + the '-r' option is used. + +'-j JUMP-VALUE' +'--jump=JUMP-VALUE' + Affects the "jump value", i.e., how far to advance the associated + byte value upon collisions. JUMP-VALUE is rounded up to an odd + number, the default is 5. If the JUMP-VALUE is 0 'gperf' jumps by + random amounts. + +'-n' +'--no-strlen' + Instructs the generator not to include the length of a keyword when + computing its hash value. This may save a few assembly + instructions in the generated lookup table. + +'-r' +'--random' + Utilizes randomness to initialize the associated values table. + This frequently generates solutions faster than using deterministic + initialization (which starts all associated values at 0). + Furthermore, using the randomization option generally increases the + size of the table. + +'-s SIZE-MULTIPLE' +'--size-multiple=SIZE-MULTIPLE' + Affects the size of the generated hash table. The numeric argument + for this option indicates "how many times larger or smaller" the + maximum associated value range should be, in relationship to the + number of keywords. It can be written as an integer, a + floating-point number or a fraction. For example, a value of 3 + means "allow the maximum associated value to be about 3 times + larger than the number of input keywords". Conversely, a value of + 1/3 means "allow the maximum associated value to be about 3 times + smaller than the number of input keywords". Values smaller than 1 + are useful for limiting the overall size of the generated hash + table, though the option '-m' is better at this purpose. + + If 'generate switch' option '-S' (or, equivalently, '%switch') is + _not_ enabled, the maximum associated value influences the static + array table size, and a larger table should decrease the time + required for an unsuccessful search, at the expense of extra table + space. + + The default value is 1, thus the default maximum associated value + about the same size as the number of keywords (for efficiency, the + maximum associated value is always rounded up to a power of 2). + The actual table size may vary somewhat, since this technique is + essentially a heuristic. + + +File: gperf.info, Node: Verbosity, Prev: Algorithmic Details, Up: Options + +4.6 Informative Output +====================== + +'-h' +'--help' + Prints a short summary on the meaning of each program option. + Aborts further program execution. + +'-v' +'--version' + Prints out the current version number. + +'-d' +'--debug' + Enables the debugging option. This produces verbose diagnostics to + "standard error" when 'gperf' is executing. It is useful both for + maintaining the program and for determining whether a given set of + options is actually speeding up the search for a solution. Some + useful information is dumped at the end of the program when the + '-d' option is enabled. + + +File: gperf.info, Node: Bugs, Next: Projects, Prev: Options, Up: Top + +5 Known Bugs and Limitations with 'gperf' +***************************************** + + The following are some limitations with the current release of +'gperf': + + * The 'gperf' utility is tuned to execute quickly, and works quickly + for small to medium size data sets (around 1000 keywords). It is + extremely useful for maintaining perfect hash functions for + compiler keyword sets. Several recent enhancements now enable + 'gperf' to work efficiently on much larger keyword sets (over + 15,000 keywords). When processing large keyword sets it helps + greatly to have over 8 megs of RAM. + + * The size of the generate static keyword array can get _extremely_ + large if the input keyword file is large or if the keywords are + quite similar. This tends to slow down the compilation of the + generated C code, and _greatly_ inflates the object code size. If + this situation occurs, consider using the '-S' option to reduce + data size, potentially increasing keyword recognition time a + negligible amount. Since many C compilers cannot correctly + generate code for large switch statements it is important to + qualify the -S option with an appropriate numerical argument that + controls the number of switch statements generated. + + * The maximum number of selected byte positions has an arbitrary + limit of 255. This restriction should be removed, and if anyone + considers this a problem write me and let me know so I can remove + the constraint. + + +File: gperf.info, Node: Projects, Next: Bibliography, Prev: Bugs, Up: Top + +6 Things Still Left to Do +************************* + + It should be "relatively" easy to replace the current perfect hash +function algorithm with a more exhaustive approach; the perfect hash +module is essential independent from other program modules. Additional +worthwhile improvements include: + + * Another useful extension involves modifying the program to generate + "minimal" perfect hash functions (under certain circumstances, the + current version can be rather extravagant in the generated table + size). This is mostly of theoretical interest, since a sparse + table often produces faster lookups, and use of the '-S' 'switch' + option can minimize the data size, at the expense of slightly + longer lookups (note that the gcc compiler generally produces good + code for 'switch' statements, reducing the need for more complex + schemes). + + * In addition to improving the algorithm, it would also be useful to + generate an Ada package as the code output, in addition to the + current C and C++ routines. + + +File: gperf.info, Node: Bibliography, Next: Concept Index, Prev: Projects, Up: Top + +7 Bibliography +************** + +[1] Chang, C.C.: A Scheme for Constructing Ordered Minimal Perfect +Hashing Functions Information Sciences 39(1986), 187-195. + +[2] Cichelli, Richard J. Author's Response to "On Cichelli's Minimal +Perfect Hash Functions Method" Communications of the ACM, 23, +12(December 1980), 729. + +[3] Cichelli, Richard J. Minimal Perfect Hash Functions Made Simple +Communications of the ACM, 23, 1(January 1980), 17-19. + +[4] Cook, C. R. and Oldehoeft, R.R. A Letter Oriented Minimal Perfect +Hashing Function SIGPLAN Notices, 17, 9(September 1982), 18-27. + +[5] Cormack, G. V. and Horspool, R. N. S. and Kaiserwerth, M. Practical +Perfect Hashing Computer Journal, 28, 1(January 1985), 54-58. + +[6] Jaeschke, G. Reciprocal Hashing: A Method for Generating Minimal +Perfect Hashing Functions Communications of the ACM, 24, 12(December +1981), 829-833. + +[7] Jaeschke, G. and Osterburg, G. On Cichelli's Minimal Perfect Hash +Functions Method Communications of the ACM, 23, 12(December 1980), +728-729. + +[8] Sager, Thomas J. A Polynomial Time Generator for Minimal Perfect +Hash Functions Communications of the ACM, 28, 5(December 1985), 523-532 + +[9] Schmidt, Douglas C. GPERF: A Perfect Hash Function Generator Second +USENIX C++ Conference Proceedings, April 1990. + +[10] Schmidt, Douglas C. GPERF: A Perfect Hash Function Generator C++ +Report, SIGS 10 10 (November/December 1998). + +[11] Sebesta, R.W. and Taylor, M.A. Minimal Perfect Hash Functions for +Reserved Word Lists SIGPLAN Notices, 20, 12(September 1985), 47-53. + +[12] Sprugnoli, R. Perfect Hashing Functions: A Single Probe Retrieving +Method for Static Sets Communications of the ACM, 20 11(November 1977), +841-850. + +[13] Stallman, Richard M. Using and Porting GNU CC Free Software +Foundation, 1988. + +[14] Stroustrup, Bjarne The C++ Programming Language. Addison-Wesley, +1986. + +[15] Tiemann, Michael D. User's Guide to GNU C++ Free Software +Foundation, 1989. + + +File: gperf.info, Node: Concept Index, Prev: Bibliography, Up: Top + +Concept Index +************* + +