diff --git a/.gitignore b/.gitignore index 866695e..8831d85 100644 --- a/.gitignore +++ b/.gitignore @@ -32,10 +32,6 @@ autom4te.cache autom4te.cache/* src/.deps/ -# Binaries -src/vcfast -src/bcfast -src/tinyfast -src/bgzip -src/tabix - +# Extra files +resources +resources/* diff --git a/LICENSE b/LICENSE index 94a9ed0..261eeb9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,674 +1,201 @@ - 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 -. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Makefile b/Makefile index 11aa512..0c326d3 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # Makefile. Generated from Makefile.in by configure. -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/apigenome pkgincludedir = $(includedir)/apigenome pkglibdir = $(libdir)/apigenome @@ -31,18 +75,12 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.vars \ - $(srcdir)/config.h.in $(top_srcdir)/configure config.guess \ - config.sub depcomp install-sh ltmain.sh missing subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -51,22 +89,62 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -77,6 +155,7 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -104,43 +183,27 @@ am__relativize = \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run aclocal-1.11 +ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing aclocal-1.14 AMTAR = $${TAR-tar} -AR = ar -AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoconf -AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoheader -AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run automake-1.11 +AM_DEFAULT_VERBOSITY = 1 +AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing autoconf +AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing autoheader +AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing automake-1.14 AWK = gawk CAT_CHECK = yes -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = CUT_CHECK = yes -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps DIRNAME_CHECK = yes -DLLTOOL = false -DSYMUTIL = -DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F GNUPLOT_CHECK = yes -GREP = /bin/grep GREP_CHECK = yes GROFF_CHECK = yes GS_CHECK = yes @@ -150,78 +213,49 @@ INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = LIBOBJS = -LIBS = -lz -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIPO = -LN_S = ln -s +LIBS = LTLIBOBJS = -MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run makeinfo +MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing makeinfo MAKE_CHECK = yes -MANIFEST_TOOL = : MKDIR_CHECK = yes MKDIR_P = /bin/mkdir -p MV_CHECK = yes -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = PACKAGE = apigenome PACKAGE_BUGREPORT = hmkang@umich.edu PACKAGE_NAME = apigenome -PACKAGE_STRING = apigenome 0.0.2 +PACKAGE_STRING = apigenome 0.2.0 PACKAGE_TARNAME = apigenome PACKAGE_URL = -PACKAGE_VERSION = 0.0.2 +PACKAGE_VERSION = 0.2.0 PATH_SEPARATOR = : PERL_CHECK = yes PFBTOPS_CHECK = yes -POW_LIB = -RANLIB = ranlib RM_CHECK = yes RSCRIPT_CHECK = yes R_CHECK = yes -SED = /bin/sed SET_MAKE = SHELL = /bin/sh SORT_CHECK = yes -STRIP = strip -VERSION = 0.0.2 +STRIP = +VERSION = 0.2.0 ZCAT_CHECK = yes abs_builddir = /home/hmkang/code/working/apigenome.master abs_srcdir = /home/hmkang/code/working/apigenome.master abs_top_builddir = /home/hmkang/code/working/apigenome.master abs_top_srcdir = /home/hmkang/code/working/apigenome.master -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_DUMPBIN = -am__include = include am__leading_dot = . -am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info @@ -231,10 +265,10 @@ libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p +mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /net/fantasia/home/hmkang/bin/apigenome +prefix = /net/fantasia/home/hmkang/tools/apigenome.master program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin @@ -247,17 +281,14 @@ top_builddir = . top_srcdir = . ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AUTOMAKE_OPTIONS = foreign -SUBDIRS = src data scripts -YAML = YAML-LibYAML-0.59 -JSON = JSON-2.90 -CONFIG = YAML-AppConfig-0.19 +SUBDIRS = data scripts all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.vars $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -280,7 +311,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/Makefile.vars: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -292,8 +322,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -306,32 +336,26 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt - # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -346,57 +370,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -412,12 +391,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -429,15 +403,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -446,9 +416,31 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -484,13 +476,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -519,40 +508,42 @@ distdir: $(DISTFILES) || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -563,8 +554,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -576,18 +565,19 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -610,7 +600,7 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -677,13 +667,12 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive @@ -704,8 +693,7 @@ install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + install-html: install-html-recursive install-html-am: @@ -734,7 +722,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-generic pdf: pdf-recursive @@ -746,30 +734,29 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-exec-am install-strip \ - tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - - -install-exec-hook: - cd data && rm -rf $(CONFIG) && tar xzvf $(CONFIG).tar.gz; cd $(CONFIG) && perl Makefile.PL INSTALL_BASE=$(prefix) && make && make test && make install +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +#include Makefile.vars + +#install-exec-hook: +# cd data && rm -rf $(CONFIG) && tar xzvf $(CONFIG).tar.gz; cd $(CONFIG) && perl Makefile.PL INSTALL_BASE=$(prefix) && make && make test && make install # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/Makefile.am b/Makefile.am index f0e611e..4a1b3a6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,9 +4,9 @@ ## files, in order to avoid collisions when non-recursive make is used. ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AUTOMAKE_OPTIONS = foreign -SUBDIRS = src data scripts +SUBDIRS = data scripts -include Makefile.vars +#include Makefile.vars -install-exec-hook: - cd data && rm -rf $(CONFIG) && tar xzvf $(CONFIG).tar.gz; cd $(CONFIG) && perl Makefile.PL INSTALL_BASE=$(prefix) && make && make test && make install +#install-exec-hook: +# cd data && rm -rf $(CONFIG) && tar xzvf $(CONFIG).tar.gz; cd $(CONFIG) && perl Makefile.PL INSTALL_BASE=$(prefix) && make && make test && make install diff --git a/Makefile.in b/Makefile.in index b106413..3202512 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -31,18 +75,12 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.vars \ - $(srcdir)/config.h.in $(top_srcdir)/configure config.guess \ - config.sub depcomp install-sh ltmain.sh missing subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -51,22 +89,62 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -77,6 +155,7 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -104,43 +183,27 @@ am__relativize = \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ -AR = @AR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT_CHECK = @CAT_CHECK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ CUT_CHECK = @CUT_CHECK@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ -DEPDIR = @DEPDIR@ DIRNAME_CHECK = @DIRNAME_CHECK@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ GNUPLOT_CHECK = @GNUPLOT_CHECK@ -GREP = @GREP@ GREP_CHECK = @GREP_CHECK@ GROFF_CHECK = @GROFF_CHECK@ GS_CHECK = @GS_CHECK@ @@ -150,26 +213,14 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_CHECK = @MAKE_CHECK@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_CHECK = @MKDIR_CHECK@ MKDIR_P = @MKDIR_P@ MV_CHECK = @MV_CHECK@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -180,12 +231,9 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_CHECK = @PERL_CHECK@ PFBTOPS_CHECK = @PFBTOPS_CHECK@ -POW_LIB = @POW_LIB@ -RANLIB = @RANLIB@ RM_CHECK = @RM_CHECK@ RSCRIPT_CHECK = @RSCRIPT_CHECK@ R_CHECK = @R_CHECK@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT_CHECK = @SORT_CHECK@ @@ -196,32 +244,18 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ -build = @build@ build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ -host = @host@ host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ @@ -247,17 +281,14 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AUTOMAKE_OPTIONS = foreign -SUBDIRS = src data scripts -YAML = YAML-LibYAML-0.59 -JSON = JSON-2.90 -CONFIG = YAML-AppConfig-0.19 +SUBDIRS = data scripts all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Makefile.vars $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -280,7 +311,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/Makefile.vars: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -292,8 +322,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -306,32 +336,26 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt - # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -346,57 +370,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -412,12 +391,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -429,15 +403,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -446,9 +416,31 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -484,13 +476,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -519,40 +508,42 @@ distdir: $(DISTFILES) || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -563,8 +554,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -576,18 +565,19 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -610,7 +600,7 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -677,13 +667,12 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive @@ -704,8 +693,7 @@ install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + install-html: install-html-recursive install-html-am: @@ -734,7 +722,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-generic pdf: pdf-recursive @@ -746,30 +734,29 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-exec-am install-strip \ - tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - - -install-exec-hook: - cd data && rm -rf $(CONFIG) && tar xzvf $(CONFIG).tar.gz; cd $(CONFIG) && perl Makefile.PL INSTALL_BASE=$(prefix) && make && make test && make install +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +#include Makefile.vars + +#install-exec-hook: +# cd data && rm -rf $(CONFIG) && tar xzvf $(CONFIG).tar.gz; cd $(CONFIG) && perl Makefile.PL INSTALL_BASE=$(prefix) && make && make test && make install # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/Makefile.vars b/Makefile.vars deleted file mode 100644 index 7056336..0000000 --- a/Makefile.vars +++ /dev/null @@ -1,3 +0,0 @@ -YAML = YAML-LibYAML-0.59 -JSON = JSON-2.90 -CONFIG = YAML-AppConfig-0.19 \ No newline at end of file diff --git a/aclocal.m4 b/aclocal.m4 index 2dd8f06..36d12bb 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,33 +11,31 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,24 +51,22 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -90,7 +85,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -114,322 +109,23 @@ AC_PREREQ([2.50])dnl am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 12 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 5 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -442,7 +138,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -471,31 +167,40 @@ AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -506,34 +211,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -555,15 +304,12 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -577,16 +323,14 @@ if test x"${install_sh}" != xset; then install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -600,69 +344,14 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -670,11 +359,10 @@ AC_DEFUN([AM_MISSING_PROG], $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -687,54 +375,22 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -744,7 +400,7 @@ AC_DEFUN([_AM_MANGLE_OPTION], # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -760,22 +416,16 @@ AC_DEFUN([_AM_IF_OPTION], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -786,32 +436,40 @@ case `pwd` in esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -821,46 +479,118 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -874,18 +604,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -895,82 +623,115 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/libtool.m4]) -m4_include([m4/ltoptions.m4]) -m4_include([m4/ltsugar.m4]) -m4_include([m4/ltversion.m4]) -m4_include([m4/lt~obsolete.m4]) diff --git a/config.guess b/config.guess deleted file mode 120000 index 405bc32..0000000 --- a/config.guess +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.11/config.guess \ No newline at end of file diff --git a/config.h b/config.h index 4de0d3c..24064a1 100644 --- a/config.h +++ b/config.h @@ -1,107 +1,6 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* libm includes erf */ -#define HAVE_ERF 1 - -/* libm includes erfc */ -#define HAVE_ERFC 1 - -/* Define to 1 if you have the `floor' function. */ -/* #undef HAVE_FLOOR */ - -/* Define to 1 if you have the `gethostname' function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `z' library (-lz). */ -#define HAVE_LIBZ 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#define HAVE_MALLOC 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the `pow' function. */ -/* #undef HAVE_POW */ - -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#define HAVE_PTRDIFF_T 1 - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#define HAVE_REALLOC 1 - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the `sqrt' function. */ -/* #undef HAVE_SQRT */ - -/* Define to 1 if stdbool.h conforms to C99. */ -#define HAVE_STDBOOL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strstr' function. */ -#define HAVE_STRSTR 1 - -/* Define to 1 if you have the `strtol' function. */ -#define HAVE_STRTOL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if the system has the type `_Bool'. */ -#define HAVE__BOOL 1 - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Define to 1 if `major', `minor', and `makedev' are declared in . - */ -/* #undef MAJOR_IN_MKDEV */ - -/* Define to 1 if `major', `minor', and `makedev' are declared in - . */ -/* #undef MAJOR_IN_SYSMACROS */ - /* Name of package */ #define PACKAGE "apigenome" @@ -112,7 +11,7 @@ #define PACKAGE_NAME "apigenome" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "apigenome 0.0.2" +#define PACKAGE_STRING "apigenome 0.2.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "apigenome" @@ -121,78 +20,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.0.2" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 +#define PACKAGE_VERSION "0.2.0" /* Version number of package */ -#define VERSION "0.0.2" - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT32_T */ - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT64_T */ - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT8_T */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int32_t */ - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int64_t */ - -/* Define to rpl_malloc if the replacement function should be used. */ -/* #undef malloc */ - -/* Define to rpl_realloc if the replacement function should be used. */ -/* #undef realloc */ - -/* Define to the equivalent of the C99 'restrict' keyword, or to - nothing if this is not supported. Do not define if restrict is - supported directly. */ -#define restrict __restrict -/* Work around a bug in Sun C++: it does not support _Restrict or - __restrict__, even though the corresponding Sun C compiler ends up with - "#define restrict _Restrict" or "#define restrict __restrict__" in the - previous line. Perhaps some future version of Sun C++ will work with - restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ -#if defined __SUNPRO_CC && !defined __RESTRICT -# define _Restrict -# define __restrict__ -#endif - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint16_t */ - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint32_t */ - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint64_t */ - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint8_t */ +#define VERSION "0.2.0" diff --git a/config.h.in b/config.h.in index d9c507d..dd3b02c 100644 --- a/config.h.in +++ b/config.h.in @@ -1,106 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* libm includes erf */ -#undef HAVE_ERF - -/* libm includes erfc */ -#undef HAVE_ERFC - -/* Define to 1 if you have the `floor' function. */ -#undef HAVE_FLOOR - -/* Define to 1 if you have the `gethostname' function. */ -#undef HAVE_GETHOSTNAME - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `z' library (-lz). */ -#undef HAVE_LIBZ - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the `pow' function. */ -#undef HAVE_POW - -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#undef HAVE_PTRDIFF_T - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the `sqrt' function. */ -#undef HAVE_SQRT - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Define to 1 if `major', `minor', and `makedev' are declared in . - */ -#undef MAJOR_IN_MKDEV - -/* Define to 1 if `major', `minor', and `makedev' are declared in - . */ -#undef MAJOR_IN_SYSMACROS - /* Name of package */ #undef PACKAGE @@ -122,76 +21,5 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - /* Version number of package */ #undef VERSION - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT8_T - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to the equivalent of the C99 'restrict' keyword, or to - nothing if this is not supported. Do not define if restrict is - supported directly. */ -#undef restrict -/* Work around a bug in Sun C++: it does not support _Restrict or - __restrict__, even though the corresponding Sun C compiler ends up with - "#define restrict _Restrict" or "#define restrict __restrict__" in the - previous line. Perhaps some future version of Sun C++ will work with - restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ -#if defined __SUNPRO_CC && !defined __RESTRICT -# define _Restrict -# define __restrict__ -#endif - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef uint16_t - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -#undef uint8_t diff --git a/config.log b/config.log index c319eac..3924f6f 100644 --- a/config.log +++ b/config.log @@ -1,10 +1,10 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by apigenome configure 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by apigenome configure 0.2.0, which was +generated by GNU Autoconf 2.69. Invocation command line was - $ ./configure --prefix /net/fantasia/home/hmkang/bin/apigenome/ --no-create --no-recursion + $ ./configure --prefix=/net/fantasia/home/hmkang/tools/apigenome.master ## --------- ## ## Platform. ## @@ -12,9 +12,9 @@ generated by GNU Autoconf 2.68. Invocation command line was hostname = fantasia uname -m = x86_64 -uname -r = 3.4.61 +uname -r = 3.13.0-143-generic uname -s = Linux -uname -v = #1 SMP Tue Sep 10 16:49:43 EDT 2013 +uname -v = #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 /usr/bin/uname -p = unknown /bin/uname -X = unknown @@ -27,6 +27,7 @@ uname -v = #1 SMP Tue Sep 10 16:49:43 EDT 2013 /usr/bin/oslevel = unknown /bin/universe = unknown +PATH: /usr/cluster/software/trusty/perl/5.18.2/bin PATH: /home/hmkang/bin PATH: /usr/local/sbin PATH: /usr/local/bin @@ -35,7 +36,12 @@ PATH: /usr/bin PATH: /sbin PATH: /bin PATH: /usr/games +PATH: /usr/local/games PATH: /usr/cluster/bin +PATH: /usr/lib/jvm/java-8-oracle/bin +PATH: /usr/lib/jvm/java-8-oracle/db/bin +PATH: /usr/lib/jvm/java-8-oracle/jre/bin +PATH: /opt/puppetlabs/bin PATH: /net/fantasia/home/hmkang/bin PATH: /net/fantasia/home/hmkang/.local/bin PATH: /usr/cluster/bin @@ -46,1436 +52,113 @@ PATH: /net/fantasia/home/hmkang/tools/scala/bin ## Core tests. ## ## ----------- ## -configure:2557: checking for a BSD-compatible install -configure:2625: result: /usr/bin/install -c -configure:2636: checking whether build environment is sane -configure:2686: result: yes -configure:2827: checking for a thread-safe mkdir -p -configure:2866: result: /bin/mkdir -p -configure:2879: checking for gawk -configure:2895: found /usr/bin/gawk -configure:2906: result: gawk -configure:2917: checking whether make sets $(MAKE) -configure:2939: result: yes -configure:3052: checking build system type -configure:3066: result: x86_64-unknown-linux-gnu -configure:3086: checking host system type -configure:3099: result: x86_64-unknown-linux-gnu -configure:3140: checking how to print strings -configure:3167: result: printf -configure:3200: checking for style of include used by make -configure:3228: result: GNU -configure:3299: checking for gcc -configure:3315: found /usr/bin/gcc -configure:3326: result: gcc -configure:3555: checking for C compiler version -configure:3564: gcc --version >&5 -gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1 -Copyright (C) 2013 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +configure:1775: checking for a BSD-compatible install +configure:1843: result: /usr/bin/install -c +configure:1854: checking whether build environment is sane +configure:1909: result: yes +configure:2060: checking for a thread-safe mkdir -p +configure:2099: result: /bin/mkdir -p +configure:2106: checking for gawk +configure:2122: found /usr/bin/gawk +configure:2133: result: gawk +configure:2144: checking whether make sets $(MAKE) +configure:2166: result: yes +configure:2195: checking whether make supports nested variables +configure:2212: result: yes +configure:2342: checking for perl +configure:2358: found /usr/bin/perl +configure:2369: result: yes +configure:2384: checking for gs +configure:2400: found /usr/bin/gs +configure:2411: result: yes +configure:2426: checking for Rscript +configure:2442: found /usr/bin/Rscript +configure:2453: result: yes +configure:2468: checking for R +configure:2484: found /usr/bin/R +configure:2495: result: yes +configure:2510: checking for grep +configure:2526: found /bin/grep +configure:2537: result: yes +configure:2552: checking for mv +configure:2568: found /bin/mv +configure:2579: result: yes +configure:2594: checking for rm +configure:2610: found /bin/rm +configure:2621: result: yes +configure:2636: checking for make +configure:2652: found /usr/bin/make +configure:2663: result: yes +configure:2678: checking for cat +configure:2694: found /bin/cat +configure:2705: result: yes +configure:2720: checking for cut +configure:2736: found /usr/bin/cut +configure:2747: result: yes +configure:2762: checking for dirname +configure:2778: found /usr/bin/dirname +configure:2789: result: yes +configure:2804: checking for head +configure:2820: found /usr/bin/head +configure:2831: result: yes +configure:2846: checking for mkdir +configure:2862: found /bin/mkdir +configure:2873: result: yes +configure:2888: checking for sort +configure:2904: found /usr/bin/sort +configure:2915: result: yes +configure:2930: checking for zcat +configure:2946: found /bin/zcat +configure:2957: result: yes +configure:2972: checking for groff +configure:2988: found /home/hmkang/bin/groff +configure:2999: result: yes +configure:3014: checking for pfbtops +configure:3030: found /home/hmkang/bin/pfbtops +configure:3041: result: yes +configure:3056: checking for gnuplot +configure:3072: found /home/hmkang/bin/gnuplot +configure:3083: result: yes +configure:3206: checking that generated files are newer than configure +configure:3212: result: done +configure:3220: creating ./config.status -configure:3575: $? = 0 -configure:3564: gcc -v >&5 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper -Target: x86_64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.1-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu -Thread model: posix -gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04) -configure:3575: $? = 0 -configure:3564: gcc -V >&5 -gcc: error: unrecognized command line option '-V' -gcc: fatal error: no input files -compilation terminated. -configure:3575: $? = 4 -configure:3564: gcc -qversion >&5 -gcc: error: unrecognized command line option '-qversion' -gcc: fatal error: no input files -compilation terminated. -configure:3575: $? = 4 -configure:3595: checking whether the C compiler works -configure:3617: gcc conftest.c >&5 -configure:3621: $? = 0 -configure:3669: result: yes -configure:3672: checking for C compiler default output file name -configure:3674: result: a.out -configure:3680: checking for suffix of executables -configure:3687: gcc -o conftest conftest.c >&5 -configure:3691: $? = 0 -configure:3713: result: -configure:3735: checking whether we are cross compiling -configure:3743: gcc -o conftest conftest.c >&5 -configure:3747: $? = 0 -configure:3754: ./conftest -configure:3758: $? = 0 -configure:3773: result: no -configure:3778: checking for suffix of object files -configure:3800: gcc -c conftest.c >&5 -configure:3804: $? = 0 -configure:3825: result: o -configure:3829: checking whether we are using the GNU C compiler -configure:3848: gcc -c conftest.c >&5 -configure:3848: $? = 0 -configure:3857: result: yes -configure:3866: checking whether gcc accepts -g -configure:3886: gcc -c -g conftest.c >&5 -configure:3886: $? = 0 -configure:3927: result: yes -configure:3944: checking for gcc option to accept ISO C89 -configure:4008: gcc -c -g -O2 conftest.c >&5 -configure:4008: $? = 0 -configure:4021: result: none needed -configure:4043: checking dependency style of gcc -configure:4154: result: gcc3 -configure:4169: checking for a sed that does not truncate output -configure:4233: result: /bin/sed -configure:4251: checking for grep that handles long lines and -e -configure:4309: result: /bin/grep -configure:4314: checking for egrep -configure:4376: result: /bin/grep -E -configure:4381: checking for fgrep -configure:4443: result: /bin/grep -F -configure:4478: checking for ld used by gcc -configure:4545: result: /usr/bin/ld -configure:4552: checking if the linker (/usr/bin/ld) is GNU ld -configure:4567: result: yes -configure:4579: checking for BSD- or MS-compatible name lister (nm) -configure:4628: result: /usr/bin/nm -B -configure:4758: checking the name lister (/usr/bin/nm -B) interface -configure:4765: gcc -c -g -O2 conftest.c >&5 -configure:4768: /usr/bin/nm -B "conftest.o" -configure:4771: output -0000000000000000 B some_variable -configure:4778: result: BSD nm -configure:4781: checking whether ln -s works -configure:4785: result: yes -configure:4793: checking the maximum length of command line arguments -configure:4923: result: 3458764513820540925 -configure:4940: checking whether the shell understands some XSI constructs -configure:4950: result: yes -configure:4954: checking whether the shell understands "+=" -configure:4960: result: yes -configure:4995: checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format -configure:5035: result: func_convert_file_noop -configure:5042: checking how to convert x86_64-unknown-linux-gnu file names to toolchain format -configure:5062: result: func_convert_file_noop -configure:5069: checking for /usr/bin/ld option to reload object files -configure:5076: result: -r -configure:5150: checking for objdump -configure:5166: found /usr/bin/objdump -configure:5177: result: objdump -configure:5209: checking how to recognize dependent libraries -configure:5411: result: pass_all -configure:5496: checking for dlltool -configure:5526: result: no -configure:5556: checking how to associate runtime and link libraries -configure:5583: result: printf %s\n -configure:5644: checking for ar -configure:5660: found /usr/bin/ar -configure:5671: result: ar -configure:5708: checking for archiver @FILE support -configure:5725: gcc -c -g -O2 conftest.c >&5 -configure:5725: $? = 0 -configure:5728: ar cru libconftest.a @conftest.lst >&5 -configure:5731: $? = 0 -configure:5736: ar cru libconftest.a @conftest.lst >&5 -ar: conftest.o: No such file or directory -configure:5739: $? = 1 -configure:5751: result: @ -configure:5809: checking for strip -configure:5825: found /usr/bin/strip -configure:5836: result: strip -configure:5908: checking for ranlib -configure:5924: found /usr/bin/ranlib -configure:5935: result: ranlib -configure:6037: checking command to parse /usr/bin/nm -B output from gcc object -configure:6157: gcc -c -g -O2 conftest.c >&5 -configure:6160: $? = 0 -configure:6164: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm -configure:6167: $? = 0 -configure:6233: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 -configure:6236: $? = 0 -configure:6274: result: ok -configure:6311: checking for sysroot -configure:6341: result: no -configure:6418: gcc -c -g -O2 conftest.c >&5 -configure:6421: $? = 0 -configure:6597: checking for mt -configure:6613: found /bin/mt -configure:6624: result: mt -configure:6647: checking if mt is a manifest tool -configure:6653: mt '-?' -configure:6661: result: no -configure:7303: checking how to run the C preprocessor -configure:7334: gcc -E conftest.c -configure:7334: $? = 0 -configure:7348: gcc -E conftest.c -conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory - #include - ^ -compilation terminated. -configure:7348: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| /* end confdefs.h. */ -| #include -configure:7373: result: gcc -E -configure:7393: gcc -E conftest.c -configure:7393: $? = 0 -configure:7407: gcc -E conftest.c -conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory - #include - ^ -compilation terminated. -configure:7407: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| /* end confdefs.h. */ -| #include -configure:7436: checking for ANSI C header files -configure:7456: gcc -c -g -O2 conftest.c >&5 -configure:7456: $? = 0 -configure:7529: gcc -o conftest -g -O2 conftest.c >&5 -configure:7529: $? = 0 -configure:7529: ./conftest -configure:7529: $? = 0 -configure:7540: result: yes -configure:7553: checking for sys/types.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for sys/stat.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for stdlib.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for string.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for memory.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for strings.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for inttypes.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for stdint.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7553: checking for unistd.h -configure:7553: gcc -c -g -O2 conftest.c >&5 -configure:7553: $? = 0 -configure:7553: result: yes -configure:7567: checking for dlfcn.h -configure:7567: gcc -c -g -O2 conftest.c >&5 -configure:7567: $? = 0 -configure:7567: result: yes -configure:7773: checking for objdir -configure:7788: result: .libs -configure:8059: checking if gcc supports -fno-rtti -fno-exceptions -configure:8077: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 -cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C [enabled by default] -configure:8081: $? = 0 -configure:8094: result: no -configure:8421: checking for gcc option to produce PIC -configure:8428: result: -fPIC -DPIC -configure:8436: checking if gcc PIC flag -fPIC -DPIC works -configure:8454: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 -configure:8458: $? = 0 -configure:8471: result: yes -configure:8500: checking if gcc static flag -static works -configure:8528: result: yes -configure:8543: checking if gcc supports -c -o file.o -configure:8564: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 -configure:8568: $? = 0 -configure:8590: result: yes -configure:8598: checking if gcc supports -c -o file.o -configure:8645: result: yes -configure:8678: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:9835: result: yes -configure:9872: checking whether -lc should be explicitly linked in -configure:9880: gcc -c -g -O2 conftest.c >&5 -configure:9883: $? = 0 -configure:9898: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 -configure:9901: $? = 0 -configure:9915: result: no -configure:10075: checking dynamic linker characteristics -configure:10586: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 -configure:10586: $? = 0 -configure:10820: result: GNU/Linux ld.so -configure:10927: checking how to hardcode library paths into programs -configure:10952: result: immediate -configure:11492: checking whether stripping libraries is possible -configure:11497: result: yes -configure:11532: checking if libtool supports shared libraries -configure:11534: result: yes -configure:11537: checking whether to build shared libraries -configure:11558: result: yes -configure:11561: checking whether to build static libraries -configure:11565: result: yes -configure:11719: checking for g++ -configure:11735: found /usr/bin/g++ -configure:11746: result: g++ -configure:11773: checking for C++ compiler version -configure:11782: g++ --version >&5 -g++ (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1 -Copyright (C) 2013 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by apigenome config.status 0.2.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status -configure:11793: $? = 0 -configure:11782: g++ -v >&5 -Using built-in specs. -COLLECT_GCC=g++ -COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper -Target: x86_64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.1-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu -Thread model: posix -gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04) -configure:11793: $? = 0 -configure:11782: g++ -V >&5 -g++: error: unrecognized command line option '-V' -g++: fatal error: no input files -compilation terminated. -configure:11793: $? = 4 -configure:11782: g++ -qversion >&5 -g++: error: unrecognized command line option '-qversion' -g++: fatal error: no input files -compilation terminated. -configure:11793: $? = 4 -configure:11797: checking whether we are using the GNU C++ compiler -configure:11816: g++ -c conftest.cpp >&5 -configure:11816: $? = 0 -configure:11825: result: yes -configure:11834: checking whether g++ accepts -g -configure:11854: g++ -c -g conftest.cpp >&5 -configure:11854: $? = 0 -configure:11895: result: yes -configure:11920: checking dependency style of g++ -configure:12031: result: gcc3 -configure:12064: checking how to run the C++ preprocessor -configure:12091: g++ -E conftest.cpp -configure:12091: $? = 0 -configure:12105: g++ -E conftest.cpp -conftest.cpp:23:28: fatal error: ac_nonexistent.h: No such file or directory - #include - ^ -compilation terminated. -configure:12105: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| /* end confdefs.h. */ -| #include -configure:12130: result: g++ -E -configure:12150: g++ -E conftest.cpp -configure:12150: $? = 0 -configure:12164: g++ -E conftest.cpp -conftest.cpp:23:28: fatal error: ac_nonexistent.h: No such file or directory - #include - ^ -compilation terminated. -configure:12164: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| /* end confdefs.h. */ -| #include -configure:12333: checking for ld used by g++ -configure:12400: result: /usr/bin/ld -m elf_x86_64 -configure:12407: checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld -configure:12422: result: yes -configure:12477: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:13482: result: yes -configure:13518: g++ -c -g -O2 conftest.cpp >&5 -configure:13521: $? = 0 -configure:14041: checking for g++ option to produce PIC -configure:14048: result: -fPIC -DPIC -configure:14056: checking if g++ PIC flag -fPIC -DPIC works -configure:14074: g++ -c -g -O2 -fPIC -DPIC -DPIC conftest.cpp >&5 -configure:14078: $? = 0 -configure:14091: result: yes -configure:14114: checking if g++ static flag -static works -configure:14142: result: yes -configure:14154: checking if g++ supports -c -o file.o -configure:14175: g++ -c -g -O2 -o out/conftest2.o conftest.cpp >&5 -configure:14179: $? = 0 -configure:14201: result: yes -configure:14206: checking if g++ supports -c -o file.o -configure:14253: result: yes -configure:14283: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:14322: result: yes -configure:14463: checking dynamic linker characteristics -configure:15142: result: GNU/Linux ld.so -configure:15195: checking how to hardcode library paths into programs -configure:15220: result: immediate -configure:15308: checking for gcc -configure:15335: result: gcc -configure:15564: checking for C compiler version -configure:15573: gcc --version >&5 -gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1 -Copyright (C) 2013 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +on fantasia -configure:15584: $? = 0 -configure:15573: gcc -v >&5 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper -Target: x86_64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.1-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu -Thread model: posix -gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04) -configure:15584: $? = 0 -configure:15573: gcc -V >&5 -gcc: error: unrecognized command line option '-V' -gcc: fatal error: no input files -compilation terminated. -configure:15584: $? = 4 -configure:15573: gcc -qversion >&5 -gcc: error: unrecognized command line option '-qversion' -gcc: fatal error: no input files -compilation terminated. -configure:15584: $? = 4 -configure:15588: checking whether we are using the GNU C compiler -configure:15616: result: yes -configure:15625: checking whether gcc accepts -g -configure:15686: result: yes -configure:15703: checking for gcc option to accept ISO C89 -configure:15780: result: none needed -configure:15802: checking dependency style of gcc -configure:15913: result: gcc3 -configure:15935: checking limits.h usability -configure:15935: gcc -c -g -O2 conftest.c >&5 -configure:15935: $? = 0 -configure:15935: result: yes -configure:15935: checking limits.h presence -configure:15935: gcc -E conftest.c -configure:15935: $? = 0 -configure:15935: result: yes -configure:15935: checking for limits.h -configure:15935: result: yes -configure:15935: checking stddef.h usability -configure:15935: gcc -c -g -O2 conftest.c >&5 -configure:15935: $? = 0 -configure:15935: result: yes -configure:15935: checking stddef.h presence -configure:15935: gcc -E conftest.c -configure:15935: $? = 0 -configure:15935: result: yes -configure:15935: checking for stddef.h -configure:15935: result: yes -configure:15935: checking for stdint.h -configure:15935: result: yes -configure:15935: checking for stdlib.h -configure:15935: result: yes -configure:15935: checking for string.h -configure:15935: result: yes -configure:15935: checking for unistd.h -configure:15935: result: yes -configure:15947: checking for stdbool.h that conforms to C99 -configure:16014: gcc -c -g -O2 conftest.c >&5 -configure:16014: $? = 0 -configure:16021: result: yes -configure:16023: checking for _Bool -configure:16023: gcc -c -g -O2 conftest.c >&5 -configure:16023: $? = 0 -configure:16023: gcc -c -g -O2 conftest.c >&5 -conftest.c: In function 'main': -conftest.c:65:20: error: expected expression before ')' token - if (sizeof ((_Bool))) - ^ -configure:16023: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| if (sizeof ((_Bool))) -| return 0; -| ; -| return 0; -| } -configure:16023: result: yes -configure:16039: checking for inline -configure:16055: gcc -c -g -O2 conftest.c >&5 -configure:16055: $? = 0 -configure:16063: result: inline -configure:16081: checking for int32_t -configure:16081: gcc -c -g -O2 conftest.c >&5 -configure:16081: $? = 0 -configure:16081: gcc -c -g -O2 conftest.c >&5 -conftest.c: In function 'main': -conftest.c:69:53: warning: integer overflow in expression [-Woverflow] - < (int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 2))]; - ^ -conftest.c:68:12: error: storage size of 'test_array' isn't constant - static int test_array [1 - 2 * !((int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 1) - ^ -configure:16081: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !((int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 1) -| < (int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 2))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:16081: result: yes -configure:16092: checking for int64_t -configure:16092: gcc -c -g -O2 conftest.c >&5 -configure:16092: $? = 0 -configure:16092: gcc -c -g -O2 conftest.c >&5 -conftest.c: In function 'main': -conftest.c:69:53: warning: integer overflow in expression [-Woverflow] - < (int64_t) (((((int64_t) 1 << N) << N) - 1) * 2 + 2))]; - ^ -conftest.c:68:12: error: storage size of 'test_array' isn't constant - static int test_array [1 - 2 * !((int64_t) (((((int64_t) 1 << N) << N) - 1) * 2 + 1) - ^ -configure:16092: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !((int64_t) (((((int64_t) 1 << N) << N) - 1) * 2 + 1) -| < (int64_t) (((((int64_t) 1 << N) << N) - 1) * 2 + 2))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:16092: result: yes -configure:16103: checking for C/C++ restrict keyword -configure:16128: gcc -c -g -O2 conftest.c >&5 -configure:16128: $? = 0 -configure:16136: result: __restrict -configure:16149: checking for size_t -configure:16149: gcc -c -g -O2 conftest.c >&5 -configure:16149: $? = 0 -configure:16149: gcc -c -g -O2 conftest.c >&5 -conftest.c: In function 'main': -conftest.c:68:21: error: expected expression before ')' token - if (sizeof ((size_t))) - ^ -configure:16149: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| #define restrict __restrict -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| if (sizeof ((size_t))) -| return 0; -| ; -| return 0; -| } -configure:16149: result: yes -configure:16160: checking for uint16_t -configure:16160: gcc -c -g -O2 conftest.c >&5 -configure:16160: $? = 0 -configure:16160: result: yes -configure:16172: checking for uint32_t -configure:16172: gcc -c -g -O2 conftest.c >&5 -configure:16172: $? = 0 -configure:16172: result: yes -configure:16186: checking for uint64_t -configure:16186: gcc -c -g -O2 conftest.c >&5 -configure:16186: $? = 0 -configure:16186: result: yes -configure:16200: checking for uint8_t -configure:16200: gcc -c -g -O2 conftest.c >&5 -configure:16200: $? = 0 -configure:16200: result: yes -configure:16214: checking for ptrdiff_t -configure:16214: gcc -c -g -O2 conftest.c >&5 -configure:16214: $? = 0 -configure:16214: gcc -c -g -O2 conftest.c >&5 -conftest.c: In function 'main': -conftest.c:68:24: error: expected expression before ')' token - if (sizeof ((ptrdiff_t))) - ^ -configure:16214: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| #define restrict __restrict -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| if (sizeof ((ptrdiff_t))) -| return 0; -| ; -| return 0; -| } -configure:16214: result: yes -configure:16226: checking for error_at_line -configure:16242: gcc -o conftest -g -O2 conftest.c >&5 -configure:16242: $? = 0 -configure:16250: result: yes -configure:16263: checking for stdlib.h -configure:16263: result: yes -configure:16273: checking for GNU libc compatible malloc -configure:16297: gcc -o conftest -g -O2 conftest.c >&5 -configure:16297: $? = 0 -configure:16297: ./conftest -configure:16297: $? = 0 -configure:16307: result: yes -configure:16328: checking whether sys/types.h defines makedev -configure:16344: gcc -o conftest -g -O2 conftest.c >&5 -configure:16344: $? = 0 -configure:16353: result: yes -configure:16380: checking for stdlib.h -configure:16380: result: yes -configure:16390: checking for GNU libc compatible realloc -configure:16414: gcc -o conftest -g -O2 conftest.c >&5 -configure:16414: $? = 0 -configure:16414: ./conftest -configure:16414: $? = 0 -configure:16424: result: yes -configure:16445: checking for working strtod -configure:16486: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c: In function 'main': -conftest.c:92:12: warning: ignoring return value of 'strtod', declared with attribute warn_unused_result [-Wunused-result] - strtod (string, &term); - ^ -configure:16486: $? = 0 -configure:16486: ./conftest -configure:16486: $? = 0 -configure:16496: result: yes -configure:16561: checking for floor -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:60:6: warning: conflicting types for built-in function 'floor' [enabled by default] - char floor (); - ^ -/tmp/ccsOXNvi.o: In function `main': -/home/hmkang/code/working/apigenome.master/conftest.c:71: undefined reference to `floor' -collect2: error: ld returned 1 exit status -configure:16561: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| #define restrict __restrict -| #define HAVE_PTRDIFF_T 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_MALLOC 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_REALLOC 1 -| /* end confdefs.h. */ -| /* Define floor to an innocuous variant, in case declares floor. -| For example, HP-UX 11i declares gettimeofday. */ -| #define floor innocuous_floor -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char floor (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef floor -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char floor (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub_floor || defined __stub___floor -| choke me -| #endif -| -| int -| main () -| { -| return floor (); -| ; -| return 0; -| } -configure:16561: result: no -configure:16561: checking for gethostname -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -configure:16561: $? = 0 -configure:16561: result: yes -configure:16561: checking for memset -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:61:6: warning: conflicting types for built-in function 'memset' [enabled by default] - char memset (); - ^ -configure:16561: $? = 0 -configure:16561: result: yes -configure:16561: checking for pow -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:62:6: warning: conflicting types for built-in function 'pow' [enabled by default] - char pow (); - ^ -/tmp/ccegqTIg.o: In function `main': -/home/hmkang/code/working/apigenome.master/conftest.c:73: undefined reference to `pow' -collect2: error: ld returned 1 exit status -configure:16561: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| #define restrict __restrict -| #define HAVE_PTRDIFF_T 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_MALLOC 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_REALLOC 1 -| #define HAVE_GETHOSTNAME 1 -| #define HAVE_MEMSET 1 -| /* end confdefs.h. */ -| /* Define pow to an innocuous variant, in case declares pow. -| For example, HP-UX 11i declares gettimeofday. */ -| #define pow innocuous_pow -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char pow (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef pow -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char pow (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub_pow || defined __stub___pow -| choke me -| #endif -| -| int -| main () -| { -| return pow (); -| ; -| return 0; -| } -configure:16561: result: no -configure:16561: checking for select -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -configure:16561: $? = 0 -configure:16561: result: yes -configure:16561: checking for sqrt -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:63:6: warning: conflicting types for built-in function 'sqrt' [enabled by default] - char sqrt (); - ^ -/tmp/cc6Ea2zp.o: In function `main': -/home/hmkang/code/working/apigenome.master/conftest.c:74: undefined reference to `sqrt' -collect2: error: ld returned 1 exit status -configure:16561: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "apigenome" -| #define PACKAGE_TARNAME "apigenome" -| #define PACKAGE_VERSION "0.0.2" -| #define PACKAGE_STRING "apigenome 0.0.2" -| #define PACKAGE_BUGREPORT "hmkang@umich.edu" -| #define PACKAGE_URL "" -| #define PACKAGE "apigenome" -| #define VERSION "0.0.2" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_LIMITS_H 1 -| #define HAVE_STDDEF_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE__BOOL 1 -| #define HAVE_STDBOOL_H 1 -| #define restrict __restrict -| #define HAVE_PTRDIFF_T 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_MALLOC 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_REALLOC 1 -| #define HAVE_GETHOSTNAME 1 -| #define HAVE_MEMSET 1 -| #define HAVE_SELECT 1 -| /* end confdefs.h. */ -| /* Define sqrt to an innocuous variant, in case declares sqrt. -| For example, HP-UX 11i declares gettimeofday. */ -| #define sqrt innocuous_sqrt -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char sqrt (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef sqrt -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char sqrt (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub_sqrt || defined __stub___sqrt -| choke me -| #endif -| -| int -| main () -| { -| return sqrt (); -| ; -| return 0; -| } -configure:16561: result: no -configure:16561: checking for strchr -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:63:6: warning: conflicting types for built-in function 'strchr' [enabled by default] - char strchr (); - ^ -configure:16561: $? = 0 -configure:16561: result: yes -configure:16561: checking for strstr -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:64:6: warning: conflicting types for built-in function 'strstr' [enabled by default] - char strstr (); - ^ -configure:16561: $? = 0 -configure:16561: result: yes -configure:16561: checking for strtol -configure:16561: gcc -o conftest -g -O2 conftest.c >&5 -configure:16561: $? = 0 -configure:16561: result: yes -configure:16570: checking for gzopen in -lz -configure:16595: gcc -o conftest -g -O2 conftest.c -lz >&5 -configure:16595: $? = 0 -configure:16604: result: yes -configure:16617: checking for erf in -lm -configure:16642: gcc -o conftest -g -O2 conftest.c -lm -lz >&5 -conftest.c:51:6: warning: conflicting types for built-in function 'erf' [enabled by default] - char erf (); - ^ -configure:16642: $? = 0 -configure:16651: result: yes -configure:16659: checking for erfc in -lm -configure:16684: gcc -o conftest -g -O2 conftest.c -lm -lz >&5 -conftest.c:52:6: warning: conflicting types for built-in function 'erfc' [enabled by default] - char erfc (); - ^ -configure:16684: $? = 0 -configure:16693: result: yes -configure:16707: checking for perl -configure:16723: found /usr/bin/perl -configure:16734: result: yes -configure:16749: checking for gs -configure:16765: found /usr/bin/gs -configure:16776: result: yes -configure:16791: checking for Rscript -configure:16807: found /usr/bin/Rscript -configure:16818: result: yes -configure:16833: checking for R -configure:16849: found /usr/bin/R -configure:16860: result: yes -configure:16875: checking for grep -configure:16891: found /bin/grep -configure:16902: result: yes -configure:16917: checking for mv -configure:16933: found /bin/mv -configure:16944: result: yes -configure:16959: checking for rm -configure:16975: found /bin/rm -configure:16986: result: yes -configure:17001: checking for make -configure:17017: found /usr/bin/make -configure:17028: result: yes -configure:17043: checking for cat -configure:17059: found /bin/cat -configure:17070: result: yes -configure:17085: checking for cut -configure:17101: found /usr/bin/cut -configure:17112: result: yes -configure:17127: checking for dirname -configure:17143: found /usr/bin/dirname -configure:17154: result: yes -configure:17169: checking for head -configure:17185: found /usr/bin/head -configure:17196: result: yes -configure:17211: checking for mkdir -configure:17227: found /bin/mkdir -configure:17238: result: yes -configure:17253: checking for sort -configure:17269: found /usr/bin/sort -configure:17280: result: yes -configure:17295: checking for zcat -configure:17311: found /bin/zcat -configure:17322: result: yes -configure:17337: checking for groff -configure:17353: found /home/hmkang/bin/groff -configure:17364: result: yes -configure:17379: checking for pfbtops -configure:17395: found /home/hmkang/bin/pfbtops -configure:17406: result: yes -configure:17421: checking for gnuplot -configure:17437: found /home/hmkang/bin/gnuplot -configure:17448: result: yes -configure:17600: creating ./config.status +config.status:829: creating Makefile +config.status:829: creating scripts/Makefile +config.status:829: creating data/Makefile +config.status:829: creating config.h +config.status:1010: config.h is unchanged ## ---------------- ## ## Cache variables. ## ## ---------------- ## -ac_cv_build=x86_64-unknown-linux-gnu -ac_cv_c_compiler_gnu=yes -ac_cv_c_inline=inline -ac_cv_c_int32_t=yes -ac_cv_c_int64_t=yes -ac_cv_c_restrict=__restrict -ac_cv_c_uint16_t=yes -ac_cv_c_uint32_t=yes -ac_cv_c_uint64_t=yes -ac_cv_c_uint8_t=yes -ac_cv_cxx_compiler_gnu=yes -ac_cv_env_CCC_set= -ac_cv_env_CCC_value= -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_CXXCPP_set= -ac_cv_env_CXXCPP_value= -ac_cv_env_CXXFLAGS_set= -ac_cv_env_CXXFLAGS_value= -ac_cv_env_CXX_set= -ac_cv_env_CXX_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_LIBS_set= -ac_cv_env_LIBS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= -ac_cv_func_floor=no -ac_cv_func_gethostname=yes -ac_cv_func_malloc_0_nonnull=yes -ac_cv_func_memset=yes -ac_cv_func_pow=no -ac_cv_func_realloc_0_nonnull=yes -ac_cv_func_select=yes -ac_cv_func_sqrt=no -ac_cv_func_strchr=yes -ac_cv_func_strstr=yes -ac_cv_func_strtod=yes -ac_cv_func_strtol=yes -ac_cv_header_dlfcn_h=yes -ac_cv_header_inttypes_h=yes -ac_cv_header_limits_h=yes -ac_cv_header_memory_h=yes -ac_cv_header_stdbool_h=yes -ac_cv_header_stdc=yes -ac_cv_header_stddef_h=yes -ac_cv_header_stdint_h=yes -ac_cv_header_stdlib_h=yes -ac_cv_header_string_h=yes -ac_cv_header_strings_h=yes -ac_cv_header_sys_stat_h=yes -ac_cv_header_sys_types_h=yes -ac_cv_header_sys_types_h_makedev=yes -ac_cv_header_unistd_h=yes -ac_cv_host=x86_64-unknown-linux-gnu -ac_cv_lib_error_at_line=yes -ac_cv_lib_m_erf=yes -ac_cv_lib_m_erfc=yes -ac_cv_lib_z_gzopen=yes -ac_cv_objext=o -ac_cv_path_EGREP='/bin/grep -E' -ac_cv_path_FGREP='/bin/grep -F' -ac_cv_path_GREP=/bin/grep -ac_cv_path_SED=/bin/sed ac_cv_path_install='/usr/bin/install -c' ac_cv_path_mkdir=/bin/mkdir ac_cv_prog_AWK=gawk ac_cv_prog_CAT_CHECK=yes -ac_cv_prog_CPP='gcc -E' ac_cv_prog_CUT_CHECK=yes -ac_cv_prog_CXXCPP='g++ -E' ac_cv_prog_DIRNAME_CHECK=yes ac_cv_prog_GNUPLOT_CHECK=yes ac_cv_prog_GREP_CHECK=yes @@ -1492,95 +175,32 @@ ac_cv_prog_RSCRIPT_CHECK=yes ac_cv_prog_R_CHECK=yes ac_cv_prog_SORT_CHECK=yes ac_cv_prog_ZCAT_CHECK=yes -ac_cv_prog_ac_ct_AR=ar -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_ac_ct_CXX=g++ -ac_cv_prog_ac_ct_MANIFEST_TOOL=mt -ac_cv_prog_ac_ct_OBJDUMP=objdump -ac_cv_prog_ac_ct_RANLIB=ranlib -ac_cv_prog_ac_ct_STRIP=strip -ac_cv_prog_cc_c89= -ac_cv_prog_cc_g=yes -ac_cv_prog_cxx_g=yes ac_cv_prog_make_make_set=yes -ac_cv_type__Bool=yes -ac_cv_type_ptrdiff_t=yes -ac_cv_type_size_t=yes -am_cv_CC_dependencies_compiler_type=gcc3 -am_cv_CXX_dependencies_compiler_type=gcc3 -lt_cv_ar_at_file=@ -lt_cv_archive_cmds_need_lc=no -lt_cv_deplibs_check_method=pass_all -lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_ld_reload_flag=-r -lt_cv_nm_interface='BSD nm' -lt_cv_objdir=.libs -lt_cv_path_LD=/usr/bin/ld -lt_cv_path_LDCXX='/usr/bin/ld -m elf_x86_64' -lt_cv_path_NM='/usr/bin/nm -B' -lt_cv_path_mainfest_tool=no -lt_cv_prog_compiler_c_o=yes -lt_cv_prog_compiler_c_o_CXX=yes -lt_cv_prog_compiler_pic='-fPIC -DPIC' -lt_cv_prog_compiler_pic_CXX='-fPIC -DPIC' -lt_cv_prog_compiler_pic_works=yes -lt_cv_prog_compiler_pic_works_CXX=yes -lt_cv_prog_compiler_rtti_exceptions=no -lt_cv_prog_compiler_static_works=yes -lt_cv_prog_compiler_static_works_CXX=yes -lt_cv_prog_gnu_ld=yes -lt_cv_prog_gnu_ldcxx=yes -lt_cv_sharedlib_from_linklib_cmd='printf %s\n' -lt_cv_shlibpath_overrides_runpath=no -lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' -lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' -lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' -lt_cv_sys_max_cmd_len=3458764513820540925 -lt_cv_to_host_file_cmd=func_convert_file_noop -lt_cv_to_tool_file_cmd=func_convert_file_noop +am_cv_make_support_nested_variables=yes ## ----------------- ## ## Output variables. ## ## ----------------- ## -ACLOCAL='${SHELL} /home/hmkang/code/working/apigenome.master/missing --run aclocal-1.11' -AMDEPBACKSLASH='\' -AMDEP_FALSE='#' -AMDEP_TRUE='' +ACLOCAL='${SHELL} /home/hmkang/code/working/apigenome.master/missing aclocal-1.14' AMTAR='$${TAR-tar}' -AR='ar' -AUTOCONF='${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoconf' -AUTOHEADER='${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoheader' -AUTOMAKE='${SHELL} /home/hmkang/code/working/apigenome.master/missing --run automake-1.11' +AM_BACKSLASH='\' +AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +AM_DEFAULT_VERBOSITY='1' +AM_V='$(V)' +AUTOCONF='${SHELL} /home/hmkang/code/working/apigenome.master/missing autoconf' +AUTOHEADER='${SHELL} /home/hmkang/code/working/apigenome.master/missing autoheader' +AUTOMAKE='${SHELL} /home/hmkang/code/working/apigenome.master/missing automake-1.14' AWK='gawk' CAT_CHECK='yes' -CC='gcc' -CCDEPMODE='depmode=gcc3' -CFLAGS='-g -O2' -CPP='gcc -E' -CPPFLAGS='' CUT_CHECK='yes' -CXX='g++' -CXXCPP='g++ -E' -CXXDEPMODE='depmode=gcc3' -CXXFLAGS='-g -O2' CYGPATH_W='echo' DEFS='-DHAVE_CONFIG_H' -DEPDIR='.deps' DIRNAME_CHECK='yes' -DLLTOOL='false' -DSYMUTIL='' -DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' -EGREP='/bin/grep -E' -EXEEXT='' -FGREP='/bin/grep -F' GNUPLOT_CHECK='yes' -GREP='/bin/grep' GREP_CHECK='yes' GROFF_CHECK='yes' GS_CHECK='yes' @@ -1589,81 +209,45 @@ INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' -LD='/usr/bin/ld -m elf_x86_64' -LDFLAGS='' LIBOBJS='' -LIBS='-lz ' -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -LIPO='' -LN_S='ln -s' +LIBS='' LTLIBOBJS='' -MAKEINFO='${SHELL} /home/hmkang/code/working/apigenome.master/missing --run makeinfo' +MAKEINFO='${SHELL} /home/hmkang/code/working/apigenome.master/missing makeinfo' MAKE_CHECK='yes' -MANIFEST_TOOL=':' MKDIR_CHECK='yes' MKDIR_P='/bin/mkdir -p' MV_CHECK='yes' -NM='/usr/bin/nm -B' -NMEDIT='' -OBJDUMP='objdump' -OBJEXT='o' -OTOOL64='' -OTOOL='' PACKAGE='apigenome' PACKAGE_BUGREPORT='hmkang@umich.edu' PACKAGE_NAME='apigenome' -PACKAGE_STRING='apigenome 0.0.2' +PACKAGE_STRING='apigenome 0.2.0' PACKAGE_TARNAME='apigenome' PACKAGE_URL='' -PACKAGE_VERSION='0.0.2' +PACKAGE_VERSION='0.2.0' PATH_SEPARATOR=':' PERL_CHECK='yes' PFBTOPS_CHECK='yes' -POW_LIB='' -RANLIB='ranlib' RM_CHECK='yes' RSCRIPT_CHECK='yes' R_CHECK='yes' -SED='/bin/sed' SET_MAKE='' SHELL='/bin/sh' SORT_CHECK='yes' -STRIP='strip' -VERSION='0.0.2' +STRIP='' +VERSION='0.2.0' ZCAT_CHECK='yes' -ac_ct_AR='ar' -ac_ct_CC='gcc' -ac_ct_CXX='g++' -ac_ct_DUMPBIN='' -am__EXEEXT_FALSE='' -am__EXEEXT_TRUE='#' -am__fastdepCC_FALSE='#' -am__fastdepCC_TRUE='' -am__fastdepCXX_FALSE='#' -am__fastdepCXX_TRUE='' -am__include='include' am__isrc='' am__leading_dot='.' -am__nodep='_no' -am__quote='' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' bindir='${exec_prefix}/bin' -build='x86_64-unknown-linux-gnu' build_alias='' -build_cpu='x86_64' -build_os='linux-gnu' -build_vendor='unknown' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='${prefix}' -host='x86_64-unknown-linux-gnu' host_alias='' -host_cpu='x86_64' -host_os='linux-gnu' -host_vendor='unknown' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' @@ -1673,10 +257,10 @@ libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' -mkdir_p='/bin/mkdir -p' +mkdir_p='$(MKDIR_P)' oldincludedir='/usr/include' pdfdir='${docdir}' -prefix='/net/fantasia/home/hmkang/bin/apigenome' +prefix='/net/fantasia/home/hmkang/tools/apigenome.master' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' @@ -1691,139 +275,11 @@ target_alias='' /* confdefs.h */ #define PACKAGE_NAME "apigenome" #define PACKAGE_TARNAME "apigenome" -#define PACKAGE_VERSION "0.0.2" -#define PACKAGE_STRING "apigenome 0.0.2" +#define PACKAGE_VERSION "0.2.0" +#define PACKAGE_STRING "apigenome 0.2.0" #define PACKAGE_BUGREPORT "hmkang@umich.edu" #define PACKAGE_URL "" #define PACKAGE "apigenome" -#define VERSION "0.0.2" -#define STDC_HEADERS 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_DLFCN_H 1 -#define LT_OBJDIR ".libs/" -#define HAVE_LIMITS_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE__BOOL 1 -#define HAVE_STDBOOL_H 1 -#define restrict __restrict -#define HAVE_PTRDIFF_T 1 -#define HAVE_STDLIB_H 1 -#define HAVE_MALLOC 1 -#define HAVE_STDLIB_H 1 -#define HAVE_REALLOC 1 -#define HAVE_GETHOSTNAME 1 -#define HAVE_MEMSET 1 -#define HAVE_SELECT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_LIBZ 1 -#define HAVE_ERF 1 -#define HAVE_ERFC 1 +#define VERSION "0.2.0" configure: exit 0 - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by apigenome config.status 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on fantasia - -config.status:1196: creating Makefile -config.status:1196: creating src/Makefile -config.status:1196: creating scripts/Makefile -config.status:1196: creating data/Makefile -config.status:1196: creating config.h -config.status:1377: config.h is unchanged -config.status:1425: executing depfiles commands -config.status:1425: executing libtool commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by apigenome config.status 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status config.h - -on fantasia - -config.status:1196: creating config.h -config.status:1377: config.h is unchanged - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by apigenome config.status 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status scripts/Makefile - -on fantasia - -config.status:1196: creating scripts/Makefile - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by apigenome config.status 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status scripts/Makefile - -on fantasia - -config.status:1196: creating scripts/Makefile - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by apigenome config.status 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status scripts/Makefile - -on fantasia - -config.status:1196: creating scripts/Makefile diff --git a/config.status b/config.status index 2b43c54..de09c8e 100755 --- a/config.status +++ b/config.status @@ -285,16 +285,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -354,28 +354,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# 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'" @@ -392,8 +380,8 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by apigenome $as_me 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by apigenome $as_me 0.2.0, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -405,9 +393,8 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " # Files that config.status was made for. -config_files=" Makefile src/Makefile scripts/Makefile data/Makefile" +config_files=" Makefile scripts/Makefile data/Makefile" config_headers=" config.h" -config_commands=" depfiles libtool" ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions @@ -434,18 +421,15 @@ $config_files Configuration headers: $config_headers -Configuration commands: -$config_commands - Report bugs to ." -ac_cs_config="'--prefix' '/net/fantasia/home/hmkang/bin/apigenome/'" +ac_cs_config="'--prefix=/net/fantasia/home/hmkang/tools/apigenome.master'" ac_cs_version="\ -apigenome config.status 0.0.2 -configured by ./configure, generated by GNU Autoconf 2.68, +apigenome config.status 0.2.0 +configured by ./configure, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" -Copyright (C) 2010 Free Software Foundation, Inc. +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." @@ -531,7 +515,7 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - set X '/bin/sh' './configure' '--prefix' '/net/fantasia/home/hmkang/bin/apigenome/' $ac_configure_extra_args --no-create --no-recursion + set X /bin/sh './configure' '--prefix=/net/fantasia/home/hmkang/tools/apigenome.master' $ac_configure_extra_args --no-create --no-recursion shift $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 CONFIG_SHELL='/bin/sh' @@ -548,275 +532,13 @@ _ASBOX $as_echo "$ac_log" } >&5 -# -# INIT-COMMANDS -# -AMDEP_TRUE="" ac_aux_dir="." - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -double_quote_subst='s/\(["`\\]\)/\\\1/g' -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -macro_version='2.4.2' -macro_revision='1.3337' -enable_shared='yes' -enable_static='yes' -pic_mode='default' -enable_fast_install='yes' -SHELL='/bin/sh' -ECHO='printf %s\n' -PATH_SEPARATOR=':' -host_alias='' -host='x86_64-unknown-linux-gnu' -host_os='linux-gnu' -build_alias='' -build='x86_64-unknown-linux-gnu' -build_os='linux-gnu' -SED='/bin/sed' -Xsed='/bin/sed -e 1s/^X//' -GREP='/bin/grep' -EGREP='/bin/grep -E' -FGREP='/bin/grep -F' -LD='/usr/bin/ld -m elf_x86_64' -NM='/usr/bin/nm -B' -LN_S='ln -s' -max_cmd_len='3458764513820540925' -ac_objext='o' -exeext='' -lt_unset='unset' -lt_SP2NL='tr \040 \012' -lt_NL2SP='tr \015\012 \040\040' -lt_cv_to_host_file_cmd='func_convert_file_noop' -lt_cv_to_tool_file_cmd='func_convert_file_noop' -reload_flag=' -r' -reload_cmds='$LD$reload_flag -o $output$reload_objs' -OBJDUMP='objdump' -deplibs_check_method='pass_all' -file_magic_cmd='$MAGIC_CMD' -file_magic_glob='' -want_nocaseglob='no' -DLLTOOL='false' -sharedlib_from_linklib_cmd='printf %s\n' -AR='ar' -AR_FLAGS='cru' -archiver_list_spec='@' -STRIP='strip' -RANLIB='ranlib' -old_postinstall_cmds='chmod 644 $oldlib~$RANLIB $tool_oldlib' -old_postuninstall_cmds='' -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $tool_oldlib' -lock_old_archive_extraction='no' -CC='gcc' -CFLAGS='-g -O2' -compiler='g++' -GCC='yes' -lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' -lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' -lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' -nm_file_list_spec='@' -lt_sysroot='' -objdir='.libs' -MAGIC_CMD='file' -lt_prog_compiler_no_builtin_flag=' -fno-builtin' -lt_prog_compiler_pic=' -fPIC -DPIC' -lt_prog_compiler_wl='-Wl,' -lt_prog_compiler_static='-static' -lt_cv_prog_compiler_c_o='yes' -need_locks='no' -MANIFEST_TOOL=':' -DSYMUTIL='' -NMEDIT='' -LIPO='' -OTOOL='' -OTOOL64='' -libext='a' -shrext_cmds='.so' -extract_expsyms_cmds='' -archive_cmds_need_lc='no' -enable_shared_with_static_runtimes='no' -export_dynamic_flag_spec='${wl}--export-dynamic' -whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' -compiler_needs_object='no' -old_archive_from_new_cmds='' -old_archive_from_expsyms_cmds='' -archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' -module_cmds='' -module_expsym_cmds='' -with_gnu_ld='yes' -allow_undefined_flag='' -no_undefined_flag='' -hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -hardcode_libdir_separator='' -hardcode_direct='no' -hardcode_direct_absolute='no' -hardcode_minus_L='no' -hardcode_shlibpath_var='unsupported' -hardcode_automatic='no' -inherit_rpath='no' -link_all_deplibs='no' -always_export_symbols='no' -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' -include_expsyms='' -prelink_cmds='' -postlink_cmds='' -file_list_spec='' -variables_saved_for_relink='PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH' -need_lib_prefix='no' -need_version='no' -version_type='linux' -runpath_var='LD_RUN_PATH' -shlibpath_var='LD_LIBRARY_PATH' -shlibpath_overrides_runpath='no' -libname_spec='lib$name' -library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -soname_spec='${libname}${release}${shared_ext}$major' -install_override_mode='' -postinstall_cmds='' -postuninstall_cmds='' -finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -finish_eval='' -hardcode_into_libs='yes' -sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/4.8 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib ' -sys_lib_dlsearch_path_spec='/lib /usr/lib /usr/lib/atlas /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/%{name} /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib/openmanage/smpop /opt/dell/srvadmin/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa /lib32 /usr/lib32 ' -hardcode_action='immediate' -enable_dlopen='unknown' -enable_dlopen_self='unknown' -enable_dlopen_self_static='unknown' -old_striplib='strip --strip-debug' -striplib='strip --strip-unneeded' -compiler_lib_search_dirs='' -predep_objects='' -postdep_objects='' -predeps='' -postdeps='' -compiler_lib_search_path='' -LD_CXX='/usr/bin/ld -m elf_x86_64' -reload_flag_CXX=' -r' -reload_cmds_CXX='$LD$reload_flag -o $output$reload_objs' -old_archive_cmds_CXX='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $tool_oldlib' -compiler_CXX='g++' -GCC_CXX='yes' -lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -lt_prog_compiler_pic_CXX=' -fPIC -DPIC' -lt_prog_compiler_wl_CXX='-Wl,' -lt_prog_compiler_static_CXX='-static' -lt_cv_prog_compiler_c_o_CXX='yes' -archive_cmds_need_lc_CXX='no' -enable_shared_with_static_runtimes_CXX='no' -export_dynamic_flag_spec_CXX='${wl}--export-dynamic' -whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' -compiler_needs_object_CXX='no' -old_archive_from_new_cmds_CXX='' -old_archive_from_expsyms_cmds_CXX='' -archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -module_cmds_CXX='' -module_expsym_cmds_CXX='' -with_gnu_ld_CXX='yes' -allow_undefined_flag_CXX='' -no_undefined_flag_CXX='' -hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' -hardcode_libdir_separator_CXX='' -hardcode_direct_CXX='no' -hardcode_direct_absolute_CXX='no' -hardcode_minus_L_CXX='no' -hardcode_shlibpath_var_CXX='unsupported' -hardcode_automatic_CXX='no' -inherit_rpath_CXX='no' -link_all_deplibs_CXX='no' -always_export_symbols_CXX='no' -export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' -include_expsyms_CXX='' -prelink_cmds_CXX='' -postlink_cmds_CXX='' -file_list_spec_CXX='' -hardcode_action_CXX='immediate' -compiler_lib_search_dirs_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.8 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/4.8/../../..' -predep_objects_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o' -postdep_objects_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o' -predeps_CXX='' -postdeps_CXX='-lstdc++ -lm -lgcc_s -lc -lgcc_s' -compiler_lib_search_path_CXX='-L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..' - -LTCC='gcc' -LTCFLAGS='-g -O2' -compiler='gcc' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL ECHO PATH_SEPARATOR SED GREP EGREP FGREP LD NM LN_S lt_SP2NL lt_NL2SP reload_flag OBJDUMP deplibs_check_method file_magic_cmd file_magic_glob want_nocaseglob DLLTOOL sharedlib_from_linklib_cmd AR AR_FLAGS archiver_list_spec STRIP RANLIB CC CFLAGS compiler lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl lt_cv_sys_global_symbol_to_c_name_address lt_cv_sys_global_symbol_to_c_name_address_lib_prefix nm_file_list_spec lt_prog_compiler_no_builtin_flag lt_prog_compiler_pic lt_prog_compiler_wl lt_prog_compiler_static lt_cv_prog_compiler_c_o need_locks MANIFEST_TOOL DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 shrext_cmds export_dynamic_flag_spec whole_archive_flag_spec compiler_needs_object with_gnu_ld allow_undefined_flag no_undefined_flag hardcode_libdir_flag_spec hardcode_libdir_separator exclude_expsyms include_expsyms file_list_spec variables_saved_for_relink libname_spec library_names_spec soname_spec install_override_mode finish_eval old_striplib striplib compiler_lib_search_dirs predep_objects postdep_objects predeps postdeps compiler_lib_search_path LD_CXX reload_flag_CXX compiler_CXX lt_prog_compiler_no_builtin_flag_CXX lt_prog_compiler_pic_CXX lt_prog_compiler_wl_CXX lt_prog_compiler_static_CXX lt_cv_prog_compiler_c_o_CXX export_dynamic_flag_spec_CXX whole_archive_flag_spec_CXX compiler_needs_object_CXX with_gnu_ld_CXX allow_undefined_flag_CXX no_undefined_flag_CXX hardcode_libdir_flag_spec_CXX hardcode_libdir_separator_CXX exclude_expsyms_CXX include_expsyms_CXX file_list_spec_CXX compiler_lib_search_dirs_CXX predep_objects_CXX postdep_objects_CXX predeps_CXX postdeps_CXX compiler_lib_search_path_CXX; do - case `eval \\$ECHO \\""\\$$var"\\"` in - *[\\\`\"\$]*) - eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED \"\$sed_quote_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\$$var\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_archive_cmds extract_expsyms_cmds old_archive_from_new_cmds old_archive_from_expsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds export_symbols_cmds prelink_cmds postlink_cmds postinstall_cmds postuninstall_cmds finish_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec reload_cmds_CXX old_archive_cmds_CXX old_archive_from_new_cmds_CXX old_archive_from_expsyms_cmds_CXX archive_cmds_CXX archive_expsym_cmds_CXX module_cmds_CXX module_expsym_cmds_CXX export_symbols_cmds_CXX prelink_cmds_CXX postlink_cmds_CXX; do - case `eval \\$ECHO \\""\\$$var"\\"` in - *[\\\`\"\$]*) - eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\$$var\\\"" - ;; - esac -done - -ac_aux_dir='.' -xsi_shell='yes' -lt_shell_append='yes' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='apigenome' - VERSION='0.0.2' - TIMESTAMP='' - RM='rm -f' - ofile='libtool' - - - - - - # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; @@ -832,7 +554,6 @@ done if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -884,9 +605,8 @@ fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && -S["am__EXEEXT_FALSE"]="" -S["am__EXEEXT_TRUE"]="#" S["LTLIBOBJS"]="" +S["LIBOBJS"]="" S["GNUPLOT_CHECK"]="yes" S["PFBTOPS_CHECK"]="yes" S["GROFF_CHECK"]="yes" @@ -905,79 +625,27 @@ S["R_CHECK"]="yes" S["RSCRIPT_CHECK"]="yes" S["GS_CHECK"]="yes" S["PERL_CHECK"]="yes" -S["POW_LIB"]="" -S["LIBOBJS"]="" -S["CXXCPP"]="g++ -E" -S["am__fastdepCXX_FALSE"]="#" -S["am__fastdepCXX_TRUE"]="" -S["CXXDEPMODE"]="depmode=gcc3" -S["ac_ct_CXX"]="g++" -S["CXXFLAGS"]="-g -O2" -S["CXX"]="g++" -S["CPP"]="gcc -E" -S["OTOOL64"]="" -S["OTOOL"]="" -S["LIPO"]="" -S["NMEDIT"]="" -S["DSYMUTIL"]="" -S["MANIFEST_TOOL"]=":" -S["RANLIB"]="ranlib" -S["ac_ct_AR"]="ar" -S["AR"]="ar" -S["DLLTOOL"]="false" -S["OBJDUMP"]="objdump" -S["LN_S"]="ln -s" -S["NM"]="/usr/bin/nm -B" -S["ac_ct_DUMPBIN"]="" -S["DUMPBIN"]="" -S["LD"]="/usr/bin/ld -m elf_x86_64" -S["FGREP"]="/bin/grep -F" -S["EGREP"]="/bin/grep -E" -S["GREP"]="/bin/grep" -S["SED"]="/bin/sed" -S["am__fastdepCC_FALSE"]="#" -S["am__fastdepCC_TRUE"]="" -S["CCDEPMODE"]="depmode=gcc3" -S["am__nodep"]="_no" -S["AMDEPBACKSLASH"]="\\" -S["AMDEP_FALSE"]="#" -S["AMDEP_TRUE"]="" -S["am__quote"]="" -S["am__include"]="include" -S["DEPDIR"]=".deps" -S["OBJEXT"]="o" -S["EXEEXT"]="" -S["ac_ct_CC"]="gcc" -S["CPPFLAGS"]="" -S["LDFLAGS"]="" -S["CFLAGS"]="-g -O2" -S["CC"]="gcc" -S["host_os"]="linux-gnu" -S["host_vendor"]="unknown" -S["host_cpu"]="x86_64" -S["host"]="x86_64-unknown-linux-gnu" -S["build_os"]="linux-gnu" -S["build_vendor"]="unknown" -S["build_cpu"]="x86_64" -S["build"]="x86_64-unknown-linux-gnu" -S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" +S["AM_BACKSLASH"]="\\" +S["AM_DEFAULT_VERBOSITY"]="1" +S["AM_DEFAULT_V"]="$(AM_DEFAULT_VERBOSITY)" +S["AM_V"]="$(V)" S["am__untar"]="$${TAR-tar} xf -" S["am__tar"]="$${TAR-tar} chof - \"$$tardir\"" S["AMTAR"]="$${TAR-tar}" S["am__leading_dot"]="." S["SET_MAKE"]="" S["AWK"]="gawk" -S["mkdir_p"]="/bin/mkdir -p" +S["mkdir_p"]="$(MKDIR_P)" S["MKDIR_P"]="/bin/mkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" -S["STRIP"]="strip" +S["STRIP"]="" S["install_sh"]="${SHELL} /home/hmkang/code/working/apigenome.master/install-sh" -S["MAKEINFO"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing --run makeinfo" -S["AUTOHEADER"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoheader" -S["AUTOMAKE"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing --run automake-1.11" -S["AUTOCONF"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoconf" -S["ACLOCAL"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing --run aclocal-1.11" -S["VERSION"]="0.0.2" +S["MAKEINFO"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing makeinfo" +S["AUTOHEADER"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing autoheader" +S["AUTOMAKE"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing automake-1.14" +S["AUTOCONF"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing autoconf" +S["ACLOCAL"]="${SHELL} /home/hmkang/code/working/apigenome.master/missing aclocal-1.14" +S["VERSION"]="0.2.0" S["PACKAGE"]="apigenome" S["CYGPATH_W"]="echo" S["am__isrc"]="" @@ -987,7 +655,7 @@ S["INSTALL_PROGRAM"]="${INSTALL}" S["target_alias"]="" S["host_alias"]="" S["build_alias"]="" -S["LIBS"]="-lz " +S["LIBS"]="" S["ECHO_T"]="" S["ECHO_N"]="-n" S["ECHO_C"]="" @@ -1012,12 +680,12 @@ S["libexecdir"]="${exec_prefix}/libexec" S["sbindir"]="${exec_prefix}/sbin" S["bindir"]="${exec_prefix}/bin" S["program_transform_name"]="s,x,x," -S["prefix"]="/net/fantasia/home/hmkang/bin/apigenome" +S["prefix"]="/net/fantasia/home/hmkang/tools/apigenome.master" S["exec_prefix"]="${prefix}" S["PACKAGE_URL"]="" S["PACKAGE_BUGREPORT"]="hmkang@umich.edu" -S["PACKAGE_STRING"]="apigenome 0.0.2" -S["PACKAGE_VERSION"]="0.0.2" +S["PACKAGE_STRING"]="apigenome 0.2.0" +S["PACKAGE_VERSION"]="0.2.0" S["PACKAGE_TARNAME"]="apigenome" S["PACKAGE_NAME"]="apigenome" S["PATH_SEPARATOR"]=":" @@ -1065,47 +733,12 @@ cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { D["PACKAGE_NAME"]=" \"apigenome\"" D["PACKAGE_TARNAME"]=" \"apigenome\"" -D["PACKAGE_VERSION"]=" \"0.0.2\"" -D["PACKAGE_STRING"]=" \"apigenome 0.0.2\"" +D["PACKAGE_VERSION"]=" \"0.2.0\"" +D["PACKAGE_STRING"]=" \"apigenome 0.2.0\"" D["PACKAGE_BUGREPORT"]=" \"hmkang@umich.edu\"" D["PACKAGE_URL"]=" \"\"" D["PACKAGE"]=" \"apigenome\"" -D["VERSION"]=" \"0.0.2\"" -D["STDC_HEADERS"]=" 1" -D["HAVE_SYS_TYPES_H"]=" 1" -D["HAVE_SYS_STAT_H"]=" 1" -D["HAVE_STDLIB_H"]=" 1" -D["HAVE_STRING_H"]=" 1" -D["HAVE_MEMORY_H"]=" 1" -D["HAVE_STRINGS_H"]=" 1" -D["HAVE_INTTYPES_H"]=" 1" -D["HAVE_STDINT_H"]=" 1" -D["HAVE_UNISTD_H"]=" 1" -D["HAVE_DLFCN_H"]=" 1" -D["LT_OBJDIR"]=" \".libs/\"" -D["HAVE_LIMITS_H"]=" 1" -D["HAVE_STDDEF_H"]=" 1" -D["HAVE_STDINT_H"]=" 1" -D["HAVE_STDLIB_H"]=" 1" -D["HAVE_STRING_H"]=" 1" -D["HAVE_UNISTD_H"]=" 1" -D["HAVE__BOOL"]=" 1" -D["HAVE_STDBOOL_H"]=" 1" -D["restrict"]=" __restrict" -D["HAVE_PTRDIFF_T"]=" 1" -D["HAVE_STDLIB_H"]=" 1" -D["HAVE_MALLOC"]=" 1" -D["HAVE_STDLIB_H"]=" 1" -D["HAVE_REALLOC"]=" 1" -D["HAVE_GETHOSTNAME"]=" 1" -D["HAVE_MEMSET"]=" 1" -D["HAVE_SELECT"]=" 1" -D["HAVE_STRCHR"]=" 1" -D["HAVE_STRSTR"]=" 1" -D["HAVE_STRTOL"]=" 1" -D["HAVE_LIBZ"]=" 1" -D["HAVE_ERF"]=" 1" -D["HAVE_ERFC"]=" 1" +D["VERSION"]=" \"0.2.0\"" for (key in D) D_is_set[key] = 1 FS = "" } @@ -1142,7 +775,7 @@ _ACAWK fi # test -n "$CONFIG_HEADERS" -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do @@ -1422,907 +1055,9 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="CXX " - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects -postdep_objects=$lt_postdep_objects -predeps=$lt_predeps -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; esac - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: CXX - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_CXX - -# A language specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU compiler? -with_gcc=$GCC_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_CXX - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_CXX - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute_CXX - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath_CXX - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_CXX - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_CXX - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_CXX -postdep_objects=$lt_postdep_objects_CXX -predeps=$lt_predeps_CXX -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# ### END LIBTOOL TAG CONFIG: CXX -_LT_EOF - - ;; - - esac done # for ac_tag diff --git a/config.sub b/config.sub deleted file mode 120000 index 4d47fbc..0000000 --- a/config.sub +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.11/config.sub \ No newline at end of file diff --git a/configure b/configure index c4df6e0..b5ab2f1 100755 --- a/configure +++ b/configure @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for apigenome 0.0.2. +# Generated by GNU Autoconf 2.69 for apigenome 0.2.0. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ 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 @@ -169,20 +192,12 @@ 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\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" + 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 @@ -222,21 +237,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # 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 - export CONFIG_SHELL - 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+"$@"} + 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 : @@ -339,6 +358,14 @@ $as_echo X"$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 @@ -460,6 +487,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits 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). @@ -494,16 +525,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -515,28 +546,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +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'" @@ -544,8 +555,6 @@ 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'" -SHELL=${CONFIG_SHELL-/bin/sh} - test -n "$DJDIR" || exec 7<&0 &1 @@ -570,50 +579,14 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='apigenome' PACKAGE_TARNAME='apigenome' -PACKAGE_VERSION='0.0.2' -PACKAGE_STRING='apigenome 0.0.2' +PACKAGE_VERSION='0.2.0' +PACKAGE_STRING='apigenome 0.2.0' PACKAGE_BUGREPORT='hmkang@umich.edu' PACKAGE_URL='' -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS +ac_unique_file="config.h" +ac_subst_vars='LTLIBOBJS +LIBOBJS GNUPLOT_CHECK PFBTOPS_CHECK GROFF_CHECK @@ -632,62 +605,10 @@ R_CHECK RSCRIPT_CHECK GS_CHECK PERL_CHECK -POW_LIB -LIBOBJS -CXXCPP -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -ac_ct_CXX -CXXFLAGS -CXX -CPP -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -752,28 +673,11 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_shared -enable_static -with_pic -enable_fast_install -enable_dependency_tracking -with_gnu_ld -with_sysroot -enable_libtool_lock +enable_silent_rules ' ac_precious_vars='build_alias host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -CXX -CXXFLAGS -CCC -CXXCPP' +target_alias' # Initialize some variables set by options. @@ -1229,8 +1133,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1316,7 +1218,7 @@ 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 apigenome 0.0.2 to adapt to many kinds of systems. +\`configure' configures apigenome 0.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1377,16 +1279,12 @@ Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of apigenome 0.0.2:";; + short | recursive ) echo "Configuration of apigenome 0.2.0:";; esac cat <<\_ACEOF @@ -1394,38 +1292,8 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --disable-libtool-lock avoid locking (might break parallel builds) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") Report bugs to . _ACEOF @@ -1490,10 +1358,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -apigenome configure 0.0.2 -generated by GNU Autoconf 2.68 +apigenome configure 0.2.0 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +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 @@ -1503,666 +1371,12 @@ fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------- ## -## Report this to hmkang@umich.edu ## -## ------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# ac_fn_c_find_intX_t LINENO BITS VAR -# ----------------------------------- -# Finds a signed integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in #( - int$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_intX_t - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_uintX_t 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 apigenome $as_me 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by apigenome $as_me 0.2.0, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2509,7 +1723,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.11' + +ac_config_headers="$ac_config_headers config.h" + + +am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2577,7 +1795,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2635,9 +1853,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2648,32 +1863,40 @@ case `pwd` in esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2685,6 +1908,16 @@ Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2707,12 +1940,12 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2724,10 +1957,10 @@ if test x"${install_sh}" != xset; then esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2746,7 +1979,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2786,7 +2019,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2837,7 +2070,7 @@ do test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2866,12 +2099,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2890,7 +2117,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2954,6 +2181,45 @@ else fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2975,8 +2241,9 @@ fi # Define the identity of the package. + PACKAGE=apigenome - VERSION=0.0.2 + VERSION=0.2.0 cat >>confdefs.h <<_ACEOF @@ -3004,13738 +2271,106 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - -ac_config_headers="$ac_config_headers config.h" - - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. -ltmain="$ac_aux_dir/ltmain.sh" +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : + +#perl +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build + if test -n "$PERL_CHECK"; then + ac_cv_prog_PERL_CHECK="$PERL_CHECK" # Let the user override the test. else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL_CHECK="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' +fi +PERL_CHECK=$ac_cv_prog_PERL_CHECK +if test -n "$PERL_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_CHECK" >&5 +$as_echo "$PERL_CHECK" >&6; } else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC="$CC" -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 - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - link_all_deplibs=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=no -fi - - - - - - - -# Checks for programs. -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - - - -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf - - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -compiler_needs_object_CXX=no -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_direct_absolute_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -inherit_rpath_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - compiler_CXX=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' - else - lt_prog_compiler_no_builtin_flag_CXX= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - ld_shlibs_CXX=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - file_list_spec_CXX='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec_CXX='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - - - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec_CXX='' - fi - link_all_deplibs_CXX=yes - allow_undefined_flag_CXX="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi - - else - ld_shlibs_CXX=no - fi - - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - ld_shlibs_CXX=no - ;; - - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - - gnu*) - ;; - - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - interix[3-9]*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - inherit_rpath_CXX=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) - prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_CXX=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - ld_shlibs_CXX=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - hardcode_direct_absolute_CXX=yes - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - ld_shlibs_CXX=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - case $host in - osf3*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - ;; - *) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - ;; - esac - - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } - test "$ld_shlibs_CXX" = no && can_build_shared=no - - GCC_CXX="$GXX" - LD_CXX="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF - - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -case $host_os in -interix[3-9]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - compiler_lib_search_dirs_CXX= -if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_CXX='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix[4-9]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-qpic' - lt_prog_compiler_static_CXX='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_CXX=yes - fi - else - lt_cv_prog_compiler_static_works_CXX=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } - -if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - case $host_os in - aix[4-9]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs_CXX=no - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -with_gnu_ld_CXX=$with_gnu_ld - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || - test -n "$runpath_var_CXX" || - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink || - test "$inherit_rpath_CXX" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -# Checks for header files. -for ac_header in limits.h stddef.h stdint.h stdlib.h string.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifndef bool - "error: bool is not defined" -#endif -#ifndef false - "error: false is not defined" -#endif -#if false - "error: false is not 0" -#endif -#ifndef true - "error: true is not defined" -#endif -#if true != 1 - "error: true is not 1" -#endif -#ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" -#endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; - -int -main () -{ - - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdbool_h=yes -else - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } -ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - -if test $ac_cv_header_stdbool_h = yes; then - -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 -$as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if ${ac_cv_c_restrict+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - for ac_kw in __restrict __restrict__ _Restrict restrict; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - } -int -main () -{ -int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_restrict=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_restrict" != no && break - done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 -$as_echo "$ac_cv_c_restrict" >&6; } - - case $ac_cv_c_restrict in - restrict) ;; - no) $as_echo "#define restrict /**/" >>confdefs.h - ;; - *) cat >>confdefs.h <<_ACEOF -#define restrict $ac_cv_c_restrict -_ACEOF - ;; - esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -#define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - -ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF - - -fi - - -# Checks for library functions. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 -$as_echo_n "checking for error_at_line... " >&6; } -if ${ac_cv_lib_error_at_line+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -error_at_line (0, 0, "", 0, "an error occurred"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_error_at_line=yes -else - ac_cv_lib_error_at_line=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 -$as_echo "$ac_cv_lib_error_at_line" >&6; } -if test $ac_cv_lib_error_at_line = no; then - case " $LIBOBJS " in - *" error.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS error.$ac_objext" - ;; -esac - -fi - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if ${ac_cv_func_malloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -$as_echo "#define malloc rpl_malloc" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 -$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } -if ${ac_cv_header_sys_types_h_makedev+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return makedev(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_header_sys_types_h_makedev=yes -else - ac_cv_header_sys_types_h_makedev=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 -$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } - -if test $ac_cv_header_sys_types_h_makedev = no; then -ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : - -$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h - -fi - - - - if test $ac_cv_header_sys_mkdev_h = no; then - ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : - -$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h - -fi - - - fi -fi - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 -$as_echo_n "checking for GNU libc compatible realloc... " >&6; } -if ${ac_cv_func_realloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_realloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif - -int -main () -{ -return ! realloc (0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_realloc_0_nonnull=yes -else - ac_cv_func_realloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_REALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_REALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" - ;; -esac - - -$as_echo "#define realloc rpl_realloc" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 -$as_echo_n "checking for working strtod... " >&6; } -if ${ac_cv_func_strtod+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_strtod=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -$ac_includes_default -#ifndef strtod -double strtod (); -#endif -int -main() -{ - { - /* Some versions of Linux strtod mis-parse strings with leading '+'. */ - char *string = " +69"; - char *term; - double value; - value = strtod (string, &term); - if (value != 69 || term != (string + 4)) - return 1; - } - - { - /* Under Solaris 2.4, strtod returns the wrong value for the - terminating character under some conditions. */ - char *string = "NaN"; - char *term; - strtod (string, &term); - if (term != string && *(term - 1) == 0) - return 1; - } - return 0; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_strtod=yes -else - ac_cv_func_strtod=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 -$as_echo "$ac_cv_func_strtod" >&6; } -if test $ac_cv_func_strtod = no; then - case " $LIBOBJS " in - *" strtod.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strtod.$ac_objext" - ;; -esac - -ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" -if test "x$ac_cv_func_pow" = xyes; then : - -fi - -if test $ac_cv_func_pow = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 -$as_echo_n "checking for pow in -lm... " >&6; } -if ${ac_cv_lib_m_pow+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_pow=yes -else - ac_cv_lib_m_pow=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 -$as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = xyes; then : - POW_LIB=-lm -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 -$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} -fi - -fi - -fi - -for ac_func in floor gethostname memset pow select sqrt strchr strstr strtol -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 -$as_echo_n "checking for gzopen in -lz... " >&6; } -if ${ac_cv_lib_z_gzopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gzopen (); -int -main () -{ -return gzopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_gzopen=yes -else - ac_cv_lib_z_gzopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 -$as_echo "$ac_cv_lib_z_gzopen" >&6; } -if test "x$ac_cv_lib_z_gzopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBZ 1 -_ACEOF - - LIBS="-lz $LIBS" - -else - as_fn_error $? "libz.{so,a} was not found. Please install zlib at http://www.zlib.net/ first" "$LINENO" 5 -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erf in -lm" >&5 -$as_echo_n "checking for erf in -lm... " >&6; } -if ${ac_cv_lib_m_erf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char erf (); -int -main () -{ -return erf (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_erf=yes -else - ac_cv_lib_m_erf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erf" >&5 -$as_echo "$ac_cv_lib_m_erf" >&6; } -if test "x$ac_cv_lib_m_erf" = xyes; then : - -$as_echo "#define HAVE_ERF 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for erfc in -lm" >&5 -$as_echo_n "checking for erfc in -lm... " >&6; } -if ${ac_cv_lib_m_erfc+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char erfc (); -int -main () -{ -return erfc (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_erfc=yes -else - ac_cv_lib_m_erfc=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erfc" >&5 -$as_echo "$ac_cv_lib_m_erfc" >&6; } -if test "x$ac_cv_lib_m_erfc" = xyes; then : - -$as_echo "#define HAVE_ERFC 1" >>confdefs.h - -fi - -#AC_CHECK_LIB(bz2, BZ2_bzopen, [], [AC_MSG_ERROR([libbz2.{so,a} was not found in the library path. Please install it at http://www.bzip.org/downloads.html first])]) -#AC_CHECK_LIB(R, R_alloc, [], [AC_MSG_ERROR([libR.{so,a} was not found. Please install it at http://www.r-project.org/ first])]) - -#perl -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PERL_CHECK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PERL_CHECK"; then - ac_cv_prog_PERL_CHECK="$PERL_CHECK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_PERL_CHECK="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PERL_CHECK=$ac_cv_prog_PERL_CHECK -if test -n "$PERL_CHECK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_CHECK" >&5 -$as_echo "$PERL_CHECK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16760,7 +2395,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GS_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16802,7 +2437,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RSCRIPT_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16844,7 +2479,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_R_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16886,7 +2521,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GREP_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16928,7 +2563,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MV_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16970,7 +2605,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RM_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17012,7 +2647,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKE_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17054,7 +2689,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CAT_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17096,7 +2731,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CUT_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17138,7 +2773,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DIRNAME_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17180,7 +2815,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HEAD_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17222,7 +2857,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MKDIR_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17264,7 +2899,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_SORT_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17306,7 +2941,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ZCAT_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17348,7 +2983,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GROFF_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17390,7 +3025,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PFBTOPS_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17432,7 +3067,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GNUPLOT_CHECK="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17457,7 +3092,7 @@ if test x"$GNUPLOT_CHECK" != x"yes" ; then as_fn_error $? "Please install gnuplot at http://sourceforge.net/projects/gnuplot/files/ before installing." "$LINENO" 5 fi -ac_config_files="$ac_config_files Makefile src/Makefile scripts/Makefile data/Makefile" +ac_config_files="$ac_config_files Makefile scripts/Makefile data/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17568,30 +3203,15 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -17890,16 +3510,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -17959,28 +3579,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# 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'" @@ -18001,8 +3609,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by apigenome $as_me 0.0.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by apigenome $as_me 0.2.0, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18028,7 +3636,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" -config_commands="$ac_config_commands" _ACEOF @@ -18058,20 +3665,17 @@ $config_files Configuration headers: $config_headers -Configuration commands: -$config_commands - Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -apigenome config.status 0.0.2 -configured by $0, generated by GNU Autoconf 2.68, +apigenome config.status 0.2.0 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +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." @@ -18162,7 +3766,7 @@ 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 + 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' @@ -18176,393 +3780,13 @@ exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib \ -compiler_lib_search_dirs \ -predep_objects \ -postdep_objects \ -predeps \ -postdeps \ -compiler_lib_search_path \ -LD_CXX \ -reload_flag_CXX \ -compiler_CXX \ -lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_pic_CXX \ -lt_prog_compiler_wl_CXX \ -lt_prog_compiler_static_CXX \ -lt_cv_prog_compiler_c_o_CXX \ -export_dynamic_flag_spec_CXX \ -whole_archive_flag_spec_CXX \ -compiler_needs_object_CXX \ -with_gnu_ld_CXX \ -allow_undefined_flag_CXX \ -no_undefined_flag_CXX \ -hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_separator_CXX \ -exclude_expsyms_CXX \ -include_expsyms_CXX \ -file_list_spec_CXX \ -compiler_lib_search_dirs_CXX \ -predep_objects_CXX \ -postdep_objects_CXX \ -predeps_CXX \ -postdeps_CXX \ -compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec \ -reload_cmds_CXX \ -old_archive_cmds_CXX \ -old_archive_from_new_cmds_CXX \ -old_archive_from_expsyms_cmds_CXX \ -archive_cmds_CXX \ -archive_expsym_cmds_CXX \ -module_cmds_CXX \ -module_expsym_cmds_CXX \ -export_symbols_cmds_CXX \ -prelink_cmds_CXX \ -postlink_cmds_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - - +## 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 @@ -18572,10 +3796,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; @@ -18591,7 +3812,6 @@ done if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -18888,7 +4108,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_HEADERS" -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do @@ -19166,907 +4386,9 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="CXX " - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects -postdep_objects=$lt_postdep_objects -predeps=$lt_predeps -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; esac - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: CXX - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_CXX - -# A language specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU compiler? -with_gcc=$GCC_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_CXX - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_CXX - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute_CXX - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath_CXX - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_CXX - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_CXX - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_CXX -postdep_objects=$lt_postdep_objects_CXX -predeps=$lt_predeps_CXX -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# ### END LIBTOOL TAG CONFIG: CXX -_LT_EOF - - ;; - - esac done # for ac_tag diff --git a/configure.ac b/configure.ac index 238afbb..d9aa36d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,51 +1,12 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_PREREQ([2.65]) -AC_INIT([apigenome], [0.0.2], [hmkang@umich.edu]) -AM_INIT_AUTOMAKE(apigenome, 0.0.2) +AC_PREREQ([2.69]) +AC_INIT([apigenome], [0.2.0], [hmkang@umich.edu]) +AC_CONFIG_SRCDIR([config.h]) AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) -AM_PROG_LIBTOOL -AC_PROG_LIBTOOL -AC_ENABLE_SHARED -AC_DISABLE_STATIC - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC - -# Checks for libraries. - -# Checks for header files. -AC_CHECK_HEADERS([limits.h stddef.h stdint.h stdlib.h string.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_INLINE -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_C_RESTRICT -AC_TYPE_SIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_UINT8_T -AC_CHECK_TYPES([ptrdiff_t]) - -# Checks for library functions. -AC_FUNC_ERROR_AT_LINE -AC_FUNC_MALLOC -AC_HEADER_MAJOR -AC_FUNC_REALLOC -AC_FUNC_STRTOD -AC_CHECK_FUNCS([floor gethostname memset pow select sqrt strchr strstr strtol]) -AC_CHECK_LIB(z, gzopen, [], [AC_MSG_ERROR([libz.{so,a} was not found. Please install zlib at http://www.zlib.net/ first])]) -AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])]) -AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])]) -#AC_CHECK_LIB(bz2, BZ2_bzopen, [], [AC_MSG_ERROR([libbz2.{so,a} was not found in the library path. Please install it at http://www.bzip.org/downloads.html first])]) -#AC_CHECK_LIB(R, R_alloc, [], [AC_MSG_ERROR([libR.{so,a} was not found. Please install it at http://www.r-project.org/ first])]) +AM_INIT_AUTOMAKE(apigenome, 0.2.0) #perl AC_CHECK_PROG(PERL_CHECK,perl,yes) @@ -155,4 +116,4 @@ if test x"$GNUPLOT_CHECK" != x"yes" ; then AC_MSG_ERROR([Please install gnuplot at http://sourceforge.net/projects/gnuplot/files/ before installing.]) fi -AC_OUTPUT(Makefile src/Makefile scripts/Makefile data/Makefile) +AC_OUTPUT(Makefile scripts/Makefile data/Makefile) diff --git a/data/JSON-2.90.tar.gz b/data/JSON-2.90.tar.gz deleted file mode 100644 index 8eaa910..0000000 Binary files a/data/JSON-2.90.tar.gz and /dev/null differ diff --git a/data/Makefile b/data/Makefile index 226e7f1..2d62dab 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # data/Makefile. Generated from Makefile.in by configure. -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/apigenome pkgincludedir = $(includedir)/apigenome pkglibdir = $(libdir)/apigenome @@ -32,24 +76,36 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/../Makefile.vars \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in subdir = data +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(dist_pkgdata_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -79,40 +135,24 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(dist_pkgdata_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run aclocal-1.11 +ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing aclocal-1.14 AMTAR = $${TAR-tar} -AR = ar -AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoconf -AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoheader -AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run automake-1.11 +AM_DEFAULT_VERBOSITY = 1 +AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing autoconf +AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing autoheader +AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing automake-1.14 AWK = gawk CAT_CHECK = yes -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = CUT_CHECK = yes -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps DIRNAME_CHECK = yes -DLLTOOL = false -DSYMUTIL = -DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F GNUPLOT_CHECK = yes -GREP = /bin/grep GREP_CHECK = yes GROFF_CHECK = yes GS_CHECK = yes @@ -122,78 +162,49 @@ INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = LIBOBJS = -LIBS = -lz -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIPO = -LN_S = ln -s +LIBS = LTLIBOBJS = -MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run makeinfo +MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing makeinfo MAKE_CHECK = yes -MANIFEST_TOOL = : MKDIR_CHECK = yes MKDIR_P = /bin/mkdir -p MV_CHECK = yes -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = PACKAGE = apigenome PACKAGE_BUGREPORT = hmkang@umich.edu PACKAGE_NAME = apigenome -PACKAGE_STRING = apigenome 0.0.2 +PACKAGE_STRING = apigenome 0.2.0 PACKAGE_TARNAME = apigenome PACKAGE_URL = -PACKAGE_VERSION = 0.0.2 +PACKAGE_VERSION = 0.2.0 PATH_SEPARATOR = : PERL_CHECK = yes PFBTOPS_CHECK = yes -POW_LIB = -RANLIB = ranlib RM_CHECK = yes RSCRIPT_CHECK = yes R_CHECK = yes -SED = /bin/sed SET_MAKE = SHELL = /bin/sh SORT_CHECK = yes -STRIP = strip -VERSION = 0.0.2 +STRIP = +VERSION = 0.2.0 ZCAT_CHECK = yes abs_builddir = /home/hmkang/code/working/apigenome.master/data abs_srcdir = /home/hmkang/code/working/apigenome.master/data abs_top_builddir = /home/hmkang/code/working/apigenome.master abs_top_srcdir = /home/hmkang/code/working/apigenome.master -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_DUMPBIN = -am__include = include am__leading_dot = . -am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info @@ -203,10 +214,10 @@ libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p +mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /net/fantasia/home/hmkang/bin/apigenome +prefix = /net/fantasia/home/hmkang/tools/apigenome.master program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin @@ -217,20 +228,14 @@ target_alias = top_build_prefix = ../ top_builddir = .. top_srcdir = .. -YAML = YAML-LibYAML-0.59 -JSON = JSON-2.90 -CONFIG = YAML-AppConfig-0.19 dist_pkgdata_DATA = prologue.ps \ GillSansItalic.pfb GillSansMT.pfb \ - calibri.pfb arial.pfb \ - $(JSON).tar.gz \ - $(YAML).tar.gz \ - $(CONFIG).tar.gz + calibri.pfb arial.pfb all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../Makefile.vars $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -239,9 +244,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../Makefile.vars $(am__c exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign data/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign data/Makefile + $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -251,7 +256,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/../Makefile.vars: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -261,16 +265,13 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -285,11 +286,11 @@ uninstall-dist_pkgdataDATA: @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -361,7 +362,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -413,7 +414,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-generic pdf: pdf-am @@ -427,17 +428,17 @@ uninstall-am: uninstall-dist_pkgdataDATA .MAKE: install-am install-strip -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dist_pkgdataDATA \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am uninstall uninstall-am uninstall-dist_pkgdataDATA +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dist_pkgdataDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-dist_pkgdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/data/Makefile.am b/data/Makefile.am index 316ea8a..a29c3ab 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,8 +1,3 @@ -include ../Makefile.vars - dist_pkgdata_DATA = prologue.ps \ GillSansItalic.pfb GillSansMT.pfb \ - calibri.pfb arial.pfb \ - $(JSON).tar.gz \ - $(YAML).tar.gz \ - $(CONFIG).tar.gz + calibri.pfb arial.pfb diff --git a/data/Makefile.in b/data/Makefile.in index 97447ba..406cdc3 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,24 +76,36 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/../Makefile.vars \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in subdir = data +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(dist_pkgdata_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -79,40 +135,24 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(dist_pkgdata_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ -AR = @AR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT_CHECK = @CAT_CHECK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ CUT_CHECK = @CUT_CHECK@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ -DEPDIR = @DEPDIR@ DIRNAME_CHECK = @DIRNAME_CHECK@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ GNUPLOT_CHECK = @GNUPLOT_CHECK@ -GREP = @GREP@ GREP_CHECK = @GREP_CHECK@ GROFF_CHECK = @GROFF_CHECK@ GS_CHECK = @GS_CHECK@ @@ -122,26 +162,14 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_CHECK = @MAKE_CHECK@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_CHECK = @MKDIR_CHECK@ MKDIR_P = @MKDIR_P@ MV_CHECK = @MV_CHECK@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -152,12 +180,9 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_CHECK = @PERL_CHECK@ PFBTOPS_CHECK = @PFBTOPS_CHECK@ -POW_LIB = @POW_LIB@ -RANLIB = @RANLIB@ RM_CHECK = @RM_CHECK@ RSCRIPT_CHECK = @RSCRIPT_CHECK@ R_CHECK = @R_CHECK@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT_CHECK = @SORT_CHECK@ @@ -168,32 +193,18 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ -build = @build@ build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ -host = @host@ host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ @@ -217,20 +228,14 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -YAML = YAML-LibYAML-0.59 -JSON = JSON-2.90 -CONFIG = YAML-AppConfig-0.19 dist_pkgdata_DATA = prologue.ps \ GillSansItalic.pfb GillSansMT.pfb \ - calibri.pfb arial.pfb \ - $(JSON).tar.gz \ - $(YAML).tar.gz \ - $(CONFIG).tar.gz + calibri.pfb arial.pfb all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../Makefile.vars $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -239,9 +244,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../Makefile.vars $(am__c exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign data/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign data/Makefile + $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -251,7 +256,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/../Makefile.vars: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -261,16 +265,13 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -285,11 +286,11 @@ uninstall-dist_pkgdataDATA: @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -361,7 +362,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -413,7 +414,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-generic pdf: pdf-am @@ -427,17 +428,17 @@ uninstall-am: uninstall-dist_pkgdataDATA .MAKE: install-am install-strip -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dist_pkgdataDATA \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am uninstall uninstall-am uninstall-dist_pkgdataDATA +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dist_pkgdataDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-dist_pkgdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/data/YAML-AppConfig-0.19.tar.gz b/data/YAML-AppConfig-0.19.tar.gz deleted file mode 100644 index 104aa1c..0000000 Binary files a/data/YAML-AppConfig-0.19.tar.gz and /dev/null differ diff --git a/data/YAML-AppConfig-0.19/Changes b/data/YAML-AppConfig-0.19/Changes deleted file mode 100644 index 532070e..0000000 --- a/data/YAML-AppConfig-0.19/Changes +++ /dev/null @@ -1,49 +0,0 @@ -Revision history for Perl module YAML::AppConfig - -Development XAERXESS - -0.19 2014-03-14T09:00:00+0100 XAERXESS - - [ Bug fixes ] - - fixed hash randomization problem in test - (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711627#19 - by Csillag Tamas ) - - META.{yaml,json} were missing prereqs - - [ Other changes ] - - included missing README file - - cleaned up prereqs - -0.18 2014-03-13T19:00:00+0100 XAERXESS - - [ Bug fixes ] - - fixed POD warning (RT #68118 by Damyan Ivanov ) - - used ref instead of isa (RT #65539 by Guillaume Rousse ) - - [ Other changes ] - - updated revision history in Changes (as per CPAN::Changes::Spec) - - cleaned up documentation - - tweaked Makefile.PL - - included LICENSE file - -0.17 2014-03-12T15:21:11+0100 XAERXESS - - - Grzegorz Rożniecki (XAERXESS) has taken over maintenance - - fixed deprecated use of `for qw(...)` (RT #85987 by gregor herrmann ) - - skipped test failing under Perl 5.18+ - -0.16 2006-07-09 - - - released by Matthew O'Connor - -0.14 2006-06-25 - - - released by Matthew O'Connor - -0.12 2006-06-22 - - - released by Matthew O'Connor - -0.10 2006-06-22 - - - first public version on CPAN diff --git a/data/YAML-AppConfig-0.19/LICENSE b/data/YAML-AppConfig-0.19/LICENSE deleted file mode 100644 index 0a51d72..0000000 --- a/data/YAML-AppConfig-0.19/LICENSE +++ /dev/null @@ -1,372 +0,0 @@ -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. - -Terms of the Perl programming language system itself - -a) the GNU General Public License as published by the Free - Software Foundation; either version 1, or (at your option) any - later version, or -b) the "Artistic License" - ---- The GNU General Public License, Version 1, February 1989 --- - -This is free software, licensed under: - - The GNU General Public License, Version 1, February 1989 - - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 - - Copyright (C) 1989 Free Software Foundation, Inc. - 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The license agreements of most software companies try to keep users -at the mercy of those companies. By contrast, our General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. The -General Public License applies to the Free Software Foundation's -software and to any other program whose authors commit to using it. -You can use it for your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Specifically, the General Public License is designed to make -sure that you have the freedom to give away or sell copies of free -software, that you receive source code or can get it if you want it, -that you can change the software or use pieces of it in new free -programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of a such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any program or other work which -contains a notice placed by the copyright holder saying it may be -distributed under the terms of this General Public License. The -"Program", below, refers to any such program or work, and a "work based -on the Program" means either the Program or any work containing the -Program or a portion of it, either verbatim or with modifications. Each -licensee is addressed as "you". - - 1. You may copy and distribute verbatim copies of the Program's source -code as you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this -General Public License and to the absence of any warranty; and give any -other recipients of the Program a copy of this General Public License -along with the Program. You may charge a fee for the physical act of -transferring a copy. - - 2. You may modify your copy or copies of the Program or any portion of -it, and copy and distribute such modifications under the terms of Paragraph -1 above, provided that you also do the following: - - a) cause the modified files to carry prominent notices stating that - you changed the files and the date of any change; and - - b) cause the whole of any work that you distribute or publish, that - in whole or in part contains the Program or any part thereof, either - with or without modifications, to be licensed at no charge to all - third parties under the terms of this General Public License (except - that you may choose to grant warranty protection to some or all - third parties, at your option). - - c) If the modified program normally reads commands interactively when - run, you must cause it, when started running for such interactive use - in the simplest and most usual way, to print or display an - announcement including an appropriate copyright notice and a notice - that there is no warranty (or else, saying that you provide a - warranty) and that users may redistribute the program under these - conditions, and telling the user how to view a copy of this General - Public License. - - d) You may charge a fee for the physical act of transferring a - copy, and you may at your option offer warranty protection in - exchange for a fee. - -Mere aggregation of another independent work with the Program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other work under the scope of these terms. - - 3. You may copy and distribute the Program (or a portion or derivative of -it, under Paragraph 2) in object code or executable form under the terms of -Paragraphs 1 and 2 above provided that you also do one of the following: - - a) accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, - - b) accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal charge - for the cost of distribution) a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of - Paragraphs 1 and 2 above; or, - - c) accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) - -Source code for a work means the preferred form of the work for making -modifications to it. For an executable file, complete source code means -all the source code for all modules it contains; but, as a special -exception, it need not include source code for modules which are standard -libraries that accompany the operating system on which the executable -file runs, or for standard header files or definitions files that -accompany that operating system. - - 4. You may not copy, modify, sublicense, distribute or transfer the -Program except as expressly provided under this General Public License. -Any attempt otherwise to copy, modify, sublicense, distribute or transfer -the Program is void, and will automatically terminate your rights to use -the Program under this License. However, parties who have received -copies, or rights to use copies, from you under this General Public -License will not have their licenses terminated so long as such parties -remain in full compliance. - - 5. By copying, distributing or modifying the Program (or any work based -on the Program) you indicate your acceptance of this license to do so, -and all its terms and conditions. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the original -licensor to copy, distribute or modify the Program subject to these -terms and conditions. You may not impose any further restrictions on the -recipients' exercise of the rights granted herein. - - 7. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of the license which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -the license, you may choose any version ever published by the Free Software -Foundation. - - 8. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to humanity, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - - To do so, attach the following notices to the program. It is safest to -attach them to the start of each source file to most effectively convey -the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - 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 1, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19xx name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the -appropriate parts of the General Public License. Of course, the -commands you use may be called something other than `show w' and `show -c'; they could even be mouse-clicks or menu items--whatever suits your -program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - program `Gnomovision' (a program to direct compilers to make passes - at assemblers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -That's all there is to it! - - ---- The Artistic License 1.0 --- - -This is free software, licensed under: - - The Artistic License 1.0 - -The Artistic License - -Preamble - -The intent of this document is to state the conditions under which a Package -may be copied, such that the Copyright Holder maintains some semblance of -artistic control over the development of the package, while giving the users of -the package the right to use and distribute the Package in a more-or-less -customary fashion, plus the right to make reasonable modifications. - -Definitions: - - - "Package" refers to the collection of files distributed by the Copyright - Holder, and derivatives of that collection of files created through - textual modification. - - "Standard Version" refers to such a Package if it has not been modified, - or has been modified in accordance with the wishes of the Copyright - Holder. - - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. - - "You" is you, if you're thinking about copying or distributing this Package. - - "Reasonable copying fee" is whatever you can justify on the basis of media - cost, duplication charges, time of people involved, and so on. (You will - not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) - - "Freely Available" means that no fee is charged for the item itself, though - there may be fees involved in handling the item. It also means that - recipients of the item may redistribute it under the same conditions they - received it. - -1. You may make and give away verbatim copies of the source form of the -Standard Version of this Package without restriction, provided that you -duplicate all of the original copyright notices and associated disclaimers. - -2. You may apply bug fixes, portability fixes and other modifications derived -from the Public Domain or from the Copyright Holder. A Package modified in such -a way shall still be considered the Standard Version. - -3. You may otherwise modify your copy of this Package in any way, provided that -you insert a prominent notice in each changed file stating how and when you -changed that file, and provided that you do at least ONE of the following: - - a) place your modifications in the Public Domain or otherwise make them - Freely Available, such as by posting said modifications to Usenet or an - equivalent medium, or placing the modifications on a major archive site - such as ftp.uu.net, or by allowing the Copyright Holder to include your - modifications in the Standard Version of the Package. - - b) use the modified Package only within your corporation or organization. - - c) rename any non-standard executables so the names do not conflict with - standard executables, which must also be provided, and provide a separate - manual page for each non-standard executable that clearly documents how it - differs from the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -4. You may distribute the programs of this Package in object code or executable -form, provided that you do at least ONE of the following: - - a) distribute a Standard Version of the executables and library files, - together with instructions (in the manual page or equivalent) on where to - get the Standard Version. - - b) accompany the distribution with the machine-readable source of the Package - with your modifications. - - c) accompany any non-standard executables with their corresponding Standard - Version executables, giving the non-standard executables non-standard - names, and clearly documenting the differences in manual pages (or - equivalent), together with instructions on where to get the Standard - Version. - - d) make other distribution arrangements with the Copyright Holder. - -5. You may charge a reasonable copying fee for any distribution of this -Package. You may charge any fee you choose for support of this Package. You -may not charge a fee for this Package itself. However, you may distribute this -Package in aggregate with other (possibly commercial) programs as part of a -larger (possibly commercial) software distribution provided that you do not -advertise this Package as a product of your own. - -6. The scripts and library files supplied as input to or produced as output -from the programs of this Package do not automatically fall under the copyright -of this Package, but belong to whomever generated them, and may be sold -commercially, and may be aggregated with this Package. - -7. C or perl subroutines supplied by you and linked into this Package shall not -be considered part of this Package. - -8. The name of the Copyright Holder may not be used to endorse or promote -products derived from this software without specific prior written permission. - -9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -The End diff --git a/data/YAML-AppConfig-0.19/MANIFEST b/data/YAML-AppConfig-0.19/MANIFEST deleted file mode 100644 index 787cda9..0000000 --- a/data/YAML-AppConfig-0.19/MANIFEST +++ /dev/null @@ -1,22 +0,0 @@ -Changes -lib/YAML/AppConfig.pm -LICENSE -Makefile.PL -MANIFEST -README.md -t/00-load.t -t/01-basic.t -t/02-normal.t -t/03-vars.t -t/04-api.t -t/05-scoping.t -t/data/basic.yaml -t/data/config.yaml -t/data/merge.yaml -t/data/normal.yaml -t/data/scoping.yaml -t/data/vars.yaml -t/lib/helpers.pl -t/lib/MatthewTestClass.pm -META.yml Module meta-data (added by MakeMaker) -META.json Module JSON meta-data (added by MakeMaker) diff --git a/data/YAML-AppConfig-0.19/META.json b/data/YAML-AppConfig-0.19/META.json deleted file mode 100644 index f271d22..0000000 --- a/data/YAML-AppConfig-0.19/META.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "abstract" : "Manage configuration files with YAML and variable references.", - "author" : [ - "Matthew O'Connor " - ], - "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.92, CPAN::Meta::Converter version 2.140640", - "license" : [ - "perl_5" - ], - "meta-spec" : { - "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" - }, - "name" : "YAML-AppConfig", - "no_index" : { - "directory" : [ - "t", - "inc" - ] - }, - "prereqs" : { - "build" : { - "requires" : { - "ExtUtils::MakeMaker" : "0" - } - }, - "configure" : { - "requires" : { - "ExtUtils::MakeMaker" : "0" - } - }, - "runtime" : { - "requires" : { - "Carp" : "0", - "Storable" : "0", - "YAML" : "0.38", - "perl" : "5.006000", - "strict" : "0", - "warnings" : "0" - } - }, - "test" : { - "requires" : { - "Test::More" : "0" - } - } - }, - "release_status" : "stable", - "resources" : { - "bugtracker" : { - "web" : "https://rt.cpan.org/Dist/Display.html?Name=YAML-AppConfig" - }, - "repository" : { - "type" : "git", - "url" : "git://github.com/Xaerxess/YAML-AppConfig.git", - "web" : "/~https://github.com/Xaerxess/YAML-AppConfig" - } - }, - "version" : "0.19" -} diff --git a/data/YAML-AppConfig-0.19/META.yml b/data/YAML-AppConfig-0.19/META.yml deleted file mode 100644 index 6aa72f2..0000000 --- a/data/YAML-AppConfig-0.19/META.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -abstract: 'Manage configuration files with YAML and variable references.' -author: - - "Matthew O'Connor " -build_requires: - ExtUtils::MakeMaker: '0' - Test::More: '0' -configure_requires: - ExtUtils::MakeMaker: '0' -dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.92, CPAN::Meta::Converter version 2.140640' -license: perl -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: '1.4' -name: YAML-AppConfig -no_index: - directory: - - t - - inc -requires: - Carp: '0' - Storable: '0' - YAML: '0.38' - perl: '5.006000' - strict: '0' - warnings: '0' -resources: - bugtracker: https://rt.cpan.org/Dist/Display.html?Name=YAML-AppConfig - repository: git://github.com/Xaerxess/YAML-AppConfig.git -version: '0.19' diff --git a/data/YAML-AppConfig-0.19/MYMETA.yml b/data/YAML-AppConfig-0.19/MYMETA.yml deleted file mode 100644 index 7b0cf0f..0000000 --- a/data/YAML-AppConfig-0.19/MYMETA.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -abstract: 'Manage configuration files with YAML and variable references.' -author: - - "Matthew O'Connor " -build_requires: - Test::More: 0 -configure_requires: - ExtUtils::MakeMaker: 0 -distribution_type: module -dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 6.57_05' -license: perl_5 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 2 -name: YAML-AppConfig -no_index: - directory: - - t - - inc -requires: - Carp: 0 - Storable: 0 - YAML: 0.38 - YAML::Syck: 0 - perl: 5.006000 - strict: 0 - warnings: 0 -resources: - bugtracker: - web: https://rt.cpan.org/Dist/Display.html?Name=YAML-AppConfig - repository: - type: git - url: git://github.com/Xaerxess/YAML-AppConfig.git - web: /~https://github.com/Xaerxess/YAML-AppConfig -version: 0.19 diff --git a/data/YAML-AppConfig-0.19/Makefile b/data/YAML-AppConfig-0.19/Makefile deleted file mode 100644 index f043a8f..0000000 --- a/data/YAML-AppConfig-0.19/Makefile +++ /dev/null @@ -1,812 +0,0 @@ -# This Makefile is for the YAML::AppConfig extension to perl. -# -# It was generated automatically by MakeMaker version -# 6.57_05 (Revision: 65705) from the contents of -# Makefile.PL. Don't edit this file, edit Makefile.PL instead. -# -# ANY CHANGES MADE HERE WILL BE LOST! -# -# MakeMaker ARGV: (q[INSTALL_BASE=/net/fantasia/home/hmkang/bin/apigenome]) -# - -# MakeMaker Parameters: - -# ABSTRACT_FROM => q[lib/YAML/AppConfig.pm] -# AUTHOR => [q[Matthew O'Connor ]] -# BUILD_REQUIRES => { Test::More=>q[0] } -# LICENSE => q[perl_5] -# META_MERGE => { resources=>{ repository=>{ web=>q[/~https://github.com/Xaerxess/YAML-AppConfig], url=>q[git://github.com/Xaerxess/YAML-AppConfig.git], type=>q[git] }, bugtracker=>{ web=>q[https://rt.cpan.org/Dist/Display.html?Name=YAML-AppConfig] } }, meta-spec=>{ version=>q[2] } } -# MIN_PERL_VERSION => q[5.006000] -# NAME => q[YAML::AppConfig] -# PREREQ_PM => { Test::More=>q[0], strict=>q[0], warnings=>q[0], YAML=>q[0.38], Storable=>q[0], YAML::Syck=>q[0], Carp=>q[0] } -# VERSION_FROM => q[lib/YAML/AppConfig.pm] -# test => { TESTS=>q[t/*.t] } - -# --- MakeMaker post_initialize section: - - -# --- MakeMaker const_config section: - -# These definitions are from config.sh (via /usr/lib/perl/5.14/Config.pm). -# They may have been overridden via Makefile.PL or on the command line. -AR = ar -CC = cc -CCCDLFLAGS = -fPIC -CCDLFLAGS = -Wl,-E -DLEXT = so -DLSRC = dl_dlopen.xs -EXE_EXT = -FULL_AR = /usr/bin/ar -LD = cc -LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector -LDFLAGS = -fstack-protector -L/usr/local/lib -LIBC = -LIB_EXT = .a -OBJ_EXT = .o -OSNAME = linux -OSVERS = 2.6.42-37-generic -RANLIB = : -SITELIBEXP = /usr/local/share/perl/5.14.2 -SITEARCHEXP = /usr/local/lib/perl/5.14.2 -SO = so -VENDORARCHEXP = /usr/lib/perl5 -VENDORLIBEXP = /usr/share/perl5 - - -# --- MakeMaker constants section: -AR_STATIC_ARGS = cr -DIRFILESEP = / -DFSEP = $(DIRFILESEP) -NAME = YAML::AppConfig -NAME_SYM = YAML_AppConfig -VERSION = 0.19 -VERSION_MACRO = VERSION -VERSION_SYM = 0_19 -DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" -XS_VERSION = 0.19 -XS_VERSION_MACRO = XS_VERSION -XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" -INST_ARCHLIB = blib/arch -INST_SCRIPT = blib/script -INST_BIN = blib/bin -INST_LIB = blib/lib -INST_MAN1DIR = blib/man1 -INST_MAN3DIR = blib/man3 -MAN1EXT = 1p -MAN3EXT = 3pm -INSTALLDIRS = site -INSTALL_BASE = /net/fantasia/home/hmkang/bin/apigenome -DESTDIR = -PREFIX = $(INSTALL_BASE) -INSTALLPRIVLIB = $(INSTALL_BASE)/lib/perl5 -DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) -INSTALLSITELIB = $(INSTALL_BASE)/lib/perl5 -DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) -INSTALLVENDORLIB = $(INSTALL_BASE)/lib/perl5 -DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) -INSTALLARCHLIB = $(INSTALL_BASE)/lib/perl5/x86_64-linux-gnu-thread-multi -DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) -INSTALLSITEARCH = $(INSTALL_BASE)/lib/perl5/x86_64-linux-gnu-thread-multi -DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) -INSTALLVENDORARCH = $(INSTALL_BASE)/lib/perl5/x86_64-linux-gnu-thread-multi -DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) -INSTALLBIN = $(INSTALL_BASE)/bin -DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) -INSTALLSITEBIN = $(INSTALL_BASE)/bin -DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) -INSTALLVENDORBIN = $(INSTALL_BASE)/bin -DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) -INSTALLSCRIPT = $(INSTALL_BASE)/bin -DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) -INSTALLSITESCRIPT = $(INSTALL_BASE)/bin -DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) -INSTALLVENDORSCRIPT = $(INSTALL_BASE)/bin -DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) -INSTALLMAN1DIR = $(INSTALL_BASE)/man/man1 -DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) -INSTALLSITEMAN1DIR = $(INSTALL_BASE)/man/man1 -DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) -INSTALLVENDORMAN1DIR = $(INSTALL_BASE)/man/man1 -DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) -INSTALLMAN3DIR = $(INSTALL_BASE)/man/man3 -DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) -INSTALLSITEMAN3DIR = $(INSTALL_BASE)/man/man3 -DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) -INSTALLVENDORMAN3DIR = $(INSTALL_BASE)/man/man3 -DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) -PERL_LIB = /usr/share/perl/5.14 -PERL_ARCHLIB = /usr/lib/perl/5.14 -LIBPERL_A = libperl.a -FIRST_MAKEFILE = Makefile -MAKEFILE_OLD = Makefile.old -MAKE_APERL_FILE = Makefile.aperl -PERLMAINCC = $(CC) -PERL_INC = /usr/lib/perl/5.14/CORE -PERL = /usr/bin/perl -FULLPERL = /usr/bin/perl -ABSPERL = $(PERL) -PERLRUN = $(PERL) -FULLPERLRUN = $(FULLPERL) -ABSPERLRUN = $(ABSPERL) -PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" -FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" -ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" -PERL_CORE = 0 -PERM_DIR = 755 -PERM_RW = 644 -PERM_RWX = 755 - -MAKEMAKER = /usr/share/perl/5.14/ExtUtils/MakeMaker.pm -MM_VERSION = 6.57_05 -MM_REVISION = 65705 - -# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). -# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) -# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) -# DLBASE = Basename part of dynamic library. May be just equal BASEEXT. -MAKE = make -FULLEXT = YAML/AppConfig -BASEEXT = AppConfig -PARENT_NAME = YAML -DLBASE = $(BASEEXT) -VERSION_FROM = lib/YAML/AppConfig.pm -OBJECT = -LDFROM = $(OBJECT) -LINKTYPE = dynamic -BOOTDEP = - -# Handy lists of source code files: -XS_FILES = -C_FILES = -O_FILES = -H_FILES = -MAN1PODS = -MAN3PODS = lib/YAML/AppConfig.pm - -# Where is the Config information that we are using/depend on -CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h - -# Where to build things -INST_LIBDIR = $(INST_LIB)/YAML -INST_ARCHLIBDIR = $(INST_ARCHLIB)/YAML - -INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) -INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) - -INST_STATIC = -INST_DYNAMIC = -INST_BOOT = - -# Extra linker info -EXPORT_LIST = -PERL_ARCHIVE = -PERL_ARCHIVE_AFTER = - - -TO_INST_PM = lib/YAML/AppConfig.pm - -PM_TO_BLIB = lib/YAML/AppConfig.pm \ - blib/lib/YAML/AppConfig.pm - - -# --- MakeMaker platform_constants section: -MM_Unix_VERSION = 6.57_05 -PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc - - -# --- MakeMaker tool_autosplit section: -# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto -AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' -- - - - -# --- MakeMaker tool_xsubpp section: - - -# --- MakeMaker tools_other section: -SHELL = /bin/sh -CHMOD = chmod -CP = cp -MV = mv -NOOP = $(TRUE) -NOECHO = @ -RM_F = rm -f -RM_RF = rm -rf -TEST_F = test -f -TOUCH = touch -UMASK_NULL = umask 0 -DEV_NULL = > /dev/null 2>&1 -MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- -EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- -FALSE = false -TRUE = true -ECHO = echo -ECHO_N = echo -n -UNINST = 0 -VERBINST = 0 -MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- -DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- -UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- -WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- -MACROSTART = -MACROEND = -USEMAKEFILE = -f -FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- - - -# --- MakeMaker makemakerdflt section: -makemakerdflt : all - $(NOECHO) $(NOOP) - - -# --- MakeMaker dist section: -TAR = tar -TARFLAGS = cvf -ZIP = zip -ZIPFLAGS = -r -COMPRESS = gzip --best -SUFFIX = .gz -SHAR = shar -PREOP = $(NOECHO) $(NOOP) -POSTOP = $(NOECHO) $(NOOP) -TO_UNIX = $(NOECHO) $(NOOP) -CI = ci -u -RCS_LABEL = rcs -Nv$(VERSION_SYM): -q -DIST_CP = best -DIST_DEFAULT = tardist -DISTNAME = YAML-AppConfig -DISTVNAME = YAML-AppConfig-0.19 - - -# --- MakeMaker macro section: - - -# --- MakeMaker depend section: - - -# --- MakeMaker cflags section: - - -# --- MakeMaker const_loadlibs section: - - -# --- MakeMaker const_cccmd section: - - -# --- MakeMaker post_constants section: - - -# --- MakeMaker pasthru section: - -PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ - LINKTYPE="$(LINKTYPE)"\ - PREFIX="$(PREFIX)"\ - INSTALL_BASE="$(INSTALL_BASE)" - - -# --- MakeMaker special_targets section: -.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) - -.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir - - - -# --- MakeMaker c_o section: - - -# --- MakeMaker xs_c section: - - -# --- MakeMaker xs_o section: - - -# --- MakeMaker top_targets section: -all :: pure_all manifypods - $(NOECHO) $(NOOP) - - -pure_all :: config pm_to_blib subdirs linkext - $(NOECHO) $(NOOP) - -subdirs :: $(MYEXTLIB) - $(NOECHO) $(NOOP) - -config :: $(FIRST_MAKEFILE) blibdirs - $(NOECHO) $(NOOP) - -help : - perldoc ExtUtils::MakeMaker - - -# --- MakeMaker blibdirs section: -blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists - $(NOECHO) $(NOOP) - -# Backwards compat with 6.18 through 6.25 -blibdirs.ts : blibdirs - $(NOECHO) $(NOOP) - -$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_LIBDIR) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) - $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists - -$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_ARCHLIB) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) - $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists - -$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_AUTODIR) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) - $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists - -$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) - $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists - -$(INST_BIN)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_BIN) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) - $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists - -$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_SCRIPT) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) - $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists - -$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_MAN1DIR) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) - $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists - -$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL - $(NOECHO) $(MKPATH) $(INST_MAN3DIR) - $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) - $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists - - - -# --- MakeMaker linkext section: - -linkext :: $(LINKTYPE) - $(NOECHO) $(NOOP) - - -# --- MakeMaker dlsyms section: - - -# --- MakeMaker dynamic section: - -dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) - $(NOECHO) $(NOOP) - - -# --- MakeMaker dynamic_bs section: - -BOOTSTRAP = - - -# --- MakeMaker dynamic_lib section: - - -# --- MakeMaker static section: - -## $(INST_PM) has been moved to the all: target. -## It remains here for awhile to allow for old usage: "make static" -static :: $(FIRST_MAKEFILE) $(INST_STATIC) - $(NOECHO) $(NOOP) - - -# --- MakeMaker static_lib section: - - -# --- MakeMaker manifypods section: - -POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" -POD2MAN = $(POD2MAN_EXE) - - -manifypods : pure_all \ - lib/YAML/AppConfig.pm - $(NOECHO) $(POD2MAN) --section=$(MAN3EXT) --perm_rw=$(PERM_RW) \ - lib/YAML/AppConfig.pm $(INST_MAN3DIR)/YAML::AppConfig.$(MAN3EXT) - - - - -# --- MakeMaker processPL section: - - -# --- MakeMaker installbin section: - - -# --- MakeMaker subdirs section: - -# none - -# --- MakeMaker clean_subdirs section: -clean_subdirs : - $(NOECHO) $(NOOP) - - -# --- MakeMaker clean section: - -# Delete temporary files but do not touch installed files. We don't delete -# the Makefile here so a later make realclean still has a makefile to use. - -clean :: clean_subdirs - - $(RM_F) \ - *$(LIB_EXT) core \ - core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \ - core.[0-9][0-9] $(BASEEXT).bso \ - pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \ - MYMETA.yml $(BASEEXT).x \ - $(BOOTSTRAP) perl$(EXE_EXT) \ - tmon.out *$(OBJ_EXT) \ - pm_to_blib $(INST_ARCHAUTODIR)/extralibs.ld \ - blibdirs.ts core.[0-9][0-9][0-9][0-9][0-9] \ - *perl.core core.*perl.*.? \ - $(MAKE_APERL_FILE) $(BASEEXT).def \ - perl core.[0-9][0-9][0-9] \ - mon.out lib$(BASEEXT).def \ - perlmain.c perl.exe \ - so_locations $(BASEEXT).exp - - $(RM_RF) \ - blib - - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) - - -# --- MakeMaker realclean_subdirs section: -realclean_subdirs : - $(NOECHO) $(NOOP) - - -# --- MakeMaker realclean section: -# Delete temporary files (via clean) and also delete dist files -realclean purge :: clean realclean_subdirs - - $(RM_F) \ - $(MAKEFILE_OLD) $(FIRST_MAKEFILE) - - $(RM_RF) \ - $(DISTVNAME) - - -# --- MakeMaker metafile section: -metafile : create_distdir - $(NOECHO) $(ECHO) Generating META.yml - $(NOECHO) $(ECHO) '--- #YAML:1.0' > META_new.yml - $(NOECHO) $(ECHO) 'name: YAML-AppConfig' >> META_new.yml - $(NOECHO) $(ECHO) 'version: 0.19' >> META_new.yml - $(NOECHO) $(ECHO) 'abstract: Manage configuration files with YAML and variable references.' >> META_new.yml - $(NOECHO) $(ECHO) 'author:' >> META_new.yml - $(NOECHO) $(ECHO) ' - Matthew O'\''Connor ' >> META_new.yml - $(NOECHO) $(ECHO) 'license: perl_5' >> META_new.yml - $(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml - $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml - $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml - $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml - $(NOECHO) $(ECHO) ' Test::More: 0' >> META_new.yml - $(NOECHO) $(ECHO) 'requires:' >> META_new.yml - $(NOECHO) $(ECHO) ' Carp: 0' >> META_new.yml - $(NOECHO) $(ECHO) ' perl: 5.006000' >> META_new.yml - $(NOECHO) $(ECHO) ' Storable: 0' >> META_new.yml - $(NOECHO) $(ECHO) ' strict: 0' >> META_new.yml - $(NOECHO) $(ECHO) ' warnings: 0' >> META_new.yml - $(NOECHO) $(ECHO) ' YAML: 0.38' >> META_new.yml - $(NOECHO) $(ECHO) ' YAML::Syck: 0' >> META_new.yml - $(NOECHO) $(ECHO) 'resources:' >> META_new.yml - $(NOECHO) $(ECHO) ' bugtracker:' >> META_new.yml - $(NOECHO) $(ECHO) ' web: https://rt.cpan.org/Dist/Display.html?Name=YAML-AppConfig' >> META_new.yml - $(NOECHO) $(ECHO) ' repository:' >> META_new.yml - $(NOECHO) $(ECHO) ' type: git' >> META_new.yml - $(NOECHO) $(ECHO) ' url: git://github.com/Xaerxess/YAML-AppConfig.git' >> META_new.yml - $(NOECHO) $(ECHO) ' web: /~https://github.com/Xaerxess/YAML-AppConfig' >> META_new.yml - $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml - $(NOECHO) $(ECHO) ' directory:' >> META_new.yml - $(NOECHO) $(ECHO) ' - t' >> META_new.yml - $(NOECHO) $(ECHO) ' - inc' >> META_new.yml - $(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.57_05' >> META_new.yml - $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml - $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml - $(NOECHO) $(ECHO) ' version: 2' >> META_new.yml - -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml - - -# --- MakeMaker signature section: -signature : - cpansign -s - - -# --- MakeMaker dist_basics section: -distclean :: realclean distcheck - $(NOECHO) $(NOOP) - -distcheck : - $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck - -skipcheck : - $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck - -manifest : - $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest - -veryclean : realclean - $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old - - - -# --- MakeMaker dist_core section: - -dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) - $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ - -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- - -tardist : $(DISTVNAME).tar$(SUFFIX) - $(NOECHO) $(NOOP) - -uutardist : $(DISTVNAME).tar$(SUFFIX) - uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu - -$(DISTVNAME).tar$(SUFFIX) : distdir - $(PREOP) - $(TO_UNIX) - $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) - $(RM_RF) $(DISTVNAME) - $(COMPRESS) $(DISTVNAME).tar - $(POSTOP) - -zipdist : $(DISTVNAME).zip - $(NOECHO) $(NOOP) - -$(DISTVNAME).zip : distdir - $(PREOP) - $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) - $(RM_RF) $(DISTVNAME) - $(POSTOP) - -shdist : distdir - $(PREOP) - $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar - $(RM_RF) $(DISTVNAME) - $(POSTOP) - - -# --- MakeMaker distdir section: -create_distdir : - $(RM_RF) $(DISTVNAME) - $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ - -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" - -distdir : create_distdir distmeta - $(NOECHO) $(NOOP) - - - -# --- MakeMaker dist_test section: -disttest : distdir - cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL "INSTALL_BASE=/net/fantasia/home/hmkang/bin/apigenome" - cd $(DISTVNAME) && $(MAKE) $(PASTHRU) - cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) - - - -# --- MakeMaker dist_ci section: - -ci : - $(PERLRUN) "-MExtUtils::Manifest=maniread" \ - -e "@all = keys %{ maniread() };" \ - -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ - -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" - - -# --- MakeMaker distmeta section: -distmeta : create_distdir metafile - $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \ - -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' -- - - - -# --- MakeMaker distsignature section: -distsignature : create_distdir - $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ - -e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' -- - $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE - cd $(DISTVNAME) && cpansign -s - - - -# --- MakeMaker install section: - -install :: pure_install doc_install - $(NOECHO) $(NOOP) - -install_perl :: pure_perl_install doc_perl_install - $(NOECHO) $(NOOP) - -install_site :: pure_site_install doc_site_install - $(NOECHO) $(NOOP) - -install_vendor :: pure_vendor_install doc_vendor_install - $(NOECHO) $(NOOP) - -pure_install :: pure_$(INSTALLDIRS)_install - $(NOECHO) $(NOOP) - -doc_install :: doc_$(INSTALLDIRS)_install - $(NOECHO) $(NOOP) - -pure__install : pure_site_install - $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site - -doc__install : doc_site_install - $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site - -pure_perl_install :: all - $(NOECHO) umask 022; $(MOD_INSTALL) \ - $(INST_LIB) $(DESTINSTALLPRIVLIB) \ - $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ - $(INST_BIN) $(DESTINSTALLBIN) \ - $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ - $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ - $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) - $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ - $(SITEARCHEXP)/auto/$(FULLEXT) - - -pure_site_install :: all - $(NOECHO) umask 02; $(MOD_INSTALL) \ - read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ - write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ - $(INST_LIB) $(DESTINSTALLSITELIB) \ - $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ - $(INST_BIN) $(DESTINSTALLSITEBIN) \ - $(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \ - $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ - $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) - $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ - $(PERL_ARCHLIB)/auto/$(FULLEXT) - -pure_vendor_install :: all - $(NOECHO) umask 022; $(MOD_INSTALL) \ - $(INST_LIB) $(DESTINSTALLVENDORLIB) \ - $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ - $(INST_BIN) $(DESTINSTALLVENDORBIN) \ - $(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \ - $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ - $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) - -doc_perl_install :: all - -doc_site_install :: all - $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLSITEARCH)/perllocal.pod - -$(NOECHO) umask 02; $(MKPATH) $(DESTINSTALLSITEARCH) - -$(NOECHO) umask 02; $(DOC_INSTALL) \ - "Module" "$(NAME)" \ - "installed into" "$(INSTALLSITELIB)" \ - LINKTYPE "$(LINKTYPE)" \ - VERSION "$(VERSION)" \ - EXE_FILES "$(EXE_FILES)" \ - >> $(DESTINSTALLSITEARCH)/perllocal.pod - -doc_vendor_install :: all - - -uninstall :: uninstall_from_$(INSTALLDIRS)dirs - $(NOECHO) $(NOOP) - -uninstall_from_perldirs :: - -uninstall_from_sitedirs :: - $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist - -uninstall_from_vendordirs :: - - - -# --- MakeMaker force section: -# Phony target to force checking subdirectories. -FORCE : - $(NOECHO) $(NOOP) - - -# --- MakeMaker perldepend section: - - -# --- MakeMaker makefile section: -# We take a very conservative approach here, but it's worth it. -# We move Makefile to Makefile.old here to avoid gnu make looping. -$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) - $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" - $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." - -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) - -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) - $(PERLRUN) Makefile.PL "INSTALL_BASE=/net/fantasia/home/hmkang/bin/apigenome" - $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" - $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" - $(FALSE) - - - -# --- MakeMaker staticmake section: - -# --- MakeMaker makeaperl section --- -MAP_TARGET = perl -FULLPERL = /usr/bin/perl - -$(MAP_TARGET) :: static $(MAKE_APERL_FILE) - $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ - -$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib - $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) - $(NOECHO) $(PERLRUNINST) \ - Makefile.PL DIR= \ - MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ - MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= \ - INSTALL_BASE=/net/fantasia/home/hmkang/bin/apigenome - - -# --- MakeMaker test section: - -TEST_VERBOSE=0 -TEST_TYPE=test_$(LINKTYPE) -TEST_FILE = test.pl -TEST_FILES = t/*.t -TESTDB_SW = -d - -testdb :: testdb_$(LINKTYPE) - -test :: $(TEST_TYPE) subdirs-test - -subdirs-test :: - $(NOECHO) $(NOOP) - - -test_dynamic :: pure_all - PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) - -testdb_dynamic :: pure_all - PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) - -test_ : test_dynamic - -test_static :: test_dynamic -testdb_static :: testdb_dynamic - - -# --- MakeMaker ppd section: -# Creates a PPD (Perl Package Description) for a binary distribution. -ppd : - $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' Manage configuration files with YAML and variable references.' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' Matthew O'\''Connor <matthew@canonical.org>' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd - - -# --- MakeMaker pm_to_blib section: - -pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) - $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ - lib/YAML/AppConfig.pm blib/lib/YAML/AppConfig.pm - $(NOECHO) $(TOUCH) pm_to_blib - - -# --- MakeMaker selfdocument section: - - -# --- MakeMaker postamble section: - - -# End. diff --git a/data/YAML-AppConfig-0.19/Makefile.PL b/data/YAML-AppConfig-0.19/Makefile.PL deleted file mode 100644 index 5023cdd..0000000 --- a/data/YAML-AppConfig-0.19/Makefile.PL +++ /dev/null @@ -1,69 +0,0 @@ -use strict; -use warnings; -use ExtUtils::MakeMaker; - -my %WriteMakefileArgs = ( - NAME => 'YAML::AppConfig', - AUTHOR => 'Matthew O\'Connor ', - ABSTRACT_FROM => 'lib/YAML/AppConfig.pm', - VERSION_FROM => 'lib/YAML/AppConfig.pm', - MIN_PERL_VERSION => '5.6.0', - PREREQ_PM => { - get_yamls(), - 'strict' => 0, - 'warnings' => 0, - 'Storable' => 0, - 'Carp' => 0, - }, - TEST_REQUIRES => { - 'Test::More' => 0, - }, - LICENSE => 'perl_5', - META_MERGE => { - 'meta-spec' => { version => 2 }, - resources => { - repository => { - type => 'git', - url => 'git://github.com/Xaerxess/YAML-AppConfig.git', - web => '/~https://github.com/Xaerxess/YAML-AppConfig', - }, - bugtracker => { - web => 'https://rt.cpan.org/Dist/Display.html?Name=YAML-AppConfig', - }, - }, - }, - test => { - TESTS => "t/*.t" - }, -); - -sub get_yamls { - my @yamls; - for my $info (['YAML::Syck' => 0], [YAML => 0.38]) { - eval "require $info->[0]; 0;"; - push @yamls, @$info unless $@; - } - die "YAML >= 0.38 or YAML::Syck >= 0 required.\n" unless @yamls; - return @yamls; -} - -unless (eval { ExtUtils::MakeMaker->VERSION(6.64) }) { - my $test_requires = delete $WriteMakefileArgs{TEST_REQUIRES}; - if (eval { ExtUtils::MakeMaker->VERSION(6.5503) }) { - $WriteMakefileArgs{BUILD_REQUIRES} = $test_requires; - } -} - -unless (eval { ExtUtils::MakeMaker->VERSION(6.48) }) { - delete $WriteMakefileArgs{MIN_PERL_VERSION}; -} - -unless (eval { ExtUtils::MakeMaker->VERSION(6.46) }) { - delete $WriteMakefileArgs{META_MERGE}; -} - -unless (eval { ExtUtils::MakeMaker->VERSION(6.31) }) { - delete $WriteMakefileArgs{LICENSE}; -} - -WriteMakefile(%WriteMakefileArgs); diff --git a/data/YAML-AppConfig-0.19/README.md b/data/YAML-AppConfig-0.19/README.md deleted file mode 100644 index 02048bb..0000000 --- a/data/YAML-AppConfig-0.19/README.md +++ /dev/null @@ -1,47 +0,0 @@ -YAML::AppConfig -=============== - -YAML::AppConfig - Manage configuration files with YAML and variable references - -INSTALLATION ------------- - -To install the module from CPAN, use - - cpan YAML::AppConfig - -If you have the App::cpanminus installer, you may prefer - - cpanm YAML::AppConfig - -To install this module from tarball archive file containing this distribution, -type - - perl Makefile.PL - make - make test - make install - -DOCUMENTATION -------------- - -You can read the documentation for the module online at the following websites: - - * http://search.cpan.org/perldoc?YAML::AppConfig - * http://metacpan.org/release/YAML::AppConfig - -After installing the module, you can read the documentation on your computer -using - - perldoc YAML::AppConfig - -COPYRIGHT AND LICENCE ---------------------- - -Copyright 2006 Matthew O'Connor. - -This program is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -The full text of the license can be found in the LICENSE file included with -this module. diff --git a/data/YAML-AppConfig-0.19/blib/arch/.exists b/data/YAML-AppConfig-0.19/blib/arch/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/arch/auto/YAML/AppConfig/.exists b/data/YAML-AppConfig-0.19/blib/arch/auto/YAML/AppConfig/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/bin/.exists b/data/YAML-AppConfig-0.19/blib/bin/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/lib/YAML/.exists b/data/YAML-AppConfig-0.19/blib/lib/YAML/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/lib/YAML/AppConfig.pm b/data/YAML-AppConfig-0.19/blib/lib/YAML/AppConfig.pm deleted file mode 100644 index d4f7cc3..0000000 --- a/data/YAML-AppConfig-0.19/blib/lib/YAML/AppConfig.pm +++ /dev/null @@ -1,602 +0,0 @@ -package YAML::AppConfig; -use strict; -use warnings; -use Carp; -use Storable qw(dclone); # For Deep Copy - -#################### -# Global Variables -#################### -our $VERSION = '0.19'; -our @YAML_PREFS = qw(YAML::Syck YAML); - -######################### -# Class Methods: Public -######################### -sub new { - my ($class, %args) = @_; - my $self = bless( \%args, ref($class) || $class ); - - # Load a YAML parser. - $self->{yaml_class} = $self->_load_yaml_class(); - - # Load config from file, string, or object. - if ( exists $self->{file} ) { - my $load_file = eval "\\&$self->{yaml_class}::LoadFile"; - $self->{config} = $load_file->( $self->{file} ); - } elsif ( exists $self->{string} ) { - my $load = eval "\\&$self->{yaml_class}::Load"; - $self->{config} = $load->( $self->{string} ); - } elsif ( exists $self->{object} ) { - $self->{config} = dclone( $self->{object}->{config} ); - } else { - $self->{config} = {}; - } - - # Initialize internal state - $self->_install_accessors(); # Install convenience accessors. - $self->{seen} = {}; # For finding circular references. - $self->{scope_stack} = []; # For implementing dynamic variables. - - return $self; -} - -############################# -# Instance Methods: Public -############################# -sub config { - my $self = shift; - return $self->{config}; -} - -sub config_keys { - my $self = shift; - return sort keys %{$self->config}; -} - -sub get { - my $self = shift; - $self->{seen} = {}; # Don't know if we exited cleanly, so clean up. - return $self->_get(@_); -} - -# Inner get so we can clear the seen hash above. Listed here for readability. -sub _get { - my ( $self, $key, $no_resolve ) = @_; - return unless $self->_scope_has($key); - return $self->config->{$key} if $self->{no_resolve} or $no_resolve; - croak "Circular reference in $key." if exists $self->{seen}->{$key}; - $self->{seen}->{$key} = 1; - my $value = $self->_resolve_refs($self->_get_from_scope($key)); - delete $self->{seen}->{$key}; - return $value; -} - -sub set { - my ($self, $key, $value) = @_; - return $self->config->{$key} = $value; -} - -sub merge { - my ( $self, %args ) = @_; - my $other_conf = $self->new( %args ); - for my $key ( $other_conf->config_keys ) { - $self->set( $key, $other_conf->get( $key, 'no vars' ) ); - } -} - -sub resolve { - my ( $self, $thing ) = @_; - $self->{seen} = {}; # Can't be sure this is empty, could've croaked. - return $self->_resolve_refs($thing); -} - -sub dump { - my ( $self, $file ) = @_; - my $func = eval "\\&$self->{yaml_class}::" . ($file ? 'DumpFile' : 'Dump'); - die "Could not find $func: $@" if $@; - $func->($file ? ($file) : (), $self->config); -} - -############################## -# Instance Methods: Private -############################## - -# void _resolve_refs(Scalar $value) -# -# Recurses on $value until a non-reference scalar is found, in which case we -# defer to _resolve_scalar. In this manner things like hashes and arrays are -# traversed depth-first. -sub _resolve_refs { - my ( $self, $value ) = @_; - if ( not ref $value ) { - $value = $self->_resolve_scalar($value); - } - elsif (ref $value eq 'HASH' ) { - $value = dclone($value); - my @hidden = $self->_push_scope($value); - for my $key ( keys %$value ) { - $value->{$key} = $self->_resolve_refs( $value->{$key} ); - } - $self->_pop_scope(@hidden); - return $value; - } - elsif (ref $value eq 'ARRAY' ) { - $value = dclone($value); - for my $item (@$value) { - $item = $self->_resolve_refs( $item ); - } - } - elsif (ref $value eq 'SCALAR' ) { - $value = $self->_resolve_scalar($$value); - } - else { - my ($class, $type) = map ref, ($self, $value); - die "${class}::_resolve_refs() can't handle $type references."; - } - - return $value; -} - -# List _push_scope(HashRef scope) -# -# Pushes a new scope onto the stack. Variables in this scope are hidden from -# the seen stack. This allows us to reference variables in the current scope -# even if they have the same name as a variable higher up in chain. The -# hidden variables are returned. -sub _push_scope { - my ( $self, $scope ) = @_; - unshift @{ $self->{scope_stack} }, dclone($scope); - my @hidden; - for my $key ( keys %$scope ) { - if ( exists $self->{seen}->{$key} ) { - push @hidden, $key; - delete $self->{seen}->{$key}; - } - } - return @hidden; -} - -# void _pop_scope(@hidden) -# -# Removes the currently active scope from the stack and unhides any variables -# passed in via @hidden, which is usually returned from _push_scope. -sub _pop_scope { - my ( $self, @hidden ) = @_; - shift @{$self->{scope_stack}}; - for my $key ( @hidden ) { - $self->{seen}->{$key} = 1; # Unhide - } -} - -# void _resolve_scalar(String $value) -# -# This function should only be called with strings (or numbers), not -# references. $value is treated as a string and is searched for $foo type -# variables, which are then resolved. The new string with variables resolved -# is returned. -sub _resolve_scalar { - my ( $self, $value ) = @_; - return unless defined $value; - my @parts = grep length, # Empty strings are useless, discard them - split /((?_get($name) if $self->_scope_has($name); - } else { - # Unescape slashes. Example: \\\$foo -> \\$foo, ditto with ${foo} - $part =~ s/(\\*)\\(\$(?:{(\w+)}|(\w+)))/$1$2/g; - } - } - return $parts[0] if @parts == 1 and ref $parts[0]; # Preserve references - return join "", map { defined($_) ? $_ : "" } @parts; -} - -# HashRef _scope(void) -# -# Returns the current scope. There is always a currenty defined scope, even -# if it's just the global scope. -sub _scope { - my $self = shift; - return $self->{scope_stack}->[0] || $self->config; -} - -# List _scope_stack(void) -# -# Returns the list of currently active scopes. The list is ordered from inner -# most scope to outer most scope. The global scope is always the last scope -# in the list. -sub _scope_stack { - my $self = shift; - return ( @{ $self->{scope_stack} }, $self->config ); -} - -# Boolean _get_from_scope(String key) -# -# This method returns true if the key is in any scope enclosing the current -# scope or in the current scope. False otherwise. -sub _scope_has { - my ( $self, $name ) = @_; - for my $scope ( $self->_scope_stack ) { - return 1 if exists $scope->{$name}; - } - return 0; -} - -# Scalar _get_from_scope(String key) -# -# Given a key this method returns its value as it's defined in the inner most -# enclosing scope containing the key. That is to say, this method implements -# the dyanmic scoping lookup for key. -sub _get_from_scope { - my ( $self, $key ) = @_; - for my $scope ( $self->_scope_stack ) { - return $scope->{$key} if exists $scope->{$key}; - } - return undef; -} - -# void _load_yaml_class -# -# Attempts to load a YAML class that can parse YAML for us. We prefer the -# yaml_class attribute over everything, then fall back to a previously loaded -# YAML parser from @YAML_PREFS, and failing that try to load a parser from -# @YAML_PREFS. -sub _load_yaml_class { - my $self = shift; - - # Always use what we were given. - if (defined $self->{yaml_class}) { - eval "require $self->{yaml_class}; 0;"; - croak "$@\n" if $@; - return $self->{yaml_class}; - } - - # Use what's already been loaded. - for my $module (@YAML_PREFS) { - my $filename = $module . ".pm"; - $filename =~ s{::}{/}; - return $self->{yaml_class} = $module if exists $INC{$filename}; - } - - # Finally, try and load something. - for my $module (@YAML_PREFS) { - eval "require $module; 0;"; - return $self->{yaml_class} = $module unless $@; - } - - die "Could not load: " . join(" or ", @YAML_PREFS); -} - -# void _install_accessors(void) -# -# Installs convienence methods for getting and setting configuration values. -# These methods are just curryed versions of get() and set(). -sub _install_accessors { - my $self = shift; - for my $key ($self->config_keys) { - next unless $key and $key =~ /^[a-zA-Z_]\w*$/; - for my $method (qw(get set)) { - no strict 'refs'; - no warnings 'redefine'; - my $method_name = ref($self) . "::${method}_$key"; - *{$method_name} = sub { $_[0]->$method($key, $_[1]) }; - } - } -} - -1; -__END__ - -=encoding UTF-8 - -=head1 NAME - -YAML::AppConfig - Manage configuration files with YAML and variable references. - -=head1 SYNOPSIS - - use YAML::AppConfig; - - # An extended example. YAML can also be loaded from a file. - my $string = <<'YAML'; - --- - root_dir: /opt - etc_dir: $root_dir/etc - cron_dir: $etc_dir/cron.d - var_dir $root_dir/var - var2_dir: ${var_dir}2 - usr: $root_dir/usr - usr_local: $usr/local - libs: - system: $usr/lib - local: $usr_local/lib - perl: - vendor: $system/perl - site: $local/perl - escape_example: $root_dir/\$var_dir/\\$var_dir - YAML - - # Load the YAML::AppConfig from the given YAML. - my $conf = YAML::AppConfig->new(string => $string); - - # Get settings in two different ways, both equivalent: - $conf->get("etc_dir"); # returns /opt/etc - $conf->get_etc_dir; # returns /opt/etc - - # Get raw settings (with no interpolation) in three equivalent ways: - $conf->get("etc_dir", 1); # returns '$root_dir/etc' - $conf->get_etc_dir(1); # returns '$root_dir/etc' - $conf->config->{etc_dir}; # returns '$root_dir/etc' - - # Set etc_dir in three different ways, all equivalent. - $conf->set("etc_dir", "/usr/local/etc"); - $conf->set_etc_dir("/usr/local/etc"); - $conf->config->{etc_dir} = "/usr/local/etc"; - - # Changing a setting can affect other settings: - $config->get_var2_dir; # returns /opt/var2 - $config->set_var_dir('/var/'); # change var_dr, which var2_dir uses. - $config->get_var2_dir; # returns /var2 - - # Variables are dynamically scoped: - $config->get_libs->{perl}->{vendor}; # returns "/opt/usr/lib/perl" - - # As seen above, variables are live and not static: - $config->usr_dir('cows are good: $root_dir'); - $config->get_usr_dir(); # returns "cows are good: /opt" - $config->resolve('rm -fR $root_dir'); # returns "rm -fR /opt" - - # Variables can be escaped, to avoid accidental interpolation: - $config->get_escape_example(); # returns "/opt/$var_dir/\$var_dir" - - # Merge in other configurations: - my $yaml =<<'YAML'; - --- - root_dir: cows - foo: are good - YAML - $config->merge(string => $yaml); - $config->get_root_dir(); # returns "cows" - $config->get_foo(); # returns "are good" - - # Get the raw YAML for your current configuration: - $config->dump(); # returns YAML as string - $config->dump("./conf.yaml"); # Writes YAML to ./conf.yaml - -=head1 DESCRIPTION - -L extends the work done in L and -L to allow more flexible configuration files. - -Your configuration is stored in YAML and then parsed and presented to you via -L. Settings can be referenced using C and C -methods and settings can refer to one another by using variables of the form -C<$foo>, much in the style of C. See L below -for more details. - -The underlying YAML parser is either L, L or one of your -choice. See L below for more information on how a YAML -parser is picked. - -=head1 THE YAML LIBRARY - -At this time there are two API compatible YAML libraries for Perl. L -and L. L chooses which YAML parser to use as -follows: - -=over - -=item yaml_class - -If C is given to C then it used above all other -considerations. You can use this to force use of L or L -when L isn't using the one you'd like. You can also use it -specify your own YAML parser, as long as it's API compatible with L and -L. - -=item The currently loaded YAML Parser - -If you don't specify C then L will default to -using an already loaded YAML parser, e.g. one of L or L. If -both are loaded then L is preferred. - -=item An installed YAML Parser. - -If no YAML parser has already been loaded then L will attempt -to load L and failing that it will attempt to load L. If -both fail then L will C when you create a new object -instance. - -=back - -=head1 USING VARIABLES - -=head2 Variable Syntax - -Variables refer to other settings inside the configuration file. -L variables have the same form as scalar variables in Perl. -That is they begin with a dollar sign and then start with a letter or an -underscore and then have zero or more letters, numbers, or underscores which -follow. For example, C<$foo>, C<$_bar>, and C<$cat_3> are all valid variable -names. - -Variable names can also be contained in curly brackets so you can have a -variable side-by-side with text that might otherwise be read as the name of -the variable itself. For example, C<${foo}bar> is the the variable C<$foo> -immediately followed by the literal text C. Without the curly brackets -L would assume the variable name was C<$foobar>, which is -incorrect. - -Variables can also be escaped by using backslashes. The text C<\$foo> will -resolve to the literal string C<$foo>. Likewise C<\\$foo> will resolve to the -literal string C<\$foo>, and so on. - -=head2 Variable Scoping - -YAML is essentially a serialization language and so it follows that your -configuration file is just an easy to read serialization of some data -structure. L assumes the top most data structure is a hash -and that variables are keys in that hash, or in some hash contained within. - -If every hash in the configuration file is thought of as a namespace then the -variables can be said to be dynamically scoped. For example, consider the -following configuration file: - - --- - foo: world - bar: hello - baz: - - $foo - - {foo: dogs, cats: $foo} - - $foo $bar - qux: - quack: $baz - -In this sample configuration the array contained by C<$baz> has two elements. -The first element resolves to the value C, the second element resolves -to the value "dogs", and the third element resolves to C. - -=head2 Variable Resolving - -Variables can also refer to entire data structures. For example, C<$quack> -will resolve to the same three element array as C<$baz>. However, YAML -natively gives you this ability and then some. So consider using YAML's -ability to take references to structures if L is not -providing enough power for your use case. - -In a L object the variables are not resolved until you -retrieve the variable (e.g. using C. This allows you to change -settings which are used by other settings and update many settings at once. -For example, if I call C then C will resolve -to C. - -If a variable can not be resolved because it doesn't correspond to a key -currently in scope then the variable will be left verbatim in the text. -Consider this example: - - --- - foo: - bar: food - qux: - baz: $bar - qix: $no_exist - -In this example C<$baz> resolves to the literal string C<$bar> since C<$bar> is -not visible within the current scope where C<$baz> is used. Likewise, C<$qix> -resolves to the literal string C<$no_exist> since there is no key in the -current scope named C. - -=head1 METHODS - -=head2 new(%args) - -Creates a new YAML::AppConfig object and returns it. new() accepts the -following key values pairs: - -=over 8 - -=item file - -The name of the file which contains your YAML configuration. - -=item string - -A string containing your YAML configuration. - -=item object - -A L object which will be deep copied into your object. - -=item no_resolve - -If true no attempt at variable resolution is done on calls to C. - -=item yaml_class - -The name of the class we should use to find our C and C -functions for parsing YAML files and strings, respectively. The named class -should provide both C and C as functions and should be loadable -via C. - -=back - -=head2 get(key, [no_resolve]) - -Given C<$key> the value of that setting is returned, same as C. If -C<$no_resolve> is true then the raw value associated with C<$key> is returned, -no variable interpolation is done. - -It is assumed that C<$key> refers to a setting at the top level of the -configuration file. - -=head2 set(key, value) - -The setting C<$key> will have its value changed to C<$value>. It is assumed -that C<$key> refers to a setting at the top level of the configuration file. - -=head2 get_*([no_resolve]) - -Convenience methods to retrieve values using a method, see C. For -example if C is a configuration key in top level of your YAML file -then C retrieves its value. These methods are curried versions -of C. These functions all take a single optional argument, -C<$no_resolve>, which is the same as C C<$no_resolve>. - -=head2 set_*(value) - -Convenience methods to set values using a method, see C and C. -These methods are curried versions of C. - -=head2 config - -Returns the hash reference to the raw config hash. None of the values are -interpolated, this is just the raw data. - -=head2 config_keys - -Returns the keys in C sorted from first to last. - -=head2 merge(%args) - -Merge takes another YAML configuration and merges it into this one. C<%args> -are the same as those passed to C, so the configuration can come from a -file, string, or existing L object. - -=head2 resolve($scalar) - -C runs the internal parser on non-reference scalars and returns the -result. If the scalar is a reference then it is deep copied and a copy is -returned where the non-reference leaves of the data structure are parsed and -replaced as described in L. - -=head2 dump([$file]) - -Serializes the current configuration using the YAML parser's Dump or, if -C<$file> is given, DumpFile functions. No interpolation is done, so the -configuration is saved raw. Things like comments will be lost, just as they -would if you did C, because that is what what calling -C on an instantiated object amounts to. - -=head1 AUTHORS - -Matthew O'Connor Ematthew@canonical.orgE - -Original implementations by Kirrily "Skud" Robert (as L) and -Shawn Boyette (as L). - -Currently maintained by Grzegorz Rożniecki Exaerxess@gmail.comE. - -=head1 SEE ALSO - -L, L, L, L - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 Matthew O'Connor, All Rights Reserved. - -This program is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff --git a/data/YAML-AppConfig-0.19/blib/lib/auto/YAML/AppConfig/.exists b/data/YAML-AppConfig-0.19/blib/lib/auto/YAML/AppConfig/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/man1/.exists b/data/YAML-AppConfig-0.19/blib/man1/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/man3/.exists b/data/YAML-AppConfig-0.19/blib/man3/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/blib/man3/YAML::AppConfig.3pm b/data/YAML-AppConfig-0.19/blib/man3/YAML::AppConfig.3pm deleted file mode 100644 index 88bd060..0000000 --- a/data/YAML-AppConfig-0.19/blib/man3/YAML::AppConfig.3pm +++ /dev/null @@ -1,408 +0,0 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "YAML::AppConfig 3pm" -.TH YAML::AppConfig 3pm "2014-03-14" "perl v5.14.2" "User Contributed Perl Documentation" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -YAML::AppConfig \- Manage configuration files with YAML and variable references. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -.Vb 1 -\& use YAML::AppConfig; -\& -\& # An extended example. YAML can also be loaded from a file. -\& my $string = <<\*(AqYAML\*(Aq; -\& \-\-\- -\& root_dir: /opt -\& etc_dir: $root_dir/etc -\& cron_dir: $etc_dir/cron.d -\& var_dir $root_dir/var -\& var2_dir: ${var_dir}2 -\& usr: $root_dir/usr -\& usr_local: $usr/local -\& libs: -\& system: $usr/lib -\& local: $usr_local/lib -\& perl: -\& vendor: $system/perl -\& site: $local/perl -\& escape_example: $root_dir/\e$var_dir/\e\e$var_dir -\& YAML -\& -\& # Load the YAML::AppConfig from the given YAML. -\& my $conf = YAML::AppConfig\->new(string => $string); -\& -\& # Get settings in two different ways, both equivalent: -\& $conf\->get("etc_dir"); # returns /opt/etc -\& $conf\->get_etc_dir; # returns /opt/etc -\& -\& # Get raw settings (with no interpolation) in three equivalent ways: -\& $conf\->get("etc_dir", 1); # returns \*(Aq$root_dir/etc\*(Aq -\& $conf\->get_etc_dir(1); # returns \*(Aq$root_dir/etc\*(Aq -\& $conf\->config\->{etc_dir}; # returns \*(Aq$root_dir/etc\*(Aq -\& -\& # Set etc_dir in three different ways, all equivalent. -\& $conf\->set("etc_dir", "/usr/local/etc"); -\& $conf\->set_etc_dir("/usr/local/etc"); -\& $conf\->config\->{etc_dir} = "/usr/local/etc"; -\& -\& # Changing a setting can affect other settings: -\& $config\->get_var2_dir; # returns /opt/var2 -\& $config\->set_var_dir(\*(Aq/var/\*(Aq); # change var_dr, which var2_dir uses. -\& $config\->get_var2_dir; # returns /var2 -\& -\& # Variables are dynamically scoped: -\& $config\->get_libs\->{perl}\->{vendor}; # returns "/opt/usr/lib/perl" -\& -\& # As seen above, variables are live and not static: -\& $config\->usr_dir(\*(Aqcows are good: $root_dir\*(Aq); -\& $config\->get_usr_dir(); # returns "cows are good: /opt" -\& $config\->resolve(\*(Aqrm \-fR $root_dir\*(Aq); # returns "rm \-fR /opt" -\& -\& # Variables can be escaped, to avoid accidental interpolation: -\& $config\->get_escape_example(); # returns "/opt/$var_dir/\e$var_dir" -\& -\& # Merge in other configurations: -\& my $yaml =<<\*(AqYAML\*(Aq; -\& \-\-\- -\& root_dir: cows -\& foo: are good -\& YAML -\& $config\->merge(string => $yaml); -\& $config\->get_root_dir(); # returns "cows" -\& $config\->get_foo(); # returns "are good" -\& -\& # Get the raw YAML for your current configuration: -\& $config\->dump(); # returns YAML as string -\& $config\->dump("./conf.yaml"); # Writes YAML to ./conf.yaml -.Ve -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -YAML::AppConfig extends the work done in Config::YAML and -YAML::ConfigFile to allow more flexible configuration files. -.PP -Your configuration is stored in \s-1YAML\s0 and then parsed and presented to you via -YAML::AppConfig. Settings can be referenced using \f(CW\*(C`get\*(C'\fR and \f(CW\*(C`set\*(C'\fR -methods and settings can refer to one another by using variables of the form -\&\f(CW$foo\fR, much in the style of \f(CW\*(C`AppConfig\*(C'\fR. See \*(L"\s-1USING\s0 \s-1VARIABLES\s0\*(R" below -for more details. -.PP -The underlying \s-1YAML\s0 parser is either \s-1YAML\s0, YAML::Syck or one of your -choice. See \*(L"\s-1THE\s0 \s-1YAML\s0 \s-1LIBRARY\s0\*(R" below for more information on how a \s-1YAML\s0 -parser is picked. -.SH "THE YAML LIBRARY" -.IX Header "THE YAML LIBRARY" -At this time there are two \s-1API\s0 compatible \s-1YAML\s0 libraries for Perl. \s-1YAML\s0 -and YAML::Syck. YAML::AppConfig chooses which \s-1YAML\s0 parser to use as -follows: -.IP "yaml_class" 4 -.IX Item "yaml_class" -If \f(CW\*(C`yaml_class\*(C'\fR is given to \f(CW\*(C`new\*(C'\fR then it used above all other -considerations. You can use this to force use of \s-1YAML\s0 or YAML::Syck -when YAML::AppConfig isn't using the one you'd like. You can also use it -specify your own \s-1YAML\s0 parser, as long as it's \s-1API\s0 compatible with \s-1YAML\s0 and -YAML::Syck. -.IP "The currently loaded \s-1YAML\s0 Parser" 4 -.IX Item "The currently loaded YAML Parser" -If you don't specify \f(CW\*(C`yaml_class\*(C'\fR then YAML::AppConfig will default to -using an already loaded \s-1YAML\s0 parser, e.g. one of \s-1YAML\s0 or YAML::Syck. If -both are loaded then YAML::Syck is preferred. -.IP "An installed \s-1YAML\s0 Parser." 4 -.IX Item "An installed YAML Parser." -If no \s-1YAML\s0 parser has already been loaded then YAML::AppConfig will attempt -to load YAML::Syck and failing that it will attempt to load \s-1YAML\s0. If -both fail then YAML::AppConfig will \f(CW\*(C`croak\*(C'\fR when you create a new object -instance. -.SH "USING VARIABLES" -.IX Header "USING VARIABLES" -.SS "Variable Syntax" -.IX Subsection "Variable Syntax" -Variables refer to other settings inside the configuration file. -YAML::AppConfig variables have the same form as scalar variables in Perl. -That is they begin with a dollar sign and then start with a letter or an -underscore and then have zero or more letters, numbers, or underscores which -follow. For example, \f(CW$foo\fR, \f(CW$_bar\fR, and \f(CW$cat_3\fR are all valid variable -names. -.PP -Variable names can also be contained in curly brackets so you can have a -variable side-by-side with text that might otherwise be read as the name of -the variable itself. For example, \f(CW\*(C`${foo}bar\*(C'\fR is the the variable \f(CW$foo\fR -immediately followed by the literal text \f(CW\*(C`bar\*(C'\fR. Without the curly brackets -YAML::AppConfig would assume the variable name was \f(CW$foobar\fR, which is -incorrect. -.PP -Variables can also be escaped by using backslashes. The text \f(CW\*(C`\e$foo\*(C'\fR will -resolve to the literal string \f(CW$foo\fR. Likewise \f(CW\*(C`\e\e$foo\*(C'\fR will resolve to the -literal string \f(CW\*(C`\e$foo\*(C'\fR, and so on. -.SS "Variable Scoping" -.IX Subsection "Variable Scoping" -\&\s-1YAML\s0 is essentially a serialization language and so it follows that your -configuration file is just an easy to read serialization of some data -structure. YAML::AppConfig assumes the top most data structure is a hash -and that variables are keys in that hash, or in some hash contained within. -.PP -If every hash in the configuration file is thought of as a namespace then the -variables can be said to be dynamically scoped. For example, consider the -following configuration file: -.PP -.Vb 9 -\& \-\-\- -\& foo: world -\& bar: hello -\& baz: -\& \- $foo -\& \- {foo: dogs, cats: $foo} -\& \- $foo $bar -\& qux: -\& quack: $baz -.Ve -.PP -In this sample configuration the array contained by \f(CW$baz\fR has two elements. -The first element resolves to the value \f(CW\*(C`hello\*(C'\fR, the second element resolves -to the value \*(L"dogs\*(R", and the third element resolves to \f(CW\*(C`hello world\*(C'\fR. -.SS "Variable Resolving" -.IX Subsection "Variable Resolving" -Variables can also refer to entire data structures. For example, \f(CW$quack\fR -will resolve to the same three element array as \f(CW$baz\fR. However, \s-1YAML\s0 -natively gives you this ability and then some. So consider using \s-1YAML\s0's -ability to take references to structures if YAML::AppConfig is not -providing enough power for your use case. -.PP -In a YAML::AppConfig object the variables are not resolved until you -retrieve the variable (e.g. using \f(CW\*(C`get()\*(C'\fR. This allows you to change -settings which are used by other settings and update many settings at once. -For example, if I call \f(CW\*(C`set("baz", "cows")\*(C'\fR then \f(CW\*(C`get("quack")\*(C'\fR will resolve -to \f(CW\*(C`cows\*(C'\fR. -.PP -If a variable can not be resolved because it doesn't correspond to a key -currently in scope then the variable will be left verbatim in the text. -Consider this example: -.PP -.Vb 6 -\& \-\-\- -\& foo: -\& bar: food -\& qux: -\& baz: $bar -\& qix: $no_exist -.Ve -.PP -In this example \f(CW$baz\fR resolves to the literal string \f(CW$bar\fR since \f(CW$bar\fR is -not visible within the current scope where \f(CW$baz\fR is used. Likewise, \f(CW$qix\fR -resolves to the literal string \f(CW$no_exist\fR since there is no key in the -current scope named \f(CW\*(C`no_exist\*(C'\fR. -.SH "METHODS" -.IX Header "METHODS" -.SS "new(%args)" -.IX Subsection "new(%args)" -Creates a new YAML::AppConfig object and returns it. \fInew()\fR accepts the -following key values pairs: -.IP "file" 8 -.IX Item "file" -The name of the file which contains your \s-1YAML\s0 configuration. -.IP "string" 8 -.IX Item "string" -A string containing your \s-1YAML\s0 configuration. -.IP "object" 8 -.IX Item "object" -A YAML::AppConfig object which will be deep copied into your object. -.IP "no_resolve" 8 -.IX Item "no_resolve" -If true no attempt at variable resolution is done on calls to \f(CW\*(C`get()\*(C'\fR. -.IP "yaml_class" 8 -.IX Item "yaml_class" -The name of the class we should use to find our \f(CW\*(C`LoadFile\*(C'\fR and \f(CW\*(C`Load\*(C'\fR -functions for parsing \s-1YAML\s0 files and strings, respectively. The named class -should provide both \f(CW\*(C`LoadFile\*(C'\fR and \f(CW\*(C`Load\*(C'\fR as functions and should be loadable -via \f(CW\*(C`require\*(C'\fR. -.SS "get(key, [no_resolve])" -.IX Subsection "get(key, [no_resolve])" -Given \f(CW$key\fR the value of that setting is returned, same as \f(CW\*(C`get_$key\*(C'\fR. If -\&\f(CW$no_resolve\fR is true then the raw value associated with \f(CW$key\fR is returned, -no variable interpolation is done. -.PP -It is assumed that \f(CW$key\fR refers to a setting at the top level of the -configuration file. -.SS "set(key, value)" -.IX Subsection "set(key, value)" -The setting \f(CW$key\fR will have its value changed to \f(CW$value\fR. It is assumed -that \f(CW$key\fR refers to a setting at the top level of the configuration file. -.SS "get_*([no_resolve])" -.IX Subsection "get_*([no_resolve])" -Convenience methods to retrieve values using a method, see \f(CW\*(C`get\*(C'\fR. For -example if \f(CW\*(C`foo_bar\*(C'\fR is a configuration key in top level of your \s-1YAML\s0 file -then \f(CW\*(C`get_foo_bar\*(C'\fR retrieves its value. These methods are curried versions -of \f(CW\*(C`get\*(C'\fR. These functions all take a single optional argument, -\&\f(CW$no_resolve\fR, which is the same as \f(CW\*(C`get()\*(Aqs\*(C'\fR \f(CW$no_resolve\fR. -.SS "set_*(value)" -.IX Subsection "set_*(value)" -Convenience methods to set values using a method, see \f(CW\*(C`set\*(C'\fR and \f(CW\*(C`get_*\*(C'\fR. -These methods are curried versions of \f(CW\*(C`set\*(C'\fR. -.SS "config" -.IX Subsection "config" -Returns the hash reference to the raw config hash. None of the values are -interpolated, this is just the raw data. -.SS "config_keys" -.IX Subsection "config_keys" -Returns the keys in \f(CW\*(C`config()\*(C'\fR sorted from first to last. -.SS "merge(%args)" -.IX Subsection "merge(%args)" -Merge takes another \s-1YAML\s0 configuration and merges it into this one. \f(CW%args\fR -are the same as those passed to \f(CW\*(C`new()\*(C'\fR, so the configuration can come from a -file, string, or existing YAML::AppConfig object. -.SS "resolve($scalar)" -.IX Subsection "resolve($scalar)" -\&\f(CW\*(C`resolve()\*(C'\fR runs the internal parser on non-reference scalars and returns the -result. If the scalar is a reference then it is deep copied and a copy is -returned where the non-reference leaves of the data structure are parsed and -replaced as described in \*(L"\s-1USING\s0 \s-1VARIABLES\s0\*(R". -.SS "dump([$file])" -.IX Subsection "dump([$file])" -Serializes the current configuration using the \s-1YAML\s0 parser's Dump or, if -\&\f(CW$file\fR is given, DumpFile functions. No interpolation is done, so the -configuration is saved raw. Things like comments will be lost, just as they -would if you did \f(CW\*(C`Dump(Load($yaml))\*(C'\fR, because that is what what calling -\&\f(CW\*(C`dump()\*(C'\fR on an instantiated object amounts to. -.SH "AUTHORS" -.IX Header "AUTHORS" -Matthew O'Connor -.PP -Original implementations by Kirrily \*(L"Skud\*(R" Robert (as YAML::ConfigFile) and -Shawn Boyette (as Config::YAML). -.PP -Currently maintained by Grzegorz RoXniecki . -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\s-1YAML\s0, YAML::Syck, Config::YAML, YAML::ConfigFile -.SH "COPYRIGHT AND LICENSE" -.IX Header "COPYRIGHT AND LICENSE" -Copyright 2006 Matthew O'Connor, All Rights Reserved. -.PP -This program is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. diff --git a/data/YAML-AppConfig-0.19/blib/script/.exists b/data/YAML-AppConfig-0.19/blib/script/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/lib/YAML/AppConfig.pm b/data/YAML-AppConfig-0.19/lib/YAML/AppConfig.pm deleted file mode 100644 index d4f7cc3..0000000 --- a/data/YAML-AppConfig-0.19/lib/YAML/AppConfig.pm +++ /dev/null @@ -1,602 +0,0 @@ -package YAML::AppConfig; -use strict; -use warnings; -use Carp; -use Storable qw(dclone); # For Deep Copy - -#################### -# Global Variables -#################### -our $VERSION = '0.19'; -our @YAML_PREFS = qw(YAML::Syck YAML); - -######################### -# Class Methods: Public -######################### -sub new { - my ($class, %args) = @_; - my $self = bless( \%args, ref($class) || $class ); - - # Load a YAML parser. - $self->{yaml_class} = $self->_load_yaml_class(); - - # Load config from file, string, or object. - if ( exists $self->{file} ) { - my $load_file = eval "\\&$self->{yaml_class}::LoadFile"; - $self->{config} = $load_file->( $self->{file} ); - } elsif ( exists $self->{string} ) { - my $load = eval "\\&$self->{yaml_class}::Load"; - $self->{config} = $load->( $self->{string} ); - } elsif ( exists $self->{object} ) { - $self->{config} = dclone( $self->{object}->{config} ); - } else { - $self->{config} = {}; - } - - # Initialize internal state - $self->_install_accessors(); # Install convenience accessors. - $self->{seen} = {}; # For finding circular references. - $self->{scope_stack} = []; # For implementing dynamic variables. - - return $self; -} - -############################# -# Instance Methods: Public -############################# -sub config { - my $self = shift; - return $self->{config}; -} - -sub config_keys { - my $self = shift; - return sort keys %{$self->config}; -} - -sub get { - my $self = shift; - $self->{seen} = {}; # Don't know if we exited cleanly, so clean up. - return $self->_get(@_); -} - -# Inner get so we can clear the seen hash above. Listed here for readability. -sub _get { - my ( $self, $key, $no_resolve ) = @_; - return unless $self->_scope_has($key); - return $self->config->{$key} if $self->{no_resolve} or $no_resolve; - croak "Circular reference in $key." if exists $self->{seen}->{$key}; - $self->{seen}->{$key} = 1; - my $value = $self->_resolve_refs($self->_get_from_scope($key)); - delete $self->{seen}->{$key}; - return $value; -} - -sub set { - my ($self, $key, $value) = @_; - return $self->config->{$key} = $value; -} - -sub merge { - my ( $self, %args ) = @_; - my $other_conf = $self->new( %args ); - for my $key ( $other_conf->config_keys ) { - $self->set( $key, $other_conf->get( $key, 'no vars' ) ); - } -} - -sub resolve { - my ( $self, $thing ) = @_; - $self->{seen} = {}; # Can't be sure this is empty, could've croaked. - return $self->_resolve_refs($thing); -} - -sub dump { - my ( $self, $file ) = @_; - my $func = eval "\\&$self->{yaml_class}::" . ($file ? 'DumpFile' : 'Dump'); - die "Could not find $func: $@" if $@; - $func->($file ? ($file) : (), $self->config); -} - -############################## -# Instance Methods: Private -############################## - -# void _resolve_refs(Scalar $value) -# -# Recurses on $value until a non-reference scalar is found, in which case we -# defer to _resolve_scalar. In this manner things like hashes and arrays are -# traversed depth-first. -sub _resolve_refs { - my ( $self, $value ) = @_; - if ( not ref $value ) { - $value = $self->_resolve_scalar($value); - } - elsif (ref $value eq 'HASH' ) { - $value = dclone($value); - my @hidden = $self->_push_scope($value); - for my $key ( keys %$value ) { - $value->{$key} = $self->_resolve_refs( $value->{$key} ); - } - $self->_pop_scope(@hidden); - return $value; - } - elsif (ref $value eq 'ARRAY' ) { - $value = dclone($value); - for my $item (@$value) { - $item = $self->_resolve_refs( $item ); - } - } - elsif (ref $value eq 'SCALAR' ) { - $value = $self->_resolve_scalar($$value); - } - else { - my ($class, $type) = map ref, ($self, $value); - die "${class}::_resolve_refs() can't handle $type references."; - } - - return $value; -} - -# List _push_scope(HashRef scope) -# -# Pushes a new scope onto the stack. Variables in this scope are hidden from -# the seen stack. This allows us to reference variables in the current scope -# even if they have the same name as a variable higher up in chain. The -# hidden variables are returned. -sub _push_scope { - my ( $self, $scope ) = @_; - unshift @{ $self->{scope_stack} }, dclone($scope); - my @hidden; - for my $key ( keys %$scope ) { - if ( exists $self->{seen}->{$key} ) { - push @hidden, $key; - delete $self->{seen}->{$key}; - } - } - return @hidden; -} - -# void _pop_scope(@hidden) -# -# Removes the currently active scope from the stack and unhides any variables -# passed in via @hidden, which is usually returned from _push_scope. -sub _pop_scope { - my ( $self, @hidden ) = @_; - shift @{$self->{scope_stack}}; - for my $key ( @hidden ) { - $self->{seen}->{$key} = 1; # Unhide - } -} - -# void _resolve_scalar(String $value) -# -# This function should only be called with strings (or numbers), not -# references. $value is treated as a string and is searched for $foo type -# variables, which are then resolved. The new string with variables resolved -# is returned. -sub _resolve_scalar { - my ( $self, $value ) = @_; - return unless defined $value; - my @parts = grep length, # Empty strings are useless, discard them - split /((?_get($name) if $self->_scope_has($name); - } else { - # Unescape slashes. Example: \\\$foo -> \\$foo, ditto with ${foo} - $part =~ s/(\\*)\\(\$(?:{(\w+)}|(\w+)))/$1$2/g; - } - } - return $parts[0] if @parts == 1 and ref $parts[0]; # Preserve references - return join "", map { defined($_) ? $_ : "" } @parts; -} - -# HashRef _scope(void) -# -# Returns the current scope. There is always a currenty defined scope, even -# if it's just the global scope. -sub _scope { - my $self = shift; - return $self->{scope_stack}->[0] || $self->config; -} - -# List _scope_stack(void) -# -# Returns the list of currently active scopes. The list is ordered from inner -# most scope to outer most scope. The global scope is always the last scope -# in the list. -sub _scope_stack { - my $self = shift; - return ( @{ $self->{scope_stack} }, $self->config ); -} - -# Boolean _get_from_scope(String key) -# -# This method returns true if the key is in any scope enclosing the current -# scope or in the current scope. False otherwise. -sub _scope_has { - my ( $self, $name ) = @_; - for my $scope ( $self->_scope_stack ) { - return 1 if exists $scope->{$name}; - } - return 0; -} - -# Scalar _get_from_scope(String key) -# -# Given a key this method returns its value as it's defined in the inner most -# enclosing scope containing the key. That is to say, this method implements -# the dyanmic scoping lookup for key. -sub _get_from_scope { - my ( $self, $key ) = @_; - for my $scope ( $self->_scope_stack ) { - return $scope->{$key} if exists $scope->{$key}; - } - return undef; -} - -# void _load_yaml_class -# -# Attempts to load a YAML class that can parse YAML for us. We prefer the -# yaml_class attribute over everything, then fall back to a previously loaded -# YAML parser from @YAML_PREFS, and failing that try to load a parser from -# @YAML_PREFS. -sub _load_yaml_class { - my $self = shift; - - # Always use what we were given. - if (defined $self->{yaml_class}) { - eval "require $self->{yaml_class}; 0;"; - croak "$@\n" if $@; - return $self->{yaml_class}; - } - - # Use what's already been loaded. - for my $module (@YAML_PREFS) { - my $filename = $module . ".pm"; - $filename =~ s{::}{/}; - return $self->{yaml_class} = $module if exists $INC{$filename}; - } - - # Finally, try and load something. - for my $module (@YAML_PREFS) { - eval "require $module; 0;"; - return $self->{yaml_class} = $module unless $@; - } - - die "Could not load: " . join(" or ", @YAML_PREFS); -} - -# void _install_accessors(void) -# -# Installs convienence methods for getting and setting configuration values. -# These methods are just curryed versions of get() and set(). -sub _install_accessors { - my $self = shift; - for my $key ($self->config_keys) { - next unless $key and $key =~ /^[a-zA-Z_]\w*$/; - for my $method (qw(get set)) { - no strict 'refs'; - no warnings 'redefine'; - my $method_name = ref($self) . "::${method}_$key"; - *{$method_name} = sub { $_[0]->$method($key, $_[1]) }; - } - } -} - -1; -__END__ - -=encoding UTF-8 - -=head1 NAME - -YAML::AppConfig - Manage configuration files with YAML and variable references. - -=head1 SYNOPSIS - - use YAML::AppConfig; - - # An extended example. YAML can also be loaded from a file. - my $string = <<'YAML'; - --- - root_dir: /opt - etc_dir: $root_dir/etc - cron_dir: $etc_dir/cron.d - var_dir $root_dir/var - var2_dir: ${var_dir}2 - usr: $root_dir/usr - usr_local: $usr/local - libs: - system: $usr/lib - local: $usr_local/lib - perl: - vendor: $system/perl - site: $local/perl - escape_example: $root_dir/\$var_dir/\\$var_dir - YAML - - # Load the YAML::AppConfig from the given YAML. - my $conf = YAML::AppConfig->new(string => $string); - - # Get settings in two different ways, both equivalent: - $conf->get("etc_dir"); # returns /opt/etc - $conf->get_etc_dir; # returns /opt/etc - - # Get raw settings (with no interpolation) in three equivalent ways: - $conf->get("etc_dir", 1); # returns '$root_dir/etc' - $conf->get_etc_dir(1); # returns '$root_dir/etc' - $conf->config->{etc_dir}; # returns '$root_dir/etc' - - # Set etc_dir in three different ways, all equivalent. - $conf->set("etc_dir", "/usr/local/etc"); - $conf->set_etc_dir("/usr/local/etc"); - $conf->config->{etc_dir} = "/usr/local/etc"; - - # Changing a setting can affect other settings: - $config->get_var2_dir; # returns /opt/var2 - $config->set_var_dir('/var/'); # change var_dr, which var2_dir uses. - $config->get_var2_dir; # returns /var2 - - # Variables are dynamically scoped: - $config->get_libs->{perl}->{vendor}; # returns "/opt/usr/lib/perl" - - # As seen above, variables are live and not static: - $config->usr_dir('cows are good: $root_dir'); - $config->get_usr_dir(); # returns "cows are good: /opt" - $config->resolve('rm -fR $root_dir'); # returns "rm -fR /opt" - - # Variables can be escaped, to avoid accidental interpolation: - $config->get_escape_example(); # returns "/opt/$var_dir/\$var_dir" - - # Merge in other configurations: - my $yaml =<<'YAML'; - --- - root_dir: cows - foo: are good - YAML - $config->merge(string => $yaml); - $config->get_root_dir(); # returns "cows" - $config->get_foo(); # returns "are good" - - # Get the raw YAML for your current configuration: - $config->dump(); # returns YAML as string - $config->dump("./conf.yaml"); # Writes YAML to ./conf.yaml - -=head1 DESCRIPTION - -L extends the work done in L and -L to allow more flexible configuration files. - -Your configuration is stored in YAML and then parsed and presented to you via -L. Settings can be referenced using C and C -methods and settings can refer to one another by using variables of the form -C<$foo>, much in the style of C. See L below -for more details. - -The underlying YAML parser is either L, L or one of your -choice. See L below for more information on how a YAML -parser is picked. - -=head1 THE YAML LIBRARY - -At this time there are two API compatible YAML libraries for Perl. L -and L. L chooses which YAML parser to use as -follows: - -=over - -=item yaml_class - -If C is given to C then it used above all other -considerations. You can use this to force use of L or L -when L isn't using the one you'd like. You can also use it -specify your own YAML parser, as long as it's API compatible with L and -L. - -=item The currently loaded YAML Parser - -If you don't specify C then L will default to -using an already loaded YAML parser, e.g. one of L or L. If -both are loaded then L is preferred. - -=item An installed YAML Parser. - -If no YAML parser has already been loaded then L will attempt -to load L and failing that it will attempt to load L. If -both fail then L will C when you create a new object -instance. - -=back - -=head1 USING VARIABLES - -=head2 Variable Syntax - -Variables refer to other settings inside the configuration file. -L variables have the same form as scalar variables in Perl. -That is they begin with a dollar sign and then start with a letter or an -underscore and then have zero or more letters, numbers, or underscores which -follow. For example, C<$foo>, C<$_bar>, and C<$cat_3> are all valid variable -names. - -Variable names can also be contained in curly brackets so you can have a -variable side-by-side with text that might otherwise be read as the name of -the variable itself. For example, C<${foo}bar> is the the variable C<$foo> -immediately followed by the literal text C. Without the curly brackets -L would assume the variable name was C<$foobar>, which is -incorrect. - -Variables can also be escaped by using backslashes. The text C<\$foo> will -resolve to the literal string C<$foo>. Likewise C<\\$foo> will resolve to the -literal string C<\$foo>, and so on. - -=head2 Variable Scoping - -YAML is essentially a serialization language and so it follows that your -configuration file is just an easy to read serialization of some data -structure. L assumes the top most data structure is a hash -and that variables are keys in that hash, or in some hash contained within. - -If every hash in the configuration file is thought of as a namespace then the -variables can be said to be dynamically scoped. For example, consider the -following configuration file: - - --- - foo: world - bar: hello - baz: - - $foo - - {foo: dogs, cats: $foo} - - $foo $bar - qux: - quack: $baz - -In this sample configuration the array contained by C<$baz> has two elements. -The first element resolves to the value C, the second element resolves -to the value "dogs", and the third element resolves to C. - -=head2 Variable Resolving - -Variables can also refer to entire data structures. For example, C<$quack> -will resolve to the same three element array as C<$baz>. However, YAML -natively gives you this ability and then some. So consider using YAML's -ability to take references to structures if L is not -providing enough power for your use case. - -In a L object the variables are not resolved until you -retrieve the variable (e.g. using C. This allows you to change -settings which are used by other settings and update many settings at once. -For example, if I call C then C will resolve -to C. - -If a variable can not be resolved because it doesn't correspond to a key -currently in scope then the variable will be left verbatim in the text. -Consider this example: - - --- - foo: - bar: food - qux: - baz: $bar - qix: $no_exist - -In this example C<$baz> resolves to the literal string C<$bar> since C<$bar> is -not visible within the current scope where C<$baz> is used. Likewise, C<$qix> -resolves to the literal string C<$no_exist> since there is no key in the -current scope named C. - -=head1 METHODS - -=head2 new(%args) - -Creates a new YAML::AppConfig object and returns it. new() accepts the -following key values pairs: - -=over 8 - -=item file - -The name of the file which contains your YAML configuration. - -=item string - -A string containing your YAML configuration. - -=item object - -A L object which will be deep copied into your object. - -=item no_resolve - -If true no attempt at variable resolution is done on calls to C. - -=item yaml_class - -The name of the class we should use to find our C and C -functions for parsing YAML files and strings, respectively. The named class -should provide both C and C as functions and should be loadable -via C. - -=back - -=head2 get(key, [no_resolve]) - -Given C<$key> the value of that setting is returned, same as C. If -C<$no_resolve> is true then the raw value associated with C<$key> is returned, -no variable interpolation is done. - -It is assumed that C<$key> refers to a setting at the top level of the -configuration file. - -=head2 set(key, value) - -The setting C<$key> will have its value changed to C<$value>. It is assumed -that C<$key> refers to a setting at the top level of the configuration file. - -=head2 get_*([no_resolve]) - -Convenience methods to retrieve values using a method, see C. For -example if C is a configuration key in top level of your YAML file -then C retrieves its value. These methods are curried versions -of C. These functions all take a single optional argument, -C<$no_resolve>, which is the same as C C<$no_resolve>. - -=head2 set_*(value) - -Convenience methods to set values using a method, see C and C. -These methods are curried versions of C. - -=head2 config - -Returns the hash reference to the raw config hash. None of the values are -interpolated, this is just the raw data. - -=head2 config_keys - -Returns the keys in C sorted from first to last. - -=head2 merge(%args) - -Merge takes another YAML configuration and merges it into this one. C<%args> -are the same as those passed to C, so the configuration can come from a -file, string, or existing L object. - -=head2 resolve($scalar) - -C runs the internal parser on non-reference scalars and returns the -result. If the scalar is a reference then it is deep copied and a copy is -returned where the non-reference leaves of the data structure are parsed and -replaced as described in L. - -=head2 dump([$file]) - -Serializes the current configuration using the YAML parser's Dump or, if -C<$file> is given, DumpFile functions. No interpolation is done, so the -configuration is saved raw. Things like comments will be lost, just as they -would if you did C, because that is what what calling -C on an instantiated object amounts to. - -=head1 AUTHORS - -Matthew O'Connor Ematthew@canonical.orgE - -Original implementations by Kirrily "Skud" Robert (as L) and -Shawn Boyette (as L). - -Currently maintained by Grzegorz Rożniecki Exaerxess@gmail.comE. - -=head1 SEE ALSO - -L, L, L, L - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 Matthew O'Connor, All Rights Reserved. - -This program is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff --git a/data/YAML-AppConfig-0.19/pm_to_blib b/data/YAML-AppConfig-0.19/pm_to_blib deleted file mode 100644 index e69de29..0000000 diff --git a/data/YAML-AppConfig-0.19/t/00-load.t b/data/YAML-AppConfig-0.19/t/00-load.t deleted file mode 100644 index 160cd26..0000000 --- a/data/YAML-AppConfig-0.19/t/00-load.t +++ /dev/null @@ -1,57 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 28; -do "t/lib/helpers.pl"; -use lib 't/lib'; - -BEGIN { use_ok('YAML::AppConfig') } - -my $SKIP_NUM = 0; -test_load("YAML"); -test_load("YAML::Syck"); -ok($SKIP_NUM < 2, "Asserting at least one YAML parser was tested"); - -sub test_load { - my $class = shift; -SKIP: { - delete $INC{'YAML/Syck.pm'}; - delete $INC{'YAML.pm'}; - eval "require $class; 0;"; - if ($@) { - $SKIP_NUM++; - skip "$class did not load, this might be ok.", 13 - } else { - ok(1, "Testing $class"); - } - -# TEST: Object creation -{ - my $app = YAML::AppConfig->new(); - ok($app, "Instantiated object"); - is($app->{yaml_class}, $class, "Testing class is right."); - isa_ok( $app, "YAML::AppConfig", "Asserting isa YAML::AppConfig" ); - ok( $app->can('new'), "\$app has new() method." ); -} - -# TEST: Loading a different YAML class, string. -{ - my $test_class = 'MatthewTestClass'; - my $app = YAML::AppConfig->new(string => "cows", yaml_class => $test_class); - ok($app, "Instantiated object"); - is($app->{yaml_class}, $test_class, "Testing class is right."); - isa_ok( $app, "YAML::AppConfig", "Asserting isa YAML::AppConfig." ); - is($app->get_string, "cows", "Testing alternate YAML class (stirng)."); -} - -# TEST: Loading a different YAML class, file. -{ - my $test_class = 'MatthewTestClass'; - my $app = YAML::AppConfig->new(file => "dogs", yaml_class => $test_class); - ok($app, "Instantiated object"); - is($app->{yaml_class}, $test_class, "Testing class is right."); - isa_ok( $app, "YAML::AppConfig", "Asserting isa YAML::AppConfig." ); - is($app->get_file, "dogs", "Testing alternate YAML class (file)."); -} - -} # end SKIP -} # end SUB diff --git a/data/YAML-AppConfig-0.19/t/01-basic.t b/data/YAML-AppConfig-0.19/t/01-basic.t deleted file mode 100644 index 4c7f883..0000000 --- a/data/YAML-AppConfig-0.19/t/01-basic.t +++ /dev/null @@ -1,46 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 21; -do "t/lib/helpers.pl"; - -BEGIN { use_ok('YAML::AppConfig') } - -# TEST: Object creation from a file. -{ - my $app = YAML::AppConfig->new( file => "t/data/basic.yaml" ); - ok( $app, "Instantiated object from file." ); - isa_ok( $app, "YAML::AppConfig", "Asserting isa YAML::AppConfig" ); - my $c = 1; - for my $var (qw(foo bar)) { - is( $app->get($var), $c, "Retrieving value for $var." ); - my $method = "get_$var"; - ok( $app->can($method), "Checking that \$app can get_$var." ); - is( $app->$method($var), $c, "Retrieving $var with $method." ); - $c++; - } - - $app->set("bar", 99); - is($app->get("bar"), 99, "Setting bar, type set()."); - $app->set_bar(101); - is( $app->get("bar"), 101, "Setting bar, type set_bar()." ); -} - -# TEST: Object creation from string. -{ - my $app = YAML::AppConfig->new( string => slurp("t/data/basic.yaml") ); - ok( $app, "Instantiated object from string." ); - isa_ok( $app, "YAML::AppConfig", "Asserting isa YAML::AppConfig" ); - my $c = 1; - for my $var (qw(foo bar)) { - is( $app->get($var), $c, "Retrieving value for $var." ); - my $method = "get_$var"; - ok( $app->can($method), "Checking that \$app can get_$var." ); - is( $app->$method($var), $c, "Retrieving $var with $method." ); - $c++; - } - - $app->set("bar", 99); - is($app->get("bar"), 99, "Setting bar, type set()."); - $app->set_bar(101); - is( $app->get("bar"), 101, "Setting bar, type set_bar()." ); -} diff --git a/data/YAML-AppConfig-0.19/t/02-normal.t b/data/YAML-AppConfig-0.19/t/02-normal.t deleted file mode 100644 index 904f1cf..0000000 --- a/data/YAML-AppConfig-0.19/t/02-normal.t +++ /dev/null @@ -1,88 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 106; -do "t/lib/helpers.pl"; - -BEGIN { use_ok('YAML::AppConfig') } - -# TEST: Object creation from a file, string, and object. -{ - test_object_creation( string => slurp("t/data/normal.yaml") ); - my $app = test_object_creation( file => "t/data/normal.yaml" ); - test_object_creation( object => $app ); -} - -sub test_object_creation { - my $app = YAML::AppConfig->new( @_ ); - ok( $app, "Checking object creation." ); - - # Test obvious accessors are there. - for my $method (qw(food man good is i_like and)) { - ok( $app->can("get_$method"), "Testing $method getter" ); - ok( $app->can("set_$method"), "Testing $method setter" ); - } - - # Test we didn't get some strays. - for my $not_method (qw(yummy like or)) { - ok( !$app->can("get_$not_method"), "Testing !$not_method getter" ); - ok( !$app->can("set_$not_method"), "Testing !$not_method getter" ); - } - - # Test our wild things - ok( !$app->can('get_somtin!^^^wild'), - "Checking we can't do get_somtin!^^^wild" ); - ok( !$app->can('set_somtin!^^^wild'), - "Checking we can't do set_somtin!^^^wild" ); - is( $app->get('somtin!^^^wild'), 'cows', "Retrieving somtin!^^^wild" ); - ok( !$app->can('get_12_foo'), "Checking we can't do get_12_foo" ); - ok( !$app->can('set_12_foo'), "Checking we can't do set_12_foo" ); - is( $app->get('12_foo'), 'blah', "Retrieving 12_foo" ); - - # Test the values - is( $app->get_food, 'oh', "food test" ); - is( $app->get_man, 'yeah', "man test" ); - is( $app->get_good, 'it', "good test" ); - is( $app->get_is, 'good', "is test" ); - is_deeply( $app->get_i_like, [ 'tofu', 'spatetee', 'ice cream' ], - "i_like test" ); - is_deeply( - $app->get_and, - { - yummy => 'stuff', like => 'popcorn', - 'or' => [qw(candy fruit bars)] - }, - "and test" - ); - - return $app; -} - -# TEST: Two objects don't clober each others methods. -{ - my $bar = "get_bar"; - - my $app1 = YAML::AppConfig->new( string => "---\nfoo: 1\nbar: 2\n" ); - ok( $app1, "Checking object creation." ); - ok( $app1->can("get_foo"), "Checking that \$app1 has get_foo method." ); - ok( $app1->can("get_bar"), "Checking that \$app1 has get_bar method." ); - is( $app1->$bar, 2, "Checking bar1 is ok." ); - - my $app2 = YAML::AppConfig->new( string => "---\nqux: 3\nbar: 5\n" ); - ok( $app2, "Checking object creation." ); - ok( $app2->can("get_qux"), "Checking that \$app2 has get_qux method." ); - ok( $app2->can("get_bar"), "Checking that \$app2 has get_bar method." ); - is( $app2->$bar, 5, "Checking bar2 is ok." ); - - # Make sure we didn't clober each other. - is( $app1->$bar, 2, "Checking that value of bar1 in app1 is the same." ); - is( $app2->$bar, 5, "Checking that value of bar2 in app1 is the same." ); -} - -# TEST: Make sure we don't get warnings on undef. values -{ - my $app = YAML::AppConfig->new( string => "---\nnovalue:\n" ); - ok($app, "Object created"); - local $SIG{__WARN__} = sub { die }; - eval { $app->get_novalue }; - ok( !$@, "Getting a setting with no value does not produce warnings." ); -} diff --git a/data/YAML-AppConfig-0.19/t/03-vars.t b/data/YAML-AppConfig-0.19/t/03-vars.t deleted file mode 100644 index 750383f..0000000 --- a/data/YAML-AppConfig-0.19/t/03-vars.t +++ /dev/null @@ -1,204 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 56; -do "t/lib/helpers.pl"; -use Storable qw(dclone); - -BEGIN { use_ok('YAML::AppConfig') } - -# TEST: Variable usage. -{ - my $app = YAML::AppConfig->new( file => 't/data/vars.yaml' ); - ok($app, "Created object."); - - # Check basic retrieval - is( $app->get_dapper, "life", "Checking variables." ); - is( $app->get_breezy, "life is good", "Checking variables." ); - is( $app->get_hoary, "life is good, but so is food", - "Checking variables." ); - is( $app->get_stable, - "life is good, but so is food and so, once again, life is good.", - "Checking variables." ); - is( $app->get_nonvar, '$these are $non $vars with a var, life', - "Checking variables." ); - - # Check get()'s no resolve flag - is( $app->get( 'breezy', 1 ), '$dapper is good', - "Checking variables, no resolve." ); - is( $app->get_hoary(1), '$breezy, but so is food', - "Checking variables, no resolve." ); - - # Check basic setting - $app->set_dapper("money"); - is( $app->get_dapper, "money", "Checking variables." ); - is( $app->get_breezy, "money is good", "Checking variables." ); - is( $app->get_hoary, "money is good, but so is food", - "Checking variables." ); - is( $app->get_stable, - "money is good, but so is food and so, once again, money is good.", - "Checking variables." ); - is( $app->get_nonvar, '$these are $non $vars with a var, money', - "Checking variables." ); - - # Check that our circular references break. - for my $n ( 1 .. 4 ) { - my $method = "get_circ$n"; - eval { $app->$method }; - like( $@, qr/Circular reference/, "Checking that get_circ$n failed" ); - } - - # Break the circular reference. - $app->set_circ1("dogs"); - is($app->get_circ1, "dogs", "Checking circularity removal."); - is($app->get_circ2, "dogs lop bop oop", "Checking circularity removal."); - is($app->get_circ3, "dogs lop bop", "Checking circularity removal."); - is($app->get_circ4, "dogs lop", "Checking circularity removal."); - - # Test that we references load up in the expected way within scalars. - like( - $app->get_refs, - qr/^ARRAY\(.*?\) will not render, nor will HASH\(.*?\)$/, - "Checking that references are not used as variables." - ); - - # Test that nesting and interpolation of references works - my $nestee = { - food => 'money', - drink => [{ cows => [qw(are good)]}, "money is good and moneyyummy"], - }; - is_deeply( - $app->get_nest1, - { - blah => ["harry potter", "golem", "mickey mouse", $nestee], - loop => {foopy => [$nestee, "money is good"], boop => $nestee}, - }, - "Checking variable interpolation with references." - ); - - # Make sure circular references between references breaks - eval { $app->get_circrefref1 }; - like( $@, qr/Circular reference/, "Checking that get_circreref1 failed" ); - - # Look in the heart of our deep data structures - is_deeply($app->get_list, - [[[[[[[ - [ - 'money', - "money is good, but so is food and so, once again, money is good.", - ], - "money is good, but so is food" - ]]]]]]], "Testing nested list."); - is_deeply( - $app->get_hash, - { - key => { - key => { - key => { - key => { key => 'money is good', other => 'money' }, - something => 'money' - } - } - } - }, - "Testing nested hash." - ); -} - -# TEST: no_resolve -{ - my $app - = YAML::AppConfig->new( file => 't/data/vars.yaml', no_resolve => 1 ); - ok($app, "Created object."); - - # Check basic retrieval - is( $app->get_dapper, "life", "Checking variables, no_resolve => 1" ); - is( $app->get_breezy, '$dapper is good', - "Checking variables, no_resolve => 1" ); - is( - $app->get_hoary, '$breezy, but so is food', - "Checking variables, no_resolve => 1" - ); - is( - $app->get_stable, - '$hoary and so, once again, $breezy.', - "Checking variables, no_resolve => 1" - ); - is( - $app->get_nonvar, '$these are $non $vars with a var, $dapper', - "Checking variables, no_resolve => 1" - ); -} - -# TEST: Substituting in a variable with no value does not produce warnings -{ - my $app = YAML::AppConfig->new( string => "---\nnv:\nfoo: \$nv bar\n" ); - ok($app, "Object created"); - local $SIG{__WARN__} = sub { die }; - eval { $app->get_nv }; - ok( !$@, "Getting a setting with no value does not produce warnings." ); - eval { $app->get_foo }; - ok( !$@, "Getting a setting using a no value variable does not warn." ); - is( $app->get_foo, " bar", "No value var used as empty string." ); -} - -# TEST: Make sure ${foo} style vars work. -{ - my $yaml =<<'YAML'; ---- -xyz: foo -xyzbar: bad -'{xyzbar': bad -'xyz}bar': bad -test1: ${xyz}bar -test2: ${xyzbar -test3: $xyz}bar -YAML - my $app = YAML::AppConfig->new( string => $yaml ); - ok($app, "Object created"); - is( $app->get_test1, 'foobar', "Testing \${foo} type variables." ); - is( $app->get_test2, '${xyzbar', "Testing \${foo} type variables." ); - is( $app->get_test3, 'foo}bar', "Testing \${foo} type variables." ); -} - -# TEST: Escaping of variables. -{ - my $yaml =<<'YAML'; ---- -paulv: likes cheese -nosubst: \$paulv a lot -usens: $nosubst \$paulv $paulv \\\$paulv \\$paulv cows. -YAML - my $ESCAPE_N = 10; - - # Add \\$paulv, \\\$paulv, \\\\$paulv, ... - for my $n (1 .. $ESCAPE_N) { - $yaml .= "literal$n: " . '\\'x$n . "\\\$paulv stuffs\n"; - } - my $app = YAML::AppConfig->new( string => $yaml ); - ok($app, "Object created"); - - for my $n (1 .. $ESCAPE_N) { - my $string = '\\'x$n . '$paulv stuffs'; - is( $app->get("literal$n"), $string, "Testing escapes: $string" ); - } - is( $app->get_usens, - '$paulv a lot $paulv likes cheese \\\\$paulv \\$paulv cows.', - "Testing vars with escapes." ); -} - -# TEST: self-circular references -{ - my $yaml = <<'YAML'; ---- -foo: $foo -bar: - - cows - - $bar -YAML - my $app = YAML::AppConfig->new( string => $yaml ); - ok( $app, "Object loaded" ); - eval { $app->get_foo }; - like( $@, qr/Circular reference/, "Testing self-circular references. " ); - eval { $app->get_bar }; - like( $@, qr/Circular reference/, "Testing self-circular references. " ); -} diff --git a/data/YAML-AppConfig-0.19/t/04-api.t b/data/YAML-AppConfig-0.19/t/04-api.t deleted file mode 100644 index ebcb8d1..0000000 --- a/data/YAML-AppConfig-0.19/t/04-api.t +++ /dev/null @@ -1,89 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 24; -do "t/lib/helpers.pl"; - -BEGIN { use_ok('YAML::AppConfig') } - -# TEST: config and config_keys -{ - my $app = YAML::AppConfig->new( file => 't/data/config.yaml' ); - ok( $app, "Object created." ); - is_deeply( $app->config, { foo => 1, bar => 2, eep => '$foo' }, - "config() method." ); - is_deeply( [ $app->config_keys ], [qw(bar eep foo)], - "config_keys() method." ); -} - -# TEST: merge -{ - my $app = YAML::AppConfig->new( file => 't/data/basic.yaml' ); - ok( $app, "Object created." ); - is( $app->get_foo, 1, "Checking foo before merge()." ); - is( $app->get_bar, 2, "Checking bar before merge()." ); - $app->merge( file => 't/data/merge.yaml' ); - is( $app->get_foo, 2, "Checking foo after merge()." ); - is( $app->get_bar, 2, "Checking bar after merge()." ); - is( $app->get_baz, 3, "Checking bar after merge()." ); -} - -# TEST: resolve -{ - my $yaml = <<'YAML'; ---- -foo: hello -bar: $foo world -circ1: $circ2 -circ2: $circ1 -cows: - - are - - wonderful - - $bar -YAML - - my $app = YAML::AppConfig->new( string => $yaml ); - ok($app, "Object loaded"); - is( - $app->resolve('I like $bar a lot'), 'I like hello world a lot', - 'Testing our resolve()' - ); - is_deeply( - $app->resolve('$cows'), - [qw(are wonderful), "hello world"], - 'Testing our resolve() with references', - ); - eval { $app->resolve('$circ1 is a loop!') }; - like( $@, qr/Circular reference/, - 'Testing our resolve() with circular refs' ); - my $template = { qux => '$foo is good', baz => [ '$foo', '$cows' ] }; - my $new = $app->resolve($template); - isnt( $new, $template, "Testing we did not smash our old object" ); - is_deeply( - $new, - { - qux => 'hello is good', - baz => [ 'hello', [ qw(are wonderful), "hello world" ], ], - }, - "Testing our resolve() with nested structures." - ); -} - -# TEST: dump -{ - my $yaml = "---\nfoo: 1\nbar: 2\n"; - my $app = YAML::AppConfig->new( string => $yaml ); - ok( $app, "Object created." ); - $app->set_foo(42); - my $dump = $app->dump(); - like( $dump, qr/foo:\s*42/, "Testing dump()" ); - like( $dump, qr/bar:\s*2/, "Testing dump()" ); - - my $file = 't/data/dump.yaml'; - $app->dump($file); - ok( ( -f $file ), "Testing dump() with file: $file" ); - ok( open( FILE, $file ), "Opening file: $file" ); - my $text = join( "", ); - like( $text, qr/foo:\s*42/, "Testing dump() with file: $file" ); - like( $text, qr/bar:\s*2/, "Testing dump() with file: $file" ); - is( $text, $dump, "Testing that dump() and dump() to file are same" ); -} diff --git a/data/YAML-AppConfig-0.19/t/05-scoping.t b/data/YAML-AppConfig-0.19/t/05-scoping.t deleted file mode 100644 index c6ce98e..0000000 --- a/data/YAML-AppConfig-0.19/t/05-scoping.t +++ /dev/null @@ -1,51 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 9; -do "t/lib/helpers.pl"; -use Storable qw(dclone); - -BEGIN { use_ok('YAML::AppConfig') } - -# TEST: Testing dynamically scoped variables -{ - my $app = YAML::AppConfig->new( file => 't/data/scoping.yaml' ); - ok( $app, "Created object." ); - is( $app->get_foo, "top scope", "Testing foo's value" ); - is_deeply( $app->get_bar, { qux => "top scope" }, "Testing top scope." ); - is_deeply( - $app->get_baz, - { - foo => 'baz scope', - qux => 'baz scope qux', - test => 'world', - quxx => [ - { - food => { burger => 'baz scope', test => 'world' }, - fries => 'baz scope qux', - test => 'world', - }, - { - foo => 'inner scope', - food => { burger => 'inner scope', test => 'world' }, - fries => 'inner scope qux', - test => 'world', - }, - ], - }, - "Testing big baz structure." - ); - is_deeply( - $app->get_blah, - { blah => "self ref test", ego => "self ref test" }, - "Dynamic scoping handles self-refs right." - ); - eval {$app->get_simple_circ}; - like( $@, qr/Circular reference in simple_circ/, - "Checking circular dynamic variables." ); - eval {$app->get_circ}; - like( $@, qr/Circular reference in (?:prolog|circ|cows_are_good)/, - "Checking circular dynamic variables." ); - eval {$app->get_bigcirc}; - like( $@, qr/Circular reference in thing/, - "Checking circular dynamic variables." ); -} diff --git a/data/YAML-AppConfig-0.19/t/data/basic.yaml b/data/YAML-AppConfig-0.19/t/data/basic.yaml deleted file mode 100644 index d41731d..0000000 --- a/data/YAML-AppConfig-0.19/t/data/basic.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -foo: 1 -bar: 2 diff --git a/data/YAML-AppConfig-0.19/t/data/config.yaml b/data/YAML-AppConfig-0.19/t/data/config.yaml deleted file mode 100644 index 4a41087..0000000 --- a/data/YAML-AppConfig-0.19/t/data/config.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -foo: 1 -bar: 2 -eep: $foo diff --git a/data/YAML-AppConfig-0.19/t/data/dump.yaml b/data/YAML-AppConfig-0.19/t/data/dump.yaml deleted file mode 100644 index 1ae5ba4..0000000 --- a/data/YAML-AppConfig-0.19/t/data/dump.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -bar: 2 -foo: 42 diff --git a/data/YAML-AppConfig-0.19/t/data/merge.yaml b/data/YAML-AppConfig-0.19/t/data/merge.yaml deleted file mode 100644 index af68b46..0000000 --- a/data/YAML-AppConfig-0.19/t/data/merge.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# To be merged with basic.yaml -foo: 2 -baz: 3 diff --git a/data/YAML-AppConfig-0.19/t/data/normal.yaml b/data/YAML-AppConfig-0.19/t/data/normal.yaml deleted file mode 100644 index 6b16918..0000000 --- a/data/YAML-AppConfig-0.19/t/data/normal.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -food: oh -man: yeah -good: it -is: good -i_like: - - tofu - - spatetee - - ice cream -and: - yummy: stuff - like: popcorn - or: - - candy - - fruit - - bars -'somtin!^^^wild': cows -'12_foo': blah diff --git a/data/YAML-AppConfig-0.19/t/data/scoping.yaml b/data/YAML-AppConfig-0.19/t/data/scoping.yaml deleted file mode 100644 index 527d5b9..0000000 --- a/data/YAML-AppConfig-0.19/t/data/scoping.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -foo: top scope -hello: world -bar: - qux: $foo -blah: - blah: self ref test - ego: $blah -circ: - circ: $prolog - prolog: $cows_are_good - cows_are_good: $circ -simple_circ: - simple_circ: $simple_circ -bigcirc: - thing: $level3 - level1: - level2: - level3: - level4: - level5: $thing -baz: - foo: baz scope - qux: $foo qux - test: $hello - quxx: - - - food: - burger: $foo - test: $hello - fries: $qux - test: $hello - - - foo: inner scope - food: - burger: $foo - test: $hello - fries: $qux - test: $hello diff --git a/data/YAML-AppConfig-0.19/t/data/vars.yaml b/data/YAML-AppConfig-0.19/t/data/vars.yaml deleted file mode 100644 index c4af418..0000000 --- a/data/YAML-AppConfig-0.19/t/data/vars.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -dapper: life -breezy: $dapper is good -hoary: $breezy, but so is food -stable: $hoary and so, once again, $breezy. -nonvar: $these are $non $vars with a var, $dapper -circ1: $circ2 eep -circ2: $circ3 oop -circ3: $circ4 bop -circ4: $circ1 lop -refs: $list will not render, nor will $hash -list: - - - - - - - - - - - - - - - - $dapper - - $stable - - $hoary -hash: - key: - key: - key: - key: - key: $breezy - other: $dapper - something: $dapper -nest1: - blah: - - harry potter - - golem - - mickey mouse - - $nestee - loop: - foopy: - - $nestee - - $breezy - boop: $nestee -nest2: - cows: - - are - - good -nestee: - food: $dapper - drink: - - $nest2 - - $breezy and ${dapper}yummy -circrefref1: - - $circrefref2 -circrefref2: - - $circrefref1 diff --git a/data/YAML-AppConfig-0.19/t/lib/MatthewTestClass.pm b/data/YAML-AppConfig-0.19/t/lib/MatthewTestClass.pm deleted file mode 100644 index ff72c8b..0000000 --- a/data/YAML-AppConfig-0.19/t/lib/MatthewTestClass.pm +++ /dev/null @@ -1,11 +0,0 @@ -package MatthewTestClass; - -sub LoadFile { - return {file => shift}; -} - -sub Load { - return {string => shift}; -} - -1; diff --git a/data/YAML-AppConfig-0.19/t/lib/helpers.pl b/data/YAML-AppConfig-0.19/t/lib/helpers.pl deleted file mode 100644 index 4f88e92..0000000 --- a/data/YAML-AppConfig-0.19/t/lib/helpers.pl +++ /dev/null @@ -1,6 +0,0 @@ -sub slurp { - my $file = shift; - local $/ = undef; - open my $fh, $file or die "Could not open $file: $!\n"; - return <$fh>; -} diff --git a/data/YAML-LibYAML-0.59.tar.gz b/data/YAML-LibYAML-0.59.tar.gz deleted file mode 100644 index 6689929..0000000 Binary files a/data/YAML-LibYAML-0.59.tar.gz and /dev/null differ diff --git a/depcomp b/depcomp deleted file mode 120000 index b0ad20c..0000000 --- a/depcomp +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.11/depcomp \ No newline at end of file diff --git a/install-sh b/install-sh index 205f21c..292a426 120000 --- a/install-sh +++ b/install-sh @@ -1 +1 @@ -/usr/share/automake-1.11/install-sh \ No newline at end of file +/usr/share/automake-1.14/install-sh \ No newline at end of file diff --git a/libtool b/libtool deleted file mode 100755 index 8addd3c..0000000 --- a/libtool +++ /dev/null @@ -1,10246 +0,0 @@ -#! /bin/sh - -# libtool - Provide generalized library-building support services. -# Generated automatically by config.status (apigenome) 0.0.2 -# Libtool was configured on host fantasia: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="CXX " - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=2.4.2 -macro_revision=1.3337 - -# Whether or not to build shared libraries. -build_libtool_libs=yes - -# Whether or not to build static libraries. -build_old_libs=yes - -# What type of objects to build. -pic_mode=default - -# Whether or not to optimize for fast installation. -fast_install=yes - -# Shell to use when invoking shell scripts. -SHELL="/bin/sh" - -# An echo program that protects backslashes. -ECHO="printf %s\\n" - -# The PATH separator for the build system. -PATH_SEPARATOR=":" - -# The host system. -host_alias= -host=x86_64-unknown-linux-gnu -host_os=linux-gnu - -# The build system. -build_alias= -build=x86_64-unknown-linux-gnu -build_os=linux-gnu - -# A sed program that does not truncate output. -SED="/bin/sed" - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP="/bin/grep" - -# An ERE matcher. -EGREP="/bin/grep -E" - -# A literal string matcher. -FGREP="/bin/grep -F" - -# A BSD- or MS-compatible name lister. -NM="/usr/bin/nm -B" - -# Whether we need soft or hard links. -LN_S="ln -s" - -# What is the maximum length of a command? -max_cmd_len=3458764513820540925 - -# Object file suffix (normally "o"). -objext=o - -# Executable file suffix (normally ""). -exeext= - -# whether the shell understands "unset". -lt_unset=unset - -# turn spaces into newlines. -SP2NL="tr \\040 \\012" - -# turn newlines into spaces. -NL2SP="tr \\015\\012 \\040\\040" - -# convert $build file names to $host format. -to_host_file_cmd=func_convert_file_noop - -# convert $build files to toolchain format. -to_tool_file_cmd=func_convert_file_noop - -# An object symbol dumper. -OBJDUMP="objdump" - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method="pass_all" - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd="\$MAGIC_CMD" - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob="" - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob="no" - -# DLL creation program. -DLLTOOL="false" - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd="printf %s\\n" - -# The archiver. -AR="ar" - -# Flags to create an archive. -AR_FLAGS="cru" - -# How to feed a file listing to the archiver. -archiver_list_spec="@" - -# A symbol stripping program. -STRIP="strip" - -# Commands used to install an old-style archive. -RANLIB="ranlib" -old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib" -old_postuninstall_cmds="" - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=no - -# A C compiler. -LTCC="gcc" - -# LTCC compiler flags. -LTCFLAGS="-g -O2" - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'" - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'" - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'" - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'" - -# Specify filename containing input files for $NM. -nm_file_list_spec="@" - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot= - -# The name of the directory that contains temporary libtool files. -objdir=.libs - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=file - -# Must we lock files when doing compilation? -need_locks="no" - -# Manifest tool. -MANIFEST_TOOL=":" - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL="" - -# Tool to change global to local symbols on Mac OS X. -NMEDIT="" - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO="" - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL="" - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64="" - -# Old archive suffix (normally "a"). -libext=a - -# Shared library suffix (normally ".so"). -shrext_cmds=".so" - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds="" - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" - -# Do we need the "lib" prefix for modules? -need_lib_prefix=no - -# Do we need a version for libraries? -need_version=no - -# Library versioning type. -version_type=linux - -# Shared library runtime path variable. -runpath_var=LD_RUN_PATH - -# Shared library path variable. -shlibpath_var=LD_LIBRARY_PATH - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=no - -# Format of library name prefix. -libname_spec="lib\$name" - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" - -# The coded name of the library, if different from the real name. -soname_spec="\${libname}\${release}\${shared_ext}\$major" - -# Permission mode override for installation of shared libraries. -install_override_mode="" - -# Command to use after installation of a shared archive. -postinstall_cmds="" - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds="" - -# Commands used to finish a libtool library installation in a directory. -finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval="" - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=yes - -# Compile-time system search path for libraries. -sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.8 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib " - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/atlas /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/%{name} /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib /opt/dell/srvadmin/lib/openmanage /opt/dell/srvadmin/lib/openmanage/smpop /opt/dell/srvadmin/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa /lib32 /usr/lib32 " - -# Whether dlopen is supported. -dlopen_support=unknown - -# Whether dlopen of programs is supported. -dlopen_self=unknown - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=unknown - -# Commands to strip libraries. -old_striplib="strip --strip-debug" -striplib="strip --strip-unneeded" - - -# The linker used to build libraries. -LD="/usr/bin/ld -m elf_x86_64" - -# How to create reloadable object files. -reload_flag=" -r" -reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" - -# Commands used to build an old-style archive. -old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib" - -# A language specific compiler. -CC="gcc" - -# Is the compiler the GNU compiler? -with_gcc=yes - -# Compiler flag to turn off builtin functions. -no_builtin_flag=" -fno-builtin" - -# Additional compiler flags for building library objects. -pic_flag=" -fPIC -DPIC" - -# How to pass a linker flag through the compiler. -wl="-Wl," - -# Compiler flag to prevent dynamic linking. -link_static_flag="-static" - -# Does compiler simultaneously support -c and -o options? -compiler_c_o="yes" - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=no - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=no - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="\${wl}--export-dynamic" - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object="no" - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds="" - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds="" - -# Commands used to build a shared archive. -archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" -archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ - cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ - echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ - \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds="" -module_expsym_cmds="" - -# Whether we are building with GNU ld or not. -with_gnu_ld="yes" - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag="" - -# Flag that enforces no undefined symbols. -no_undefined_flag="" - -# Flag to hardcode $libdir into a binary during linking. -# This must work even if $libdir does not exist -hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir" - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator="" - -# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=no - -# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting ${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=no - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=no - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=unsupported - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=no - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=no - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=no - -# Set to "yes" if exported symbols are required. -always_export_symbols=no - -# The commands to list exported symbols. -export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*" - -# Symbols that must always be exported. -include_expsyms="" - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds="" - -# Commands necessary for finishing linking programs. -postlink_cmds="" - -# Specify filename containing input files. -file_list_spec="" - -# How to hardcode a shared library path into an executable. -hardcode_action=immediate - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs="" - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects="" -postdep_objects="" -predeps="" -postdeps="" - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path="" - -# ### END LIBTOOL CONFIG - - -# libtool (GNU libtool) 2.4.2 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1ubuntu1" -TIMESTAMP="" -package_revision=1.3337 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} # Extended-shell func_dirname implementation - - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} # Extended-shell func_basename implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} # Extended-shell func_dirname_and_basename implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} # Extended-shell func_stripname implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} -} # Extended-shell func_split_short_opt implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=} -} # Extended-shell func_split_long_opt implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}+=\${2}" -} # Extended-shell func_append implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}+=\\ \$func_quote_for_eval_result" -} # Extended-shell func_append_quoted implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} # Extended-shell func_arith implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} # Extended-shell func_len implementation - - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} # Extended-shell func_lo2o implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} # Extended-shell func_xform implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -preserve_args+=" $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -preserve_args+=" $opt" - ;; - --no-verbose) - opt_verbose=false -preserve_args+=" $opt" - ;; - --silent|--quiet) - opt_silent=: -preserve_args+=" $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -preserve_args+=" $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -preserve_args+=" $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || preserve_args+=" --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_to_host_path_result+="$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - pie_flag+=" $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - later+=" $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - base_compile+=" $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - removelist+=" $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - removelist+=" $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command+=" -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command+=" -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command+="$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - dir+="/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - libdirs+=" $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - libs+=" $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds+=" - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - install_prog+="$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - files+=" $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog+=" $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - install_shared_prog+=" $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - install_shared_prog+=" -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs+=" $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs+=" $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs+=" $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - dir+="$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs+=" $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) symtab_cflags+=" $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - libtool_args+=" $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command+=" @OUTPUT@" - finalize_command+=" @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command+=" @SYMFILE@" - finalize_command+=" @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles+=" $arg" - else - dlprefiles+=" $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) deplibs+=" $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# moreargs+=" $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles+=" $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles+=" $pic_object" - prev= - fi - - # A PIC object. - libobjs+=" $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects+=" $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects+=" $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - libobjs+=" $pic_object" - non_pic_objects+=" $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath+=" $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath+=" $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - weak_libs+=" $arg" - prev= - continue - ;; - xcclinker) - linker_flags+=" $qarg" - compiler_flags+=" $qarg" - prev= - compile_command+=" $qarg" - finalize_command+=" $qarg" - continue - ;; - xcompiler) - compiler_flags+=" $qarg" - prev= - compile_command+=" $qarg" - finalize_command+=" $qarg" - continue - ;; - xlinker) - linker_flags+=" $qarg" - compiler_flags+=" $wl$qarg" - prev= - compile_command+=" $wl$qarg" - finalize_command+=" $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - compile_command+=" $link_static_flag" - finalize_command+=" $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command+=" $arg" - finalize_command+=" $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;; - *) deplibs+=" -L$dir" ;; - esac - lib_search_path+=" $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) dllsearchpath+=":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) dllsearchpath+=":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs+=" System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs+=" $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - compiler_flags+=" $arg" - compile_command+=" $arg" - finalize_command+=" $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - compiler_flags+=" $arg" - compile_command+=" $arg" - finalize_command+=" $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) new_inherited_linker_flags+=" $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath+=" $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - arg+=" $func_quote_for_eval_result" - compiler_flags+=" $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - arg+=" $wl$func_quote_for_eval_result" - compiler_flags+=" $wl$func_quote_for_eval_result" - linker_flags+=" $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - compile_command+=" $arg" - finalize_command+=" $arg" - compiler_flags+=" $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - objs+=" $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles+=" $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles+=" $pic_object" - prev= - fi - - # A PIC object. - libobjs+=" $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects+=" $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects+=" $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - libobjs+=" $pic_object" - non_pic_objects+=" $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs+=" $arg" - old_deplibs+=" $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles+=" $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles+=" $func_resolve_sysroot_result" - prev= - else - deplibs+=" $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command+=" $arg" - finalize_command+=" $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command+=" $arg" - finalize_command+=" $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) specialdeplibs+=" $deplib" ;; - esac - fi - libs+=" $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;; - esac - pre_post_deps+=" $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) deplibs+=" $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags+=" $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags+=" $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags+=" $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - newlib_search_path+=" $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - newlib_search_path+=" $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath+=" $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles+=" $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles+=" $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles+=" $dlopen" - test -n "$dlpreopen" && dlprefiles+=" $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - convenience+=" $ladir/$objdir/$old_library" - old_convenience+=" $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs+=" $deplib" ;; - esac - fi - tmp_libs+=" $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles+=" $lib $dependency_libs" - else - newdlfiles+=" $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path+=" $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path+=" $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - newdlprefiles+=" $dir/$linklib" - else - newdlprefiles+=" $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs+=" $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles+=" $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs+=" $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles+=" $dir/$dlname" - else - newdlprefiles+=" $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path+=" $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - newlib_search_path+=" $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs+=" $deplib" ;; - esac - fi - tmp_libs+=" $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) temp_rpath+="$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath+=" $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath+=" $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - notinst_deplibs+=" $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - notinst_deplibs+=" $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath+=" $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath+=" $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir+=" -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath+="$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath+="$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath+="$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir+=" -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath+=" $temp_xrpath";; - esac;; - *) temp_deplibs+=" $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path+=" $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - specialdeplibs+=" $func_resolve_sysroot_result" ;; - esac - fi - tmp_libs+=" $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path+=" $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs+=" $deplib" ;; - esac - ;; - *) tmp_libs+=" $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs+=" $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs+="$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - libobjs+=" $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring+=":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - libobjs+=" $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist+=" $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs+=" $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - temp_xrpath+=" -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath+=" $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles+=" $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles+=" $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs+=" System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs+=" -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs+=" $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs+=" $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs+=" $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs+=" $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs+=" $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs+=" -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs+=" $deplib" ;; - esac - ;; - *) new_libs+=" $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs+="$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath+=" $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath+=" $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath+="$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames+=" $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - delfiles+=" $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - delfiles+=" $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles+=" $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs+=" $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - generated+=" $gentop" - - func_extract_archives $gentop $convenience - libobjs+=" $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags+=" $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - delfiles+=" $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - delfiles+=" $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - objlist+=" $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - delfiles+=" $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles+=" $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated+=" $gentop" - - func_extract_archives $gentop $dlprefiles - libobjs+=" $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated+=" $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - compile_command+=" ${wl}-bind_at_load" - finalize_command+=" ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs+=" -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs+=" $deplib" ;; - esac - ;; - *) new_libs+=" $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command+=" $compile_deplibs" - finalize_command+=" $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath+=" $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs+="$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath+=" $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath+=" $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) dllsearchpath+=":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) dllsearchpath+=":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs+="$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath+=" $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath+=" $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath+="$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath+="$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs+=" $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated+=" $gentop" - - func_extract_archives $gentop $addlibs - oldobjs+=" $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated+=" $gentop" - - func_extract_archives $gentop $dlprefiles - oldobjs+=" $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - generated+=" $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs+=" $gentop/$newobj" - ;; - *) oldobjs+=" $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - objlist+=" $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - newdependency_libs+=" -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - newdependency_libs+=" -R$func_replace_sysroot_result" - ;; - *) newdependency_libs+=" $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles+=" ${lt_sysroot:+=}$libdir/$name" - ;; - *) newdlfiles+=" $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles+=" $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles+=" $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) RM+=" $arg"; rmforce=yes ;; - -*) RM+=" $arg" ;; - *) files+=" $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) rmdirs+=" $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles+=" $odir/$n" - done - test -n "$old_library" && rmfiles+=" $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;; - esac - test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - rmfiles+=" $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - rmfiles+=" $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles+=" $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - rmfiles+=" $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles+=" $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles+=" $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles+=" $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - - -# ### BEGIN LIBTOOL TAG CONFIG: CXX - -# The linker used to build libraries. -LD="/usr/bin/ld -m elf_x86_64" - -# How to create reloadable object files. -reload_flag=" -r" -reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" - -# Commands used to build an old-style archive. -old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib" - -# A language specific compiler. -CC="g++" - -# Is the compiler the GNU compiler? -with_gcc=yes - -# Compiler flag to turn off builtin functions. -no_builtin_flag=" -fno-builtin" - -# Additional compiler flags for building library objects. -pic_flag=" -fPIC -DPIC" - -# How to pass a linker flag through the compiler. -wl="-Wl," - -# Compiler flag to prevent dynamic linking. -link_static_flag="-static" - -# Does compiler simultaneously support -c and -o options? -compiler_c_o="yes" - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=no - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=no - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="\${wl}--export-dynamic" - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object="no" - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds="" - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds="" - -# Commands used to build a shared archive. -archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" -archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds="" -module_expsym_cmds="" - -# Whether we are building with GNU ld or not. -with_gnu_ld="yes" - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag="" - -# Flag that enforces no undefined symbols. -no_undefined_flag="" - -# Flag to hardcode $libdir into a binary during linking. -# This must work even if $libdir does not exist -hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir" - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator="" - -# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=no - -# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting ${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=no - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=no - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=unsupported - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=no - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=no - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=no - -# Set to "yes" if exported symbols are required. -always_export_symbols=no - -# The commands to list exported symbols. -export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*" - -# Symbols that must always be exported. -include_expsyms="" - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds="" - -# Commands necessary for finishing linking programs. -postlink_cmds="" - -# Specify filename containing input files. -file_list_spec="" - -# How to hardcode a shared library path into an executable. -hardcode_action=immediate - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs="/usr/lib/gcc/x86_64-linux-gnu/4.8 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/4.8/../../.." - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o" -postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o" -predeps="" -postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path="-L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.." - -# ### END LIBTOOL TAG CONFIG: CXX diff --git a/ltmain.sh b/ltmain.sh deleted file mode 120000 index 4159958..0000000 --- a/ltmain.sh +++ /dev/null @@ -1 +0,0 @@ -/usr/share/libtool/config/ltmain.sh \ No newline at end of file diff --git a/m4/libtool.m4 b/m4/libtool.m4 deleted file mode 120000 index f3504e9..0000000 --- a/m4/libtool.m4 +++ /dev/null @@ -1 +0,0 @@ -/usr/share/aclocal/libtool.m4 \ No newline at end of file diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 deleted file mode 120000 index b81279e..0000000 --- a/m4/ltoptions.m4 +++ /dev/null @@ -1 +0,0 @@ -/usr/share/aclocal/ltoptions.m4 \ No newline at end of file diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 deleted file mode 120000 index 4d76cc7..0000000 --- a/m4/ltsugar.m4 +++ /dev/null @@ -1 +0,0 @@ -/usr/share/aclocal/ltsugar.m4 \ No newline at end of file diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 deleted file mode 120000 index 5eb474f..0000000 --- a/m4/ltversion.m4 +++ /dev/null @@ -1 +0,0 @@ -/usr/share/aclocal/ltversion.m4 \ No newline at end of file diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 deleted file mode 120000 index de0b9f9..0000000 --- a/m4/lt~obsolete.m4 +++ /dev/null @@ -1 +0,0 @@ -/usr/share/aclocal/lt~obsolete.m4 \ No newline at end of file diff --git a/missing b/missing index 20bc5b0..bc0fe73 120000 --- a/missing +++ b/missing @@ -1 +1 @@ -/usr/share/automake-1.11/missing \ No newline at end of file +/usr/share/automake-1.14/missing \ No newline at end of file diff --git a/releases/apigenome-0.0.1.tar.gz b/releases/apigenome-0.0.1.tar.gz deleted file mode 100644 index 55f56bf..0000000 Binary files a/releases/apigenome-0.0.1.tar.gz and /dev/null differ diff --git a/releases/apigenome-0.0.2.tar.gz b/releases/apigenome-0.0.2.tar.gz deleted file mode 100644 index 4d2f1d8..0000000 Binary files a/releases/apigenome-0.0.2.tar.gz and /dev/null differ diff --git a/releases/apigenome-latest.tar.gz b/releases/apigenome-latest.tar.gz deleted file mode 120000 index 79f08ec..0000000 --- a/releases/apigenome-latest.tar.gz +++ /dev/null @@ -1 +0,0 @@ -apigenome-0.0.2.tar.gz \ No newline at end of file diff --git a/scripts/Makefile b/scripts/Makefile index 8aeefb1..b295a73 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # scripts/Makefile. Generated from Makefile.in by configure. -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/apigenome pkgincludedir = $(includedir)/apigenome pkglibdir = $(libdir)/apigenome @@ -32,16 +76,11 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu subdir = scripts -DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(dist_bin_SCRIPTS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -77,42 +116,43 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(dist_bin_SCRIPTS) +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run aclocal-1.11 +ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing aclocal-1.14 AMTAR = $${TAR-tar} -AR = ar -AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoconf -AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoheader -AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run automake-1.11 +AM_DEFAULT_VERBOSITY = 1 +AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing autoconf +AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing autoheader +AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing automake-1.14 AWK = gawk CAT_CHECK = yes -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = CUT_CHECK = yes -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps DIRNAME_CHECK = yes -DLLTOOL = false -DSYMUTIL = -DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F GNUPLOT_CHECK = yes -GREP = /bin/grep GREP_CHECK = yes GROFF_CHECK = yes GS_CHECK = yes @@ -122,78 +162,49 @@ INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = LIBOBJS = -LIBS = -lz -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIPO = -LN_S = ln -s +LIBS = LTLIBOBJS = -MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run makeinfo +MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing makeinfo MAKE_CHECK = yes -MANIFEST_TOOL = : MKDIR_CHECK = yes MKDIR_P = /bin/mkdir -p MV_CHECK = yes -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = PACKAGE = apigenome PACKAGE_BUGREPORT = hmkang@umich.edu PACKAGE_NAME = apigenome -PACKAGE_STRING = apigenome 0.0.2 +PACKAGE_STRING = apigenome 0.2.0 PACKAGE_TARNAME = apigenome PACKAGE_URL = -PACKAGE_VERSION = 0.0.2 +PACKAGE_VERSION = 0.2.0 PATH_SEPARATOR = : PERL_CHECK = yes PFBTOPS_CHECK = yes -POW_LIB = -RANLIB = ranlib RM_CHECK = yes RSCRIPT_CHECK = yes R_CHECK = yes -SED = /bin/sed SET_MAKE = SHELL = /bin/sh SORT_CHECK = yes -STRIP = strip -VERSION = 0.0.2 +STRIP = +VERSION = 0.2.0 ZCAT_CHECK = yes abs_builddir = /home/hmkang/code/working/apigenome.master/scripts abs_srcdir = /home/hmkang/code/working/apigenome.master/scripts abs_top_builddir = /home/hmkang/code/working/apigenome.master abs_top_srcdir = /home/hmkang/code/working/apigenome.master -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_DUMPBIN = -am__include = include am__leading_dot = . -am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info @@ -203,10 +214,10 @@ libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p +mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /net/fantasia/home/hmkang/bin/apigenome +prefix = /net/fantasia/home/hmkang/tools/apigenome.master program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin @@ -227,31 +238,42 @@ dist_bin_SCRIPTS = \ cel-extract-intensity \ count-dropseq \ count-dropseq-unit \ + cram-vt-discover \ draw-afs \ dropseq-resolve-barcode-trimming \ - dropseq-kalisto \ + dropseq-kallisto \ demux-fastq \ + fasta-lr-dist \ + fbin-lookup \ + gene-conv-names \ gtf2GenePred \ inspect-sv \ merge-fastq \ + merge-tsv-generic \ now-seq-each \ now-seq-batch \ paste-pileup-pro \ pileup-pro \ rev-trim \ run-make \ + tsv-join \ + vcf-apply-external-filter \ vcf-delta-svm \ vcf-extract-gt-only \ vcf-resolve-chrX-hets \ vcf-add-rsid \ vcf-milk-filter \ vcf-f2-sharing \ + vcf-infer-ped \ vcf-issac-summary \ vcf-liftover \ vcf-lookup-rsid \ + vcf-view-gt \ + vcf-pass-variants \ vcf-summary \ vcf-summary-merge \ vcf-summary-v2 \ + vt-merge-variants \ yipe \ epstopdf \ hyunlib.pm wGetOptions.pm @@ -268,9 +290,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign scripts/Makefile + $(AUTOMAKE) --gnu scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -291,8 +313,11 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ @@ -321,17 +346,11 @@ uninstall-dist_binSCRIPTS: files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) +tags TAGS: -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags: TAGS -TAGS: +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -403,7 +422,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -455,7 +474,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-generic pdf: pdf-am @@ -469,17 +488,17 @@ uninstall-am: uninstall-dist_binSCRIPTS .MAKE: install-am install-strip -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dist_binSCRIPTS \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am uninstall uninstall-am uninstall-dist_binSCRIPTS +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dist_binSCRIPTS install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-dist_binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b484ae3..550582b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -8,31 +8,42 @@ dist_bin_SCRIPTS = \ cel-extract-intensity \ count-dropseq \ count-dropseq-unit \ + cram-vt-discover \ draw-afs \ dropseq-resolve-barcode-trimming \ - dropseq-kalisto \ + dropseq-kallisto \ demux-fastq \ + fasta-lr-dist \ + fbin-lookup \ + gene-conv-names \ gtf2GenePred \ inspect-sv \ merge-fastq \ + merge-tsv-generic \ now-seq-each \ now-seq-batch \ paste-pileup-pro \ pileup-pro \ rev-trim \ run-make \ + tsv-join \ + vcf-apply-external-filter \ vcf-delta-svm \ vcf-extract-gt-only \ vcf-resolve-chrX-hets \ vcf-add-rsid \ vcf-milk-filter \ vcf-f2-sharing \ + vcf-infer-ped \ vcf-issac-summary \ vcf-liftover \ vcf-lookup-rsid \ + vcf-view-gt \ + vcf-pass-variants \ vcf-summary \ vcf-summary-merge \ vcf-summary-v2 \ + vt-merge-variants \ yipe \ epstopdf \ hyunlib.pm wGetOptions.pm diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 3267748..2a850c9 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,16 +76,11 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ subdir = scripts -DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(dist_bin_SCRIPTS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -77,42 +116,43 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(dist_bin_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ -AR = @AR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT_CHECK = @CAT_CHECK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ CUT_CHECK = @CUT_CHECK@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ -DEPDIR = @DEPDIR@ DIRNAME_CHECK = @DIRNAME_CHECK@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ GNUPLOT_CHECK = @GNUPLOT_CHECK@ -GREP = @GREP@ GREP_CHECK = @GREP_CHECK@ GROFF_CHECK = @GROFF_CHECK@ GS_CHECK = @GS_CHECK@ @@ -122,26 +162,14 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_CHECK = @MAKE_CHECK@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_CHECK = @MKDIR_CHECK@ MKDIR_P = @MKDIR_P@ MV_CHECK = @MV_CHECK@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -152,12 +180,9 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_CHECK = @PERL_CHECK@ PFBTOPS_CHECK = @PFBTOPS_CHECK@ -POW_LIB = @POW_LIB@ -RANLIB = @RANLIB@ RM_CHECK = @RM_CHECK@ RSCRIPT_CHECK = @RSCRIPT_CHECK@ R_CHECK = @R_CHECK@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SORT_CHECK = @SORT_CHECK@ @@ -168,32 +193,18 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ -build = @build@ build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ -host = @host@ host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ @@ -227,31 +238,42 @@ dist_bin_SCRIPTS = \ cel-extract-intensity \ count-dropseq \ count-dropseq-unit \ + cram-vt-discover \ draw-afs \ dropseq-resolve-barcode-trimming \ - dropseq-kalisto \ + dropseq-kallisto \ demux-fastq \ + fasta-lr-dist \ + fbin-lookup \ + gene-conv-names \ gtf2GenePred \ inspect-sv \ merge-fastq \ + merge-tsv-generic \ now-seq-each \ now-seq-batch \ paste-pileup-pro \ pileup-pro \ rev-trim \ run-make \ + tsv-join \ + vcf-apply-external-filter \ vcf-delta-svm \ vcf-extract-gt-only \ vcf-resolve-chrX-hets \ vcf-add-rsid \ vcf-milk-filter \ vcf-f2-sharing \ + vcf-infer-ped \ vcf-issac-summary \ vcf-liftover \ vcf-lookup-rsid \ + vcf-view-gt \ + vcf-pass-variants \ vcf-summary \ vcf-summary-merge \ vcf-summary-v2 \ + vt-merge-variants \ yipe \ epstopdf \ hyunlib.pm wGetOptions.pm @@ -268,9 +290,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign scripts/Makefile + $(AUTOMAKE) --gnu scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -291,8 +313,11 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ @@ -321,17 +346,11 @@ uninstall-dist_binSCRIPTS: files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) +tags TAGS: -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags: TAGS -TAGS: +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -403,7 +422,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -455,7 +474,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-generic pdf: pdf-am @@ -469,17 +488,17 @@ uninstall-am: uninstall-dist_binSCRIPTS .MAKE: install-am install-strip -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dist_binSCRIPTS \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am uninstall uninstall-am uninstall-dist_binSCRIPTS +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dist_binSCRIPTS install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-dist_binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/scripts/cram-vt-discover b/scripts/cram-vt-discover new file mode 100644 index 0000000..7f4c102 --- /dev/null +++ b/scripts/cram-vt-discover @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(forkExecWait); +use wGetOptions qw(wpod2usage wGetOptions); +use Time::HiRes; + +## vcf-apply-external-filter +## Apply external filter to existing VCF + +my $vt = "vt"; +my $vtcmd = "discover2 -z -q 20"; +my $ref = "/data/local/ref/gotcloud.ref/hg38/hs38DH.fa"; +my $samtools = "samtools"; +my $bamutil = "bamUtil"; +my $bcftools = "bcftools"; +my $region = ""; +my $out = ""; +my $sm = ""; +my $cram = ""; + +wGetOptions( + "-Run variant discovery algorithm", + "--Required Options", + "cram=s" => [\$cram, "Input CRAM file to discover variants"], + "out=s" => [\$out, "Output BCF file name"], + "sm=s" => [\$sm, "Sample ID"], + "--Additional Options", + "region=s" => [\$region,"Region to focus on (CHR:BEG-END format)"], + "vt=s" => [\$vt,"Binary path of vt software tool"], + "samtools=s" => [\$samtools,"Binary path of samtools software tool"], + "bamutil=s" => [\$bamutil,"Binary path of bamUtil software tool"], + "bcftools=s" => [\$bcftools,"Binary path of bcftools software tool"], + "ref=s" => [\$ref,"Path to reference FASTA sequence"], + "vt-opt=s" => [\$vtcmd,"Command line argument for vt software"], + ) || wpod2usage(2); + +unless ( ( $cram ) && ( $out ) && ( $sm ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +my $cmd = "bash -c 'set -o pipefail; $samtools view -T $ref -uh $cram $region 2> $out.samtools_err | $bamutil clipoverlap --poolSize 100000000 --in -.ubam --out -.ubam 2> $out.bamUtil_err | $vt $vtcmd -b + -r $ref -s $sm -o $out 2> $out.vt_err'"; +&forkExecWait($cmd); + +$cmd = "$bcftools index $out"; +&forkExecWait($cmd); + diff --git a/scripts/cram-vt-run-discover b/scripts/cram-vt-run-discover new file mode 100644 index 0000000..20e9ae3 --- /dev/null +++ b/scripts/cram-vt-run-discover @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(forkExecWait); +use wGetOptions qw(wpod2usage wGetOptions); +use Time::HiRes; + +## vcf-apply-external-filter +## Apply external filter to existing VCF + +my $vt = "vt"; +my $vtcmd = "discover2 -z -q 20"; +my $ref = "/data/local/ref/gotcloud.ref/hg38/hs38DH.fa"; +my $samtools = "samtools"; +my $bamutil = "bamUtil"; +my $bcftools = "bcftools"; +my $region = ""; +my $out = ""; +my $sm = ""; +my $cram = ""; + +wGetOptions( + "-Run variant discovery algorithm", + "--Required Options", + "cram=s" => [\$cram, "Input CRAM file to discover variants"], + "out=s" => [\$out, "Output BCF file name"], + "sm=s" => [\$sm, "Sample ID"], + "--Additional Options", + "region=s" => [\$region,"Region to focus on (CHR:BEG-END format)"], + "vt=s" => [\$vt,"Binary path of vt software tool"], + "samtools=s" => [\$samtools,"Binary path of samtools software tool"], + "bamutil=s" => [\$bamutil,"Binary path of bamUtil software tool"], + "bcftools=s" => [\$bcftools,"Binary path of bcftools software tool"], + "ref=s" => [\$ref,"Path to reference FASTA sequence"], + "vt-opt=s" => [\$vtcmd,"Command line argument for vt software"], + ) || wpod2usage(2); + +unless ( ( $cram ) && ( $out ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +my $cmd = "bash -c 'set -o pipefail; $samtools view -T $ref -uh $cram $region 2> $out.samtools_err | $bamutil clipoverlap --poolSize 100000000 --in -.ubam --out -.ubam 2> $out.bamUtil_err | $vt $vtcmd -b + -r $ref -s $sm -o $out 2> $out.vt_err'"; +&forkExecWait($cmd); + +$cmd = "$bcftools index $out"; +&forkExecWait($cmd); + diff --git a/scripts/demux-fastq b/scripts/demux-fastq index ba1d548..f75c697 100644 --- a/scripts/demux-fastq +++ b/scripts/demux-fastq @@ -18,9 +18,9 @@ my $barcodeLength = 6; my $umiLength = 8; wGetOptions( - "-Demultiplex FASTQ files based on barcode information", + "-Demultiplex FASTQ files based on barcode information\n\nThis software performs demultiplexing of FASTQ files for DropSeq-like paired-ended data, where the first read containing barcode (as a concatenation of cell barcode, UMI, and parity nucleotides) and the second read containing the actual reads", "--Key Options", - "fq1=s" => [\$fq1, "FASTQ files for the first end"], + "fq1=s" => [\$fq1, "FASTQ files for the first end, containing the barcode information"], "fq2=s" => [\$fq2, "FASTQ files for the second end"], "mapf=s" => [\$mapf, "Mapping file containing (1) BARCODE (2) ID"], "out=s" => [\$out, "Output prefix"], diff --git a/scripts/dropseq-kallisto b/scripts/dropseq-kallisto new file mode 100644 index 0000000..38d329a --- /dev/null +++ b/scripts/dropseq-kallisto @@ -0,0 +1,211 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use Time::HiRes; +use lib $FindBin::Bin; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(makeMake forkExecWait zopen wopen); + +my $fq1 = ""; +my $fq2 = ""; +my $out = ""; +my $cutadapt = "/net/fantasia/home/hmkang/tools/cutadapt-1.8.1/bin/cutadapt"; +my $samtools = "/usr/cluster/bin/samtools"; +my $kallisto = "/net/fantasia/home/hmkang/tools/kallisto/kallisto"; +my $index = "/net/1000g/hmkang/data/ref/GRCh37.GRCm38.75/GRCh37.GRCm38.75.cdna.all.minus_pseudo.fa.idx"; +my $fasta = "/net/1000g/hmkang/data/ref/GRCh37.GRCm38.75/GRCh37.GRCm38.75.cdna.all.minus_pseudo.fa"; +my $lenCellBarcode = 12; +my $lenUMI = 8; +my $Rscript = "Rscript"; +my $Qthres = 10; +my $adapter = "AAGCAGTGGTATCAACGCAGAGTGAATGGG"; +my $minLength = 20; +my $sampleID = int(rand(1000000)); +my $maxCell = 3000; +my $maxNM = 3; + +wGetOptions( + "-Alignment pipeline for DropSeq data from raw FASTQ files\nFirst reads are assumed to be 12bp cell barcode, 8bp UMI, attached to the readname\n1. Tag cell and molecular barcode\n2. Trim 5' adapter sequences\n2. Trim 3' polA sequences\n3. Bowtie", + "--Key Options", + "fq1=s" => [\$fq1, "First end of input FASTQ file (expected length 20)"], + "fq2=s" => [\$fq2, "Second end of input FASTQ file (expected length 50)"], + "out=s" => [\$out, "Output file prefix"], + "--Additional Options", + "cutadapt=s" => [\$cutadapt, "Path to the binary of cutadapt software tool"], + "kallisto=s" => [\$kallisto, "Path to the binary of kallisto aligner"], + "samtools=s" => [\$samtools, "Path to the binary of samtools"], + "Rscript=s" => [\$Rscript, "Path to the binary of Rscript"], + "index=s" => [\$index, "Path to the kallisto index file"], + "fasta=s" => [\$fasta, "Path to the kallisto FASTA file"], + "adapter=s" => [\$adapter, "Adapter sequences to trmp at 5' prime end"], + "min-length=i" => [\$minLength, "Minimum length of reads to retain after trimming"], + "length-cell-barcode=i" => [\$lenCellBarcode, "Length of cell barcode"], + "length-umi=i",[\$lenUMI, "Length of unique molecular index (UMI)"], + "max-cell=i",[\$maxCell, "Maximum number of cell counts for plotting"], + "max-NM=i",[\$maxNM, "Maximum number of mismatchs allowed to be considered as valid mapping"], + "sample-id=s",[\$sampleID, "Sample ID"], + "Qthres=i",[\$Qthres, "Threashold of base quality for representing the barcode as upper/lower cases"], + ) || wpod2usage(2); + +if ( !$fq1 || !$fq2 || !$out ) { + print STDERR "Missing required options : --fq1, --fq2, --out\n"; + wpod2usage(); +} + +print STDERR "Analysis started at ".scalar(localtime)."\n"; + +my $fh1 = &zopen($fq1); +my $fh2 = &zopen($fq2); +my @fq = (); + +print STDERR "Performing alignment using kalisto...\n"; +open(OUT,"| $cutadapt -f fastq -g $adapter -a AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -m $minLength /dev/stdin 2> $out.err_cutadapt | $kallisto quant -o $out -i $index --single -l 250 -s 100 --plaintext --pseudobam /dev/stdin 2> $out.err_kallisto | $samtools calmd -Sb - $fasta > $out.bam 2> $out.err_samtools") || die "Cannot open file\n"; + +my %cntBarcodes = (); + +for( my $i=0; &readFQ($fh1,$fh2,\@fq) > 0; ++$i ) { + print STDERR "Processing $i FASTQ records at ".scalar(localtime)."\n" if ( $i % 500000 == 0 ); + + my @bases = split(//,$fq[1]); + my @quals = split(//,$fq[3]); + + #for(my $i=0; $i < @quals; ++$i) { + #if ( ord($quals[$i]) < ord(' ') + $Qthres ) { ## quality less than $Qthres + #$bases[$i] = lc($bases[$i]); + #} + #} + + my $barcode = join("",@bases[0..($lenCellBarcode-1)]); + my $umi = join("",@bases[($lenCellBarcode)..($lenCellBarcode+$lenUMI-1)]); + + my $ucBarcode = uc($barcode); + $cntBarcodes{$ucBarcode} = 0 unless ( defined($cntBarcodes{$ucBarcode}) ); + ++$cntBarcodes{$ucBarcode}; + + print OUT "$fq[0]:$barcode:$umi\n$fq[2]\n+\n$fq[4]\n"; + #last if ( $i == 100000 ); +} + +$fh1->close(); +$fh2->close(); +close OUT; + +print STDERR "Finished kallisto alignment at ".scalar(localtime)."\n"; + +## Step 1b. Create the CDF of the barcode counts +open(DAT,">$out.barcode.counts.dat") || die "Cannot open file\n"; +foreach my $barcode(keys %cntBarcodes) { + print DAT join("\t",$barcode,$cntBarcodes{$barcode})."\n"; +} +close DAT; + +open(R,">$out.barcode.counts.R") || die "Cannot open file\n"; +print R "M <- read.table('$out.barcode.counts.dat',header=F)\n"; +print R "total <- sum(M[,2])\n"; +print R "fracSorted <- cumsum(sort(M[,2], decreasing=TRUE))/total\n"; +print R "pdf(file='$out.barcode.counts.pdf',width=8,height=6)\n"; +print R "plot(1:$maxCell,fracSorted[1:$maxCell],xlab='Number of cell barcodes',ylab='Fraction of reads')\n"; +print R "dev.off()\n"; +close R; + +&forkExecWait("$Rscript $out.barcode.counts.R"); + +print STDERR "Finished collecting barcode distribution metrics at ".scalar(localtime)."\n"; + +## Step 3. Digital counting of expressions +## For now - let's building simple counting histograms : +## minimum, fractional, maximum + +&forkExecWait("$FindBin::Bin/cramore kallisto-count --sam $out.bam --out $out.counts --max-NM $maxNM"); + +print STDERR "Finished counting digital expressions at ".scalar(localtime)."\n"; + +# my $prevName; +# my %tbcd = (); +# my @tbufs = (); +# my $unit = 1000000; +# open(IN,"$samtools view $out.bam |") || die "Cannot open file\n"; +# while() { +# print STDERR "Processing $. BAM records at ".scalar(localtime)."\n" if ( $. % 500000 == 0 ); + +# my ($rname,$flag,$tname,$pos,$mq,$cigar,$rnext,$pnext,$tlen,$seq,$qual) = split; + +# if ( ( defined($prevName) ) && ( $prevName ne $rname ) ) { +# my @rnames = split(/:/,$prevName); + +# my $bc = uc($rnames[$#rnames-1]); +# my $umi = uc($rnames[$#rnames]); + +# foreach my $t (@tbufs) { +# ++($tbcd{$bc}{$t}{$umi}); # += ($unit + 1/($#tbufs+1)); +# } +# @tbufs = ($tname); +# } +# else { +# push(@tbufs,$tname); +# } +# $prevName = $rname; +# } +# close IN; + +# if ( defined($prevName) ) { +# my @rnames = split(/:/,$prevName); +# my $bc = uc($rnames[$#rnames-1]); +# my $umi = uc($rnames[$#rnames]); +# foreach my $t (@tbufs) { +# ++($tbcd{$bc}{$t}{$umi}); +# } +# } + +# print STDERR "Finished reading BAM files at ".scalar(localtime)."\n"; + +# my @sbcds = sort { $cntBarcodes{$b} <=> $cntBarcodes{$a} } keys %cntBarcodes; + +# print STDERR "Started writing digital expression at ".scalar(localtime)."\n"; + +# open(OUT,">$out.exprs") || die "Cannot open file\n"; +# for(my $i=0; $i < $maxCell; ++$i) { +# my $r = $tbcd{$sbcds[$i]}; +# unless ( defined($r) ) { +# warn "Cannot find $sbcds[$i]\n"; +# next; +# } +# print OUT "$sbcds[$i]"; +# foreach my $t (sort keys %{$r}) { +# print OUT "\t$t:".(scalar keys %{$r->{$t}}); +# } +# print OUT "\n"; +# } +# close OUT; + +# print STDERR "Finished writing digital expression at ".scalar(localtime)."\n"; + +## read paired-end FASTQ file +## Return array with five elements +## 0. ReadName +## 1. First Sequence +## 2. Second sequence +## 3. First Quality +## 4. Second Quality +sub readFQ { + my ($fh1,$fh2,$ref) = @_; + my $line1 = $fh1->getline(); + return 0 unless ( defined($line1) ); + ($line1) = split(/[\s\/]/,$line1); + ($ref->[0]) = split(/[\s\/]/,$fh2->getline()); + die "$line1 != ".($ref->[0])."\n" if ( $line1 ne $ref->[0] ); + $ref->[1] = $fh1->getline(); + $ref->[2] = $fh2->getline(); + my $dummy = $fh1->getline(); + my $dummy2 = $fh2->getline(); + $ref->[3] = $fh1->getline(); + $ref->[4] = $fh2->getline(); + + chomp($ref->[1]); + chomp($ref->[2]); + chomp($ref->[3]); + chomp($ref->[4]); + + return 1; +} diff --git a/scripts/dropseq-resolve-barcode-trimming b/scripts/dropseq-resolve-barcode-trimming index eec2344..ecc28c5 100644 --- a/scripts/dropseq-resolve-barcode-trimming +++ b/scripts/dropseq-resolve-barcode-trimming @@ -186,7 +186,7 @@ for(my $i=0; $line = $fh->getline(); ++$i) { print {$wh} $line; print {$wh} $endBC; for(my $i=$bcL; $i < $orgLenBC; ++$i) { - print {$wh} "N"; ## Put 'N' for trimmed barcode + print {$wh} "A"; ## Put 'N' for trimmed barcode } print {$wh} substr($seq,$bcL,$seqL-$orgLenBC); print {$wh} "\n"; diff --git a/scripts/fasta-lr-dist b/scripts/fasta-lr-dist new file mode 100644 index 0000000..429ccb4 --- /dev/null +++ b/scripts/fasta-lr-dist @@ -0,0 +1,89 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +#use lib '/net/fantasia/home/hmkang/bin/utils'; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(zopen); + +my $fasta = ""; +my $region = ""; +my $outf = ""; +my $samtools = "samtools"; +my $maxdel = 10; +my $maxshift = 50; + +wGetOptions( + "-Identify nuclear families from KING2 output and sex map", + "--Required Options", + "fasta=s" => [\$fasta, "Fasta file with fasta index"], + "region=s" => [\$region, "Genomic region to focus on"], + "out=s" => [\$outf, "Output file", "Output file prefix"], + "--Additional Options", + "samtools=s" => [\$samtools, "Samtools binary path"], + "max-del=i" => [\$maxdel, "Maximum deletion length"], + "max-shift=i" => [\$maxshift, "Maximum shift distance"], + ) || wpod2usage(2); + +unless ( ( $fasta ) && ( $region ) && ( $outf ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +my @s = (); + +my ($chr,$beg,$end) = split(/[:-]/,$region); +#if ( defined($beg) ) { $beg -= $maxshift; } +#else { $beg = 0; for(my $i=0; $i < $maxshift; ++$i) { push(@s,"N"); } } +#if ( defined($end) ) { $end += $maxshift; } +#else { $end = 1000000000; } + +open(FASTA,"$samtools faidx $fasta $chr:$beg-$end|") || die "Cannot open file\n"; +while() { + next if ( /^>/ ); + chomp; + my @a = split(//); + push(@s,@a); +} + +my $l = $#s+1; +my @cnts = (0) x (($maxdel+1) * (2*$maxshift+1)); +my %hcnts = (); +for(my $i=0; $i < $l; ++$i) { + next if ( $s[$i] eq "N" ); + for(my $j=1; $j <= $maxdel; ++$j) { ## deletion length + ## looking at substring $i..$i+$j + next if ( $i + $j >= $l ); + my $key = join("",@s[$i..($i+$j-1)]); + my $k = 0; + while( ( $k < $maxshift ) && ( $i > $k ) && ( $s[$i-1-$k] eq $s[$i + $j - 1 - ($k % $j)]) ) { ++$k; } + my $m = 0; + while( ( $m < $maxshift ) && ( $i + $j + $m < $l ) && ( $s[$i+$j+$m] eq $s[$i + ($m % $j)]) ) { ++$m; } + #print join("\t",$i,$j,$k,$m)."\n"; + ++$cnts[$j*(2*$maxshift+1)+($k+$m)]; + unless ( defined($hcnts{$key}) ) { + my @a = (0) x (2*$maxshift+1); + $hcnts{$key} = \@a; + } + ++($hcnts{$key}->[$k+$m]); + } +} + +open(OUT,">$outf.size.dist") || die "Cannot open file\n"; +for(my $i=1; $i <= $maxdel; ++$i) { + print OUT $i; + for(my $j=0; $j <= 2*$maxshift; ++$j) { + print OUT "\t".$cnts[$i*(2*$maxshift+1)+$j]; + } + print OUT "\n"; +} +close OUT; + +open(OUT,">$outf.allele.dist") || die "Cannot open file\n"; +foreach my $key (sort keys %hcnts) { + print OUT join("\t",$key,@{$hcnts{$key}})."\n"; +} +close OUT; + diff --git a/scripts/fbin-lookup b/scripts/fbin-lookup new file mode 100644 index 0000000..193a93b --- /dev/null +++ b/scripts/fbin-lookup @@ -0,0 +1,82 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use lib $FindBin::Bin; +use lib "/net/fantasia/home/hmkang/bin/utils/"; +use hyunlib qw(initRef getCpGs); +use wGetOptions qw(wGetOptions wpod2usage); + +my $region = ""; +my $fbin = ""; +my $bedf = ""; +my $avg = ""; + +## Parse options and print usage if there is a syntax error, +## or if usage was explicitly requested. +wGetOptions( + "-Lookup (legacy) FBIN format to look up scores", + "--Required Options", + "reg=s" => [\$region, "Region in [chr]:[beg1]-[end1]"], + "bed=s" => [\$bedf, "Regions in BED format"], + "fbin=s" => [\$fbin, "Directory containing fbin files"], + "avg" => [\$avg, "Print average per region"] + ) || wpod2usage(2); + +wpod2usage("(--reg or --bed), --fbin and are required") unless ( ( ( $region ) || ( $bedf ) ) && ( $fbin ) ); + +## open FBIN files +if ( $bedf ) { + open(BED,$bedf) || die "Cannot open $bedf\n"; + my $prevchr = ""; + while() { + my ($chr,$beg0,$end1) = split; + $chr = "chr$chr" unless ( $chr =~ /^chr/ ); + if ( $prevchr ne $chr ) { + close FBIN if ( $prevchr ); + open(FBIN,"$fbin/$chr.fbin") || die "Cannot open $fbin/$chr.fbin\n"; + $prevchr = $chr; + } + seek(FBIN,$beg0*4,0); + my $n = $end1-$beg0; + read(FBIN,my $buf,4*$n); + die "Cannot read $n float numbers from $fbin/$chr.$fbin from $chr:".($beg0+1)."\n" if ( length($buf) ne 4*$n ); + + my @scores = unpack("f$n",$buf); + if ( $avg ) { + my $sum = 0; + foreach my $s (@scores) { $sum += $s; } + printf("$chr:".($beg0+1)."-$end1\t%.g\n",$sum/$n); + } + else { + for(my $i=0; $i < @scores; ++$i) { + printf("$chr:%d\t%.g\n",$beg0+1+$i,$scores[$i]); + } + } + } + close BED; + close FBIN; +} +else { + my ($chr,$beg1,$end1) = split(/[:\-]/,$region); + $chr = "chr$chr" unless ( $chr =~ /^chr/ ); + die unless ( defined($end1) ); + open(FBIN,"$fbin/$chr.fbin") || die "Cannot open $fbin/$chr.fbin\n"; + #my $score = "nan"; + seek(FBIN,($beg1-1)*4,0); + my $n = $end1-$beg1+1; + read(FBIN,my $buf,4*$n); + close FBIN; + die "Cannot read $n float numbers from $fbin/$chr.$fbin from $chr:$beg1\n" if ( length($buf) ne 4*$n ); + my @scores = unpack("f$n",$buf); + if ( $avg ) { + my $sum = 0; + foreach my $s (@scores) { $sum += $s; } + printf("$chr:$beg1-$end1\t%.5lg\n",$sum/$n); + } + else { + for(my $i=0; $i < @scores; ++$i) { + printf("$chr:%d\t%.5lg\n",$beg1+$i,$scores[$i]); + } + } +} diff --git a/scripts/gene-conv-names b/scripts/gene-conv-names new file mode 100644 index 0000000..b8c2078 --- /dev/null +++ b/scripts/gene-conv-names @@ -0,0 +1,42 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use Time::HiRes; +use lib $FindBin::Bin; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(makeMake forkExecWait zopen wopen); + +my $mapf = ""; +my $inf = ""; + +wGetOptions( + "-Convert transcript names to gene names\n", + "--Key Options", + "map=s" => [\$mapf, "Map file containing Ensemble gene id / transcript id / gene symbol"], + "in=s" => [\$inf, "Input file"], + ) || wpod2usage(2); + +if ( !$mapf || !$inf ) { + print STDERR "Missing required options : --fq1, --fq2, --out\n"; + wpod2usage(); +} + +print STDERR "Analysis started at ".scalar(localtime)."\n"; + +my %hconv = (); +open(IN,$mapf) || die "Cannot open file\n"; +while() { + my ($tid,$gid,$gname) = split; + $hconv{$tid} = $gname; +} +close IN; + +open(IN,$inf) || die "Cannot open file\n"; +while() { + next if ( /^#/ ); + my ($tid,@G) = split; + die "Cannot find $tid\n" unless ( defined($hconv{$tid}) ); + print join("\t",$hconv{$tid},$tid,@G)."\n"; +} +close IN; diff --git a/scripts/gtf2GenePred b/scripts/gtf2GenePred index e267448..555ef3d 100644 --- a/scripts/gtf2GenePred +++ b/scripts/gtf2GenePred @@ -20,7 +20,7 @@ wGetOptions( "--Additional Options", "tabix=s" => [\$tabix, "Binary to the tabix file"], "bgzip=s" => [\$bgzip, "Binary to the bgzip file"], - "ucsc-dir=s" => [\$tabix, "Directory containing the binary of UCSC tools"], + "ucsc-dir=s" => [\$ucscdir, "Directory containing the binary of UCSC tools"], ) || wpod2usage(2); if ( !$gtf || !$out ) { diff --git a/scripts/merge-tsv-generic b/scripts/merge-tsv-generic new file mode 100644 index 0000000..f8bc109 --- /dev/null +++ b/scripts/merge-tsv-generic @@ -0,0 +1,109 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use lib $FindBin::Bin; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(makeMake forkExecWait zopen wopen); + +my $in = ""; +my $list = ""; +my $out = "-"; +my @keyCols = (); +my @skipCols = (); +my $nheaders = 1; +my $lenient = ""; + +wGetOptions( + "-Merge multiple TSV files by summing up each individual line", + "--Key Options", + "in=s" => [\$in, "Input filesn with wildcard form"], + "list=s" => [\$list, "Input file containing the list of all input files"], + "out=s" => [\$out, "Output file"], + "key-col=i" => [\@keyCols, "Column containing the key info"], + "skip-cols=i" => [\@skipCols, "Skip specific columns not to add together"], + "nheaders=i" => [\$nheaders, "Number of header lines"], + "lenient" => [\$lenient, "Skip riegourus format checking"], + ) || wpod2usage(2); + +if ( ( !$in && !$list ) || ( $in && $list ) || ( $#keyCols < 0 ) ) { + print STDERR "Missing required options : --key-col + EITHER --in OR --list\n"; + wpod2usage(); +} + +my @infiles = (); + +if ( $in ) { + @infiles = glob($in); +} +elsif ( $list ) { + open(IN,$list) || die "Cannot open $list for reading\n"; + while() { + chomp; + push(@infiles,$_); + } + close IN; +} +else { + die; +} + +my %hskip = (); +my %hkey = (); +foreach my $c (@skipCols) { $hskip{$c-1} = 1; } +foreach my $c (@keyCols) { $hkey{$c-1} = 1; } + +my %h = (); +my @hdrs = (); +for(my $i=0; $i < @infiles; ++$i) { + print STDERR "Processing $infiles[$i]..\n"; + + open(IN,$infiles[$i]) || die "Cannot open $list for reading\n"; + for(my $j=0; $j < $nheaders; ++$j) { + my $line = ; + if ( $i == 0 ) { + push(@hdrs,$line); + } + else { + die "Header line $j do not match in $infiles[$i]\n" unless ( ( $hdrs[$j] eq $line ) || ( $lenient ) ); + } + } + while() { + my @F = split; + my %hlocal = (); + my $key; + for(my $j=0; $j < @keyCols; ++$j) { + die "Column $keyCols[$j] cannot be found in $infiles[$i]\n" if ( $keyCols[$j] > @F ); + $key = ($j == 0) ? $F[$keyCols[$j]-1] : $key."\t".$F[$keyCols[$j]-1]; + } + if ( defined($hlocal{$key}) ) { + die "Observed key [$key] more than once in the same file. Make sure that the key is unique\n"; + } + $hlocal{$key} = 1; + + if ( defined($h{$key}) ) { + my $r = $h{$key}; + for(my $j=0; $j < @F; ++$j) { + if ( $hskip{$j} ) { + die "Skipped column $j are not identical at $infiles[$i]\n" unless ( ( $r->[$j] eq $F[$j] ) || ( $lenient ) ); + } + elsif ( !$hkey{$j} ) { + $r->[$j] += $F[$j]; + } + } + } + else { + $h{$key} = \@F; + } + } + close IN; +} + +my $fh = wopen($out); +for(my $i=0; $i < @hdrs; ++$i) { + print {$fh} $hdrs[$i]; +} +foreach my $key (sort keys %h) { + print {$fh} join("\t",@{$h{$key}})."\n"; +} +$fh->close(); diff --git a/scripts/now-seq-batch b/scripts/now-seq-batch index aefca84..53a87e7 100644 --- a/scripts/now-seq-batch +++ b/scripts/now-seq-batch @@ -15,12 +15,14 @@ my $out = ""; my $numjobs = 100; my $keeptmp = ""; my $samtools = "samtools"; +my $listf = ""; wGetOptions( "-Scan the gotCloud QC outputs, and merge summarized statistics", "--Required Options", "dir=s" => [\$dir, "Directory to scan"], "out=s" => [\$out, "Output directory"], + "list=s" => [\$listf, "List file containing the locations of CRAM, QPLOT, verifyBamID files"], "--Additional Options", "extSelfSM=s" => [\$extSelfSM, "Suffix (or file extension) for verifyBamID's .selfSM file per sample"], "extQplotStats=s" => [\$extQplotStats, "Suffix (or file extension) for QPLOT's .stats file per sample"], @@ -39,54 +41,41 @@ $dir =~ s/\/$//g; ## remove trailing slashes print STDERR "Scanning $dir...\n"; -my @qcdirs = (); - my @args = (); -open(IN,"find $dir -name '*.$extQplotR' |") || die "Cannot open file\n"; -while() { - chomp; - my $fqplotR = $_; - my $fqplotStats = $_; - my $fselfSM = $_; - $fqplotStats =~ s/\Q$extQplotR\E$/$extQplotStats/; - $fselfSM =~ s/\Q$extQplotR\E$/$extSelfSM/; - - #die "$fqplotR $fqplotStats $fselfSM"; - - if ( ( -s $fqplotR ) && ( -s $fqplotStats ) && ( -s $fselfSM ) ) { - if ( $fqplotR =~ /^\Q$dir\E\/(\S+)\/([^\/]+)\.\Q$extQplotR\E$/ ) { - my $id = $2; - my $group = $1; #""; - # if ( $fqplotR =~ /illumina\.barnes\.01/ ) { - # $group = "Illumina_Barnes_Asthma"; - # } - # elsif ( $fqplotR =~ /illumina/ ) { - # $group = "Illumina_Blangero_SAFHS"; - # } - # elsif ( $fqplotR =~ /nygc\/nhlbi-umich-20150609/ ) { - # $group = "NYGC_Burchard_Asthm"; - # } - # elsif ( $fqplotR =~ /weiss/ ) { - # $group = "UW_Weiss_Asthma"; - # } - # elsif ( $fqplotR =~ /silverman/ ) { - # $group = "UW_Silverman_COPD"; - # } - # if ( $group ) { - # push(@files,[$id,$group,$fqplotR,$fqplotStats,$fselfSM]); - # } - # else { - # print STDERR "Skipping $id in $fqplotR..\n"; - # } - push(@args,[$id,$group,$fqplotR,$fqplotStats,$fselfSM]); - } - else { - die "Cannot find ID from $fqplotR"; +if ( $listf ) { + open(IN,$listf) || die "Cannot open file\n"; + while() { + chomp; + my @F = split; + push(@args,\@F); + } +} +else { + open(IN,"find $dir -name '*.$extQplotR' |") || die "Cannot open file\n"; + while() { + chomp; + my $fqplotR = $_; + my $fqplotStats = $_; + my $fselfSM = $_; + $fqplotStats =~ s/\Q$extQplotR\E$/$extQplotStats/; + $fselfSM =~ s/\Q$extQplotR\E$/$extSelfSM/; + + #die "$fqplotR $fqplotStats $fselfSM"; + + if ( ( -s $fqplotR ) && ( -s $fqplotStats ) && ( ( $extSelfSM eq "." ) || ( -s $fselfSM ) ) ) { + if ( $fqplotR =~ /^\Q$dir\E\/(\S+)\/([^\/]+)\.\Q$extQplotR\E$/ ) { + my $id = $2; + my $group = $1; #""; + push(@args,[$id,$group,$fqplotR,$fqplotStats,$fselfSM]); + } + else { + die "Cannot find ID from $fqplotR"; + } } } + close IN; } -close IN; print STDERR "Finished identifying ".($#args+1)." samples with QC..\n"; diff --git a/scripts/now-seq-each b/scripts/now-seq-each index e135047..f0c85af 100644 --- a/scripts/now-seq-each +++ b/scripts/now-seq-each @@ -121,13 +121,19 @@ sub parseQCFiles { my ($genocheckfile,$statfile,$rfile) = @_; my @metrics = (); - open(IN,$genocheckfile) || die "Cannot open $genocheckfile for reading\n"; - my $line = ; - $line = ; - close IN; + if ( -s $genocheckfile ) { + open(IN,$genocheckfile) || die "Cannot open $genocheckfile for reading\n"; + my $line = ; + $line = ; + close IN; - my @F = split(/\s+/,$line); - push(@metrics,sprintf("%.1lf",$F[6]*100)); + my @F = split(/\s+/,$line); + push(@metrics,sprintf("%.1lf",$F[6]*100)); + } + else { + print STDERR "Cannot find $genocheckfile\n"; + push(@metrics,"0.0"); + } my @flags = (0,1,1,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); open(IN,$statfile) || die "Cannot open $statfile for reading\n"; @@ -301,7 +307,7 @@ sub parseQCFiles { #my $group = "DACHS_BATCH".int(rand(3)); - my $mindate = (stat($genocheckfile))[9]; + my $mindate = (stat($statfile))[9]; $mindate = (stat($rfile))[9] if ( (stat($rfile))[9] < $mindate ); $mindate = (stat($statfile))[9] if ( (stat($statfile))[9] < $mindate ); #$mindate = sprintf(strftime("%m/%d/%Y", localtime( $mindate ))); diff --git a/scripts/tsv-join b/scripts/tsv-join new file mode 100644 index 0000000..e67ba70 --- /dev/null +++ b/scripts/tsv-join @@ -0,0 +1,46 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use lib $FindBin::Bin; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(makeMake forkExecWait zopen wopen); + +my @ins = (); + +wGetOptions( + "-Produce a joint list of multiple files", + "--Key Options", + "in=s" => [\@ins, "Input text files"], + ) || wpod2usage(2); + +if ( $#ins < 0 ) { + print STDERR "Missing required input --in\n"; + wpod2usage(2); +} + +my %h = (); +my %c = (); +for(my $i=0; $i < @ins; ++$i) { + #chomp; + open(IN,$ins[$i]) || die "Cannot open $ins[$i]"; + my %d = (); + while() { + my ($id,@F) = split; + unless ( defined($h{$id}) ) { + $h{$id} = []; + } + push(@{$h{$id}},@F); + if ( defined($d{$id}) ) { + die "Duplicate key $id in $ins[$i]\n"; + } + $d{$id} = 1; + ++$c{$id}; + } + close IN; +} + +foreach my $id (sort keys %h) { + next if ( $c{$id} < $#ins+1 ); + print join("\t",$id,@{$h{$id}})."\n"; +} diff --git a/scripts/vcf-add-rsid b/scripts/vcf-add-rsid index 7b1f65f..add8dc6 100644 --- a/scripts/vcf-add-rsid +++ b/scripts/vcf-add-rsid @@ -15,6 +15,7 @@ my $sepchr = ""; my $keep = ""; my $binbgzip = "$FindBin::Bin/bgzip"; my $bintabix = "$FindBin::Bin/tabix"; +my $binbcftools = "bcftools"; wGetOptions( "-Add rsID into VCF", @@ -37,7 +38,8 @@ else { open(VCF,$vcf) || die "Cannot open file\n"; } die "Cannot open $dbSNPf\n" unless ( -s $dbSNPf ); die "$dbSNPf is not indexed and tabixed\n" unless ( $dbSNPf =~ /\.vcf.gz$/ ); -if ( $out =~ /\.gz$/ ) { open(OUT,"| $binbgzip -c > $out") || die "Cannot open file\n"; } +if ( $out =~ /\.vcf.gz$/ ) { open(OUT,"| $binbgzip -c > $out") || die "Cannot open file\n"; } +elsif ( $out =~ /\.bcf$/ ) { open(OUT,"| $binbcftools view -Ob -o $out /dev/stdin") || die "Cannot open file $out using $binbcftools\n"; } elsif ( $out ) { open(OUT,">$out") || die "Cannot open file\n"; } else { *OUT = *STDOUT; } @@ -71,7 +73,12 @@ while() { $cdb =~ s/chr1/chr$chr/g; } - open(DBF,"$bintabix $cdb $chr:0|") || die "Cannot open file\n"; + if ( $cdb =~ /\.vcf.gz$/ ) { + open(DBF,"$bintabix $cdb $chr:0|") || die "Cannot open file\n"; + } + elsif ( $cdb =~ /\.bcf$/ ) { + open(DBF,"$binbcftools view $cdb $chr:0-|") || die "Cannot open file\n"; + } $bufLine = ; ## read a line if ( $bufLine ) { ## if a line was read diff --git a/scripts/vcf-apply-external-filter b/scripts/vcf-apply-external-filter new file mode 100644 index 0000000..44ee409 --- /dev/null +++ b/scripts/vcf-apply-external-filter @@ -0,0 +1,208 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +use wGetOptions qw(wpod2usage wGetOptions); +use Time::HiRes; + +## vcf-apply-external-filter +## Apply external filter to existing VCF + +my $vcf = ""; +my $ext = ""; +my $out = ""; +my $prefix = ""; +my $region = ""; +my $tabix = "$FindBin::Bin/tabix"; # "/usr/cluster/bin/tabix"; +my $bgzip = "$FindBin::Bin/bgzip"; #"/usr/cluster/bin/bgzip"; +my $bcftools = "bcftools"; #"/usr/cluster/bin/bcftools"; + +wGetOptions( + "-Family-based variant quality evaluation", + "--Required Options", + "vcf=s" => [\$vcf, "Input VCF file", "Input VCF file to modify FILTER column"], + "ext=s" => [\$ext, "External VCF file with FILTER information", "Input VCF file to modify FILTER column"], + "out=s" => [\$out, "Output file", "Output VCF file with modified FILTER column"], + "--Additional Options", + "prefix=s" => [\$prefix,"Prefix of the external filter"], + "region=s" => [\$region,"Genomic region to focus on"], + "tabix=s" => [\$tabix,"Path to the tabix software binary"], + "bgzip=s" => [\$bgzip,"Path to the bgzip software binary"], + "bcftools=s" => [\$bcftools,"Path to the bcftools software binary"], + ) || wpod2usage(2); + +unless ( ( $vcf ) && ( $out ) && ( $ext ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +if ( $ext =~ /\.vcf.gz$/ ) { + die "Cannot open $vcf\n" unless ( -s $ext ); + if ( $region ) { + open(EX,"$tabix -h $ext $region |"); + } + else { + open(EX,"zcat $ext |"); + } +} +elsif ( $ext =~ /\.bcf$/ ) { + print STDERR "Reading BCF file using BCFtools\n"; + die "Cannot open $ext\n" unless ( -s $ext ); + if ( $region ) { + open(EX,"$bcftools view $ext $region |"); + } + else { + open(EX,"$bcftools view $ext |"); + } +} +else { + open(EX,$ext) || die "Cannot open $vcf\n"; +} + +my @exfilts = (); +my @exhdrs = (); +my @exG = (); + +while() { + #if ( /^##FILTER=/ ) { + if ( /^##FILTER=/ ) { + my $desc = $1; + push(@exhdrs,"##FILTER=\n"); + } + else { + die "Cannot parse FILTER meta line $prefix$filt\n"; + } + } + else { + push(@exfilts,$1); + push(@exhdrs,$_); + } + } + elsif ( ! /^#/ ) { + my ($chr,$pos,$id,$ref,$alt,$qual,$filt) = split; + push(@exG,[$chr,$pos,$ref,$alt,$filt]); + last; + } +} + +## hvcfids contains the list of IDs sequenced +if ( $vcf =~ /\.vcf.gz$/ ) { + die "Cannot open $vcf\n" unless ( -s $vcf ); + if ( $region ) { + open(IN,"$tabix -h $vcf $region |"); + } + else { + open(IN,"zcat $vcf |"); + } +} +elsif ( $vcf =~ /\.bcf$/ ) { + print STDERR "Reading BCF file $vcf using BCFtools\n"; + die "Cannot open $vcf\n" unless ( -s $vcf ); + if ( $region ) { + open(IN,"$bcftools view $vcf $region |"); + } + else { + open(IN,"$bcftools view $vcf |"); + } +} +else { + open(IN,$vcf) || die "Cannot open $vcf\n"; +} + +if ( $out =~ /\.bcf$/ ) { + open(OUT,"| $bcftools view -Ob -o $out /dev/stdin >$out.out 2> $out.err ") || die "Cannot open file\n"; +} +elsif ( $out =~ /\.gz$/ ) { + open(OUT,"| $bgzip -c > $out") || die "Cannot open file\n"; +} +else { + open(OUT,">$out") || die "Cannot open file\n"; +} + +my %hfilts = (); +while() { + if ( /^#/ ) { + if ( /^##/ ) { + print OUT $_; + if ( /^##FILTER=[0] ); + + $F[6] = "PASS" if ( $F[6] eq "." ); + + ## make sure that exG does not contain anything before the current position + while( $exG[0]->[1] < $F[1] ) { + my ($chr,$pos,$id,$ref,$alt,$qual,$filt) = split(/[\t\r\n ]+/,); + if ( defined($chr) ) { + @exG = ($exG[$#exG],[$chr,$pos,$ref,$alt,$filt]); + } + else { + @exG = ($exG[$#exG],[$F[0],1e9,".",".","."]); + last; + } + } + + ## make sure that ties all exist + while( $exG[0]->[1] == $exG[$#exG]->[1] ) { + my ($chr,$pos,$id,$ref,$alt,$qual,$filt) = split(/[\t\r\n ]+/,); + if ( defined($chr) ) { + push(@exG,[$chr,$pos,$ref,$alt,$filt]); + } + else { + push(@exG,[$F[0],1e9,".",".","."]); + last; + } + } + + if ( $F[1] % 10000 == 0 ) { + print STDERR "$F[0]:$F[1] $exG[0]->[0]:$exG[0]->[1]\n"; + } + + ## Search for overlaps + if ( $F[1] == $exG[0]->[1] ) { + for(my $i=0; $i < $#exG; ++$i) { + if ( $exG[$i]->[4] ne "PASS" ) { + if ( ( $F[3] eq $exG[$i]->[2] ) && ( $F[4] eq $exG[$i]->[3] ) ) { + my @oldFilts = split(/;/,$F[6]); + @oldFilts = () if ( ( $F[6] eq "PASS" ) || ( $F[6] eq "." ) ); + my @newFilts = split(/;/,$exG[$i]->[4]); + for(my $i=0; $i < @newFilts; ++$i) { + my $j=0; + for($j=0; $j < @oldFilts; ++$j) { + last if ( $oldFilts[$j] eq $prefix.$newFilts[$i] ); + } + if ( $j == $#oldFilts+1 ) { + push(@oldFilts,$prefix.$newFilts[$i]); + } + } + $F[6] = $#oldFilts < 0 ? "PASS" : join(";",@oldFilts); + } + } + } + } + print OUT join("\t",@F)."\n"; + } +} + +close OUT; +close IN; +close EX; diff --git a/scripts/vcf-delta-svm b/scripts/vcf-delta-svm index 47398f2..7eb4517 100644 --- a/scripts/vcf-delta-svm +++ b/scripts/vcf-delta-svm @@ -12,6 +12,8 @@ my $outvcf = ""; my $ref = ""; my $weightf = ""; my $infoKey = "DELTA_SVM"; +my $multiWeightf = ""; +my $rawScore = ""; my $region = ""; my $binbgzip = "$FindBin::Bin/bgzip"; my $bintabix = "$FindBin::Bin/tabix"; @@ -22,48 +24,71 @@ wGetOptions( "in-vcf=s",[\$invcf,"Input VCF file"], "out-vcf=s",[\$outvcf,"Output VCF file where deltaSVM score will be attached to the INFO field"], "weight=s",[\$weightf,"Weight file trained by delta-SVM method"], + "multi-weight=s",[\$multiWeightf,"Tab-limited file containing the list of multiple weight files as [KEY] [FILENAME]"], "ref=s",[\$ref,"FASTA-format sequences for the reference genome, which should match to the genome build used for the input VCF file"], "--Additional Options", "info-key=s",[\$infoKey,"The name of INFO field entry to record the delta svm score"], "region=s",[\$region,"Subset of genomic regions to extract from the input VCF"], "bgzip=s",[\$binbgzip,"Path to bgzip binary"], "tabix=s",[\$bintabix,"Path to tabix binary"], + "raw-score",[\$rawScore,"Report (averaged) raw score of delta-svm binding score for each allele, rather than reporting the difference from reference allele"], ) || wpod2usage(2); -wpod2usage(2) unless ( ( $invcf ) || ( $outvcf ) || ( $weightf ) || ( $ref ) ); - +wpod2usage(2) unless ( ( $invcf ) && ( $outvcf ) && ( ( $weightf ) || ( $multiWeightf) ) && ( $ref ) ); + print STDERR "Analysis started at ".scalar(localtime)."\n"; ### Initialize the reference FASTQ sequence &initRef($ref); -### Read the weight file to contstruct the hash table - -print STDERR "Reading SVM weight file $weightf..\n"; -my %svmW = (); -my $calcRevComp = 0; -my $kmerLength = 0; -open(IN,$weightf) || die "Cannot open the weight file $weightf\n"; -while() { - next if ( /^(#|kmer|bias)/ ); - my @F = split; - if ( $#F == 1 ) { - $svmW{$F[0]} = $F[1]; - $svmW{revcomp($F[0])} = $F[1]; - } - elsif ( $#F == 2 ) { - $svmW{$F[0]} = $F[2]; - $svmW{$F[1]} = $F[2]; - } - else { - die "Cannot recognize the SVM weight file. line $. -- @F\n"; - } +my @weightfs = (); +my @infokeys = (); - $kmerLength = length($F[0]) if ( $kmerLength == 0 ); +if ( $multiWeightf ) { + open(IN,$multiWeightf) || die "Cannot open file\n"; + while() { + my ($key,$fname) = split; + push(@weightfs, $fname); + push(@infokeys,$key); + } + close IN; +} +else { + push(@weightfs,$weightf); + push(@infokeys,$infoKey); } -close IN; +my @svmWeights = (); +my @kmerLengths = (); +for(my $i=0; $i < @weightfs; ++$i) { + ### Read the weight file to contstruct the hash table + print STDERR "Reading SVM weight file $weightfs[$i]..\n"; + my %svmW = (); + my $calcRevComp = 0; + my $kmerLength = 0; + open(IN,$weightfs[$i]) || die "Cannot open the weight file $weightf\n"; + while() { + next if ( /^(#|kmer|bias)/ ); + my @F = split; + if ( $#F == 1 ) { + $svmW{$F[0]} = $F[1]; + $svmW{revcomp($F[0])} = $F[1]; + } + elsif ( $#F == 2 ) { + $svmW{$F[0]} = $F[2]; + $svmW{$F[1]} = $F[2]; + } + else { + die "Cannot recognize the SVM weight file. line $. -- @F\n"; + } + + $kmerLength = length($F[0]) if ( $kmerLength == 0 ); + } + close IN; + push(@svmWeights,\%svmW); + push(@kmerLengths,$kmerLength); +} print STDERR "Finished reading weights and processing VCF file $invcf...\n"; ### Read input VCF file @@ -108,37 +133,51 @@ while() { } } else { - my $refSeq = uc(&readFasta($F[0],$F[1]-$kmerLength+1,$F[1]+$kmerLength-2+$refLength)); - ## if any non-ACGT is observed, fill with random sequence - if ( $refSeq =~ /[^ACGT]/ ) { - for(my $i=0; $i < length($refSeq); ++$i) { - unless ( substr($refSeq,$i,1) =~ /[ACGT]/ ) { - my @acgts = qw(A C G T); - substr($refSeq,$i,1) = $acgts[int(rand(4))]; ## replace the string with random sequence - } + my $refSeq = uc(&readFasta($F[0],$F[1]-$kmerLengths[0]+1,$F[1]+$kmerLengths[0]-2+$refLength)); + $refSeq =~ s/[^ACGT]/A/g; + my $winRef = $kmerLengths[0]+$refLength-1; + my @alts = split(/,/,$F[4]); + + my @infoFields = (); + + for(my $i=0; $i < @infokeys; ++$i) { + if ( ( $i > 0 ) && ( $kmerLengths[$i] != $kmerLengths[$i-1] ) ) { + $refSeq = uc(&readFasta($F[0],$F[1]-$kmerLengths[$i]+1,$F[1]+$kmerLengths[$i]-2+$refLength)); + $refSeq =~ s/[^ACGT]/A/g; + $winRef = $kmerLengths[$i]+$refLength-1; + } + + my $sumRef = 0; + for(my $j=0; $j < $winRef; ++$j) { + $sumRef += $svmWeights[$i]->{substr($refSeq,$j,$kmerLengths[$i])}; } - } - my $winRef = $kmerLength+$refLength-1; - my $sumRef = 0; - for(my $i=0; $i < $winRef; ++$i) { - $sumRef += $svmW{substr($refSeq,$i,$kmerLength)}; - } - my @alts = split(/,/,$F[4]); - my @deltaSVMScores = (); + my @deltaSVMScores = (); - foreach my $alt (@alts) { - my $altSeq = substr($refSeq,0,$kmerLength-1).$alt.substr($refSeq,1-$kmerLength); - my $winAlt = $kmerLength+length($alt)-1; - my $sumAlt = 0; - for(my $i=0; $i < $winAlt; ++$i) { - $sumAlt += $svmW{substr($altSeq,$i,$kmerLength)}; + if ( $rawScore ) { + push(@deltaSVMScores,sprintf("%.5lf",$kmerLengths[$i] * ( $sumRef / $winRef ))); } - - ## To make deltaSVM score compatible to the original code, we rescale the scores by kmer length - push(@deltaSVMScores,sprintf("%.6lf",$kmerLength * ( $sumAlt / $winAlt - $sumRef / $winRef ))); + + foreach my $alt (@alts) { + my $altSeq = substr($refSeq,0,$kmerLengths[$i]-1).$alt.substr($refSeq,1-$kmerLengths[$i]); + my $winAlt = $kmerLengths[$i]+length($alt)-1; + my $sumAlt = 0; + for(my $j=0; $j < $winAlt; ++$j) { + $sumAlt += $svmWeights[$i]->{substr($altSeq,$j,$kmerLengths[$i])}; + } + + ## To make deltaSVM score compatible to the original code, we rescale the scores by kmer length + if ( $rawScore ) { + push(@deltaSVMScores,sprintf("%.5lf",$kmerLengths[$i] * ( $sumAlt / $winAlt))); + } + else { + push(@deltaSVMScores,sprintf("%.5lf",$kmerLengths[$i] * ( $sumAlt / $winAlt - $sumRef / $winRef ))); + } + } + my $infoField = $infokeys[$i] . "=".join(",",@deltaSVMScores); + push(@infoFields,$infoField); } - $F[7] .= ";DELTA_SVM=".join(",",@deltaSVMScores); + $F[7] .= ";".join(";",@infoFields); } print OUT join("\t",@F)."\n"; } diff --git a/scripts/vcf-infer-ped b/scripts/vcf-infer-ped new file mode 100644 index 0000000..83a7443 --- /dev/null +++ b/scripts/vcf-infer-ped @@ -0,0 +1,253 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +#use lib '/net/fantasia/home/hmkang/bin/utils'; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(zopen); + +my $kin0f = ""; +my $sexmapf = ""; +my $outf = ""; +my $groupf = ""; +my $dupThres = 0.4; +my $relThres = 0.175; +my $poThres = 0.0035; +my $rmOverlap = ""; + +wGetOptions( + "-Identify nuclear families from KING2 output and sex map", + "--Required Options", + "kin0=s" => [\$kin0f, ".kin0 file from KING2",".kin0 file from KING2. Use options --kinship --degree 4 (or 3)"], + "sex=s" => [\$sexmapf, "Sex map file", "Sex map file containing the sex of each individual as ploidy of X chromosomes"], + "out=s" => [\$outf, "Output file", "Output file prefix"], + "--Additional Options", + "group=s" => [\$groupf, "Group file of each individual", "Group map file containing the batch information of each individual"], + "dup-thres=f" => [\$dupThres, "Mininumn kinship coefficient to be considered as duplicate pair"], + "rel-thres=f" => [\$relThres, "Mininumn kinship coefficient to be considered as 1st degree relative"], + "po-thres=f" => [\$poThres, "Maximum IBS0 coefficient to be considered as parent-offspring pair"], + "rm-overlap" => [\$rmOverlap, "Remove overlapping individuals between families"], + ) || wpod2usage(2); + +unless ( ( $kin0f ) && ( $outf ) && ( $sexmapf ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +my %hsex = (); +my %hcent = (); +my @ids = (); + +my $nsex = 0; + +open(IN,$sexmapf) || die "Cannot open file $sexmapf\n"; +while() { + my ($id,$sex) = split; + $hsex{$id} = $sex; + push(@ids,$id); + ++$nsex; +} +close IN; + +print STDERR "Finished reading sex information of $nsex individuals from $sexmapf\n"; + +if ( $groupf ) { + my $ngrp = 0; + open(IN,$groupf) || die "Cannot open file $groupf\n"; + while() { + my ($id,$group) = split; + $hcent{$id} = $group; + ++$ngrp; + } + close IN; + print STDERR "Finished reading group information of $ngrp indiviuduals from $groupf\n"; +} +else { + foreach my $id (sort keys %hsex) { + $hcent{$id} = "."; + } + print STDERR "Skipping assigning group information for each individual\n"; +} + + +my %hrel = (); + +my ($ndup,$npo,$nfs,$netc) = (0,0,0,0); +open(IN,$kin0f) || die "Cannot open file $kin0f\n"; +while() { + next if ( /^FID/ ); + my ($fid1,$id1,$fid2,$id2,$nsnp,$hethet,$ibs0,$kin) = split; + + my $rel = "ETC"; + if ( $kin > $dupThres ) { $rel = "DUP"; ++$ndup; } + elsif ( ( $kin >$relThres )&& ( $ibs0 < $poThres ) ) { $rel = "PO"; ++$npo; } + elsif ( $kin > $relThres ) { $rel = "FS"; ++$nfs; } + else { ++$netc; } + + $hrel{$id1}{$id2} = $rel; + $hrel{$id2}{$id1} = $rel; +} +close IN; + +print STDERR "Finished reading pairwise relationship of $ndup duplicates, $npo parent-offsprings, $nfs full-siblings, and $netc other relationships\n"; + + +my %hpar = (); +my %hfam = (); +my %hdup = (); +my %hkid = (); + +## First, search for only dups +foreach my $id (@ids) { $hdup{$id} = [$id]; } + +foreach my $id (@ids) { + my $r = $hrel{$id}; + my @others = sort keys %{$r}; + foreach my $other (@others) { + my $rel = $hrel{$id}{$other}; + if ( $rel eq "DUP" ) { + my @newdups = sort(uniq(@{$hdup{$id}},@{$hdup{$other}})); + foreach my $dup (@newdups) { + $hdup{$dup} = \@newdups; + } + } + } +} + +## Second, seach for parents +foreach my $id (@ids) { + my $r = $hrel{$id}; + my @others = sort keys %{$r}; + next unless ( $hdup{$id}->[0] eq $id ); ## skip redundancies in duplicates + + my @POs = (); + foreach my $other (@others) { + my $rel = $hrel{$id}{$other}; + if ( $rel eq "PO" ) { + next unless ( $hdup{$other}->[0] eq $other ); ## skip redundancies in duplicates + push(@POs,$other); + } + } + + my $dad; + my $mom; + + for(my $i=0; $i < @POs; ++$i) { + for(my $j=0; $j < $i; ++$j) { + unless ( defined($hrel{$POs[$i]}{$POs[$j]}) ) { + if ( defined($dad) || defined($mom) ) { + die "ERROR: for kid $id, parents are already found [$dad,$mom], but another pairs [".join(",",$POs[$i],$POs[$j])."] were found too \n"; + next; + } + + if ( $hsex{$POs[$i]} < $hsex{$POs[$j]} ) { + $dad = $POs[$i]; + $mom = $POs[$j]; + } + elsif ( $hsex{$POs[$i]} > $hsex{$POs[$j]} ) { + $dad = $POs[$j]; + $mom = $POs[$i]; + } + else { + die "ERROR: for kid $id, parents are inferred to be [$POs[$i],$POs[$j]], but their sexes are [".join(",",$hsex{$POs[$i]},$hsex{$POs[$j]})."]\n"; + } + } + } + } + + if ( defined($dad) && defined($mom) ) { ## check if the dad or mom is already involved in other families + #print STDERR "$dad $mom $id\n"; + + next if ( defined($hpar{$dad}) && ( $hpar{$dad} ne $mom ) ); + $hfam{"$dad:$mom"} = [] unless ( defined($hfam{"$dad:$mom"}) ); + push(@{$hfam{"$dad:$mom"}},$id); + #print "$id\t$dad\t$mom\n"; + $hpar{$dad} = $mom; + $hpar{$mom} = $dad; + $hkid{$id} = 1; + } +} + +## Remove any possible overlaps in families +if ( $rmOverlap ) { + my %hobs = (); + my @toremove = (); + foreach my $dadmom (sort keys %hfam) { + my @mids = split(/:/,$dadmom); + push(@mids,@{$hfam{$dadmom}}); + my $remove = 0; + foreach my $mid (@mids) { + if ( defined($hobs{$mid}) ) { ++$remove; } + $hobs{$mid} = 1; + } + if ( $remove > 0 ) { + push(@toremove,$dadmom); + } + } + print STDERR "Removing ".($#toremove+1)." families with partial overlaps...\n"; + foreach my $dadmom (@toremove) { + delete $hfam{$dadmom}; + } +} + + +open(PED,">$outf") || die "Cannot open file $outf for writing\n"; + +## print each family first +foreach my $dadmom (sort keys %hfam) { + my ($dad,$mom) = split(/:/,$dadmom); + next if ( defined($hkid{$dad}) || defined($hkid{$mom}) ); + my @kids = @{$hfam{$dadmom}}; + my $fid = "$dad\_$mom"; + my @cents = (); + + foreach my $id (@{$hdup{$dad}}) { + push(@cents,$hcent{$id}); + } + foreach my $id (@{$hdup{$mom}}) { + push(@cents,$hcent{$id}); + } + foreach my $kid (@kids) { + foreach my $id (@{$hdup{$kid}}) { + push(@cents,$hcent{$id}); + } + } + my $centSuffix = join("_",sort(uniq(@cents))); + if ( $centSuffix ne "." ) { + $fid .= "-$centSuffix"; + } + + print PED join("\t",$fid,join(",",@{$hdup{$dad}}),0,0,1,-9)."\n"; + print PED join("\t",$fid,join(",",@{$hdup{$mom}}),0,0,2,-9)."\n"; + foreach my $kid (@kids) { + print PED join("\t",$fid,join(",",@{$hdup{$kid}}),$dad,$mom,$hsex{$kid},-9)."\n"; + } +} + +## print remaining duplicates +foreach my $id (sort keys %hdup) { + next unless ( $#{$hdup{$id}} > 0 ); + next if ( defined($hkid{$id}) || defined($hpar{$id}) ); + next if ( $id ne $hdup{$id}->[0] ); + + my @cents = (); + foreach my $id2 (@{$hdup{$id}}) { + push(@cents,$hcent{$id2}); + } + my $fid = $id; + my $centSuffix = join("_",sort(uniq(@cents))); + if ( $centSuffix ne "." ) { + $fid .= "-$centSuffix"; + } + #my $fid = "$id-".join("_",uniq(@cents)); + + print PED join("\t",$fid,join(",",@{$hdup{$id}}),0,0,1,-9)."\n"; +} +close PED; + +sub uniq { + my %seen; + return grep { !$seen{$_}++ } @_; +} diff --git a/scripts/vcf-liftover b/scripts/vcf-liftover index 4f1e042..9bef450 100644 --- a/scripts/vcf-liftover +++ b/scripts/vcf-liftover @@ -3,7 +3,7 @@ use strict; use FindBin; use lib $FindBin::Bin; -use hyunlib qw(forkExecWait); +use hyunlib qw(forkExecWait initRef @achrs %hszchrs); use wGetOptions qw(wGetOptions wpod2usage); my $vcf = ""; @@ -13,8 +13,10 @@ my $sepchr = ""; my $keep = ""; my $binbgzip = "$FindBin::Bin/bgzip"; my $bintabix = "$FindBin::Bin/tabix"; +my $bcftools = "/usr/cluster/bin/bcftools"; my $binliftOver = "/net/fantasia/home/hmkang/tools/ucsc_tools/executables/liftOver"; my $chain = ""; +my $newref = ""; wGetOptions( "-LiftOver a VCF file", @@ -22,27 +24,41 @@ wGetOptions( "vcf=s",[\$vcf,"Input VCF file"], "out=s",[\$out,"Output file. STDOUT if unspecified"], "chain=s",[\$chain,"liftOver chain file"], - "liftover=s",[\$binliftOver,"Binary to liftOver tool (downloadable from UCSC)"], + "liftover=s",[\$binliftOver,"Path to binary of liftOver tool (downloadable from UCSC)"], + "ref=s",[\$newref,"Path to the new reference FASTA file"], + "bcftools=s",[\$bcftools,"Path to binary of bcftools"], ) || wpod2usage(2); -wpod2usage(2) unless ( ( $vcf ) && ( $out ) && ( $chain ) && ( $binliftOver) ) ; +wpod2usage(2) unless ( ( $vcf ) && ( $out ) && ( $chain ) && ( $binliftOver) && ( $newref ) ) ; -if ( $vcf =~ /\.gz$/ ) { open(VCF,"zcat $vcf|") || die "Cannot open file\n"; } +&initRef($newref); + +if ( $vcf =~ /\.bcf$/ ) { open(VCF, "$bcftools view $vcf|") || die "Cannot open file\n"; } +elsif ( $vcf =~ /\.gz$/ ) { open(VCF,"zcat $vcf|") || die "Cannot open file\n"; } else { open(VCF,$vcf) || die "Cannot open file\n"; } +if ( $out =~ /\.vcf\.gz$/ ) { $out =~ s/\.vcf\.gz$//; } + open(BED,">$out.old.bed") || die "Cannot write $out.old.bed"; open(OUT,"| $binbgzip -c > $out.vcf.gz") || die "Cannot open file\n"; my %h = (); +my $chrPrefix = ( $achrs[0] =~ /^chr/ ) ? 1 : 0; while() { if ( /^#/ ) { + next if ( /^##contig=/ ); print OUT $_; + if ( $. == 1 ) { + for(my $i=0; $i < @achrs; ++$i) { + print OUT "##contig=[3].">\n"; + } + } next; } my @F = split; my $key = "$F[0]\_$F[1]\_$F[3]\_$F[4]"; - unless ( $F[0] =~ /^chr/ ) { + unless ( $F[0] =~ /^chr/ ) { $F[0] = "chr$F[0]"; } $h{$key} = \@F; @@ -53,18 +69,22 @@ close BED; &forkExecWait("$binliftOver $out.old.bed $chain $out.new.bed $out.unmapped.bed"); -open(IN,"cat $out.new.bed | sort -k 1,1 -k 2,3n |") || die "Cannot open $out.new.bed"; -while() { - my ($chr,$beg,$end,$key) = split; - next unless ( $chr =~ /^chr(\d+|X|Y|M)$/ ); - if ( $chain =~ /ToHg19/ ) { - $chr =~ s/^chr//; +foreach my $mychr (1..22,"X","Y","M") { + print "Writing chromosome chr$mychr..\n"; + open(IN,"cat $out.new.bed | grep -w ^chr$mychr | sort -k 2,3n |") || die "Cannot open $out.new.bed"; + while() { + my ($chr,$beg,$end,$key) = split; + next unless ( $chr =~ /^chr(\d+|X|Y|M)$/ ); + #if ( $chain =~ /ToHg19/ ) { + if ( $chrPrefix == 0 ) { + $chr =~ s/^chr//; + } + my @F = @{$h{$key}}; + $F[7] .= ";OLD_VARIANT=$key"; + print OUT join("\t",$chr,$beg+1,@F[2..$#F])."\n"; } - my @F = @{$h{$key}}; - $F[7] .= ";OLD_VARIANT=$key"; - print OUT join("\t",$chr,$beg+1,@F[2..$#F])."\n"; + close IN; } -close IN; close OUT; my $cmd = "$bintabix -pvcf $out.vcf.gz"; diff --git a/scripts/vcf-lr-align b/scripts/vcf-lr-align new file mode 100644 index 0000000..5fcc331 --- /dev/null +++ b/scripts/vcf-lr-align @@ -0,0 +1,247 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +#use lib '/net/fantasia/home/hmkang/bin/utils'; +use wGetOptions qw(wpod2usage wGetOptions); +use hyunlib qw(zopen); + +my $fasta = ""; +my $region = ""; +my $outf = ""; +my $samtools = "samtools"; +my $maxdel = 20; + +wGetOptions( + "-Identify nuclear families from KING2 output and sex map", + "--Required Options", + "fasta=s" => [\$fasta, "Fasta file with fasta index"], + "region=s" => [\$region, "Genomic region to focus on"], + "out=s" => [\$outf, "Output file", "Output file prefix"], + "--Additional Options", + "samtools=s" => [\$samtools, "Samtools binary path"], + "max-del=i" => [\$maxdel, "Maximum deletion length"], + ) || wpod2usage(2); + +unless ( ( $fasta ) && ( $outf ) && ( $sexmapf ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +my %hsex = (); +my %hcent = (); +my @ids = (); + +my $nsex = 0; + +open(IN,$sexmapf) || die "Cannot open file $sexmapf\n"; +while() { + my ($id,$sex) = split; + $hsex{$id} = $sex; + push(@ids,$id); + ++$nsex; +} +close IN; + +print STDERR "Finished reading sex information of $nsex individuals from $sexmapf\n"; + +if ( $groupf ) { + my $ngrp = 0; + open(IN,$groupf) || die "Cannot open file $groupf\n"; + while() { + my ($id,$group) = split; + $hcent{$id} = $group; + ++$ngrp; + } + close IN; + print STDERR "Finished reading group information of $ngrp indiviuduals from $groupf\n"; +} +else { + foreach my $id (sort keys %hsex) { + $hcent{$id} = "."; + } + print STDERR "Skipping assigning group information for each individual\n"; +} + + +my %hrel = (); + +my ($ndup,$npo,$nfs,$netc) = (0,0,0,0); +open(IN,$kin0f) || die "Cannot open file $kin0f\n"; +while() { + next if ( /^FID/ ); + my ($fid1,$id1,$fid2,$id2,$nsnp,$hethet,$ibs0,$kin) = split; + + my $rel = "ETC"; + if ( $kin > $dupThres ) { $rel = "DUP"; ++$ndup; } + elsif ( ( $kin >$relThres )&& ( $ibs0 < $poThres ) ) { $rel = "PO"; ++$npo; } + elsif ( $kin > $relThres ) { $rel = "FS"; ++$nfs; } + else { ++$netc; } + + $hrel{$id1}{$id2} = $rel; + $hrel{$id2}{$id1} = $rel; +} +close IN; + +print STDERR "Finished reading pairwise relationship of $ndup duplicates, $npo parent-offsprings, $nfs full-siblings, and $netc other relationships\n"; + + +my %hpar = (); +my %hfam = (); +my %hdup = (); +my %hkid = (); + +## First, search for only dups +foreach my $id (@ids) { $hdup{$id} = [$id]; } + +foreach my $id (@ids) { + my $r = $hrel{$id}; + my @others = sort keys %{$r}; + foreach my $other (@others) { + my $rel = $hrel{$id}{$other}; + if ( $rel eq "DUP" ) { + my @newdups = sort(uniq(@{$hdup{$id}},@{$hdup{$other}})); + foreach my $dup (@newdups) { + $hdup{$dup} = \@newdups; + } + } + } +} + +## Second, seach for parents +foreach my $id (@ids) { + my $r = $hrel{$id}; + my @others = sort keys %{$r}; + next unless ( $hdup{$id}->[0] eq $id ); ## skip redundancies in duplicates + + my @POs = (); + foreach my $other (@others) { + my $rel = $hrel{$id}{$other}; + if ( $rel eq "PO" ) { + next unless ( $hdup{$other}->[0] eq $other ); ## skip redundancies in duplicates + push(@POs,$other); + } + } + + my $dad; + my $mom; + + for(my $i=0; $i < @POs; ++$i) { + for(my $j=0; $j < $i; ++$j) { + unless ( defined($hrel{$POs[$i]}{$POs[$j]}) ) { + if ( defined($dad) || defined($mom) ) { + die "ERROR: for kid $id, parents are already found [$dad,$mom], but another pairs [".join(",",$POs[$i],$POs[$j])."] were found too \n"; + next; + } + + if ( $hsex{$POs[$i]} < $hsex{$POs[$j]} ) { + $dad = $POs[$i]; + $mom = $POs[$j]; + } + elsif ( $hsex{$POs[$i]} > $hsex{$POs[$j]} ) { + $dad = $POs[$j]; + $mom = $POs[$i]; + } + else { + die "ERROR: for kid $id, parents are inferred to be [$POs[$i],$POs[$j]], but their sexes are [".join(",",$hsex{$POs[$i]},$hsex{$POs[$j]})."]\n"; + } + } + } + } + + if ( defined($dad) && defined($mom) ) { ## check if the dad or mom is already involved in other families + #print STDERR "$dad $mom $id\n"; + + next if ( defined($hpar{$dad}) && ( $hpar{$dad} ne $mom ) ); + $hfam{"$dad:$mom"} = [] unless ( defined($hfam{"$dad:$mom"}) ); + push(@{$hfam{"$dad:$mom"}},$id); + #print "$id\t$dad\t$mom\n"; + $hpar{$dad} = $mom; + $hpar{$mom} = $dad; + $hkid{$id} = 1; + } +} + +## Remove any possible overlaps in families +if ( $rmOverlap ) { + my %hobs = (); + my @toremove = (); + foreach my $dadmom (sort keys %hfam) { + my @mids = split(/:/,$dadmom); + push(@mids,@{$hfam{$dadmom}}); + my $remove = 0; + foreach my $mid (@mids) { + if ( defined($hobs{$mid}) ) { ++$remove; } + $hobs{$mid} = 1; + } + if ( $remove > 0 ) { + push(@toremove,$dadmom); + } + } + print STDERR "Removing ".($#toremove+1)." families with partial overlaps...\n"; + foreach my $dadmom (@toremove) { + delete $hfam{$dadmom}; + } +} + + +open(PED,">$outf") || die "Cannot open file $outf for writing\n"; + +## print each family first +foreach my $dadmom (sort keys %hfam) { + my ($dad,$mom) = split(/:/,$dadmom); + next if ( defined($hkid{$dad}) || defined($hkid{$mom}) ); + my @kids = @{$hfam{$dadmom}}; + my $fid = "$dad\_$mom"; + my @cents = (); + + foreach my $id (@{$hdup{$dad}}) { + push(@cents,$hcent{$id}); + } + foreach my $id (@{$hdup{$mom}}) { + push(@cents,$hcent{$id}); + } + foreach my $kid (@kids) { + foreach my $id (@{$hdup{$kid}}) { + push(@cents,$hcent{$id}); + } + } + my $centSuffix = join("_",sort(uniq(@cents))); + if ( $centSuffix ne "." ) { + $fid .= "-$centSuffix"; + } + + print PED join("\t",$fid,join(",",@{$hdup{$dad}}),0,0,1,-9)."\n"; + print PED join("\t",$fid,join(",",@{$hdup{$mom}}),0,0,2,-9)."\n"; + foreach my $kid (@kids) { + print PED join("\t",$fid,join(",",@{$hdup{$kid}}),$dad,$mom,$hsex{$kid},-9)."\n"; + } +} + +## print remaining duplicates +foreach my $id (sort keys %hdup) { + next unless ( $#{$hdup{$id}} > 0 ); + next if ( defined($hkid{$id}) || defined($hpar{$id}) ); + next if ( $id ne $hdup{$id}->[0] ); + + my @cents = (); + foreach my $id2 (@{$hdup{$id}}) { + push(@cents,$hcent{$id2}); + } + my $fid = $id; + my $centSuffix = join("_",sort(uniq(@cents))); + if ( $centSuffix ne "." ) { + $fid .= "-$centSuffix"; + } + #my $fid = "$id-".join("_",uniq(@cents)); + + print PED join("\t",$fid,join(",",@{$hdup{$id}}),0,0,1,-9)."\n"; +} +close PED; + +sub uniq { + my %seen; + return grep { !$seen{$_}++ } @_; +} diff --git a/scripts/vcf-milk-svm-filter b/scripts/vcf-milk-svm-filter new file mode 100644 index 0000000..ff77c79 --- /dev/null +++ b/scripts/vcf-milk-svm-filter @@ -0,0 +1,866 @@ +#!/usr/bin/perl -w + +use strict; +use Time::HiRes qw(usleep nanosleep); +use File::Path; +use File::Basename; +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(%hszchrs initRef forkExecWait); + +## vcf-milk-svm-filter +## Performs SVM filtering based on the aggregated output of MILK SVM + +my $omnivcf = "/data/local/ref/gotcloud.ref/hg38/1000G_omni2.5.b38.sites.PASS.vcf.gz"; +my $hapmapvcf = "/data/local/ref/gotcloud.ref/hg38/hapmap_3.3.b38.sites.vcf.gz"; +my @posVcfs = ($omnivcf,$hapmapvcf); + +my $ref = "/data/local/ref/gotcloud.ref/hg38/hs38DH.fa"; +my $tabix = "tabix"; +my $bgzip = "bgzip"; +my $gotcloudroot = "../gotcloud"; +my $dbsnp = "/data/local/ref/gotcloud.ref/hg38/dbsnp_142.b38.vcf.gz"; +my $modelchr = "chr2"; +my $xchr = "chrX"; +my ($xStart,$xStop) = (2781479,155701383); +my $centbed = "hg38.centromere.bed.gz"; +my $chr = ""; +my $out = ""; +my $cutoff = -0.5; + +wGetOptions( + "-Identify nuclear families from KING2 output and sex map", + "--Required Options", + "vcf" => [\$vcf, "Chromosome to perform SVM filtering"], + "chr" => [\$chr, "Chromosome to perform SVM filtering"], + "out" => [\$out, "Output VCf file name to generate"], + "--Additional Options", + "model-chr" => [\$modelchr, "Chromosome label of model chromosome to train for autosomes"], + "ref=s" => [\$ref, "Reference FASTA file (with .fai index)"], + "tabix=s" => [\$tabix, "Binary path of tabix"], + "bgzip=s" => [\$bgzip, "Binary path of bgzip"], + "gcroot=s" => [\$gotcloudroot, "Gotcloud root directory"], + "dbsnp=s" => [\$dbsnp, "dbSNP VCF file"], + "pos=s" => [\@posvcf, "High quality VCFs"], + "cutoff=f" => [\$cutoff, "Cutoff of SVM scores to consider the + "--Options for X chromosome", + "x-label" => [\$xchr, "Chromosome label of X chromosome"], + "x-start" => [\$xStart, "Start base position of non-PAR region in X chromosome"], + "x-stop" => [\$xStop, "Stop base position of non-PAR region in X chromosome"], + ) || wpod2usage(2); + +unless ( ( $out ) && ( $chr ) ) { + print STDERR "Missing required options --chr and/or --out\n"; + wpodusage(2); +} + +die "Cannot open $centbed\n" unless ( -s $centbed ); + +my %hcent = (); +my $fh = zopen($fh); +while(<$fh>) { + my ($chr,$beg,$end) = split; + $hcent{$chr} = [$beg,$end]; +} +close IN; + +my $vcfsummary = "$FindBin::Bin/vcf-summary"; +my $vcfsummary2 = "$FindBin::Bin/vcf-summary-v2"; +my $invNorm = "$gotcloudroot/src/bin/invNorm"; +my $svmlearn = "$gotcloudroot/src/bin/svm-train"; +my $svmclassify = "$gotcloudroot/src/bin/svm-predict"; + +die "Cannot file $vcfsummary\n" unless ( -s $vcfsummary ); +die "Cannot file $vcfsummary2\n" unless ( -s $vcfsummary2 ); +die "Cannot file $invNorm\n" unless ( -s $invNorm ); +die "Cannot file $svmlearn\n" unless ( -s $svmlearn ); +die "Cannot file $svmclassify\n" unless ( -s $svmclassify ); + +&initRef($ref); + +my $milkDir = "milk"; +my $svmDir = "svm"; +my @ignores = qw(AC AN AF GC GN HWEAF_P MAX_IF MIN_IF MILK_LRE MILK_LUD MILK_BF MILK_HWEAF MILK_HWDGF DUP_CONC_ALL DUP_CONC_THRES TRIO_CONC_ALL TRIO_CONC_THRES MILK_CHRX); +my @includes = (); +my $checkNA = 1; +#my $bfIntercept = 2; +#my $bfSlope = 2; + +unless ( -e "$svmDir" ) { + mkdir("$svmDir") || die "Cannot create directory $svmDir\n"; +} + +my @names = (); +my $ncols = 0; +my %hIgnores = map { $_ => 1 } @ignores; +my %hIncludes = (); +my @includeKeys = (); +my @includeDefaultValues = (); +for(my $i=0; $i < @includes; ++$i) { + my ( $key, $defaultVal ) = split(/,/,$includes[$i]); + $hIncludes{$key} = $i; + push(@names,$key); + push(@includeKeys,$key); + push(@includeDefaultValues,defined($defaultVal) ? $defaultVal : 0); +} +my $nIncludes = $#includes + 1; + +my @discordsA = (0,1,1, 0,0,1, 1,0,1, 0,0,1, 0,0,0, 1,0,0, 1,0,1, 1,0,0, 1,1,0); +my @discordsX = (0,1,1, 0,0,0, 1,0,0, 0,0,0, 0,0,0, 0,0,0, 0,0,1, 0,0,0, 1,1,0); +my @dupdisc = (0,1,1, 1,0,1, 1,1,0); + +## Process the model chromosome first +my $szmodelchr = $hszchrs{$modelchr}->[3]; +unless ( -s "$svmDir/milk_model.$modelchr.svm.model" ) { + print STDERR "Creating SVM model for $modelchr first..\n"; + my $chr = $modelchr; + my $szchr = $hszchrs{$chr}->[3]; + + my %hpos = (); + + print STDERR "Loading positive labels..\n"; + ## LABEL positive samples + foreach my $posVcf (@posVcfs) { + open(IN,"$tabix $posVcf $chr:1-$szchr| grep -w PASS|") || die "Cannot open file\n"; + while() { + next if ( /^#/ ); + my ($chrom,$pos,$id,$ref,$alt) = split; + $hpos{"$chrom:$pos"} = "$ref:$alt"; + } + } + my ($cbeg,$cend) = @{$hcent{$chr}}; + + my %hneg = (); + my $milkVcf = "$milkDir/milk.$chr.sites.vcf.gz"; + print STDERR "Identifying negative labels from $milkVcf\n"; # using intercept $bfIntercept, log10-scale slope $bfSlope..\n"; + + open(IN,"zcat $milkVcf | cut -f 1-8| grep -v ^#|") || die "Cannot open file\n"; + while() { + my @F = split; + next if ( $F[4] =~ /,/ ); + #next if ( ( ( length($F[3]) > 1 ) || ( length($F[4]) > 1 ) ) && ( $F[6] ne "." ) ); + next if ( ( length($F[3]) > 1 ) || ( length($F[4]) > 1 ) ); + + next if ( ( $F[1] > $cbeg ) && ( $F[1] < $cend ) ); + + my $ac = $1 if ( $F[7] =~ /AC=(\d+);/ ); + + my @tcnts = split(/,/,$1) if ( $F[7] =~ /TRIO_CONC_THRES=([^;]+)/ ); + my @dcnts = split(/,/,$1) if ( $F[7] =~ /DUP_CONC_THRES=([^;]+)/ ); + my ($ndisc,$nconc,$ddisc,$dconc) = (0,0,0,0); + for(my $i=1; $i < 27; ++$i) { + if ( $tcnts[$i] > 0 ) { + next if ( ( $i == 26 ) || ( $i == 12 ) || ( $i == 13 ) || ( $i == 14 ) ); + if ( $discordsA[$i] == 0 ) { $nconc += $tcnts[$i] } + else { $ndisc += $tcnts[$i]; } + } + } + + for(my $i=1; $i < 9; ++$i) { + if ( $dcnts[$i] > 0 ) { + next if ( $i == 8 ); + if ( $dupdisc[$i] == 0 ) { $dconc += $dcnts[$i] } + else { $ddisc += $dcnts[$i]; } + } + } + + next if ( $ac < 2 ); ## do not include singletons + if ( ( ( $ndisc > 2 ) && ( $ndisc > $nconc * 0.05 ) ) || ( ( $ddisc > 2 ) && ( $ddisc > $dconc * 0.05 ) ) ) { + $hneg{"$F[0]:$F[1]:$F[3]:$F[4]"} = 1; + } + } + close IN; + + ## write features + my $out = "$svmDir/milk_model.$modelchr"; + + print STDERR "Writing the feature information for libsvm..\n"; + open(RAW,">$out.raw") || die "Cannot open $out.raw for writing\n"; + open(SITE,">$out.site") || die "Cannot open $out.raw for writing\n"; + #open(IN,"zcat $pasteDir/$chr\_1\_$szchr\_paste.sites.vcf.gz|") || die "Cannot open file\n"; + open(IN,"zcat $milkDir/milk.$chr.sites.vcf.gz|") || die "Cannot open file\n"; + my @hdrs = (); + while() { + if ( /^#/ ) { + push(@hdrs,$_); + next; + } + my ($chrom,$pos,$id,$ref,$alt,$qual,$filt,$info) = split(/[ \t\r\n]+/); + $info .= ";QUAL=$qual" unless ( $qual eq "." ); + my @infos = split(/;/,$info); + my @values = (); + my $k = 0; + for(my $j=0; $j < @includeKeys; ++$j) { + push(@values,$includeDefaultValues[$j]); + ++$k; + } + + for(my $j=0; $j < @infos; ++$j) { + my ($key,$val) = split(/=/,$infos[$j]); + #next if ( defined($hIgnores{$key}) || (!defined($hIncludes{$key}))); ## skip if ignored, or not in includes key + next if ( defined($hIgnores{$key}) ); + next unless defined($val); ## skip keys without any values + if ( defined($hIncludes{$key}) ) { + if ( !($checkNA) || ($val =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) ) { + $values[$hIncludes{$key}] = $val; # set value if given + } + } + else { + if ( !($checkNA) || ( $val =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) ) { + push(@values,$val); + } + else { + push(@values,0); + } + + if ( $ncols == 0 ) { + push(@names,$key); + } + else { + die "Cannot recognize $key in $infos[$j], supposed to be $names[$j] at $j, $chrom:$pos:$ref:$alt $info\n" unless ($names[$k] eq $key ); + } + ++$k; + } + } + if ( $ncols == 0 ) { + $ncols = $#names+1; + print STDERR "Recording following $ncols features : @names\nThe info field was $info\n@infos\n"; + die if ( $ncols == 0 ); + } + elsif ( $ncols != $#values+1 ) { + die "Number of columns are not identical at $chrom:$pos:$ref:$alt\n"; + } + print SITE join("\t",$chrom,$pos,$id,$ref,$alt,$qual,$filt,$info)."\n"; + print RAW join("\t",@values)."\n"; + } + close IN; + close RAW; + close SITE; + + print STDERR "Performing quantile normalization of features..\n"; + my $cmd = "$invNorm --in $out.raw --out $out.norm"; + &forkExecWait($cmd); + + open(SITE,"$out.site") || die "Cannot open $out.sites\n"; + open(NORM,"$out.norm") || die "Cannot open $out.norm\n"; + #open(FTR,">$out.feature") || die "Cannot open $out.feature\n"; + open(LBL,">$out.label") || die "Cannot open $out.label\n"; + + my ($npos,$nneg,$noth) = (0,0,0); + while() { + my ($chrom,$pos,$id,$ref,$alt) = split; + my @z = split(/[ \t\r\n]+/,); + my $ln = ""; + for(my $i=0; $i < @names; ++$i) { + $ln .= " ".($i+1).":$z[$i]"; + } + #if ( defined($hpos{"$chrom:$pos:$ref:$alt"}) ) { + if ( defined($hpos{"$chrom:$pos"}) ) { + if ( ( $hpos{"$chrom:$pos"} ne "$ref:$alt" ) || defined($hneg{"$chrom:$pos:$ref:$alt"}) ) { + #print FTR "0 $ln\n"; + ++$noth; + } + else { + #print FTR "1 $ln\n"; + print LBL "1 $ln\n"; + ++$npos; + } + } + elsif ( defined($hneg{"$chrom:$pos:$ref:$alt"}) ) { + #print FTR "-1 $ln\n"; + print LBL "-1 $ln\n"; + ++$nneg; + } + else { + #print FTR "0 $ln\n"; + ++$noth; + } + } + #close FTR; + close LBL; + close SITE; + + print STDERR "Training SVM classification model using $npos positive samples, $nneg negative samples with $noth additional samples\n"; + + $cmd = "$svmlearn -s 0 -t 2 $out.label $out.svm.model"; + &forkExecWait($cmd); +} + +my $modelf = "$svmDir/milk_model.$modelchr.svm.model"; + +foreach my $chr (@chrs) { + my $szchr = $hszchrs{$chr}->[3]; + my $out = "$svmDir/milk_svm.$chr.gtonly"; + + ## make a new training model for X chromosomes + if ( $chr eq $xchr ) { + ## develop a new training model, focused only on non-PAR + + my %hpos = (); + + print STDERR "Loading positive labels..\n"; + ## LABEL positive samples + foreach my $posVcf (@posVcfs) { + open(IN,"$tabix $posVcf $chr:$xStart-$xStop| grep -w PASS|") || die "Cannot open file\n"; + while() { + next if ( /^#/ ); + my ($chrom,$pos,$id,$ref,$alt) = split; + next if ( $pos < $xStart ); + next if ( $pos > $xStop ); + $hpos{"$chrom:$pos"} = "$ref:$alt"; + } + } + my ($cbeg,$cend) = @{$hcent{$chr}}; + + my %hneg = (); + my $milkVcf = "$milkDir/milk.$chr.sites.vcf.gz"; + print STDERR "Identifying negative labels from $milkVcf\n"; # using intercept $bfIntercept, log10-scale slope $bfSlope..\n"; + + open(IN,"$tabix $milkVcf $chr:$xStart-$xStop | cut -f 1-8| grep -v ^#|") || die "Cannot open file\n"; + while() { + my @F = split; + next if ( $F[4] =~ /,/ ); + #next if ( ( ( length($F[3]) > 1 ) || ( length($F[4]) > 1 ) ) && ( $F[6] ne "." ) ); + next if ( ( length($F[3]) > 1 ) || ( length($F[4]) > 1 ) ); + + next if ( ( $F[1] > $cbeg ) && ( $F[1] < $cend ) ); + + my $ac = $1 if ( $F[7] =~ /AC=(\d+);/ ); + + my @tcnts = split(/,/,$1) if ( $F[7] =~ /TRIO_CONC_THRES=([^;]+)/ ); + my @dcnts = split(/,/,$1) if ( $F[7] =~ /DUP_CONC_THRES=([^;]+)/ ); + my ($ndisc,$nconc,$ddisc,$dconc) = (0,0,0,0); + for(my $i=1; $i < 27; ++$i) { + if ( $tcnts[$i] > 0 ) { + next if ( ( $i == 26 ) || ( $i == 12 ) || ( $i == 13 ) || ( $i == 14 ) ); + if ( $discordsX[$i] == 0 ) { $nconc += $tcnts[$i] } + else { $ndisc += $tcnts[$i]; } + } + } + + for(my $i=1; $i < 9; ++$i) { + if ( $dcnts[$i] > 0 ) { + next if ( $i == 8 ); + if ( $dupdisc[$i] == 0 ) { $dconc += $dcnts[$i] } + else { $ddisc += $dcnts[$i]; } + } + } + + next if ( $ac < 2 ); ## do not include singletons + if ( ( ( $ndisc > 2 ) && ( $ndisc > $nconc * 0.05 ) ) || ( ( $ddisc > 2 ) && ( $ddisc > $dconc * 0.05 ) ) ) { + $hneg{"$F[0]:$F[1]:$F[3]:$F[4]"} = 1; + } + } + close IN; + + ## write features + my $out = "$svmDir/milk_model.$chr"; + + print STDERR "Writing the feature information for libsvm..\n"; + open(RAWPAR,">$out.rawPAR") || die "Cannot open $out.raw for writing\n"; + open(RAWX,">$out.rawX") || die "Cannot open $out.raw for writing\n"; + #open(SITEPAR,">$out.sitePAR") || die "Cannot open $out.sitePAR for writing\n"; + #open(SITEX,">$out.siteX") || die "Cannot open $out.siteX for writing\n"; + open(SITE,">$out.site") || die "Cannot open $out.sitePAR for writing\n"; + #open(IN,"zcat $pasteDir/$chr\_1\_$szchr\_paste.sites.vcf.gz|") || die "Cannot open file\n"; + #open(IN,"$tabix $milkDir/milk.$chr.sites.vcf.gz $chr:$xStart-$xStop |") || die "Cannot open file\n"; + open(IN,"zcat $milkDir/milk.$chr.sites.vcf.gz |") || die "Cannot open file\n"; + my @hdrs = (); + while() { + if ( /^#/ ) { + next if ( /^##PEDIGREE/ ); + next if ( /^##INFO= $xStop ) ) { + print RAWPAR join("\t",@values)."\n"; + } + else { + print RAWX join("\t",@values)."\n"; + } + } + close IN; + close RAWX; + close RAWPAR; + close SITE; + + print STDERR "Performing quantile normalization of features..\n"; + my $cmd = "$invNorm --in $out.rawX --out $out.normX"; + &forkExecWait($cmd); + $cmd = "$invNorm --in $out.rawPAR --out $out.normPAR"; + &forkExecWait($cmd); + + open(SITE,"$out.site") || die "Cannot open $out.sites\n"; + open(NORMX,"$out.normX") || die "Cannot open $out.normX\n"; + #open(FTR,">$out.feature") || die "Cannot open $out.feature\n"; + open(LBLX,">$out.labelX") || die "Cannot open $out.labelX\n"; + + my ($npos,$nneg,$noth) = (0,0,0); + while() { + my ($chrom,$pos,$id,$ref,$alt) = split; + next if ( $pos < $xStart ); + next if ( $pos > $xStop ); + my @z = split(/[ \t\r\n]+/,); + my $ln = ""; + for(my $i=0; $i < @names; ++$i) { + $ln .= " ".($i+1).":$z[$i]"; + } + #if ( defined($hpos{"$chrom:$pos:$ref:$alt"}) ) { + if ( defined($hpos{"$chrom:$pos"}) ) { + if ( ( $hpos{"$chrom:$pos"} ne "$ref:$alt" ) || defined($hneg{"$chrom:$pos:$ref:$alt"}) ) { + #print FTR "0 $ln\n"; + ++$noth; + } + else { + #print FTR "1 $ln\n"; + print LBLX "1 $ln\n"; + ++$npos; + } + } + elsif ( defined($hneg{"$chrom:$pos:$ref:$alt"}) ) { + #print FTR "-1 $ln\n"; + print LBLX "-1 $ln\n"; + ++$nneg; + } + else { + #print FTR "0 $ln\n"; + ++$noth; + } + } + #close FTR; + close LBLX; + close SITE; + close NORMX; + + print STDERR "Training SVM classification model using $npos positive samples, $nneg negative samples with $noth additional samples\n"; + + $cmd = "$svmlearn -s 0 -t 2 $out.labelX $out.svm.modelX"; + &forkExecWait($cmd); + + + ### After training, create predictions for PAR and nonPAR seperately, + + open(SITE,"$out.site") || die "Cannot open $out.sites\n"; + open(NORMX,"$out.normX") || die "Cannot open $out.norm\n"; + open(NORMPAR,"$out.normPAR") || die "Cannot open $out.norm\n"; + open(FTRX,">$out.featureX") || die "Cannot open $out.feature\n"; + open(FTRPAR,">$out.featurePAR") || die "Cannot open $out.feature\n"; + + #my ($npos,$nneg,$noth) = (0,0,0); + while() { + my ($chrom,$pos,$id,$ref,$alt) = split; + if ( ( $pos < $xStart ) || ( $pos > $xStop ) ) { + my @z = split(/[ \t\r\n]+/,); + my $ln = ""; + for(my $i=0; $i < @names; ++$i) { + $ln .= " ".($i+1).":$z[$i]"; + } + print FTRPAR "0 $ln\n"; + ++$noth; + } + else { + my @z = split(/[ \t\r\n]+/,); + my $ln = ""; + for(my $i=0; $i < @names; ++$i) { + $ln .= " ".($i+1).":$z[$i]"; + } + print FTRX "0 $ln\n"; + ++$noth; + } + } + close FTRX; + close FTRPAR; + close NORMX; + close NORMPAR; + close SITE; + + print STDERR "Applying trained SVM model on $noth variants\n"; + + $cmd = "$svmclassify $out.featurePAR $modelf $out.svm.predPAR"; + &forkExecWait($cmd); + $cmd = "$svmclassify $out.featureX $out.svm.modelX $out.svm.predX"; + &forkExecWait($cmd); + + print STDERR "Writing filtered site VCF files with SVM scores..\n"; + open(SITE,"$out.site") || die "Cannot open $out.sites\n"; + open(PREDX,"$out.svm.predX") || die "Cannot open $out.svm.pred file\n"; + open(PREDPAR,"$out.svm.predPAR") || die "Cannot open $out.svm.pred file\n"; + open(OUT,"| $bgzip -c > $out.sites.vcf.gz") || die "Cannot open $out.sites.vcf.gz\n"; + #open(OUTU,"| $bgzip -c > $out.uniq.sites.vcf.gz") || die "Cannot open $out.sites.vcf.gz\n"; + + splice(@hdrs,$#hdrs,0,"##INFO=\n"); + splice(@hdrs,$#hdrs,0,"##FILTER=\n"); + splice(@hdrs,$#hdrs,0,"##FILTER=\n"); + splice(@hdrs,$#hdrs,0,"##INFO=\n"); + splice(@hdrs,$#hdrs,0,"##FILTER=) { + my @F = split; + my $isX = ( ( $F[1] < $xStart ) || ( $F[1] > $xStop ) ) ? 0 : 1; + my $pred; + if ( $isX == 0 ) { + $pred = ; + } + else { + $pred = ; + } + chomp($pred); + + my $info = $F[7]; + $info =~ s/;MILK_LRE.*$//; + $info =~ s/^MILK_CHRX=[^;]+;//; + + my $an = $1 if ( $F[7] =~ /;AN=(\d+)/ ); + $maxan = $an if ( $maxan < $an ); + my @tcnts = split(/,/,$1) if ( $F[7] =~ /TRIO_CONC_THRES=([^;]+)/ ); + my @dcnts = split(/,/,$1) if ( $F[7] =~ /DUP_CONC_THRES=([^;]+)/ ); + my ($ndisc,$nconc,$ddisc,$dconc) = (0,0,0,0); + + my @discords = ($isX == 1) ? @discordsX : @discordsA; + + my $chrx = $1 if ( $F[7] =~ /MILK_CHRX=([^;]+);/ ); + + for(my $i=1; $i < 27; ++$i) { + if ( $tcnts[$i] > 0 ) { + next if ( ( $i == 26 ) || ( $i == 12 ) || ( $i == 13 ) || ( $i == 14 ) ); + if ( $discords[$i] == 0 ) { $nconc += $tcnts[$i] } + else { $ndisc += $tcnts[$i]; } + } + } + for(my $i=1; $i < 9; ++$i) { + if ( $dcnts[$i] > 0 ) { + next if ( $i == 8 ); + if ( $dupdisc[$i] == 0 ) { $dconc += $dcnts[$i] } + else { $ddisc += $dcnts[$i]; } + } + } + + my $maf = $1 if ( $F[7] =~ /AF=([^;]+);/ ); + $maf = 1-$maf if ( $maf > 0.5 ); + + my $hweslp = $1 if ( $F[7] =~ /HWE_SLP_I=([^;]+);/ ); + + my ($cbeg,$cend) = @{$hcent{$chr}}; + + my @filts = (); + if ( ( $pred < $cutoff ) || ( $F[7] =~ /AC=0;/ ) ) { + push(@filts,"SVM"); + } + if ( ( $F[1] > $cbeg ) && ( $F[1] < $cend ) ) { + push(@filts,"CEN"); + } + + if ( ( ( $ndisc > 2 ) && ( $ndisc > $nconc * 0.05 ) ) || ( ( $ddisc > 2 ) && ( $ddisc > $dconc * 0.05 ) ) ) { + push(@filts,"DISC"); + } + if ( $hweslp < -13.81551 ) { + push(@filts,"EXHET"); + } + if ( ( defined($chrx) && ( $chrx < -3 ) ) ) { + push(@filts,"CHRXHET"); + } + + $F[6] = ($#filts < 0) ? "PASS" : join(';',@filts); + $info .= ";SVM=$pred"; + print OUT join("\t",@F[0..6],$info)."\n"; + } + close OUT; + close PREDPAR; + close PREDX; + close SITE; + + my @acbrs = (1,2,3); + push(@acbrs, int($maxan*1e-6)) if ( $maxan >= 4e6 ); + push(@acbrs, int($maxan*1e-5)) if ( $maxan >= 4e5 ); + push(@acbrs, int($maxan*1e-4)) if ( $maxan >= 4e4 ); + push(@acbrs, int($maxan*1e-3)) if ( $maxan >= 4e3 ); + push(@acbrs, int($maxan*1e-2)) if ( $maxan >= 4e2 ); + push(@acbrs, int($maxan*1e-1)) if ( $maxan >= 4e1 ); + my $acbreaks = join(",",@acbrs); + + print STDERR "Producing VCF summary for SNPs..\n"; + print STDERR "Producing VCF summary for SNPs..\n"; + open(IN,"zcat $out.sites.vcf.gz|") || die "Cannot open file\n"; + open(OUT2, "| $vcfsummary --ref $ref --db $dbsnp --FNRvcf $hapmapvcf --bgzip $bgzip --tabix $tabix --chr $chr > $out.sites.summary") || die "Cannot open file\n"; + open(OUT3, "| $vcfsummary2 --ref $ref --db $dbsnp --FNRvcf $hapmapvcf --bgzip $bgzip --tabix $tabix --chr $chr > $out.sites.summary_v2") || die "Cannot open file\n"; + while() { + next if ( /^#/ ); + my @F = split; + print OUT3 $_; + print OUT2 $_; + } + close IN; + close OUT2; + close OUT3; + } + else { + print STDERR "Writing the feature information for libsvm..\n"; + open(RAW,">$out.raw") || die "Cannot open $out.raw for writing\n"; + open(SITE,">$out.site") || die "Cannot open $out.raw for writing\n"; + open(IN,"zcat $milkDir/milk.$chr.sites.vcf.gz |") || die "Cannot open file\n"; + + my @hdrs = (); + while() { + if ( /^#/ ) { + next if ( /^##PEDIGREE/ ); + next if ( /^##INFO=$out.feature") || die "Cannot open $out.feature\n"; + + my ($npos,$nneg,$noth) = (0,0,0); + while() { + my ($chrom,$pos,$id,$ref,$alt) = split; + my @z = split(/[ \t\r\n]+/,); + my $ln = ""; + for(my $i=0; $i < @names; ++$i) { + $ln .= " ".($i+1).":$z[$i]"; + } + print FTR "0 $ln\n"; + ++$noth; + } + close FTR; + close SITE; + + print STDERR "Applying trained SVM model on $noth variants\n"; + + $cmd = "$svmclassify $out.feature $modelf $out.svm.pred"; + &forkExecWait($cmd); + + print STDERR "Writing filtered site VCF files with SVM scores..\n"; + open(SITE,"$out.site") || die "Cannot open $out.sites\n"; + open(PRED,"$out.svm.pred") || die "Cannot open $out.svm.pred file\n"; + open(OUT,"| $bgzip -c > $out.sites.vcf.gz") || die "Cannot open $out.sites.vcf.gz\n"; + #open(OUTU,"| $bgzip -c > $out.uniq.sites.vcf.gz") || die "Cannot open $out.sites.vcf.gz\n"; + + splice(@hdrs,$#hdrs,0,"##INFO=\n"); + splice(@hdrs,$#hdrs,0,"##FILTER=\n"); + splice(@hdrs,$#hdrs,0,"##FILTER=\n"); + splice(@hdrs,$#hdrs,0,"##INFO=\n"); + splice(@hdrs,$#hdrs,0,"##FILTER=) { + my @F = split; + my $pred = ; + chomp($pred); + + #my $milk = ; + #chomp($milk); + + #my @M = split(/[\t\r\n ]+/,$milk); + #while( defined($M[4]) && ( $M[4] =~ /,/ ) ) { + # $milk = ; + # chomp($milk); + # @M = split(/[\t\r\n ]+/,$milk); + #} + + my $info = $F[7]; + $info =~ s/;MILK_LRE.*$//; + + my $an = $1 if ( $F[7] =~ /;AN=(\d+)/ ); + $maxan = $an if ( $maxan < $an ); + my @tcnts = split(/,/,$1) if ( $F[7] =~ /TRIO_CONC_THRES=([^;]+)/ ); + my @dcnts = split(/,/,$1) if ( $F[7] =~ /DUP_CONC_THRES=([^;]+)/ ); + my ($ndisc,$nconc,$ddisc,$dconc) = (0,0,0,0); + for(my $i=1; $i < 27; ++$i) { + if ( $tcnts[$i] > 0 ) { + next if ( ( $i == 26 ) || ( $i == 12 ) || ( $i == 13 ) || ( $i == 14 ) ); + if ( $discordsA[$i] == 0 ) { $nconc += $tcnts[$i] } + else { $ndisc += $tcnts[$i]; } + } + } + for(my $i=1; $i < 9; ++$i) { + if ( $dcnts[$i] > 0 ) { + next if ( $i == 8 ); + if ( $dupdisc[$i] == 0 ) { $dconc += $dcnts[$i] } + else { $ddisc += $dcnts[$i]; } + } + } + + my $maf = $1 if ( $F[7] =~ /AF=([^;]+);/ ); + $maf = 1-$maf if ( $maf > 0.5 ); + + my $hweslp = $1 if ( $F[7] =~ /HWE_SLP_I=([^;]+);/ ); + + my ($cbeg,$cend) = @{$hcent{$chr}}; + + my @filts = (); + if ( ( $pred < $cutoff ) || ( $F[7] =~ /AC=0;/ ) ) { + push(@filts,"SVM"); + } + if ( ( $F[1] > $cbeg ) && ( $F[1] < $cend ) ) { + push(@filts,"CEN"); + } + + if ( ( ( $ndisc > 2 ) && ( $ndisc > $nconc * 0.05 ) ) || ( ( $ddisc > 2 ) && ( $ddisc > $dconc * 0.05 ) ) ) { + push(@filts,"DISC"); + } + if ( $hweslp < -13.81551 ) { + push(@filts,"EXHET"); + } + + $F[6] = ($#filts < 0) ? "PASS" : join(';',@filts); + $info .= ";SVM=$pred"; + print OUT join("\t",@F[0..6],$info)."\n"; + } + close OUT; + close PRED; + close SITE; + + my @acbrs = (1,2,3); + push(@acbrs, int($maxan*1e-6)) if ( $maxan >= 4e6 ); + push(@acbrs, int($maxan*1e-5)) if ( $maxan >= 4e5 ); + push(@acbrs, int($maxan*1e-4)) if ( $maxan >= 4e4 ); + push(@acbrs, int($maxan*1e-3)) if ( $maxan >= 4e3 ); + push(@acbrs, int($maxan*1e-2)) if ( $maxan >= 4e2 ); + push(@acbrs, int($maxan*1e-1)) if ( $maxan >= 4e1 ); + my $acbreaks = join(",",@acbrs); + + print STDERR "Producing VCF summary for SNPs..\n"; + print STDERR "Producing VCF summary for SNPs..\n"; + open(IN,"zcat $out.sites.vcf.gz|") || die "Cannot open file\n"; + open(OUT2, "| $vcfsummary --ref $ref --db $dbsnp --FNRvcf $hapmapvcf --bgzip $bgzip --tabix $tabix --chr $chr > $out.sites.summary") || die "Cannot open file\n"; + open(OUT3, "| $vcfsummary2 --ref $ref --db $dbsnp --FNRvcf $hapmapvcf --bgzip $bgzip --tabix $tabix --chr $chr > $out.sites.summary_v2") || die "Cannot open file\n"; + while() { + next if ( /^#/ ); + my @F = split; + print OUT3 $_; + print OUT2 $_; + } + close IN; + close OUT2; + close OUT3; + } +} diff --git a/scripts/vcf-pass-variants b/scripts/vcf-pass-variants new file mode 100644 index 0000000..3375902 --- /dev/null +++ b/scripts/vcf-pass-variants @@ -0,0 +1,73 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use lib $FindBin::Bin; +#use lib "/net/fantasia/home/hmkang/bin/utils/"; +use hyunlib qw(initRef getCpGs); +use wGetOptions qw(wGetOptions wpod2usage); + +my $invcf = ""; +my $outvcf = ""; +my $sitevcf = ""; +my $binbgzip = "$FindBin::Bin/bgzip"; +my $bintabix = "$FindBin::Bin/tabix"; +my $binbcftools = "bcftools"; + +wGetOptions( + "-Add rsID into VCF", + "--Required Options", + "vcf=s",[\$invcf,"Input VCF file"], + "out=s",[\$outvcf,"Output VCF file"], + "site=s",[\$sitevcf,"Site VCF file"], + "--Additional Options", + "bcftools=s",[\$binbcftools,"Path to bcftools"], + ) || wpod2usage(2); + + +wpod2usage(2) unless ( ( $invcf ) && ( $sitevcf ) ); + +if ( $outvcf =~ /\.gz$/ ) { open(OUT,"| $binbgzip -c > $outvcf") || die "Cannot open file\n"; } +elsif ( $outvcf =~ /\.bcf$/ ) { open(OUT,"| $binbcftools view --no-version -Ob -o $outvcf /dev/stdin") || die "Cannot open file\n"; } +elsif ( $outvcf ) { open(OUT,">$outvcf") || die "Cannot open file\n"; } +else { *OUT = *STDOUT; } + +if ( $sitevcf =~ /\.gz$/ ) { open(SITE,"zcat $sitevcf |") || die "Cannot open file\n"; } +elsif ( $sitevcf =~ /\.bcf$/ ) { open(SITE,"$binbcftools view --no-version $sitevcf |") || die "Cannot open file\n"; } +elsif ( $sitevcf ) { open(SITE,$sitevcf) || die "Cannot open file\n"; } + +my %h = (); +my $ndic = 0; +while() { + next if ( /^#/ ); + my ($chrom,$pos,$id,$ref,$alt) = split; + $h{"$chrom:$pos:$ref:$alt"} = 1; + ++$ndic; +} +close SITE; + +if ( $invcf =~ /\.gz$/ ) { open(IN,"zcat $invcf |") || die "Cannot open file\n"; } +elsif ( $invcf =~ /\.bcf$/ ) { open(IN,"$binbcftools view --no-version $invcf |") || die "Cannot open file\n"; } +elsif ( $invcf ) { open(IN,$invcf) || die "Cannot open file\n"; } + +my $nup = 0; +while() { + if ( /^#/ ) { + print OUT $_; + } + else { + my ($chrom,$pos,$id,$ref,$alt,$qual,$filt,@F) = split; + if ( defined($h{"$chrom:$pos:$ref:$alt"}) ) { + print OUT join("\t",$chrom,$pos,$id,$ref,$alt,$qual,"PASS",@F)."\n"; + ++$nup; + } + else { + print OUT $_; + } + } +} + +close IN; +close OUT; + +print STDERR "Finished updating $nup variants out of $ndic\n"; diff --git a/scripts/vcf-plot-fine-mapping b/scripts/vcf-plot-fine-mapping new file mode 100644 index 0000000..137b51c --- /dev/null +++ b/scripts/vcf-plot-fine-mapping @@ -0,0 +1,494 @@ +#!/usr/bin/perl -w + +################################################################## + +use strict; +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(forkExecWait); +use wGetOptions qw(wpod2usage wGetOptions); +use warnings; + +my $refFlat = "/net/fantasia/home/hmkang/data/UCSC/hg19/refFlat.txt.gz"; +#my $vcf = "/net/1000g/hmkang/1KG/20101123/integration/release/ALL.chr1.merged_beagle_mach.20101123.snps_indels_svs.vcf.gz"; +#my $vcf = "/net/fantasia/home/hmkang/data/1KG.phase1.interim.bcm/ALL.chr1.phase1.projectConsensus.genotypes.vcf.gz"; +my $vcf = "/net/1000g/1000g/release/20110521/ALL.chr1.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz"; +my $map = "/net/fantasia/home/hmkang/data/genmap/genetic_map_GRCh37_wgs.txt.gz"; +my $pop = "EUR"; +my $indexf = "/net/fantasia/home/hmkang/data/1KG.phase1/umake.1KG.1092.index"; +my $r2thres = 0.5; +my $cMext = 0.02; +my $dbSNP = "/net/fantasia/home/hmkang/data/dbSNP/b135/dbsnp_135.rssorted.txt.gz"; +#my $dbSNP = "/net/fantasia/home/hmkang/data/dbSNP/b129.ncbi37/dbsnp_129_b37.rod.map"; +my $win = 1000000; +my $snpid = ""; +my $tableFlag = ""; +my $plotRegion = ""; +my $shadeRegion = ""; +my $outf = ""; +my $pointsize = 1; + +wGetOptions( + "-Select and visualize fine mapping regions based on index SNP, LD and genetic map\nThis program takes an index SNP ([chrom:pos] format, [chrom:pos:REF:ALT] format, or rsID), a 1000 Genomes VCF, and genetic map as input arguments to create a boundary for fine mapping region with the criteria}", + "--Required parameters", + "snpid=s",[\$snpid,"(required) index SNP given by rsID, [chrom:pos], or [chrom:pos:REF:ALT] format"], + "vcf=s",[\$vcf,"Input VCF file containing the genotypes for LD computation"], + "map=s",[\$map,"Genetic map file containing centimorgan and recombination rate"], + "r2thres=f",[\$r2thres, "Minimum r2 threshold for selecting boundaries"], + "--Required parameters", + "indexf=s",[\$indexf,"Index file containing the list of IDs (and population label) to include. If absent, it uses all individuals in the VCF"], + "pop=s",[\$pop,"Population or superpopulation label to subset the individuals. If absent, it uses all individuals in the index file"], + "cMext=f",\$cMext, + "dbSNP=s",\$dbSNP, + "win=i",\$win, + "table",\$tableFlag, + "plotregion=s",\$plotRegion, + "shaderegion=s",\$shadeRegion, + "out=s",\$outf, + ); + +my $usage = <) { + my ($id,@pops) = split(/[\t\r\n\s,]+/); + if ( (!defined($pop)) || ( $pop eq "" ) ) { + $hids{$id} = 1; + } + else { + foreach my $p (@pops) { + next if ( $p =~ /^\// ); + #$hids{$id} = $p; + $hids{$id} = 1 if ( $p eq $pop ); + } + } +} +close IN; + +## if SNP is in dbSNP, try to find it +my ($chr,$indexbp); +if ( $snpid =~ /^rs(\d+)$/ ) { + #my @F = split(/\s+/,`grep -w $snpid $dbSNP`); + my @F = split(/\s+/,`tabix $dbSNP b135:$1-$1`); + if ( $#F < 0 ) { + die "Cannot find $snpid in $dbSNP\n"; + } + else { + $chr = $F[2]; + $indexbp = $F[3]; + } +} +elsif ( $snpid =~ /^(\d+|X|Y|MT):(\d+)/ ) { + $chr = $1; + $indexbp = $2; +} +else { + die "Cannot recognize snpid $snpid\n"; +} + +print STDERR "SNP ID : $snpid at chromosome $chr, position $indexbp\n"; +print STDERR "Examining +-$win bp window\n"; + +$vcf =~ s/chr1\./chr$chr\./; +print STDERR "Setting VCF file name as $vcf..\n"; + +## Retrieve genetic map information +my $start = ($indexbp > $win) ? ($indexbp-$win) : 0; +my $end = $indexbp+$win; + +my $region = "$chr:$start-$end"; + +my @mapPos = (); +my @mapCMs = (); +open(IN,"tabix $map $region|") || die "Cannot open file\n"; +while() { + my ($chrom,$bp,$rate,$cM) = split; + push(@mapPos,$bp); + push(@mapCMs,$cM); +} +close IN; + +my $indexcm; +for(my $i=0; $i < @mapPos; ++$i) { + if ( $mapPos[$i] eq $indexbp ) { + $indexcm = $mapCMs[$i] + } + elsif ( $mapPos[$i] < $indexbp ) { + $indexcm = $mapCMs[$i]; + } + elsif ( $mapPos[$i] > $indexbp ) { + if ( $mapPos[$i-1] < $indexbp ) { + $indexcm += ($indexbp-$mapPos[$i-1])/($mapPos[$i]-$mapPos[$i-1])*($mapCMs[$i]-$mapCMs[$i-1]); + } + } +} + +print STDERR "Index SNP's cM position is $indexcm\n"; + +## Extract the valid individuals first +my @F = split(/[\t\r\n]+/,`zcat $vcf | head -100 | grep ^#CHROM`); +my @vids = (); +for(my $i=9; $i < @F; ++$i) { + if ( defined($hids{$F[$i]}) ) { + push(@vids,$i); + } +} + +## Extract the index SNP's genotypes +@F = split(/[\t\r\n]+/,`tabix $vcf $chr:$indexbp-$indexbp | grep -v VT=SV`); +die "Cannot find $chr:$indexbp in $vcf\n" if ( $#F < 0 ); + +####################### +## a b p +## c d q +## r s n +###################### +my @anchorHaps = (); +foreach my $v (@vids) { + my ($g1,$sep,$g2) = split(//,$F[$v]); + push(@anchorHaps,($g1 == 0) ? 0 : 1); + push(@anchorHaps,($g2 == 0) ? 0 : 1); +} + +my $n = 2*($#vids+1); +my $p = 0; +foreach my $h (@anchorHaps) { + $p += $h; +} +my $q = $n-$p; + +if ( ( $p == 0 ) || ( $q == 0 ) ) { + print STDERR "ERROR: The index SNP is monomorphic within population $pop\n"; + die; +} + +print STDERR "Computing r2 with index SNP with allele frequency ($p,$q)\n"; + +my @r2s = (); +my @bps = (); +my @mafs = (); +my $minPos = $indexbp+$win; +my $maxPos = $indexbp-$win; +open(IN,"tabix $vcf $region|") || die "Cannot open file\n"; +for(my $i=0; ; ++$i) { + print STDERR "Reading $i SNPs..\n" if ( $i % 1000 == 0 ); + @F = split(/[\t\r\n]+/); + my @haps = (); + foreach my $v (@vids) { + my ($g1,$sep,$g2) = split(//,$F[$v]); + push(@haps,($g1 == 0) ? 0 : 1); + push(@haps,($g2 == 0) ? 0 : 1); + } + my $r = 0; + my $a = 0; + for(my $i=0; $i < @haps; ++$i) { + if ( $haps[$i] == 1 ) { + ++$r; + ++$a if ( $anchorHaps[$i] == 1 ); + } + } + my $s = $n-$r; + my ($b,$c) = ($p-$a,$r-$a); + my $d = $n-$a-$b-$c; + my $r2 = sprintf("%.4lf",($a*$d-$b*$c)*($a*$d-$b*$c)/($p*$q*$r*$s+1e-6)); + + my $pos = $F[1]; + if ($r2 > $r2thres ) { + $minPos = $pos if ( $minPos > $pos ); + $maxPos = $pos if ( $maxPos < $pos ); + } + my $maf = (($r > $s) ? $s : $r)/$n; + push(@r2s,$r2); + push(@bps,$pos); + push(@mafs,$maf); +} +close IN; + +print STDERR "Unextended interval is $chr:$minPos-$maxPos (".($maxPos-$minPos)." bps)\n"; +print STDERR "Extending the intervals by $cMext cM\n"; + +my ($mincm,$maxcm); +for(my $i=0; $i < @mapPos; ++$i) { + if ( $mapPos[$i] eq $minPos ) { + $mincm = $mapCMs[$i]; + } + elsif ( $mapPos[$i] < $minPos ) { + $mincm = $mapCMs[$i]; + } + elsif ( $mapPos[$i] > $minPos ) { + if ( $mapPos[$i-1] < $minPos ) { + $mincm += ($minPos-$mapPos[$i-1])/($mapPos[$i]-$mapPos[$i-1])*($mapCMs[$i]-$mapCMs[$i-1]); + } + } + + if ( $mapPos[$i] eq $maxPos ) { + $maxcm = $mapCMs[$i]; + } + elsif ( $mapPos[$i] < $maxPos ) { + $maxcm = $mapCMs[$i]; + } + elsif ( $mapPos[$i] > $maxPos ) { + if ( $mapPos[$i-1] < $maxPos ) { + $maxcm += ($maxPos-$mapPos[$i-1])/($mapPos[$i]-$mapPos[$i-1])*($mapCMs[$i]-$mapCMs[$i-1]); + } + } +} +my ($minExPos,$maxExPos) = ($minPos,$maxPos); +for(my $i=0; $i < @mapPos; ++$i) { + if ( $mapCMs[$i] > $mincm - $cMext ) { + $minExPos = $mapPos[$i] if ( $minExPos > $mapPos[$i] ); + } + if ( $mapCMs[$i] < $maxcm + $cMext ) { + $maxExPos = $mapPos[$i] if ( $maxExPos < $mapPos[$i] ); + } +} + +my ($norg,$next) = (0,0); +for(my $i=0; $i < @bps; ++$i) { + ++$norg if ( ( $bps[$i] >= $minPos ) && ( $bps[$i] <= $maxPos ) ); + ++$next if ( ( $bps[$i] >= $minExPos ) && ( $bps[$i] <= $maxExPos ) ); +} + +if ( $tableFlag ) { + print "#INDEX_SNP\tCHROM\tPOS\t$pop\_AF\tR2_FROM\tR2_TO\tR2_SIZE\tR2_NSNP\tEX_FROM\tEX_TO\tEX_SIZE\tEX_NSNP\n"; + print "$snpid\t$chr\t$indexbp\t".sprintf("%.4lf",$p/($p+$q))."\t$minPos\t$maxPos\t".($maxPos-$minPos)."\t$norg\t$minExPos\t$maxExPos\t".($maxExPos-$minExPos)."\t$next\n"; +} +else { +print "-------------------------------------------------------\n"; +print "INDEX_SNP \t$snpid\n"; +print "CHROM \t$chr\n"; +print "INDEX_POS \t$indexbp\n"; +print "1KG_".($pop)."_AF \t".sprintf("%.4lf",$p/($p+$q))."\n"; +print "RSQ>$r2thres\_FROM\t$minPos\n"; +print "RSQ>$r2thres\_TO \t$maxPos\n"; +print "RSQ>$r2thres\_SIZE\t".($maxPos-$minPos)."\n"; +print "RSQ>$r2thres\_#SNP\t$norg\n"; +print "+".($cMext)."cM_FROM\t$minExPos\n"; +print "+".($cMext)."cM_TO \t$maxExPos\n"; +print "+".($cMext)."cM_SIZE\t".($maxExPos-$minExPos)."\n"; +print "+".($cMext)."cM_#SNP\t$next\n"; +print "-------------------------------------------------------\n"; +} +#print "SNP\tCHROM\tPOS\torgMIN\torgMAX\textMIN\textMAX\tSIZE\n"; +#print "$snpid\t$chr\t$indexbp\t$minPos\t$maxPos\t$minExPos\t$maxExPos\t".($maxExPos-$minExPos)."\n"; + +my ($plotStart,$plotEnd) = ($start,$end); +if ( $plotRegion ) { + my ($c,$s,$e) = split(/[:\-]/,$plotRegion); + $plotStart = $s; + $plotEnd = $e; +} + +my $bufferedStartMb = $plotStart/1e6; +my $bufferedEndMb = $plotEnd/1e6; + +my ($shadeStart,$shadeEnd) = ($minExPos,$maxExPos); +if ( $shadeRegion ) { + my ($c,$s,$e) = split(/[:\-]/,$shadeRegion); + $shadeStart = $s; + $shadeEnd = $e; +} + +## Retrieve gene information within the region +open(IN,"zcat $refFlat|") || die "Cannot open file\n"; +my @genes = (); +my %hgenes = (); +while() { + my ($name1,$name2,$chr2,$strand,$txStart,$txEnd,$cdsStart,$cdsEnd,$exonCount,$exonStart,$exonEnd) = split; + $chr2 =~ s/^chr//; + if ( ( $chr eq $chr2 ) && ( $txEnd > $plotStart ) && ( $txStart < $plotEnd ) ) { + $exonStart =~ s/,$//; + $exonEnd =~ s/,$//; + my @exonStarts = split(/,/,$exonStart); + my @exonEnds = split(/,/,$exonEnd); + push(@genes,[$name1,$txStart/1e6,$txEnd/1e6,\@exonStarts,\@exonEnds]) unless defined($hgenes{$name1}); + $hgenes{$name1} = 1; + } +} +close IN; +@genes = sort {$a->[1] <=> $b->[1]} @genes; + +my $width = 5; +open(CMD,">$outf.cmd") || die "Cannot open file\n"; +print CMD "set terminal postscript eps enhanced dashed dashlength 1.0 linewidth 1.0 size $width,3 font 'Calibri,15' fontfile 'calibri.pfb' fontfile 'GillSansMT.pfb' fontfile 'GillSansItalic.pfb'\n"; +print CMD "set out '$outf.eps'\n"; +print CMD "set tmargin 0.3\n"; +print CMD "set bmargin 0\n"; +print CMD "set lmargin 7\n"; +print CMD "set rmargin 7\n"; +print CMD "set multiplot layout 2,1 title '$snpid in chr$chr:$shadeStart-$shadeEnd' font 'GillSansMT,18'\n"; +print CMD "set x2range [$bufferedStartMb:$bufferedEndMb]\n"; +print CMD "set yrange [0:1]\n"; +print CMD "set format x2 \"\"\n"; +print CMD "set x2tics nomirror out\n"; +print CMD "set xrange [$bufferedStartMb:$bufferedEndMb]\n"; +print CMD "unset xtics\n"; +print CMD "set ytics nomirror out\n"; +print CMD "set ylabel 'r^2 with index SNP' offset 2\n"; +print CMD "set grid x2 y\n"; +print CMD "set y2range [0:100]\n"; +print CMD "set y2tics nomirror out\n"; +print CMD "set y2label 'Recombination rate (cM/Mb)' offset -2\n"; +print CMD "set obj 99 rect behind from 62.098986,0 to 62.5206,100 fc rgb \"#DDDDFF\" fs solid noborder\n"; +print CMD "set obj 100 rect behind from ".($shadeStart/1e6).",0 to ".($shadeEnd/1e6).",100 fc rgb \"#FFFFCC\" fs solid noborder\n"; +print CMD "plot "; +my @xs = (); +my @ys = (); +my @colors = (0xFF3300,0x00AA00,0x0000AA); +my @legends = ("MAF [0.05,0.50]","MAF [0.02,0.05)","MAF (0.00,0.02)"); +for(my $i=0; $i < @bps; ++$i) { + push(@xs,$bps[$i]/1e6); + push(@ys,$r2s[$i]); + my $pt = 7; #defined($hWCO{$bps[$i]}) ? 5 : ($genotypeds[$i] > 0 ? 7 : 9); + my $col = sprintf("'#%0X'",$colors[( $mafs[$i] >= 0.05 ) ? 0 : ( $mafs[$i] < 0.02 ? 2 : 1 )]); + #my $col = sprintf("'#%0X'",$colors[0]); + print CMD "," if ( $i > 0); + print CMD " '-' u 1:2 with points ps $pointsize pt $pt lc rgbcolor $col notitle axis x2y1"; + print CMD ", '-' u 1:2 with points ps $pointsize pt ".($pt-1)." lc rgbcolor '#000000' notitle axis x2y1"; +} +print CMD ", '-' u 1:2 with lines lt 1 lw 3 lc rgbcolor \"#6600FF\" notitle axis x2y2"; +my $indexcol = "#9999FF"; +my $indexpt = 7; +print CMD ", '-' u 1:2 with points ps ".($pointsize*1.5)." pt $indexpt lc rgbcolor '$indexcol' notitle axis x2y1"; +print CMD ", '-' u 1:2 with points ps ".($pointsize*1.5)." pt ".($indexpt-1)." lc rgbcolor '#000000' notitle axis x2y1"; +#print CMD ",'-' u 1:2:3 with points pt 7 lc rgbcolor variable notitle axis x2y1"; +print CMD "\n"; +for(my $i=0; $i < @xs; ++$i) { + print CMD "$xs[$i]\t$ys[$i]\ne\n"; + print CMD "$xs[$i]\t$ys[$i]\ne\n"; +} +open(IN,"tabix $map $region |") || die "Cannot open file\n"; +while() { + my ($chr,$bp,$rate) = split; + printf CMD ("%.6lf\t$rate\n",$bp/1e6); +} +close IN; +print CMD "e\n"; +print CMD ($indexbp/1e6)."\t1\n"; +print CMD "e\n"; +print CMD ($indexbp/1e6)."\t1\n"; +print CMD "e\n"; + +my $nobj = 1; +my $ystep = 0.1; +my $y; +my $ymstep = 0.01; +my $yoffset = -0.05; +my $geneFontSize = ($#genes > 5) ? ( $#genes > 11 ? 12 : 14 ) : 16; +my @geneEnds = (); +for(my $i=0; $i < @genes; ++$i) { + my ($geneName,$txStart,$txEnd) = ($genes[$i]->[0],$genes[$i]->[1],$genes[$i]->[2]); + my ($xStart,$xEnd,$xLabel,$xAlign); + my $lenLabel = ($bufferedEndMb-$bufferedStartMb) * 0.02 * $geneFontSize / 10 * length($geneName); + if ( $txStart > $bufferedStartMb + $lenLabel ) { + $xLabel = $txStart - ($bufferedEndMb-$bufferedStartMb) * 0.01; + $xAlign = "right"; + $xStart = $txStart - $lenLabel; + $xEnd = $txEnd; + } + else { + $xLabel = $txEnd + ($bufferedEndMb-$bufferedStartMb) * 0.01; + $xAlign = "left"; + $xStart = $txStart; + $xEnd = $txEnd + $lenLabel; + } + my $geneIdx = 0; + while ( $geneIdx <= $#geneEnds ) { + if ( $geneEnds[$geneIdx] > $xStart ) { + ++$geneIdx; + } + else { + $geneEnds[$geneIdx] = $xEnd; + last; + } + } + if ( $geneIdx > $#geneEnds ) { + push(@geneEnds,$xEnd); + } + $y = $yoffset+(0-$geneIdx-0.5)*$ystep; + my $yu = sprintf("%.3lf",$y+$ymstep); + my $yl = sprintf("%.3lf",$y-$ymstep); + my ($name,$start2,$end2) = ($genes[$i]->[0],$genes[$i]->[1],$genes[$i]->[2]); + print CMD "set label $nobj '$name' at $xLabel,$yu $xAlign front nopoint tc rgb '#000000' font 'GillSansMT,$geneFontSize'\n"; + ++$nobj; + print CMD "set obj $nobj rect from $txStart,$yu to $txEnd,$yl fc rgb '#000000'\n"; + ++$nobj; + my $nExons = $#{$genes[$i]->[3]}+1; + for(my $j=0; $j < $nExons; ++$j) { + $yu = sprintf("%.3lf",$y+$ystep/2); + $yl = sprintf("%.3lf",$y-$ystep/2); + my ($exStart,$exEnd) = ($genes[$i]->[3]->[$j]/1e6,$genes[$i]->[4]->[$j]/1e6); + print CMD "set obj $nobj rect from $exStart,$yu to $exEnd,$yl fc rgb '#000000'\n"; + ++$nobj; + } +} +$y = $yoffset+(0-$#geneEnds-0.5)*$ystep; +$y = ($y < -0.5) ? ($y - $ystep) : (-0.5 - $ystep); +print CMD "set tmargin 0\n"; +print CMD "set bmargin 5\n"; +print CMD "set yrange [$y:0]\n"; +print CMD "set ytics 0,1\n"; +print CMD "set ylabel ''\n"; +print CMD "set xlabel 'Base Positions in Chromosome $chr (Mb)' offset 0,0.5\n"; +print CMD "unset x2tics\n"; +print CMD "unset y2tics\n"; +print CMD "unset y2label\n"; +print CMD "set xtics nomirror out\n"; +print CMD "set grid x\n"; +print CMD "set xrange [$bufferedStartMb:$bufferedEndMb]\n"; +print CMD "set key box below width 2 samplen 1\n"; +#print CMD "unset key\n"; +print CMD "plot NaN with points notitle"; +for(my $i=0; $i < 3; ++$i) { + print CMD ", NaN with points pt 7 lc rgbcolor ".sprintf("'#%0X'",$colors[$i])." title '$legends[$i]'"; +} +print CMD "\n"; +close CMD; + +my $bindir = "/net/fantasia/home/hmkang/bin/"; +my $setenv = "export GDFONTPATH=/net/fantasia/home/hmkang/lib/fonts/; export GNUPLOT_FONTPATH=/net/fantasia/home/hmkang/lib/fonts/"; + +my $cmd = "$setenv; $bindir/gnuplot $outf.cmd"; +print STDERR "$cmd\n"; +print STDERR `$cmd`; + +$cmd = "$setenv; $bindir/epstopdf $outf.eps; rm $outf.cmd; rm $outf.eps"; +print STDERR "$cmd\n"; +print STDERR `$cmd`; diff --git a/scripts/vcf-snpeff b/scripts/vcf-snpeff new file mode 100644 index 0000000..38ee6a0 --- /dev/null +++ b/scripts/vcf-snpeff @@ -0,0 +1,49 @@ +#!/usr/bin/perl -w + +use strict; +use Time::HiRes qw(usleep nanosleep); +use File::Path; +use File::Basename; +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(%hszchrs initRef forkExecWait); + +my $vcf = ""; +my $out = ""; +my $dbsnp = ""; +my $snpeffjar = ""; +my $snpeffdb = "GRCh38.86"; +my $addrs = "$FinBin::Bin/vcf-add-rsid"; +my $opts = ""; +my $bcftools = "bcftools"; + +wGetOptions( + "-Identify nuclear families from KING2 output and sex map", + "--Required Options", + "vcf=s" => [\$vcf, "Input VCF/BCF file"], + "out=s" => [\$out, "Output VCF/BCF file that contains annotation and rsID"], + "sex=s" => [\$sexmapf, "Sex map file", "Sex map file containing the sex of each individual as ploidy of X chromosomes"], + "out=s" => [\$outf, "Output file", "Output file prefix"], + "--Additional Options", + "group=s" => [\$groupf, "Group file of each individual", "Group map file containing the batch information of each individual"], + "dup-thres=f" => [\$dupThres, "Mininumn kinship coefficient to be considered as duplicate pair"], + "rel-thres=f" => [\$relThres, "Mininumn kinship coefficient to be considered as 1st degree relative"], + "po-thres=f" => [\$poThres, "Maximum IBS0 coefficient to be considered as parent-offspring pair"], + "rm-overlap" => [\$rmOverlap, "Remove overlapping individuals between families"], + ) || wpod2usage(2); + +unless ( ( $kin0f ) && ( $outf ) && ( $sexmapf ) ) { + print STDERR "ERROR: Missing required option\n"; +} + +if ( ( $vcf =~ /.vcf.gz$/ ) || ( $vcf =~ /.vcf$/ ) ) { + my $cmd = "java $opts -jar $snpEff $snpeffdb $vcf | $addrs --vcf /dev/stdin --out $out"; + &forkExecWaiit($cmd); +} +elsif ( $vcf =~ /.bcf$/ ) { + my $cmd = "java $opts -jar $snpEff $snpeffdb $vcf | $addrs --vcf /dev/stdin --out $out"; + &forkExecWaiit($cmd); +} +else { + die "Cannot recogsize the file format for $vcf. Only .vcf, .vcf.gz and .bcf format are currently accepted\n"; +} diff --git a/scripts/vcf-summary-merge b/scripts/vcf-summary-merge index 69a2ba2..e9c3a61 100644 --- a/scripts/vcf-summary-merge +++ b/scripts/vcf-summary-merge @@ -14,6 +14,7 @@ my @summaries = @ARGV; die "Usage [program] [summary1] [summary2] ...\n" if ( $#ARGV < 0 ); my %hcnts = (); +my %hicnts = (); foreach my $file (@summaries) { print STDERR "Reading $file\n"; @@ -60,14 +61,41 @@ foreach my $file (@summaries) { $r->[10] += ($hm3 * $tot / 100); print STDERR "$filt\t$tot\n"; } - close IN; + + while ( $line && !( $line =~ /INDEL SUMMARY/ ) ) { + $line = ; + } + if ( $line =~ /INDEL SUMMARY/ ) { + $line = ; + $line = ; + $line = ; + die "Summary file $file does not start with --\n" unless ( $line =~ /^\-\-/ ); + + while() { + s/^\s+//; + last if ( /^\-\-/ ); + my ($filt,$tot,$dbsnp,$indb) = split; + $indb = 0 if ( $indb eq "NA" ); + + $hicnts{$filt} = [0,0] unless ( defined($hicnts{$filt}) ); + my $r = $hicnts{$filt}; + + $r->[0] += $tot; + $r->[1] += $dbsnp; + } + } + close IN; } +my $pass = "PASS"; + my %mcnts = (); foreach my $key (sort keys %hcnts) { my $s = $hcnts{$key}; my @filts = split(/;/,$key); + my $passfail = ( ( $key =~ /$pass;/ ) || ( $key eq $pass ) ) ? "PASS" : "FAIL"; foreach my $filt (@filts) { + $filt = "$filt;$passfail"; $mcnts{$filt} = [0,0,0,0,0,0,0,0,0,0,0] unless ( defined($mcnts{$filt}) ); my $r = $mcnts{$filt}; for(my $i=0; $i < 11; ++$i) { @@ -76,18 +104,34 @@ foreach my $key (sort keys %hcnts) { } } -my $pass = "SVM"; +my %micnts = (); +foreach my $key (sort keys %hicnts) { + my $s = $hicnts{$key}; + my @filts = split(/;/,$key); + my $passfail = ( ( $key =~ /$pass;/ ) || ( $key eq $pass ) ) ? "PASS" : "FAIL"; + foreach my $filt (@filts) { + $filt = "$filt;$passfail"; + $micnts{$filt} = [0,0] unless ( defined($micnts{$filt}) ); + my $r = $micnts{$filt}; + for(my $i=0; $i < 2; ++$i) { + $r->[$i] += $s->[$i]; + } + } +} my @totals = (0,0,0,0,0,0,0,0,0,0,0); my @passes = (0,0,0,0,0,0,0,0,0,0,0); my @fails = (0,0,0,0,0,0,0,0,0,0,0); + +print "--------------------------------------------------------------------------------------------------------------\n"; +print "SNP SUMMARY\n"; print "--------------------------------------------------------------------------------------------------------------\n"; print sprintf("%20s","FILTER")."\t#SNPs\t#dbSNP\t%dbSNP\t%CpG\t%CpG\t%Known\t%Novel\t%nCpG-K\t%nCpG-N\t%HM3\n"; print sprintf("%20s","")."\t\t\t\tKnown\tNovel\tTs/Tv\tTs/Tv\tTs/Tv\tTs/Tv\tsens\n"; print "--------------------------------------------------------------------------------------------------------------\n"; foreach my $key (sort keys %hcnts) { - if ( ( $key eq $pass ) || ( $key eq "0" ) ) { + if ( ( $key eq $pass ) || ($key =~ /$pass;/ ) || ( $key eq "0" ) ) { for(my $j=0; $j < 11; ++$j) { $passes[$j] += $hcnts{$key}->[$j]; $totals[$j] += $hcnts{$key}->[$j]; @@ -118,12 +162,57 @@ if ( $fails[0] > 0 ) { &printSummary("TOTAL",\@totals); print "------------------------------------------------------------------------------------------------------------\n"; + +@totals = (0,0); +@passes = (0,0); +@fails = (0,0); +print "--------------------------------------------------------------------------------------------------------------\n"; +print "INDEL SUMMARY\n"; +print "--------------------------------------------------------------------------------------------------------------\n"; +print sprintf("%20s","FILTER")."\t#SNPs\t#dbSNP\n"; +print "--------------------------------------------------------------------------------------------------------------\n"; + +foreach my $key (sort keys %hicnts) { + if ( ( $key eq $pass ) || ($key =~ /$pass;/ ) || ( $key eq "0" ) ) { + #if ( ( $key eq $pass ) || ( $key eq "0" ) ) { + for(my $j=0; $j < 2; ++$j) { + $passes[$j] += $hicnts{$key}->[$j]; + $totals[$j] += $hicnts{$key}->[$j]; + } + } + else { + for(my $j=0; $j < 2; ++$j) { + $fails[$j] += $hicnts{$key}->[$j]; + $totals[$j] += $hicnts{$key}->[$j]; + } + } + &printiSummary($key,$hicnts{$key}); +} + +print "--------------------------------------------------------------------------------------------------------------\n"; +print sprintf("%20s","FILTER")."\t#SNPs\t#dbSNP\t%dbSNP\n"; +print "--------------------------------------------------------------------------------------------------------------\n"; +foreach my $key (sort keys %micnts) { + &printiSummary($key,$micnts{$key}); +} +print "--------------------------------------------------------------------------------------------------------------\n"; +if ( $passes[0] > 0 ) { + &printiSummary($pass,\@passes); +} +if ( $fails[0] > 0 ) { + &printiSummary("FAIL",\@fails); +} +&printiSummary("TOTAL",\@totals); +print "------------------------------------------------------------------------------------------------------------\n"; + + sub printSummary { my $key = $_[0]; my ($total,$db,$kts,$ktv,$nts,$ntv,$knts,$kntv,$nnts,$nntv,$hm3) = @{$_[1]}; #print STDERR "$key\t$r->[0]\t$s\t".join("\t",@{$r->[2]})."\n" if ( $key eq "TOTAL" ); - print sprintf("%20s",$key)."\t".($key)."\t".($total)."\t".sprintf("%.1lf",$db*100/($total+1e-10)); + #print sprintf("%20s",$key)."\t".($key)."\t".($total)."\t".sprintf("%.1lf",$db*100/($total+1e-10)); + print sprintf("%20s",$key)."\t".($total)."\t".($db)."\t".sprintf("%.1lf",$db*100/($total+1e-10)); print ( ($kts+$ktv+$knts+$kntv > 0) ? sprintf("\t%.1lf",($kts-$knts+$ktv-$kntv)/($kts+$ktv)*100) : "\tNA"); print ( ($nts+$ntv+$nnts+$nntv > 0) ? sprintf("\t%.1lf",($nts-$nnts+$ntv-$nntv)/($nts+$ntv)*100) : "\tNA"); print ( ($kts+$ktv == 0) ? "\tNA" : sprintf("\t%.2lf",($kts)/($ktv)) ); @@ -133,3 +222,12 @@ sub printSummary { printf("\t%.3lf",100*($hm3/($total+1e-6))); printf("\n"); } + +sub printiSummary { + my $key = $_[0]; + my ($total,$db) = @{$_[1]}; + + #print sprintf("%20s",$key)."\t".($key)."\t".($total)."\t".sprintf("%.1lf",$db*100/($total+1e-10)); + print sprintf("%20s",$key)."\t".($total)."\t".($db)."\t".sprintf("%.1lf",$db*100/($total+1e-10)); + printf("\n"); +} diff --git a/scripts/vcf-summary-v2 b/scripts/vcf-summary-v2 index a9a3f26..8901f4a 100644 --- a/scripts/vcf-summary-v2 +++ b/scripts/vcf-summary-v2 @@ -189,7 +189,7 @@ while() { next if ( $alt =~ /,/ ); #next if ( ( length($ref) > 1 ) || ( length($alt) > 1 ) ); next if ( ($auto) && ( ! ( $chrom =~ /^(chr)?\d+$/ ) ) ); - next if ( $prev eq $pos ); + #next if ( $prev eq $pos ); $prev = $pos; if ( $infoField ) { diff --git a/scripts/vcf-view-gt b/scripts/vcf-view-gt new file mode 100644 index 0000000..3e58aa0 --- /dev/null +++ b/scripts/vcf-view-gt @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +use strict; +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(initRef getCpGs); +use wGetOptions qw(wGetOptions wpod2usage); + +my $vcf = ""; +my $region = ""; +my $out = ""; +my $binbgzip = "$FindBin::Bin/bgzip"; +my $bintabix = "$FindBin::Bin/tabix"; + +wGetOptions( + "-Quickly view the genotypes of the VCF file in a specified region", + "--Required Options", + "vcf=s",[\$vcf,"Input VCF file, bgzipped and tabixed"], + "region=s",[\$region,"Region to query"], + "--Additional Options", + "out=s",[\$out,"Output file prefix"], + ) || wpod2usage(2); + + +wpod2usage(2) unless ( ( $vcf ) && ( $region ) ); + +if ( $out =~ /\.gz$/ ) { open(OUT,"| $binbgzip -c > $out") || die "Cannot open file\n"; } +elsif ( $out ) { open(OUT,">$out") || die "Cannot open file\n"; } +else { *OUT = *STDOUT; } + +open(IN,"tabix -h $vcf $region| grep -v ^##|") || die "Cannot open file\n"; +my @H = split(/[\t\r\n ]+/,); +while() { + my @G = split; + print OUT join("\t","----",$G[0].":".$G[1].":".$G[3].":".$G[4],$G[6],$G[7])."\n"; + for(my $i=9; $i < @G; ++$i) { + my @fields = split(/:/,$G[$i]); + print OUT join("\t",$H[$i],@fields)."\n"; + } + print OUT "\n"; +} +close IN; +close OUT; diff --git a/scripts/vt-merge-variants b/scripts/vt-merge-variants new file mode 100644 index 0000000..f20d225 --- /dev/null +++ b/scripts/vt-merge-variants @@ -0,0 +1,49 @@ +#!/usr/bin/perl -w + +use strict; +use POSIX qw(pow log10 sqrt); +use FindBin; +use lib $FindBin::Bin; +use hyunlib qw(forkExecWait); +use wGetOptions qw(wpod2usage wGetOptions); +use Time::HiRes; + +my $vt = "vt"; +my $vtcmd = "discover2 -z -q 20"; +my $ref = "/data/local/ref/gotcloud.ref/hg38/hs38DH.fa"; +my $samtools = "samtools"; +my $bamutil = "bamUtil"; +my $bcftools = "bcftools"; +my $cramore = "$FindBin::Bin/cramore"; +my $region = ""; +my $out = ""; +my $bcflist = ""; + +wGetOptions( + "-Merge detected variants", + "--Required Options", + "bcf-list=s" => [\$bcflist, "Merge BCF list"], + "out=s" => [\$out, "Output BCF file name"], + "region=s" => [\$region,"Region to focus on (CHR:BEG-END format)"], + "--Additional Options", + "vt=s" => [\$vt,"Binary path of vt software tool"], + "cramore=s" => [\$vt,"Binary path of cramore software tool"], + "bcftools=s" => [\$bcftools,"Binary path of bcftools software tool"], + "ref=s" => [\$ref,"Path to reference FASTA sequence"], + ) || wpod2usage(2); + +unless ( ( $bcflist ) && ( $out ) && ( $region ) ) { + print STDERR "ERROR: Missing required option\n"; + wpod2usage(2); +} + +my ($chr,$beg,$end) = split(/[:\-]/,$region); +$beg = 0 unless (defined($beg)); +$end = 1000000000 unless (defined($end)); + +my $cmd = "bash -c 'set pipefail; $cramore vcf-merge-candidate-variants --in-vcf-list $bcflist --region $chr:$beg-$end --out-vcf - 2> $out.merge_err | $vt annotate_indels -r $ref + -o + 2> $out.annotate_err | $vt consolidate_variants + -o $out 2> $out.consolidate_err'"; +&forkExecWait($cmd); + +$cmd = "$bcftools index $out"; +&forkExecWait($cmd); + diff --git a/scripts/yipe b/scripts/yipe index f294abb..b394679 100644 --- a/scripts/yipe +++ b/scripts/yipe @@ -28,26 +28,28 @@ for(my $i=0; $i < @yamls; ++$i) { $conf->merge(file => $yamls[$i]); } +$conf->dump(); + ## parse all iterable variables first -my $iterables = $conf->get("ITERTABLES"); -if ( defined($iterables) ) { - foreach my $k (keys %{$iterables}) { - my $rlist = $iterables->{$k} - if ( define($rlist->{file}) ) { - open(IN,$rlist->{file}) || die "Cannot open ".$rlist->{$file}."\n"; - while() { - my @F = split; - } - close IN; - } - } -} +#my $iterables = $conf->get("ITERTABLES"); +#if ( defined($iterables) ) { +# foreach my $k (keys %{$iterables}) { +# my $rlist = $iterables->{$k} +# if ( define($rlist->{file}) ) { +# open(IN,$rlist->{file}) || die "Cannot open ".$rlist->{$file}."\n"; +# while() { +# my @F = split; +# } +# close IN; +# } +# } +#} ### Go to the steps we need to run -foreach my $run (@runs) { - my $confRun = $conf->get($run); -} +#foreach my $run (@runs) { +# my $confRun = $conf->get($run); +#} # $conf->set("var_dir","\$etc_dir/var"); diff --git a/src/Constant.h b/src/Constant.h deleted file mode 100644 index 8420331..0000000 --- a/src/Constant.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#ifndef _CONSTANT_H_ -#define _CONSTANT_H_ - -#define COMPAREFUNC (int (*)(const void *, const void *)) - -#define BUFSIZE 1024 -#define FILENAMELEN 100 -#define IDLEN 20 - -#define SEPARATORS " \t\n\r\f/" -#define WHITESPACE " \t\n\r\f" - -#define SWTABLESKIP 9 -#define SWTABLEMAX 10000 - -#define _NAN_ ((double) (6.66666e-66)) - -#define QTDTDATA "qtdt.dat" -#define QTDTPED "qtdt.ped" -#define QTDTIBD "qtdt.ibd" -#define QTDTRAW "regress.tbl" -#define GENIHDATAIN "genih.dat" - -#ifndef __WIN32__ -#define stricmp strcasecmp -#endif - -// Constants for older haplotype handling programs -// Constants for HAPLOXT -#define XT_MAX_ALLELES 50 // Maximum alleles for crosstabulation -#define XT_VECTORSIZE 10000 // Total haplotypes in population -#define XT_POOLTRESH 7 // Threshold for pooling rare alleles -// Simwalk Haplotype Vectors -#define HV_MAXSIZE 100 // Haplotypes in single SimWalk pedigree -#define HV_INFOTRESH 75 // Percentage of loci typed -#define HV_STATELENGTH 100 // Markers per haplotype -#define HV_SKIPLINES 4 // lines to skip at bottom of family tree -// Simwalk Summary Files -#define HT_TABLE_SIZE 1000 -#define HT_SKIP_LINES 9 - -#endif - diff --git a/src/Error.cpp b/src/Error.cpp deleted file mode 100644 index 29c7870..0000000 --- a/src/Error.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#include "Error.h" -#include "pException.h" - -#include -#include -#include -#include - -void error(const char * msg, ...) -{ - va_list ap; - - va_start(ap, msg); - - fprintf(stderr, "\nFATAL ERROR - \n"); - vfprintf(stderr, msg, ap); - fprintf(stderr, "\n\n"); - - va_end(ap); - - throw pexception; - //exit(EXIT_FAILURE); -} - -void warning(const char * msg, ...) -{ - va_list ap; - - va_start(ap, msg); - - fprintf(stderr,"\n\aWARNING - \n"); - vfprintf(stderr, msg, ap); - fprintf(stderr,"\n"); - - va_end(ap); -} - -void numerror(const char * msg , ...) -{ - va_list ap; - - va_start(ap, msg); - - fprintf(stderr,"\nFATAL NUMERIC ERROR - "); - vfprintf(stderr, msg, ap); - fprintf(stderr,"\n\n"); - - va_end(ap); - - exit(EXIT_FAILURE); -} - -void notice(const char * msg, ...) { - va_list ap; - va_start(ap, msg); - - fprintf(stderr,"NOTICE - "); - vfprintf(stderr, msg, ap); - fprintf(stderr,"\n"); - - va_end(ap); -} - -void catprintf(std::string &s, const char * msg, ...) -{ - va_list ap; - - va_start(ap, msg); - - char buf[1000]; - vsprintf(buf, msg, ap); - - s += buf; - va_end(ap); -} diff --git a/src/Error.h b/src/Error.h deleted file mode 100644 index 0833812..0000000 --- a/src/Error.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#ifndef _ERROR_H_ -#define _ERROR_H_ - -#include - -// #ifdef __cplusplus -// extern "C" { -// #endif - -void error(const char * msg, ...); -void warning(const char * msg, ...); -void numerror(const char * msg, ...); -void notice(const char * msg, ...); -void catprintf(std::string &s, const char * msg, ...); - -// #ifdef __cplusplus -// }; -// #endif - - -#endif diff --git a/src/GenomeSequence.h b/src/GenomeSequence.h deleted file mode 100644 index b9d7ec1..0000000 --- a/src/GenomeSequence.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef _GENOMESEQUENCE_H_ -#define _GENOMESEQUENCE_H_ - -// .fai format -// contig, size, location, basesPerLine, bytesPerLine -// e.g. -// 1 249250621 52 60 61 -// 2 243199373 253404903 60 61 -class Faidx{ -public: - struct Info{ - int contigSize; - int offset; - int basePerLine; - int bytePerLine; - }; -public: - /// @return: # of contigs read, minus number means errors! - /// @param: file name - int loadFaidx(const char* fn){ - LineReader lr(fn); - std::vector fd; - int lineNo = 0; - while (lr.readLineBySep(&fd, "\t")){ - lineNo ++; - if (fd.size() != 5) { - fprintf(stderr, "Wrong format: %s...\n", fd[0].c_str()); - continue; - }; - Faidx::Info info; - if ( !str2int( fd[1], &info.contigSize) ) { - fprintf(stderr, "Cannot convert to integer at line %d!\n", lineNo); - continue; - } - if ( !str2int( fd[2], &info.offset) ) { - fprintf(stderr, "Cannot convert to integer at line %d!\n", lineNo); - continue; - } - if ( !str2int( fd[3], &info.basePerLine) ) { - fprintf(stderr, "Cannot convert to integer at line %d!\n", lineNo); - continue; - } - if ( !str2int( fd[4], &info.bytePerLine) ) { - fprintf(stderr, "Cannot convert to integer at line %d!\n", lineNo); - continue; - } - if (this->data.count(fd[0]) != 0) { - fprintf(stderr, "Warning, duplicate contig name at line %d!", lineNo); - } - this->data[fd[0]] = info; - }; - return this->data.size(); - }; - Faidx::Info* getInfo(const std::string& chr){ - if (data.count(chr) == 0) { - return NULL; - } else { - return &(data[chr]); - } - }; - int size() const { - return data.size(); - }; - long int getGenomeLength() const { - long int l = 0; - std::map::const_iterator it; - for (it = data.begin(); it != data.end(); it++){ - l += it->second.contigSize; - } - return l; - } -private: - std::map data; -}; - -class Chromosome{ -public: - explicit Chromosome(FILE* faFile, Faidx::Info* info): fp(faFile), info(info) { - }; - explicit Chromosome():fp(NULL), info(NULL){}; - Chromosome(const Chromosome& chrom) { - this->fp = chrom.fp; - this->info = chrom.info; - }; -public: - // here offset is 0-based index - char operator[] (unsigned int offset) const { - if (!info) return 'N'; - int lineNo = offset / info->basePerLine; - int remainder = offset % info->basePerLine; - unsigned int pos = info->offset + lineNo * info->bytePerLine + remainder; - if ( fseek(fp, pos, SEEK_SET) ) { - fprintf(stderr, "Cannot fseek() at position %d!\n", pos); - return 'N'; - } - char c; - if (1 != fread(&c, sizeof(char), 1, this->fp)) { - fprintf(stderr, "Cannot fread()!\n"); - return 'N'; - } - return c; - }; - int size() const{ - return info->contigSize; - }; -private: - FILE* fp; - Faidx::Info* info; -}; - -class GenomeSequence{ -public: -GenomeSequence():fp(NULL){}; - virtual ~GenomeSequence(){ - if (this->fp) { - fclose(this->fp); - } - }; -private: - //forbid copying - GenomeSequence(const GenomeSequence& gs); - GenomeSequence& operator= (const GenomeSequence& gs); -public: - /** - * @return true: if loads successful - */ - bool open(const char* fileName){ - // load .fa - this->fp = fopen(fileName, "r"); - if (!this->fp) { - fprintf(stderr, "Cannot open file: %s!", fileName); - return false; - } - - // load .fai - std::string faiName = fileName; - faiName.append(".fai"); - if (this->faidx.loadFaidx(faiName.c_str()) < 0) { - fprintf(stderr, "Cannot open fai file!"); - return false; - } - - return true; - }; - - /** - * @return total number of chromosome - */ - int size() const { - return this->faidx.size(); - }; - /** - * @return total number of chromosome - */ - long int getGenomeLength() const { - return faidx.getGenomeLength(); - }; - - Chromosome& getChromosome(const std::string& c){ - std::map::iterator it = data.find(c); - if (it == data.end()) { - Chromosome chrom(fp, faidx.getInfo(c)); - data[c] = chrom; - return data[c]; - } else { - return (it->second); - } - }; - const Chromosome& operator[] (const std::string& c) { - std::map::const_iterator it = data.find(c); - if (it == data.end()) { - Chromosome chrom(fp, faidx.getInfo(c)); - data[c] = chrom; - return data[c]; - } else { - return (it->second); - } - } - /** - * @return reference bases from chr:beg-end (beg inclusive, end exclusive) - */ - std::string getBase(const std::string& c, int beg, int end) { - std::string ret; - if (beg > end) return ret; - ret.resize( end - beg); - for (int i = beg; i < end; ++i ) { - ret[i- beg] = (*this)[c][i]; - }; - return ret; - }; - bool exists(const std::string& c){ - if (this->data.find(c) != this->data.end()) - return true; - if (faidx.getInfo(c) != NULL) - return true; - return false; - } -public: - std::map data; - FILE* fp; - Faidx faidx; -}; - -#endif /* _GENOMESEQUENCE_H_ */ diff --git a/src/IO.cpp b/src/IO.cpp deleted file mode 100644 index 59d8834..0000000 --- a/src/IO.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "IO.h" -#include - -//static method -AbstractFileReader* AbstractFileReader::open(const char* fileName){ - AbstractFileReader * fr = NULL; - if (!fileName || fileName[0] == '\0') { - fprintf(stderr, "Empty file name.\n"); - return fr; - } - - switch(AbstractFileReader::checkFileType(fileName)) { - case IO_PLAIN: - fr = new PlainFileReader(fileName); - break; - case IO_GZIP: - fr = new GzipFileReader(fileName); - break; - default: - fprintf(stderr, "Cannot detect file type (does it exist?!)\n"); - break; - } - return fr; -} -// static method -void AbstractFileReader::close(AbstractFileReader** f) { - assert(f && *f); - (*f)->close(); - delete (*f); - *f = NULL; -}; - -// check header for known file type -FileType AbstractFileReader::checkFileType(const char* fileName){ - // treat stdin as plain text file - if (strncmp(fileName, "-", 1) == 0) { - return IO_PLAIN; - } - // magic numbers - const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - // read file header - FILE* fp = fopen(fileName, "rb"); - if (!fp) return IO_UNKNOWN; - unsigned char header[2]={0,0}; - int n = fread(header, sizeof(char), 2, fp); - fclose(fp); - // check file types - if ( n >= 2 && header[0] == gz_magic[0] && header[1] == gz_magic[1]) { - return IO_GZIP; - } - return IO_PLAIN; - /* // check the characters fall into visible ASCII range */ - /* if ( header[0] >= 0x20 /\* space *\/ && */ - /* header[0] < 0x7f /\* DEL *\/ && */ - /* header[1] >= 0x20 /\* space *\/ && */ - /* header[1] < 0x7f /\* DEL *\/) { */ - /* return PLAIN; */ - /* } */ - /* return UNKNOWN; */ -}; - -/** - * @return number of empty elements filtered out - */ -int removeEmptyField(std::vector* fields) { - int s = fields->size(); - std::remove(fields->begin(), fields->end(), ""); - s -= fields->size(); - return s; -}; - - -AbstractFileWriter::~AbstractFileWriter() { -#ifdef IO_DEBUG - fprintf(stderr, "AbstractFileWriter desc()\n"); -#endif -}; - - -int BGZipFileWriter::open(const char* fn, bool append){ - if (append) - fprintf(stderr, "Gzip does not support appending.\n"); - this->fp = bgzf_open(fn, "w"); - if (!this->fp) { - fprintf(stderr, "ERROR: Cannot open %s for write\n", fn); - return -1; - } - return 0; -} -void BGZipFileWriter::close(){ - if (this->fp) { - bgzf_close(this->fp); - this->fp = NULL; - } -}; -int BGZipFileWriter::write(const char* s) { - return bgzf_write(this->fp, s, strlen(s)); - }; -int BGZipFileWriter::writeLine(const char* s) { - int ret = bgzf_write(this->fp, s, strlen(s)); - ret += bgzf_write(this->fp, "\n", 1); - return (ret); -}; - diff --git a/src/IO.h b/src/IO.h deleted file mode 100644 index 0279405..0000000 --- a/src/IO.h +++ /dev/null @@ -1,856 +0,0 @@ -#ifndef _IO_H_ -#define _IO_H_ - -#define UNUSED(x) ((void)(x)) -#include //fopen -#include //malloc -#include //strchr -#include //assert -#include // va_list - -#include -#include - -// cannot forward declare an typdef anonymous struct -// http://stackoverflow.com/questions/804894/forward-declaration-of-a-typedef-in-c -// so include the header file -#include "bgzf.h" - -// #define IO_DEBUG - -typedef enum FileType { - IO_PLAIN = 0, - IO_GZIP = 1, - IO_BGZIP = 3, - IO_UNKNOWN = 99 -} FileType; - -/** - * Sample usage: - * std::string line; - * LineReader* f = AbstractFileReader::open("abc"); - * while (f->readLine(line) > 0) { - * ... - * } - * delete f; - */ -class AbstractFileReader{ -public: - /* typedef enum FileType { */ - /* PLAIN = 0, */ - /* GZIP = 1, */ - /* BZIP2 = 2, */ - /* UNKNOWN = 99 */ - /* } FileType; */ - virtual ~AbstractFileReader() {}; // make it virtual so subclass types can close file handle - static AbstractFileReader* open(const char* fileName); - static void close(AbstractFileReader** f); - // virtual functions - // each specific file type will need to implement the following function - //virtual int readLine(std::string* line) = 0; - //virtual int readLineBySep(std::vector* fields, const char* sep) = 0; - virtual int getc() = 0; - virtual bool isEof() = 0; - virtual void close() = 0; - virtual int read(void* buf, int len) = 0; - // common utility function - static FileType checkFileType(const char* fileName); -protected: - AbstractFileReader() {}; // forbid explicit create AbstractFileReader class. -}; - -class PlainFileReader: public AbstractFileReader{ -public: -PlainFileReader(const char* fileName): - fp(NULL) { - this->open(fileName); -#ifdef IO_DEBUG - fprintf(stderr, "PlainFileReader() open %s\n", fileName); -#endif - }; - virtual ~PlainFileReader() { -#ifdef IO_DEBUG - fprintf(stderr, "~PlainFileReader() close\n"); -#endif - this->close(); - }; - - // get a char, if EOF, return EOF - int getc(){ - return ::getc(this->fp); - } - // check eof - bool isEof() { - return (feof(this->fp) != 0); - } - // open - FILE* open(const char* fileName) { - this->fp = fopen(fileName, "r"); - if (!this->fp) { - fprintf(stderr, "ERROR: Cannot open %s\n", fileName); - } - return this->fp; - } - // close - void close() { - if (this->fp) { - fclose(fp); - fp = NULL; - } - } - int read(void* buf, int len) { - return ::fread(buf, sizeof(char), len, this->fp); - }; -private: - FILE* fp; -}; - -////////////////////////////////////////////////////////////////////// -// Gzip reading class -#include -class GzipFileReader: public AbstractFileReader{ -public: -GzipFileReader(const char* fileName): - fp(NULL) { - this->open(fileName); -#ifdef IO_DEBUG - fprintf(stderr, "GzipFileReader() open %s\n", fileName); -#endif - }; - virtual ~GzipFileReader() { -#ifdef IO_DEBUG - fprintf(stderr, "~PlainFileReader() close\n"); -#endif - this->close(); - }; - - // get a char, if EOF, return EOF - int getc(){ - return gzgetc(this->fp); - } - // check eof - bool isEof() { - return (gzeof(this->fp) != 0); - } - // open - gzFile open(const char* fileName) { - this->fp = gzopen(fileName, "r"); - if (!this->fp) { - fprintf(stderr, "ERROR: Cannot open %s\n", fileName); - } - return this->fp; - } - // close - void close() { - if (this->fp) { - gzclose(fp); - fp = NULL; - } - } - int read(void* buf, int len) { - return gzread(this->fp, buf, len); - }; - -private: - gzFile fp; -}; - -/* -////////////////////////////////////////////////////////////////////// -// Bzip2 reading class -#include -class Bzip2FileReader: public AbstractFileReader{ -public: -Bzip2FileReader(const char* fileName): - fp(NULL) { - this->open(fileName); -#ifdef IO_DEBUG - fprintf(stderr, "Bzip2FileReader() open %s\n", fileName); -#endif - }; - virtual ~Bzip2FileReader() { -#ifdef IO_DEBUG - fprintf(stderr, "~Bzip2FileReader() close\n"); -#endif - if (this->fp) { - BZ2_bzclose(fp); - } - }; - - // get a char, if EOF, return EOF - int getc(){ - char c; - this->bzerror = BZ_OK; - int nBuf = BZ2_bzRead(&this->bzerror, this->bzp, &c, sizeof(char)); - UNUSED(nBuf); - if (this->bzerror == BZ_OK) { - return c; - } else { - return EOF; - } - } - // check eof - bool isEof() { - return (this->bzerror == BZ_STREAM_END); - } - // open - BZFILE* open(const char* fileName) { - this->fp = fopen(fileName, "rb"); - if (!this->fp) { - fprintf(stderr, "ERROR: Cannot open %s\n", fileName); - return NULL; - } - this->bzp = BZ2_bzReadOpen(&this->bzerror, this->fp, 0, 0, NULL, 0); - - if (this->bzerror != BZ_OK) { - BZ2_bzReadClose ( &bzerror, this->bzp ); - fprintf(stderr, "ERROR: Cannot open %s\n", fileName); - return NULL; - } - return this->bzp; - } - // close - void close() { - if (this->bzerror != BZ_STREAM_END) { - BZ2_bzReadClose(&this->bzerror, this->bzp); - } else { - BZ2_bzReadClose(&this->bzerror, this->bzp); - } - if (this->fp) fclose(this->fp); - this->fp = NULL; - this->bzp = NULL; - this->bzerror = 0; - }; - int read(void* buf, int len) { - return BZ2_bzRead ( &this->bzerror, this->bzp, buf, len); - }; -private: - FILE* fp; - BZFILE* bzp; - int bzerror; -}; -////////////////////////////////////////////////////////////////////// -*/ - -/** - * Example code: - - BufferedReader br("Makefile", 200); - char buf[500] = {}; - int nRead = 0; - while ( (nRead = br.read(buf, 500)) > 0) { - for (int i = 0; i < nRead; i++) { - printf("%c", buf[i]); - } - } -*/ -class BufferedReader: public AbstractFileReader{ -public: -BufferedReader(const char* fileName, int bufferCapacity): - bufCap(0),bufEnd(0),bufPtr(0),buf(NULL),fp(NULL) { -#ifdef IO_DEBUG - fprintf(stderr, "BufferedReader open %s\n", fileName); -#endif - // initialize buf - if (bufferCapacity == 0) { - fprintf(stderr, "Buffer size should be greater than 0, now use default buffer size 8096 instead of %d.\n", bufferCapacity); - this->bufCap = 8096; - } else { - this->bufCap = (int) (bufferCapacity); - } - this->buf = new char[this->bufCap]; - if (!this->buf) { - fprintf(stderr, "Cannot allocate buffer for BufferedReader.\n"); - return; - } - this->bufPtr = 0; - this->bufEnd = 0; - // initialize fp - this->fp = AbstractFileReader::open(fileName); - if (!this->fp) { - fprintf(stderr, "Canont open file %s\n", fileName); - this->fp = NULL; - } - } - virtual ~BufferedReader(){ - this->close(); - } - int getc() { - if (this->bufPtr == this->bufEnd) { //buffer all used, need to refresh - this->bufEnd = this->fp->read(this->buf, this->bufCap); - this->bufPtr = 0; - } - - if (this->bufPtr < this->bufEnd) - return (this->buf [ this->bufPtr++ ] ); - else - return EOF; - } - bool isEof() { - if (this->fp && this->fp->isEof() && this->bufPtr == this->bufEnd){ - return true; - } - return false; - } - void close() { -#ifdef IO_DEBUG - fprintf(stderr, "BufferedReader close\n"); -#endif - // delete fp - if (this->fp){ - AbstractFileReader::close(&fp); - } - this->fp = NULL; - // delete buf - if (this->buf) { - delete [] this->buf; - this->buf = NULL; - this->bufCap = 0; - this->bufPtr = 0; - this->bufEnd = 0; - } - this->buf = NULL; - } - int read(void* buf, int len) { - // use current buffer to fill in buf - int idx = 0; - while (this->bufPtr < this->bufEnd && len > 0) { - ((char*)buf)[idx++] = this->buf[this->bufPtr++]; - len --; - } - if (len == 0) { - return idx; - } - // fill rest of buf - int nRead = this->fp->read(((char*)buf)+idx, len); - idx += nRead; - // refill buffer - this->bufEnd = this->fp->read(this->buf, this->bufCap); - this->bufPtr = 0; - return idx; - } -private: - int bufCap; // capacity of the buffer - int bufEnd; // bufPtr should not read beyond bufEnd(incluive) - int bufPtr; // from which buffer begins to read - char* buf; - AbstractFileReader* fp; -}; - -/** Example code: - // LineReader lr(fn); - // while(lr.readLine(&line)>0){ - // fprintf(stdout, "%s\n", line.c_str()); - // } - */ -class LineReader{ -public: - LineReader(const std::string& fileName){ - init(fileName.c_str()); - } - LineReader(const char* fileName){ - init(fileName); - } - void init(const char* fileName) { -#ifdef IO_DEBUG - fprintf(stderr, "LineReader open %s\n", fileName); -#endif - this->fp = new BufferedReader(fileName, 1024); - if (!this->fp) { - fprintf(stderr, "Canont open file %s\n", fileName); - this->fp = NULL; - } - } - LineReader(AbstractFileReader* fp) { - this->fp = fp; - } - virtual ~LineReader(){ - if (this->fp){ - fp->close(); - delete this->fp; - this->fp = NULL; - } -#ifdef IO_DEBUG - fprintf(stderr, "LineReader close\n"); -#endif - } - // return number of characters read. - // when reading an empty line, will return 1, as we read '\n', however, line will be empty - // when reading the end, we will return 0 - int readLine(std::string* line) { - assert(this->fp && line); - if (this->fp->isEof()) return 0; - line->clear(); - char c; - unsigned nRead = 0; - while (true) { - c = this->fp->getc(); - if (c == EOF) { - return nRead; - } else if (c == '\r') { - // skip this - continue; - } else if (c == '\n') { - ++nRead; - return nRead; - } else { // normal characters - ++nRead; - line->push_back(c); - } - } - assert(false); // should not reach here - return 0; - }; - // return number of fields read. - // when reading an empty line, will return 1, meaning 1 field are read, although its content is empty - // consecutive separators, e.g. \t\t, will yield empty field - // when reading to the EOF, will return 0. - int readLineBySep(std::vector* fields, const char* sep) { - assert(this->fp && fields && sep); - if (this->fp->isEof()) return 0; - fields->clear(); - char c; - std::string s; - while (true) { - c = this->fp->getc(); - if (c == EOF) { - fields->push_back(s); - return fields->size(); - } else if (c == '\r') { - // skip this - continue; - } else if (c == '\n') { - fields->push_back(s); - return fields->size(); - } else if (strchr(sep, c) != NULL) { // separator - fields->push_back(s); - s.clear(); - } else { // normal characters - s.push_back(c); - } - } - assert(false); // should not reach here - return 0; - }; -private: - AbstractFileReader* fp; -}; - -/** - * @return number of empty elements filtered out - */ -extern int removeEmptyField(std::vector* fields); - -////////////////////////////////////////////////////////////////////// -// FileWriter related classes -class AbstractFileWriter{ -public: - /// when open is successful, return 0; else: return non-zero - virtual int open(const char* fn, bool append = false) = 0; - virtual void close() = 0; - virtual int write(const char* s) = 0; - virtual int writeLine(const char* s) = 0; - virtual ~AbstractFileWriter() = 0; -}; - -class TextFileWriter:public AbstractFileWriter{ -public: - TextFileWriter(const char* fn, bool append = false){ - if (this->open(fn, append)){ - fprintf(stderr, "Cannot create text file %s\n", fn); - } - } - virtual ~TextFileWriter(){ -#ifdef IO_DEBUG - fprintf(stderr, "TextFileWriter desc()\n"); -#endif - this->close(); - } - int open(const char* fn, bool append = false){ - if (append) - this->fp = fopen(fn, "a"); - else - this->fp = fopen(fn, "w"); - if (!this->fp) { - fprintf(stderr, "ERROR: Cannot open %s for write\n", fn); - return -1; - } - return 0; - } - void close(){ - if (this->fp) { - fclose(this->fp); - this->fp = NULL; - } - }; - int write(const char* s) { - return fputs(s, this->fp); - }; - int writeLine(const char* s) { - int ret = fputs(s, this->fp); - fputc('\n', this->fp); - return (ret + 1); - }; - int printf(const char *fmt, ...){ - va_list args; - va_start(args,fmt); - int ret = vfprintf(fp, fmt, args); - va_end(args); - return ret; - }; -private: - FILE* fp; -}; // end TextFileWriter - -class GzipFileWriter:public AbstractFileWriter{ -public: - GzipFileWriter(const char* fn, bool append = false){ - if (this->open(fn, append)){ - fprintf(stderr, "Cannot create gzip file %s\n", fn); - } - } - virtual ~GzipFileWriter(){ - this->close(); -#ifdef IO_DEBUG - fprintf(stderr, "GzipFileWriter desc()\n"); -#endif - }; - int open(const char* fn, bool append = false){ - if (append) - fprintf(stderr, "Gzip does not support appending.\n"); - this->fp = gzopen(fn, "wb"); - if (!this->fp) { - fprintf(stderr, "ERROR: Cannot open %s for write\n", fn); - return -1; - } - return 0; - } - void close(){ - if (this->fp) { - gzclose(this->fp); - this->fp = NULL; - } - }; - int write(const char* s) { - return gzputs(this->fp, s); - }; - int writeLine(const char* s) { - int ret = gzputs(this->fp, s); - gzputc(this->fp, '\n'); - return (ret + 1); - }; -private: - gzFile fp; -}; // end GzipFileWriter - -/* -class Bzip2FileWriter:public AbstractFileWriter{ -public: - Bzip2FileWriter(const char* fn, bool append = false){ - if (this->open(fn, append)){ - fprintf(stderr, "Cannot create bzip2 file %s\n", fn); - } - } - virtual ~Bzip2FileWriter(){ - this->close(); -#ifdef IO_DEBUG - fprintf(stderr, "Bzip2FileWriter desc()\n"); -#endif - }; - int open(const char* fn, bool append = false){ - if (append) - fprintf(stderr, "bzip2 does not support appending.\n"); - this->fp = fopen(fn, "wb"); - if (fp == NULL) return -1; - - this->bzp = BZ2_bzWriteOpen(&this->bzerror, this->fp, 9, 0, 30); //block size is 9, 0 means silent, 30 means working factor - if (this->bzerror != BZ_OK) { - BZ2_bzWriteClose( & bzerror, this->bzp, 0, 0, 0); // 0: abandon, 0: results of # of bytes for input, 0: results of # of bytes outputted. - fprintf(stderr, "ERROR: Cannot open %s for write\n", fn); - return -1; - } - return 0; - } - void close(){ - BZ2_bzWriteClose(&bzerror, this->bzp, 0, 0, 0); - if (bzerror != BZ_OK){ - }; - if (this->fp) fclose(this->fp); - - this->bzp = NULL; - this->fp = NULL; - }; - int write(const char* s) { - int ret = strlen(s); - BZ2_bzWrite(&this->bzerror, this->bzp, (void*)s, ret); - if (this->bzerror != BZ_OK) { - this->close(); - return -1; - } - return ret; - }; - int writeLine(const char* s) { - int ret = strlen(s); - BZ2_bzWrite(&this->bzerror, this->bzp, (void*)s, ret); - if (this->bzerror != BZ_OK) { - this->close(); - return -1; - } - char buf[] = "\n"; - BZ2_bzWrite(&this->bzerror, this->bzp, buf, 1); - if (this->bzerror != BZ_OK) { - this->close(); - return -1; - } - return (ret + 1); - }; -private: - FILE* fp; - BZFILE* bzp; - int bzerror; -}; // end Bzip2FileWriter -*/ - -class BGZipFileWriter:public AbstractFileWriter{ -public: - BGZipFileWriter(const char* fn, bool append = false){ - if (this->open(fn)){ - fprintf(stderr, "Cannot create BGzip file %s\n", fn); - } - } - virtual ~BGZipFileWriter(){ - this->close(); -#ifdef IO_DEBUG - fprintf(stderr, "BGZipFileWriter desc()\n"); -#endif - }; - /** - * @param append: ignored - */ - int open(const char* fn, bool append = false); - void close(); - int write(const char* s); - int writeLine(const char* s); -private: - BGZF* fp; -}; // end BGZipFileWriter - -#define DEFAULT_WRITER_BUFFER 4096 -class BufferedFileWriter: public AbstractFileWriter{ -public: - BufferedFileWriter(AbstractFileWriter* f, int bufLen = DEFAULT_WRITER_BUFFER){ - this->bufLen = DEFAULT_WRITER_BUFFER; - this->buf = new char[bufLen + 1]; // last char in the buffer is always '\0' - // that help to use fputs() - if (!this->buf) { - fprintf(stderr, "Cannot create BufferedFileWriter\n"); - abort(); - } - this->buf[bufLen] = '\0'; - this->bufPtr = 0; - - if (!this->buf) { - fprintf(stderr, "Buffer allocation failed!\n"); - } - this->f = f; - } - ~BufferedFileWriter(){ - if (this->buf) { - delete [] this->buf; - this->buf = NULL; - } -#ifdef IO_DEBUG - fprintf(stderr, "BufferedFileWriter desc()\n"); -#endif - }; - int open(const char* fn, bool append = false){ - return this->f->open(fn, append); - }; - void close() { - this->flush(); - //this->f->close(); - }; - int write(const char* s){ - int nbyte = 0; - int i = 0; - while (s[i] != '\0'){ - this->buf[this->bufPtr++] = s[i++]; - nbyte ++ ; - if (this->bufPtr == this->bufLen) { - this->f->write(this->buf); - this->bufPtr = 0; - } - } - return nbyte; - }; - int writeLine(const char* s){ - int ret = this->write(s); - this->write("\n"); - return (ret + 1) ; - }; - int flush() { - this->buf[this->bufPtr] = '\0'; - this->f->write(this->buf); - this->bufPtr = 0; - return 0; - }; -private: - char* buf; - int bufLen; - int bufPtr; - AbstractFileWriter* f; -}; // end BufferedFileWriter - - -/** - * design: - * a high level file class, underlying using BufferedFileWriter - * usage: - * FileWriter* fout = new FileWriter("a.txt", "w"); - * fout->write("abc"); - * fout->writeLn("abc"); - * fout->close(); - * delete fout->write; - */ -class FileWriter{ -public: - FileWriter(const char* fileName, bool append = false){ - // int l = strlen(fileName); - if (this->checkSuffix(fileName, ".gz")) { - this->fpRaw = new GzipFileWriter(fileName, append); - // } else if (this->checkSuffix(fileName, ".bz2")){ - //this->fpRaw = new Bzip2FileWriter(fileName, append); - } else { - this->fpRaw = new TextFileWriter(fileName, append); - } - this->fp = new BufferedFileWriter(this->fpRaw); - if (!this->fpRaw || !this->fp){ - fprintf(stderr, "Cannot create file\n"); - abort(); - } - - this->createBuffer(); - } - FileWriter(const char* fileName, FileType t) { - bool append = false; - if ( IO_PLAIN == t) { - this->fpRaw = new TextFileWriter(fileName, append); - } else if (IO_GZIP == t) { - this->fpRaw = new GzipFileWriter(fileName, append); - } else if (IO_BGZIP == t) { - this->fpRaw = new BGZipFileWriter(fileName, append); - } else { - fprintf(stderr, "Unrecognized file type, use plain text format instead!\n"); - this->fpRaw = new TextFileWriter(fileName, append); - } - - this->fp = new BufferedFileWriter(this->fpRaw); - if (!this->fpRaw || !this->fp){ - fprintf(stderr, "Cannot create file\n"); - abort(); - } - - this->createBuffer(); - }; - void createBuffer() { - // create buffer for formatted string - this->bufLen = 1024; - this->buf = new char[this->bufLen]; - if (!this->buf){ - fprintf(stderr, "Cannot allocate printf buffer for FileWriter.\n"); - }; - }; - void close() { - if (this->fp){ - this->fp->close(); - delete this->fp; - this->fp = NULL; - } - if (this->fpRaw){ - delete this->fpRaw; - this->fpRaw = NULL; - } - if (this->buf){ - delete [] this->buf; - this->buf = NULL; - } -#ifdef IO_DEBUG - fprintf(stderr, "FileWriter desc()\n"); -#endif - }; - ~FileWriter(){ - this->close(); - }; - int write(const char* s){ - return this->fp->write(s); - }; - int writeLine(const char* s){ - int ret = this->fp->write(s); - this->fp->write("\n"); - return (ret + 1); - }; - // if @param fileName ends with @param suffix, then return true; - static bool checkSuffix(const char* fileName, const char* suffix){ - int lf = strlen(fileName); - int ls = strlen(suffix); - if (lf < ls) return false; - for (int i = lf - ls, j = 0; j < ls;){ - if (fileName[i++] != suffix[j++]) return false; - } - return true; - }; - - /** - * format string to this->buf, then write it out - */ - // since in C++, a hidden this pointer is passed, we will use 2, 3 instead of 1 and 2 - int printf(const char *fmt, ...) __attribute__ ((format (printf, 2, 3))){ - // we'll put the formatted string to internal buffer - va_list args; - int ret; - int newBufLen; - - while (1) { - /* Try to print in the allocated space. */ - va_start(args,fmt); - ret = vsnprintf(this->buf, this->bufLen, fmt, args); - va_end(args); - /* If that worked, return the string. */ - if (ret > -1 && ret < this->bufLen) { - return this->write(this->buf); - } - /* Else try again with more space. */ - if (ret > -1) /* glibc 2.1 */ - newBufLen = ret + 1; /* precisely what is needed */ - else /* glibc 2.0 */ - newBufLen = bufLen * 2; /* twice the old size */ - increaseBufferTo(newBufLen); - } - }; - - - - /* while (( ret = vsnprintf(this->buf, this->bufLen, fmt, args)) >= this->bufLen){ */ - /* this->increaseBufferTo( ret + this->bufLen + 1); */ - /* }; */ - /* va_end(args); */ - /* return this->write(this->buf); */ - /* }; */ - -private: - void increaseBufferTo(int newBufLen){ - delete[] this->buf; - this->buf = new char[newBufLen]; - if (!this->buf){ - fprintf(stderr, "Cannot increase printf buffer for FileWriter.\n"); - abort(); - }; - this->bufLen = newBufLen; - }; - AbstractFileWriter* fp; - AbstractFileWriter* fpRaw; - char* buf; - int bufLen; -}; // end class FileWriter - -#endif /* _IO_H_ */ diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 13866d2..0000000 --- a/src/Makefile +++ /dev/null @@ -1,653 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# src/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - - - -pkgdatadir = $(datadir)/apigenome -pkgincludedir = $(includedir)/apigenome -pkglibdir = $(libdir)/apigenome -pkglibexecdir = $(libexecdir)/apigenome -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -bin_PROGRAMS = vcfast$(EXEEXT) bgzip$(EXEEXT) tabix$(EXEEXT) \ - tinyfast$(EXEEXT) -subdir = src -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -libtabix_a_AR = $(AR) $(ARFLAGS) -libtabix_a_LIBADD = -am_libtabix_a_OBJECTS = bedidx.$(OBJEXT) bgzf.$(OBJEXT) \ - knetfile.$(OBJEXT) kstring.$(OBJEXT) index.$(OBJEXT) -libtabix_a_OBJECTS = $(am_libtabix_a_OBJECTS) -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_bgzip_OBJECTS = bgzip.$(OBJEXT) bedidx.$(OBJEXT) bgzf.$(OBJEXT) \ - knetfile.$(OBJEXT) kstring.$(OBJEXT) -bgzip_OBJECTS = $(am_bgzip_OBJECTS) -bgzip_LDADD = $(LDADD) -am_tabix_OBJECTS = tabix.$(OBJEXT) bedidx.$(OBJEXT) bgzf.$(OBJEXT) \ - knetfile.$(OBJEXT) kstring.$(OBJEXT) index.$(OBJEXT) -tabix_OBJECTS = $(am_tabix_OBJECTS) -tabix_LDADD = $(LDADD) -am_tinyfast_OBJECTS = tinyfast.$(OBJEXT) Error.$(OBJEXT) \ - params.$(OBJEXT) -tinyfast_OBJECTS = $(am_tinyfast_OBJECTS) -tinyfast_DEPENDENCIES = libtabix.a -am_vcfast_OBJECTS = vcfast.$(OBJEXT) Error.$(OBJEXT) \ - PhredHelper.$(OBJEXT) params.$(OBJEXT) codonHelper.$(OBJEXT) \ - genomePosition.$(OBJEXT) IO.$(OBJEXT) -vcfast_OBJECTS = $(am_vcfast_OBJECTS) -vcfast_DEPENDENCIES = libtabix.a -DEFAULT_INCLUDES = -I. -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libtabix_a_SOURCES) $(bgzip_SOURCES) $(tabix_SOURCES) \ - $(tinyfast_SOURCES) $(vcfast_SOURCES) -DIST_SOURCES = $(libtabix_a_SOURCES) $(bgzip_SOURCES) $(tabix_SOURCES) \ - $(tinyfast_SOURCES) $(vcfast_SOURCES) -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run aclocal-1.11 -AMTAR = $${TAR-tar} -AR = ar -AUTOCONF = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoconf -AUTOHEADER = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run autoheader -AUTOMAKE = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run automake-1.11 -AWK = gawk -CAT_CHECK = yes -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = -CUT_CHECK = yes -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DIRNAME_CHECK = yes -DLLTOOL = false -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F -GNUPLOT_CHECK = yes -GREP = /bin/grep -GREP_CHECK = yes -GROFF_CHECK = yes -GS_CHECK = yes -HEAD_CHECK = yes -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -LIBOBJS = -LIBS = -lz -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/hmkang/code/working/apigenome.master/missing --run makeinfo -MAKE_CHECK = yes -MANIFEST_TOOL = : -MKDIR_CHECK = yes -MKDIR_P = /bin/mkdir -p -MV_CHECK = yes -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = -PACKAGE = apigenome -PACKAGE_BUGREPORT = hmkang@umich.edu -PACKAGE_NAME = apigenome -PACKAGE_STRING = apigenome 0.0.2 -PACKAGE_TARNAME = apigenome -PACKAGE_URL = -PACKAGE_VERSION = 0.0.2 -PATH_SEPARATOR = : -PERL_CHECK = yes -PFBTOPS_CHECK = yes -POW_LIB = -RANLIB = ranlib -RM_CHECK = yes -RSCRIPT_CHECK = yes -R_CHECK = yes -SED = /bin/sed -SET_MAKE = -SHELL = /bin/sh -SORT_CHECK = yes -STRIP = strip -VERSION = 0.0.2 -ZCAT_CHECK = yes -abs_builddir = /home/hmkang/code/working/apigenome.master/src -abs_srcdir = /home/hmkang/code/working/apigenome.master/src -abs_top_builddir = /home/hmkang/code/working/apigenome.master -abs_top_srcdir = /home/hmkang/code/working/apigenome.master -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = $${TAR-tar} chof - "$$tardir" -am__untar = $${TAR-tar} xf - -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/hmkang/code/working/apigenome.master/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /net/fantasia/home/hmkang/bin/apigenome -program_transform_name = s,x,x, -psdir = ${docdir} -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = . -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = ../ -top_builddir = .. -top_srcdir = .. -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -TABIX_VER = 0.2.5 -TABIX = tabix-$(TABIX_VER) -AM_CPPFLAGS = -Wall -Wno-unused-local-typedefs -Wno-enum-compare -fpic -O2 #-I../include/ #-I$(TABIX)/ -noinst_HEADERS = hDist.h \ - bam_endian.h \ - boolParser.h \ - cdsStat.h ncStat.h \ - TypeConversion.h \ - Constant.h GenomeSequence.h \ - kseq.h pException.h tabix.h \ - Error.h \ - ksort.h pFile.h \ - genomeLoci.h genomePosition.h IO.h kstring.h \ - PhredHelper.h bgzf.h \ - codonHelper.h fVcf.h \ - genomeScore.h khash.h params.h \ - boolExprParser.h \ - knetfile.h \ - wFile.h - -noinst_LIBRARIES = libtabix.a -vcfast_SOURCES = vcfast.cpp Error.cpp PhredHelper.cpp params.cpp codonHelper.cpp genomePosition.cpp IO.cpp -vcfast_LDADD = libtabix.a -tinyfast_SOURCES = tinyfast.cpp Error.cpp params.cpp -tinyfast_LDADD = libtabix.a -bgzip_SOURCES = bgzip.c bedidx.c bgzf.c knetfile.c kstring.c -tabix_SOURCES = tabix.c bedidx.c bgzf.c knetfile.c kstring.c index.c -libtabix_a_SOURCES = bedidx.c bgzf.c knetfile.c kstring.c index.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libtabix.a: $(libtabix_a_OBJECTS) $(libtabix_a_DEPENDENCIES) $(EXTRA_libtabix_a_DEPENDENCIES) - -rm -f libtabix.a - $(libtabix_a_AR) libtabix.a $(libtabix_a_OBJECTS) $(libtabix_a_LIBADD) - $(RANLIB) libtabix.a -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -bgzip$(EXEEXT): $(bgzip_OBJECTS) $(bgzip_DEPENDENCIES) $(EXTRA_bgzip_DEPENDENCIES) - @rm -f bgzip$(EXEEXT) - $(LINK) $(bgzip_OBJECTS) $(bgzip_LDADD) $(LIBS) -tabix$(EXEEXT): $(tabix_OBJECTS) $(tabix_DEPENDENCIES) $(EXTRA_tabix_DEPENDENCIES) - @rm -f tabix$(EXEEXT) - $(LINK) $(tabix_OBJECTS) $(tabix_LDADD) $(LIBS) -tinyfast$(EXEEXT): $(tinyfast_OBJECTS) $(tinyfast_DEPENDENCIES) $(EXTRA_tinyfast_DEPENDENCIES) - @rm -f tinyfast$(EXEEXT) - $(CXXLINK) $(tinyfast_OBJECTS) $(tinyfast_LDADD) $(LIBS) -vcfast$(EXEEXT): $(vcfast_OBJECTS) $(vcfast_DEPENDENCIES) $(EXTRA_vcfast_DEPENDENCIES) - @rm -f vcfast$(EXEEXT) - $(CXXLINK) $(vcfast_OBJECTS) $(vcfast_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/Error.Po -include ./$(DEPDIR)/IO.Po -include ./$(DEPDIR)/PhredHelper.Po -include ./$(DEPDIR)/bedidx.Po -include ./$(DEPDIR)/bgzf.Po -include ./$(DEPDIR)/bgzip.Po -include ./$(DEPDIR)/codonHelper.Po -include ./$(DEPDIR)/genomePosition.Po -include ./$(DEPDIR)/index.Po -include ./$(DEPDIR)/knetfile.Po -include ./$(DEPDIR)/kstring.Po -include ./$(DEPDIR)/params.Po -include ./$(DEPDIR)/tabix.Po -include ./$(DEPDIR)/tinyfast.Po -include ./$(DEPDIR)/vcfast.Po - -.c.o: - $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c $< - -.c.obj: - $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: - $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LTCOMPILE) -c -o $@ $< - -.cpp.o: - $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: - $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: - $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-noinstLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool clean-noinstLIBRARIES ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 211ec32..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -## Additional flags to pass to aclocal when it is invoked automatically at -## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment -## to provide a way for the user to supply additional arguments. -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - -## Paths to include -TABIX_VER = 0.2.5 -TABIX = tabix-$(TABIX_VER) -AM_CPPFLAGS = -Wall -Wno-unused-local-typedefs -Wno-enum-compare -fpic -O2 #-I../include/ #-I$(TABIX)/ - -noinst_HEADERS = hDist.h \ - bam_endian.h \ - boolParser.h \ - cdsStat.h ncStat.h \ - TypeConversion.h \ - Constant.h GenomeSequence.h \ - kseq.h pException.h tabix.h \ - Error.h \ - ksort.h pFile.h \ - genomeLoci.h genomePosition.h IO.h kstring.h \ - PhredHelper.h bgzf.h \ - codonHelper.h fVcf.h \ - genomeScore.h khash.h params.h \ - boolExprParser.h \ - knetfile.h \ - wFile.h - -bin_PROGRAMS = vcfast bgzip tabix tinyfast - -noinst_LIBRARIES = libtabix.a - -## vcfast files -vcfast_SOURCES = vcfast.cpp Error.cpp PhredHelper.cpp params.cpp codonHelper.cpp genomePosition.cpp IO.cpp -vcfast_LDADD = libtabix.a - -tinyfast_SOURCES = tinyfast.cpp Error.cpp params.cpp -tinyfast_LDADD = libtabix.a - -bgzip_SOURCES = bgzip.c bedidx.c bgzf.c knetfile.c kstring.c - -tabix_SOURCES = tabix.c bedidx.c bgzf.c knetfile.c kstring.c index.c - -libtabix_a_SOURCES = bedidx.c bgzf.c knetfile.c kstring.c index.c diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index 60e370d..0000000 --- a/src/Makefile.in +++ /dev/null @@ -1,653 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = vcfast$(EXEEXT) bgzip$(EXEEXT) tabix$(EXEEXT) \ - tinyfast$(EXEEXT) -subdir = src -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -libtabix_a_AR = $(AR) $(ARFLAGS) -libtabix_a_LIBADD = -am_libtabix_a_OBJECTS = bedidx.$(OBJEXT) bgzf.$(OBJEXT) \ - knetfile.$(OBJEXT) kstring.$(OBJEXT) index.$(OBJEXT) -libtabix_a_OBJECTS = $(am_libtabix_a_OBJECTS) -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_bgzip_OBJECTS = bgzip.$(OBJEXT) bedidx.$(OBJEXT) bgzf.$(OBJEXT) \ - knetfile.$(OBJEXT) kstring.$(OBJEXT) -bgzip_OBJECTS = $(am_bgzip_OBJECTS) -bgzip_LDADD = $(LDADD) -am_tabix_OBJECTS = tabix.$(OBJEXT) bedidx.$(OBJEXT) bgzf.$(OBJEXT) \ - knetfile.$(OBJEXT) kstring.$(OBJEXT) index.$(OBJEXT) -tabix_OBJECTS = $(am_tabix_OBJECTS) -tabix_LDADD = $(LDADD) -am_tinyfast_OBJECTS = tinyfast.$(OBJEXT) Error.$(OBJEXT) \ - params.$(OBJEXT) -tinyfast_OBJECTS = $(am_tinyfast_OBJECTS) -tinyfast_DEPENDENCIES = libtabix.a -am_vcfast_OBJECTS = vcfast.$(OBJEXT) Error.$(OBJEXT) \ - PhredHelper.$(OBJEXT) params.$(OBJEXT) codonHelper.$(OBJEXT) \ - genomePosition.$(OBJEXT) IO.$(OBJEXT) -vcfast_OBJECTS = $(am_vcfast_OBJECTS) -vcfast_DEPENDENCIES = libtabix.a -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libtabix_a_SOURCES) $(bgzip_SOURCES) $(tabix_SOURCES) \ - $(tinyfast_SOURCES) $(vcfast_SOURCES) -DIST_SOURCES = $(libtabix_a_SOURCES) $(bgzip_SOURCES) $(tabix_SOURCES) \ - $(tinyfast_SOURCES) $(vcfast_SOURCES) -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CAT_CHECK = @CAT_CHECK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CUT_CHECK = @CUT_CHECK@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIRNAME_CHECK = @DIRNAME_CHECK@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUPLOT_CHECK = @GNUPLOT_CHECK@ -GREP = @GREP@ -GREP_CHECK = @GREP_CHECK@ -GROFF_CHECK = @GROFF_CHECK@ -GS_CHECK = @GS_CHECK@ -HEAD_CHECK = @HEAD_CHECK@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MAKE_CHECK = @MAKE_CHECK@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_CHECK = @MKDIR_CHECK@ -MKDIR_P = @MKDIR_P@ -MV_CHECK = @MV_CHECK@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL_CHECK = @PERL_CHECK@ -PFBTOPS_CHECK = @PFBTOPS_CHECK@ -POW_LIB = @POW_LIB@ -RANLIB = @RANLIB@ -RM_CHECK = @RM_CHECK@ -RSCRIPT_CHECK = @RSCRIPT_CHECK@ -R_CHECK = @R_CHECK@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SORT_CHECK = @SORT_CHECK@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ZCAT_CHECK = @ZCAT_CHECK@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -TABIX_VER = 0.2.5 -TABIX = tabix-$(TABIX_VER) -AM_CPPFLAGS = -Wall -Wno-unused-local-typedefs -Wno-enum-compare -fpic -O2 #-I../include/ #-I$(TABIX)/ -noinst_HEADERS = hDist.h \ - bam_endian.h \ - boolParser.h \ - cdsStat.h ncStat.h \ - TypeConversion.h \ - Constant.h GenomeSequence.h \ - kseq.h pException.h tabix.h \ - Error.h \ - ksort.h pFile.h \ - genomeLoci.h genomePosition.h IO.h kstring.h \ - PhredHelper.h bgzf.h \ - codonHelper.h fVcf.h \ - genomeScore.h khash.h params.h \ - boolExprParser.h \ - knetfile.h \ - wFile.h - -noinst_LIBRARIES = libtabix.a -vcfast_SOURCES = vcfast.cpp Error.cpp PhredHelper.cpp params.cpp codonHelper.cpp genomePosition.cpp IO.cpp -vcfast_LDADD = libtabix.a -tinyfast_SOURCES = tinyfast.cpp Error.cpp params.cpp -tinyfast_LDADD = libtabix.a -bgzip_SOURCES = bgzip.c bedidx.c bgzf.c knetfile.c kstring.c -tabix_SOURCES = tabix.c bedidx.c bgzf.c knetfile.c kstring.c index.c -libtabix_a_SOURCES = bedidx.c bgzf.c knetfile.c kstring.c index.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libtabix.a: $(libtabix_a_OBJECTS) $(libtabix_a_DEPENDENCIES) $(EXTRA_libtabix_a_DEPENDENCIES) - -rm -f libtabix.a - $(libtabix_a_AR) libtabix.a $(libtabix_a_OBJECTS) $(libtabix_a_LIBADD) - $(RANLIB) libtabix.a -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -bgzip$(EXEEXT): $(bgzip_OBJECTS) $(bgzip_DEPENDENCIES) $(EXTRA_bgzip_DEPENDENCIES) - @rm -f bgzip$(EXEEXT) - $(LINK) $(bgzip_OBJECTS) $(bgzip_LDADD) $(LIBS) -tabix$(EXEEXT): $(tabix_OBJECTS) $(tabix_DEPENDENCIES) $(EXTRA_tabix_DEPENDENCIES) - @rm -f tabix$(EXEEXT) - $(LINK) $(tabix_OBJECTS) $(tabix_LDADD) $(LIBS) -tinyfast$(EXEEXT): $(tinyfast_OBJECTS) $(tinyfast_DEPENDENCIES) $(EXTRA_tinyfast_DEPENDENCIES) - @rm -f tinyfast$(EXEEXT) - $(CXXLINK) $(tinyfast_OBJECTS) $(tinyfast_LDADD) $(LIBS) -vcfast$(EXEEXT): $(vcfast_OBJECTS) $(vcfast_DEPENDENCIES) $(EXTRA_vcfast_DEPENDENCIES) - @rm -f vcfast$(EXEEXT) - $(CXXLINK) $(vcfast_OBJECTS) $(vcfast_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Error.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IO.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PhredHelper.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bedidx.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bgzf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bgzip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codonHelper.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genomePosition.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knetfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kstring.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/params.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyfast.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcfast.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -.cpp.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-noinstLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool clean-noinstLIBRARIES ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/PhredHelper.cpp b/src/PhredHelper.cpp deleted file mode 100644 index 1419482..0000000 --- a/src/PhredHelper.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#include "PhredHelper.h" - -#include - -phredConverter phredConv; - -phredConverter::phredConverter() -{ - // Create a quick lookup table to speed up conversion of - // base quality values stored as log10 (error rates) into - // fractional error rates - for (int i = 0; i <= 255; i++) { - phred2Err[i] = (i > 1) ? pow(0.1, i * 0.1) : 0.75; - phred2Mat[i] = 1.-phred2Err[i]; - phred2Mat3[i] = 1.-phred2Err[i]/3.; - phred2LogMat[i] = log10(phred2Mat[i]); - phred2LogMat3[i] = log10(phred2Mat3[i]); - phred2HalfLogMat3[i] = log10(0.5-phred2Err[i]/3); - } - log3 = log10(3.0); - // doubleLookup[255] = 0.0; -} - -uint8_t phredConverter::err2Phred(double err) { - double d = 0-log10(err); - return ( d > 255 ? 255 : ( d < 0 ? 0 : (uint8_t)floor(d+.5) ) ); -} - -uint8_t phredConverter::mat2Phred(double mat) { - double d = 0-log10(1.-mat); - return ( d > 255 ? 255 : ( d < 0 ? 0 : (uint8_t)floor(d+.5) ) ); -} - -uint8_t phredConverter::mat32Phred(double mat3) { - double d = 0-log10(1.-mat3); - return ( d > 255 ? 255 : ( d < 0 ? 0 : (uint8_t)floor(d+.5) ) ); -} - diff --git a/src/PhredHelper.h b/src/PhredHelper.h deleted file mode 100644 index cd64837..0000000 --- a/src/PhredHelper.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#ifndef __PHREDHELPER_H__ -#define __PHREDHELPER_H__ - -#include - -class phredConverter -{ -public: - phredConverter(); - double phred2Err[256]; - double phred2Mat[256]; - double phred2Mat3[256]; - double phred2LogMat[256]; - double phred2LogMat3[256]; - double phred2HalfLogMat3[256]; - double log3; - - uint8_t err2Phred(double err); - uint8_t mat2Phred(double mat); - uint8_t mat32Phred(double mat3); -}; - -extern phredConverter phredConv; - -#endif - - diff --git a/src/TypeConversion.h b/src/TypeConversion.h deleted file mode 100644 index bf09ab4..0000000 --- a/src/TypeConversion.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _TYPECONVERSION_H_ -#define _TYPECONVERSION_H_ - -#include -#include -#include // for HUGE_VALH, HUGE_VALL -#include - -// convert double/int/byte to string type -template -std::string toString(T i){ - std::stringstream ss; - ss << i; - return ss.str(); -} - -// convert std::string to integer -// @return true if conversion succeed -bool str2int(const char* input, int* output) { - char* endptr; - long val; - errno = 0; - val = strtol(input, &endptr, 10); - - if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) - || (errno != 0 && val == 0)) { - perror("strtol"); - return false; - } - - if (endptr == input) { - // no digits found - return false; - } - *output = val; - return true; -} - -bool str2int(const std::string& input, int* output) { - return str2int(input.c_str(), output); -} - -int toInt(const char* input) { - return (atoi(input)); -}; -int toInt(const std::string& input) { - return (atoi(input.c_str())); -}; - -float toFloat(const char* input) { - return (atof(input)); -}; -float toFloat(const std::string& input) { - return (atof(input.c_str())); -}; - -double toDouble(const char* input) { - return (atof(input)); -}; -double toDouble(const std::string& input) { - return (atof(input.c_str())); -}; - -// convert std::string to double -// @return true if conversion succeed -bool str2double(const char* input, double* output) { - char* endptr; - double val; - - errno = 0; - val = strtod(input, &endptr); - - if ((errno == ERANGE && (val == HUGE_VALF || val == HUGE_VALL)) - || (errno != 0 && val == 0.)) { - perror("strtod"); - return false; - } - - if (endptr == input) { - // no digits found - return false; - } - *output = val; - return true; -} - -#endif /* _TYPECONVERSION_H_ */ diff --git a/src/bam_endian.h b/src/bam_endian.h deleted file mode 100644 index 0fc74a8..0000000 --- a/src/bam_endian.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef BAM_ENDIAN_H -#define BAM_ENDIAN_H - -#include - -static inline int bam_is_big_endian() -{ - long one= 1; - return !(*((char *)(&one))); -} -static inline uint16_t bam_swap_endian_2(uint16_t v) -{ - return (uint16_t)(((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8)); -} -static inline void *bam_swap_endian_2p(void *x) -{ - *(uint16_t*)x = bam_swap_endian_2(*(uint16_t*)x); - return x; -} -static inline uint32_t bam_swap_endian_4(uint32_t v) -{ - v = ((v & 0x0000FFFFU) << 16) | (v >> 16); - return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8); -} -static inline void *bam_swap_endian_4p(void *x) -{ - *(uint32_t*)x = bam_swap_endian_4(*(uint32_t*)x); - return x; -} -static inline uint64_t bam_swap_endian_8(uint64_t v) -{ - v = ((v & 0x00000000FFFFFFFFLLU) << 32) | (v >> 32); - v = ((v & 0x0000FFFF0000FFFFLLU) << 16) | ((v & 0xFFFF0000FFFF0000LLU) >> 16); - return ((v & 0x00FF00FF00FF00FFLLU) << 8) | ((v & 0xFF00FF00FF00FF00LLU) >> 8); -} -static inline void *bam_swap_endian_8p(void *x) -{ - *(uint64_t*)x = bam_swap_endian_8(*(uint64_t*)x); - return x; -} - -#endif diff --git a/src/bedidx.c b/src/bedidx.c deleted file mode 100644 index 722877d..0000000 --- a/src/bedidx.c +++ /dev/null @@ -1,156 +0,0 @@ -#include -#include -#include -#include -#include - -#include "ksort.h" -KSORT_INIT_GENERIC(uint64_t) - -#include "kseq.h" -KSTREAM_INIT(gzFile, gzread, 8192) - -typedef struct { - int n, m; - uint64_t *a; - int *idx; -} bed_reglist_t; - -#include "khash.h" -KHASH_MAP_INIT_STR(reg, bed_reglist_t) - -#define LIDX_SHIFT 13 - -typedef kh_reg_t reghash_t; - -int *bed_index_core(int n, uint64_t *a, int *n_idx) -{ - int i, j, m, *idx; - m = *n_idx = 0; idx = 0; - for (i = 0; i < n; ++i) { - int beg, end; - beg = a[i]>>32 >> LIDX_SHIFT; end = ((uint32_t)a[i]) >> LIDX_SHIFT; - if (m < end + 1) { - int oldm = m; - m = end + 1; - kroundup32(m); - idx = realloc(idx, m * sizeof(int)); - for (j = oldm; j < m; ++j) idx[j] = -1; - } - if (beg == end) { - if (idx[beg] < 0) idx[beg] = i; - } else { - for (j = beg; j <= end; ++j) - if (idx[j] < 0) idx[j] = i; - } - *n_idx = end + 1; - } - return idx; -} - -void bed_index(void *_h) -{ - reghash_t *h = (reghash_t*)_h; - khint_t k; - for (k = 0; k < kh_end(h); ++k) { - if (kh_exist(h, k)) { - bed_reglist_t *p = &kh_val(h, k); - if (p->idx) free(p->idx); - ks_introsort(uint64_t, p->n, p->a); - p->idx = bed_index_core(p->n, p->a, &p->m); - } - } -} - -int bed_overlap_core(const bed_reglist_t *p, int beg, int end) -{ - int i, min_off; - if (p->n == 0) return 0; - min_off = (beg>>LIDX_SHIFT >= p->n)? p->idx[p->n-1] : p->idx[beg>>LIDX_SHIFT]; - if (min_off < 0) { // TODO: this block can be improved, but speed should not matter too much here - int n = beg>>LIDX_SHIFT; - if (n > p->n) n = p->n; - for (i = n - 1; i >= 0; --i) - if (p->idx[i] >= 0) break; - min_off = i >= 0? p->idx[i] : 0; - } - for (i = min_off; i < p->n; ++i) { - if ((int)(p->a[i]>>32) >= end) break; // out of range; no need to proceed - if ((int32_t)p->a[i] > beg && (int32_t)(p->a[i]>>32) < end) - return 1; // find the overlap; return - } - return 0; -} - -int bed_overlap(const void *_h, const char *chr, int beg, int end) -{ - const reghash_t *h = (const reghash_t*)_h; - khint_t k; - if (!h) return 0; - k = kh_get(reg, h, chr); - if (k == kh_end(h)) return 0; - return bed_overlap_core(&kh_val(h, k), beg, end); -} - -void *bed_read(const char *fn) -{ - reghash_t *h = kh_init(reg); - gzFile fp; - kstream_t *ks; - int dret; - kstring_t *str; - // read the list - fp = strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r"); - if (fp == 0) return 0; - str = calloc(1, sizeof(kstring_t)); - ks = ks_init(fp); - while (ks_getuntil(ks, 0, str, &dret) >= 0) { // read the chr name - int beg = -1, end = -1; - bed_reglist_t *p; - khint_t k = kh_get(reg, h, str->s); - if (k == kh_end(h)) { // absent from the hash table - int ret; - char *s = strdup(str->s); - k = kh_put(reg, h, s, &ret); - memset(&kh_val(h, k), 0, sizeof(bed_reglist_t)); - } - p = &kh_val(h, k); - if (dret != '\n') { // if the lines has other characters - if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) { - beg = atoi(str->s); // begin - if (dret != '\n') { - if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) - end = atoi(str->s); // end - } - } - } - if (dret != '\n') while ((dret = ks_getc(ks)) > 0 && dret != '\n'); // skip the rest of the line - if (end < 0 && beg > 0) end = beg, beg = beg - 1; // if there is only one column - if (beg >= 0 && end > beg) { - if (p->n == p->m) { - p->m = p->m? p->m<<1 : 4; - p->a = realloc(p->a, p->m * 8); - } - p->a[p->n++] = (uint64_t)beg<<32 | end; - } - } - ks_destroy(ks); - gzclose(fp); - free(str->s); free(str); - bed_index(h); - return h; -} - -void bed_destroy(void *_h) -{ - reghash_t *h = (reghash_t*)_h; - khint_t k; - for (k = 0; k < kh_end(h); ++k) { - if (kh_exist(h, k)) { - free(kh_val(h, k).a); - free(kh_val(h, k).idx); - free((char*)kh_key(h, k)); - } - } - kh_destroy(reg, h); -} diff --git a/src/bgzf.c b/src/bgzf.c deleted file mode 100644 index 3bea718..0000000 --- a/src/bgzf.c +++ /dev/null @@ -1,555 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Broad Institute / Massachusetts Institute of Technology - 2011 Attractive Chaos - - 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 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include -#include -#include -#include -#include -#include -#include "bgzf.h" - -#ifdef _USE_KNETFILE -#include "knetfile.h" -typedef knetFile *_bgzf_file_t; -#define _bgzf_open(fn, mode) knet_open(fn, mode) -#define _bgzf_dopen(fp, mode) knet_dopen(fp, mode) -#define _bgzf_close(fp) knet_close(fp) -#define _bgzf_fileno(fp) ((fp)->fd) -#define _bgzf_tell(fp) knet_tell(fp) -#define _bgzf_seek(fp, offset, whence) knet_seek(fp, offset, whence) -#define _bgzf_read(fp, buf, len) knet_read(fp, buf, len) -#define _bgzf_write(fp, buf, len) knet_write(fp, buf, len) -#else // ~defined(_USE_KNETFILE) -#if defined(_WIN32) || defined(_MSC_VER) -#define ftello(fp) ftell(fp) -#define fseeko(fp, offset, whence) fseek(fp, offset, whence) -#else // ~defined(_WIN32) -extern off_t ftello(FILE *stream); -extern int fseeko(FILE *stream, off_t offset, int whence); -#endif // ~defined(_WIN32) -typedef FILE *_bgzf_file_t; -#define _bgzf_open(fn, mode) fopen(fn, mode) -#define _bgzf_dopen(fp, mode) fdopen(fp, mode) -#define _bgzf_close(fp) fclose(fp) -#define _bgzf_fileno(fp) fileno(fp) -#define _bgzf_tell(fp) ftello(fp) -#define _bgzf_seek(fp, offset, whence) fseeko(fp, offset, whence) -#define _bgzf_read(fp, buf, len) fread(buf, 1, len, fp) -#define _bgzf_write(fp, buf, len) fwrite(buf, 1, len, fp) -#endif // ~define(_USE_KNETFILE) - -#define BLOCK_HEADER_LENGTH 18 -#define BLOCK_FOOTER_LENGTH 8 - -/* BGZF/GZIP header (speciallized from RFC 1952; little endian): - +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - | 31|139| 8| 4| 0| 0|255| 6| 66| 67| 2|BLK_LEN| - +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ -*/ -static const uint8_t g_magic[19] = "\037\213\010\4\0\0\0\0\0\377\6\0\102\103\2\0\0\0"; - -#ifdef BGZF_CACHE -typedef struct { - int size; - uint8_t *block; - int64_t end_offset; -} cache_t; -#include "khash.h" -KHASH_MAP_INIT_INT64(cache, cache_t) -#endif - -static inline void packInt16(uint8_t *buffer, uint16_t value) -{ - buffer[0] = value; - buffer[1] = value >> 8; -} - -static inline int unpackInt16(const uint8_t *buffer) -{ - return buffer[0] | buffer[1] << 8; -} - -static inline void packInt32(uint8_t *buffer, uint32_t value) -{ - buffer[0] = value; - buffer[1] = value >> 8; - buffer[2] = value >> 16; - buffer[3] = value >> 24; -} - -static BGZF *bgzf_read_init() -{ - BGZF *fp; - fp = calloc(1, sizeof(BGZF)); - fp->open_mode = 'r'; - fp->uncompressed_block = malloc(BGZF_BLOCK_SIZE); - fp->compressed_block = malloc(BGZF_BLOCK_SIZE); -#ifdef BGZF_CACHE - fp->cache = kh_init(cache); -#endif - return fp; -} - -static BGZF *bgzf_write_init(int compress_level) // compress_level==-1 for the default level -{ - BGZF *fp; - fp = calloc(1, sizeof(BGZF)); - fp->open_mode = 'w'; - fp->uncompressed_block = malloc(BGZF_BLOCK_SIZE); - fp->compressed_block = malloc(BGZF_BLOCK_SIZE); - fp->compress_level = compress_level < 0? Z_DEFAULT_COMPRESSION : compress_level; // Z_DEFAULT_COMPRESSION==-1 - if (fp->compress_level > 9) fp->compress_level = Z_DEFAULT_COMPRESSION; - return fp; -} -// get the compress level from the mode string -static int mode2level(const char *__restrict mode) -{ - int i, compress_level = -1; - for (i = 0; mode[i]; ++i) - if (mode[i] >= '0' && mode[i] <= '9') break; - if (mode[i]) compress_level = (int)mode[i] - '0'; - if (strchr(mode, 'u')) compress_level = 0; - return compress_level; -} - -BGZF *bgzf_open(const char *path, const char *mode) -{ - BGZF *fp = 0; - if (strchr(mode, 'r') || strchr(mode, 'R')) { - _bgzf_file_t fpr; - if ((fpr = _bgzf_open(path, "r")) == 0) return 0; - fp = bgzf_read_init(); - fp->fp = fpr; - } else if (strchr(mode, 'w') || strchr(mode, 'W')) { - FILE *fpw; - if ((fpw = fopen(path, "w")) == 0) return 0; - fp = bgzf_write_init(mode2level(mode)); - fp->fp = fpw; - } - return fp; -} - -BGZF *bgzf_dopen(int fd, const char *mode) -{ - BGZF *fp = 0; - if (strchr(mode, 'r') || strchr(mode, 'R')) { - _bgzf_file_t fpr; - if ((fpr = _bgzf_dopen(fd, "r")) == 0) return 0; - fp = bgzf_read_init(); - fp->fp = fpr; - } else if (strchr(mode, 'w') || strchr(mode, 'W')) { - FILE *fpw; - if ((fpw = fdopen(fd, "w")) == 0) return 0; - fp = bgzf_write_init(mode2level(mode)); - fp->fp = fpw; - } - return fp; -} - -// Deflate the block in fp->uncompressed_block into fp->compressed_block. Also adds an extra field that stores the compressed block length. -static int deflate_block(BGZF *fp, int block_length) -{ - uint8_t *buffer = fp->compressed_block; - int buffer_size = BGZF_BLOCK_SIZE; - int input_length = block_length; - int compressed_length = 0; - int remaining; - uint32_t crc; - - assert(block_length <= BGZF_BLOCK_SIZE); // guaranteed by the caller - memcpy(buffer, g_magic, BLOCK_HEADER_LENGTH); // the last two bytes are a place holder for the length of the block - while (1) { // loop to retry for blocks that do not compress enough - int status; - z_stream zs; - zs.zalloc = NULL; - zs.zfree = NULL; - zs.next_in = fp->uncompressed_block; - zs.avail_in = input_length; - zs.next_out = (void*)&buffer[BLOCK_HEADER_LENGTH]; - zs.avail_out = buffer_size - BLOCK_HEADER_LENGTH - BLOCK_FOOTER_LENGTH; - status = deflateInit2(&zs, fp->compress_level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); // -15 to disable zlib header/footer - if (status != Z_OK) { - fp->errcode |= BGZF_ERR_ZLIB; - return -1; - } - status = deflate(&zs, Z_FINISH); - if (status != Z_STREAM_END) { // not compressed enough - deflateEnd(&zs); // reset the stream - if (status == Z_OK) { // reduce the size and recompress - input_length -= 1024; - assert(input_length > 0); // logically, this should not happen - continue; - } - fp->errcode |= BGZF_ERR_ZLIB; - return -1; - } - if (deflateEnd(&zs) != Z_OK) { - fp->errcode |= BGZF_ERR_ZLIB; - return -1; - } - compressed_length = zs.total_out; - compressed_length += BLOCK_HEADER_LENGTH + BLOCK_FOOTER_LENGTH; - assert(compressed_length <= BGZF_BLOCK_SIZE); - break; - } - - assert(compressed_length > 0); - packInt16((uint8_t*)&buffer[16], compressed_length - 1); // write the compressed_length; -1 to fit 2 bytes - crc = crc32(0L, NULL, 0L); - crc = crc32(crc, fp->uncompressed_block, input_length); - packInt32((uint8_t*)&buffer[compressed_length-8], crc); - packInt32((uint8_t*)&buffer[compressed_length-4], input_length); - - remaining = block_length - input_length; - if (remaining > 0) { - assert(remaining <= input_length); - memcpy(fp->uncompressed_block, fp->uncompressed_block + input_length, remaining); - } - fp->block_offset = remaining; - return compressed_length; -} - -// Inflate the block in fp->compressed_block into fp->uncompressed_block -static int inflate_block(BGZF* fp, int block_length) -{ - z_stream zs; - zs.zalloc = NULL; - zs.zfree = NULL; - zs.next_in = fp->compressed_block + 18; - zs.avail_in = block_length - 16; - zs.next_out = fp->uncompressed_block; - zs.avail_out = BGZF_BLOCK_SIZE; - - if (inflateInit2(&zs, -15) != Z_OK) { - fp->errcode |= BGZF_ERR_ZLIB; - return -1; - } - if (inflate(&zs, Z_FINISH) != Z_STREAM_END) { - inflateEnd(&zs); - fp->errcode |= BGZF_ERR_ZLIB; - return -1; - } - if (inflateEnd(&zs) != Z_OK) { - fp->errcode |= BGZF_ERR_ZLIB; - return -1; - } - return zs.total_out; -} - -static int check_header(const uint8_t *header) -{ - return (header[0] == 31 && header[1] == 139 && header[2] == 8 && (header[3] & 4) != 0 - && unpackInt16((uint8_t*)&header[10]) == 6 - && header[12] == 'B' && header[13] == 'C' - && unpackInt16((uint8_t*)&header[14]) == 2); -} - -#ifdef BGZF_CACHE -static void free_cache(BGZF *fp) -{ - khint_t k; - khash_t(cache) *h = (khash_t(cache)*)fp->cache; - if (fp->open_mode != 'r') return; - for (k = kh_begin(h); k < kh_end(h); ++k) - if (kh_exist(h, k)) free(kh_val(h, k).block); - kh_destroy(cache, h); -} - -static int load_block_from_cache(BGZF *fp, int64_t block_address) -{ - khint_t k; - cache_t *p; - khash_t(cache) *h = (khash_t(cache)*)fp->cache; - k = kh_get(cache, h, block_address); - if (k == kh_end(h)) return 0; - p = &kh_val(h, k); - if (fp->block_length != 0) fp->block_offset = 0; - fp->block_address = block_address; - fp->block_length = p->size; - memcpy(fp->uncompressed_block, p->block, BGZF_BLOCK_SIZE); - _bgzf_seek((_bgzf_file_t)fp->fp, p->end_offset, SEEK_SET); - return p->size; -} - -static void cache_block(BGZF *fp, int size) -{ - int ret; - khint_t k; - cache_t *p; - khash_t(cache) *h = (khash_t(cache)*)fp->cache; - if (BGZF_BLOCK_SIZE >= fp->cache_size) return; - if ((kh_size(h) + 1) * BGZF_BLOCK_SIZE > fp->cache_size) { - /* A better way would be to remove the oldest block in the - * cache, but here we remove a random one for simplicity. This - * should not have a big impact on performance. */ - for (k = kh_begin(h); k < kh_end(h); ++k) - if (kh_exist(h, k)) break; - if (k < kh_end(h)) { - free(kh_val(h, k).block); - kh_del(cache, h, k); - } - } - k = kh_put(cache, h, fp->block_address, &ret); - if (ret == 0) return; // if this happens, a bug! - p = &kh_val(h, k); - p->size = fp->block_length; - p->end_offset = fp->block_address + size; - p->block = malloc(BGZF_BLOCK_SIZE); - memcpy(kh_val(h, k).block, fp->uncompressed_block, BGZF_BLOCK_SIZE); -} -#else -static void free_cache(BGZF *fp) {} -static int load_block_from_cache(BGZF *fp, int64_t block_address) {return 0;} -static void cache_block(BGZF *fp, int size) {} -#endif - -int bgzf_read_block(BGZF *fp) -{ - uint8_t header[BLOCK_HEADER_LENGTH], *compressed_block; - int count, size = 0, block_length, remaining; - int64_t block_address; - block_address = _bgzf_tell((_bgzf_file_t)fp->fp); - if (load_block_from_cache(fp, block_address)) return 0; - count = _bgzf_read(fp->fp, header, sizeof(header)); - if (count == 0) { // no data read - fp->block_length = 0; - return 0; - } - if (count != sizeof(header) || !check_header(header)) { - fp->errcode |= BGZF_ERR_HEADER; - return -1; - } - size = count; - block_length = unpackInt16((uint8_t*)&header[16]) + 1; // +1 because when writing this number, we used "-1" - compressed_block = (uint8_t*)fp->compressed_block; - memcpy(compressed_block, header, BLOCK_HEADER_LENGTH); - remaining = block_length - BLOCK_HEADER_LENGTH; - count = _bgzf_read(fp->fp, &compressed_block[BLOCK_HEADER_LENGTH], remaining); - if (count != remaining) { - fp->errcode |= BGZF_ERR_IO; - return -1; - } - size += count; - if ((count = inflate_block(fp, block_length)) < 0) return -1; - if (fp->block_length != 0) fp->block_offset = 0; // Do not reset offset if this read follows a seek. - fp->block_address = block_address; - fp->block_length = count; - cache_block(fp, size); - return 0; -} - -ssize_t bgzf_read(BGZF *fp, void *data, ssize_t length) -{ - ssize_t bytes_read = 0; - uint8_t *output = data; - if (length <= 0) return 0; - assert(fp->open_mode == 'r'); - while (bytes_read < length) { - int copy_length, available = fp->block_length - fp->block_offset; - uint8_t *buffer; - if (available <= 0) { - if (bgzf_read_block(fp) != 0) return -1; - available = fp->block_length - fp->block_offset; - if (available <= 0) break; - } - copy_length = length - bytes_read < available? length - bytes_read : available; - buffer = fp->uncompressed_block; - memcpy(output, buffer + fp->block_offset, copy_length); - fp->block_offset += copy_length; - output += copy_length; - bytes_read += copy_length; - } - if (fp->block_offset == fp->block_length) { - fp->block_address = _bgzf_tell((_bgzf_file_t)fp->fp); - fp->block_offset = fp->block_length = 0; - } - return bytes_read; -} - -int bgzf_flush(BGZF *fp) -{ - assert(fp->open_mode == 'w'); - while (fp->block_offset > 0) { - int block_length; - block_length = deflate_block(fp, fp->block_offset); - if (block_length < 0) return -1; - if (fwrite(fp->compressed_block, 1, block_length, fp->fp) != block_length) { - fp->errcode |= BGZF_ERR_IO; // possibly truncated file - return -1; - } - fp->block_address += block_length; - } - return 0; -} - -int bgzf_flush_try(BGZF *fp, ssize_t size) -{ - if (fp->block_offset + size > BGZF_BLOCK_SIZE) - return bgzf_flush(fp); - return -1; -} - -ssize_t bgzf_write(BGZF *fp, const void *data, ssize_t length) -{ - const uint8_t *input = data; - int block_length = BGZF_BLOCK_SIZE, bytes_written; - assert(fp->open_mode == 'w'); - input = data; - bytes_written = 0; - while (bytes_written < length) { - uint8_t* buffer = fp->uncompressed_block; - int copy_length = block_length - fp->block_offset < length - bytes_written? block_length - fp->block_offset : length - bytes_written; - memcpy(buffer + fp->block_offset, input, copy_length); - fp->block_offset += copy_length; - input += copy_length; - bytes_written += copy_length; - if (fp->block_offset == block_length && bgzf_flush(fp)) break; - } - return bytes_written; -} - -int bgzf_close(BGZF* fp) -{ - int ret, count, block_length; - if (fp == 0) return -1; - if (fp->open_mode == 'w') { - if (bgzf_flush(fp) != 0) return -1; - block_length = deflate_block(fp, 0); // write an empty block - count = fwrite(fp->compressed_block, 1, block_length, fp->fp); - if (fflush(fp->fp) != 0) { - fp->errcode |= BGZF_ERR_IO; - return -1; - } - } - ret = fp->open_mode == 'w'? fclose(fp->fp) : _bgzf_close(fp->fp); - if (ret != 0) return -1; - free(fp->uncompressed_block); - free(fp->compressed_block); - free_cache(fp); - free(fp); - return 0; -} - -void bgzf_set_cache_size(BGZF *fp, int cache_size) -{ - if (fp) fp->cache_size = cache_size; -} - -int bgzf_check_EOF(BGZF *fp) -{ - static uint8_t magic[28] = "\037\213\010\4\0\0\0\0\0\377\6\0\102\103\2\0\033\0\3\0\0\0\0\0\0\0\0\0"; - uint8_t buf[28]; - off_t offset; - offset = _bgzf_tell((_bgzf_file_t)fp->fp); - if (_bgzf_seek(fp->fp, -28, SEEK_END) < 0) return 0; - _bgzf_read(fp->fp, buf, 28); - _bgzf_seek(fp->fp, offset, SEEK_SET); - return (memcmp(magic, buf, 28) == 0)? 1 : 0; -} - -int64_t bgzf_seek(BGZF* fp, int64_t pos, int where) -{ - int block_offset; - int64_t block_address; - - if (fp->open_mode != 'r' || where != SEEK_SET) { - fp->errcode |= BGZF_ERR_MISUSE; - return -1; - } - block_offset = pos & 0xFFFF; - block_address = pos >> 16; - if (_bgzf_seek(fp->fp, block_address, SEEK_SET) < 0) { - fp->errcode |= BGZF_ERR_IO; - return -1; - } - fp->block_length = 0; // indicates current block has not been loaded - fp->block_address = block_address; - fp->block_offset = block_offset; - return 0; -} - -int bgzf_is_bgzf(const char *fn) -{ - uint8_t buf[16]; - int n; - _bgzf_file_t fp; - if ((fp = _bgzf_open(fn, "r")) == 0) return 0; - n = _bgzf_read(fp, buf, 16); - _bgzf_close(fp); - if (n != 16) return 0; - return memcmp(g_magic, buf, 16) == 0? 1 : 0; -} - -int bgzf_getc(BGZF *fp) -{ - int c; - if (fp->block_offset >= fp->block_length) { - if (bgzf_read_block(fp) != 0) return -2; /* error */ - if (fp->block_length == 0) return -1; /* end-of-file */ - } - c = ((unsigned char*)fp->uncompressed_block)[fp->block_offset++]; - if (fp->block_offset == fp->block_length) { - fp->block_address = _bgzf_tell((_bgzf_file_t)fp->fp); - fp->block_offset = 0; - fp->block_length = 0; - } - return c; -} - -#ifndef kroundup32 -#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) -#endif - -int bgzf_getline(BGZF *fp, int delim, kstring_t *str) -{ - int l, state = 0; - unsigned char *buf = (unsigned char*)fp->uncompressed_block; - str->l = 0; - do { - if (fp->block_offset >= fp->block_length) { - if (bgzf_read_block(fp) != 0) { state = -2; break; } - if (fp->block_length == 0) { state = -1; break; } - } - for (l = fp->block_offset; l < fp->block_length && buf[l] != delim; ++l); - if (l < fp->block_length) state = 1; - l -= fp->block_offset; - if (str->l + l + 1 >= str->m) { - str->m = str->l + l + 2; - kroundup32(str->m); - str->s = (char*)realloc(str->s, str->m); - } - memcpy(str->s + str->l, buf + fp->block_offset, l); - str->l += l; - fp->block_offset += l + 1; - if (fp->block_offset >= fp->block_length) { - fp->block_address = _bgzf_tell((_bgzf_file_t)fp->fp); - fp->block_offset = 0; - fp->block_length = 0; - } - } while (state == 0); - if (str->l == 0 && state < 0) return state; - str->s[str->l] = 0; - return str->l; -} diff --git a/src/bgzf.h b/src/bgzf.h deleted file mode 100644 index 1fdf625..0000000 --- a/src/bgzf.h +++ /dev/null @@ -1,193 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Broad Institute / Massachusetts Institute of Technology - 2011 Attractive Chaos - - 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 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -/* The BGZF library was originally written by Bob Handsaker from the Broad - * Institute. It was later improved by the SAMtools developers. */ - -#ifndef __BGZF_H -#define __BGZF_H - -#include -#include -#include - -#define BGZF_BLOCK_SIZE 0x10000 // 64k - -#define BGZF_ERR_ZLIB 1 -#define BGZF_ERR_HEADER 2 -#define BGZF_ERR_IO 4 -#define BGZF_ERR_MISUSE 8 - -typedef struct { - int open_mode:8, compress_level:8, errcode:16; - int cache_size; - int block_length, block_offset; - int64_t block_address; - void *uncompressed_block, *compressed_block; - void *cache; // a pointer to a hash table - void *fp; // actual file handler; FILE* on writing; FILE* or knetFile* on reading -} BGZF; - -#ifndef KSTRING_T -#define KSTRING_T kstring_t -typedef struct __kstring_t { - size_t l, m; - char *s; -} kstring_t; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - /****************** - * Basic routines * - ******************/ - - /** - * Open an existing file descriptor for reading or writing. - * - * @param fd file descriptor - * @param mode mode matching /[rwu0-9]+/: 'r' for reading, 'w' for writing and a digit specifies - * the zlib compression level; if both 'r' and 'w' are present, 'w' is ignored. - * @return BGZF file handler; 0 on error - */ - BGZF* bgzf_dopen(int fd, const char *mode); - - /** - * Open the specified file for reading or writing. - */ - BGZF* bgzf_open(const char* path, const char *mode); - - /** - * Close the BGZF and free all associated resources. - * - * @param fp BGZF file handler - * @return 0 on success and -1 on error - */ - int bgzf_close(BGZF *fp); - - /** - * Read up to _length_ bytes from the file storing into _data_. - * - * @param fp BGZF file handler - * @param data data array to read into - * @param length size of data to read - * @return number of bytes actually read; 0 on end-of-file and -1 on error - */ - ssize_t bgzf_read(BGZF *fp, void *data, ssize_t length); - - /** - * Write _length_ bytes from _data_ to the file. - * - * @param fp BGZF file handler - * @param data data array to write - * @param length size of data to write - * @return number of bytes actually written; -1 on error - */ - ssize_t bgzf_write(BGZF *fp, const void *data, ssize_t length); - - /** - * Write the data in the buffer to the file. - */ - int bgzf_flush(BGZF *fp); - - /** - * Return a virtual file pointer to the current location in the file. - * No interpetation of the value should be made, other than a subsequent - * call to bgzf_seek can be used to position the file at the same point. - * Return value is non-negative on success. - */ - #define bgzf_tell(fp) ((fp->block_address << 16) | (fp->block_offset & 0xFFFF)) - - /** - * Set the file to read from the location specified by _pos_. - * - * @param fp BGZF file handler - * @param pos virtual file offset returned by bgzf_tell() - * @param whence must be SEEK_SET - * @return 0 on success and -1 on error - */ - int64_t bgzf_seek(BGZF *fp, int64_t pos, int whence); - - /** - * Check if the BGZF end-of-file (EOF) marker is present - * - * @param fp BGZF file handler opened for reading - * @return 1 if EOF is present; 0 if not or on I/O error - */ - int bgzf_check_EOF(BGZF *fp); - - /** - * Check if a file is in the BGZF format - * - * @param fn file name - * @return 1 if _fn_ is BGZF; 0 if not or on I/O error - */ - int bgzf_is_bgzf(const char *fn); - - /********************* - * Advanced routines * - *********************/ - - /** - * Set the cache size. Only effective when compiled with -DBGZF_CACHE. - * - * @param fp BGZF file handler - * @param size size of cache in bytes; 0 to disable caching (default) - */ - void bgzf_set_cache_size(BGZF *fp, int size); - - /** - * Flush the file if the remaining buffer size is smaller than _size_ - */ - int bgzf_flush_try(BGZF *fp, ssize_t size); - - /** - * Read one byte from a BGZF file. It is faster than bgzf_read() - * @param fp BGZF file handler - * @return byte read; -1 on end-of-file or error - */ - int bgzf_getc(BGZF *fp); - - /** - * Read one line from a BGZF file. It is faster than bgzf_getc() - * - * @param fp BGZF file handler - * @param delim delimitor - * @param str string to write to; must be initialized - * @return length of the string; 0 on end-of-file; negative on error - */ - int bgzf_getline(BGZF *fp, int delim, kstring_t *str); - - /** - * Read the next BGZF block. - */ - int bgzf_read_block(BGZF *fp); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/bgzip.c b/src/bgzip.c deleted file mode 100644 index 5429a22..0000000 --- a/src/bgzip.c +++ /dev/null @@ -1,206 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Broad Institute / Massachusetts Institute of Technology - - 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 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "bgzf.h" - -static const int WINDOW_SIZE = 64 * 1024; - -static int bgzip_main_usage() -{ - fprintf(stderr, "\n"); - fprintf(stderr, "Usage: bgzip [options] [file] ...\n\n"); - fprintf(stderr, "Options: -c write on standard output, keep original files unchanged\n"); - fprintf(stderr, " -d decompress\n"); - fprintf(stderr, " -f overwrite files without asking\n"); - fprintf(stderr, " -b INT decompress at virtual file pointer INT\n"); - fprintf(stderr, " -s INT decompress INT bytes in the uncompressed file\n"); - fprintf(stderr, " -h give this help\n"); - fprintf(stderr, "\n"); - return 1; -} - -static int write_open(const char *fn, int is_forced) -{ - int fd = -1; - char c; - if (!is_forced) { - if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0666)) < 0 && errno == EEXIST) { - fprintf(stderr, "[bgzip] %s already exists; do you wish to overwrite (y or n)? ", fn); - scanf("%c", &c); - if (c != 'Y' && c != 'y') { - fprintf(stderr, "[bgzip] not overwritten\n"); - exit(1); - } - } - } - if (fd < 0) { - if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { - fprintf(stderr, "[bgzip] %s: Fail to write\n", fn); - exit(1); - } - } - return fd; -} - -static void fail(BGZF* fp) -{ - fprintf(stderr, "Error: %d\n", fp->errcode); - exit(1); -} - -int main(int argc, char **argv) -{ - int c, compress, pstdout, is_forced; - BGZF *fp; - void *buffer; - long start, end, size; - - compress = 1; pstdout = 0; start = 0; size = -1; end = -1; is_forced = 0; - while((c = getopt(argc, argv, "cdhfb:s:")) >= 0){ - switch(c){ - case 'h': return bgzip_main_usage(); - case 'd': compress = 0; break; - case 'c': pstdout = 1; break; - case 'b': start = atol(optarg); break; - case 's': size = atol(optarg); break; - case 'f': is_forced = 1; break; - } - } - if (size >= 0) end = start + size; - if (end >= 0 && end < start) { - fprintf(stderr, "[bgzip] Illegal region: [%ld, %ld]\n", start, end); - return 1; - } - if (compress == 1) { - struct stat sbuf; - int f_src = fileno(stdin); - int f_dst = fileno(stdout); - - if ( argc>optind ) - { - if ( stat(argv[optind],&sbuf)<0 ) - { - fprintf(stderr, "[bgzip] %s: %s\n", strerror(errno), argv[optind]); - return 1; - } - - if ((f_src = open(argv[optind], O_RDONLY)) < 0) { - fprintf(stderr, "[bgzip] %s: %s\n", strerror(errno), argv[optind]); - return 1; - } - - if (pstdout) - f_dst = fileno(stdout); - else - { - char *name = malloc(strlen(argv[optind]) + 5); - strcpy(name, argv[optind]); - strcat(name, ".gz"); - f_dst = write_open(name, is_forced); - if (f_dst < 0) return 1; - free(name); - } - } - else if (!pstdout && isatty(fileno((FILE *)stdout)) ) - return bgzip_main_usage(); - - fp = bgzf_dopen(f_dst, "w"); - buffer = malloc(WINDOW_SIZE); - while ((c = read(f_src, buffer, WINDOW_SIZE)) > 0) - if (bgzf_write(fp, buffer, c) < 0) fail(fp); - // f_dst will be closed here - if (bgzf_close(fp) < 0) fail(fp); - if (argc > optind && !pstdout) unlink(argv[optind]); - free(buffer); - close(f_src); - return 0; - } else { - struct stat sbuf; - int f_dst; - - if ( argc>optind ) - { - if ( stat(argv[optind],&sbuf)<0 ) - { - fprintf(stderr, "[bgzip] %s: %s\n", strerror(errno), argv[optind]); - return 1; - } - char *name; - int len = strlen(argv[optind]); - if ( strcmp(argv[optind]+len-3,".gz") ) - { - fprintf(stderr, "[bgzip] %s: unknown suffix -- ignored\n", argv[optind]); - return 1; - } - fp = bgzf_open(argv[optind], "r"); - if (fp == NULL) { - fprintf(stderr, "[bgzip] Could not open file: %s\n", argv[optind]); - return 1; - } - - if (pstdout) { - f_dst = fileno(stdout); - } - else { - name = strdup(argv[optind]); - name[strlen(name) - 3] = '\0'; - f_dst = write_open(name, is_forced); - free(name); - } - } - else if (!pstdout && isatty(fileno((FILE *)stdin)) ) - return bgzip_main_usage(); - else - { - f_dst = fileno(stdout); - fp = bgzf_dopen(fileno(stdin), "r"); - if (fp == NULL) { - fprintf(stderr, "[bgzip] Could not read from stdin: %s\n", strerror(errno)); - return 1; - } - } - buffer = malloc(WINDOW_SIZE); - if (bgzf_seek(fp, start, SEEK_SET) < 0) fail(fp); - while (1) { - if (end < 0) c = bgzf_read(fp, buffer, WINDOW_SIZE); - else c = bgzf_read(fp, buffer, (end - start > WINDOW_SIZE)? WINDOW_SIZE:(end - start)); - if (c == 0) break; - if (c < 0) fail(fp); - start += c; - write(f_dst, buffer, c); - if (end >= 0 && start >= end) break; - } - free(buffer); - if (bgzf_close(fp) < 0) fail(fp); - if (!pstdout) unlink(argv[optind]); - return 0; - } -} diff --git a/src/boolExprParser.h b/src/boolExprParser.h deleted file mode 100644 index b246574..0000000 --- a/src/boolExprParser.h +++ /dev/null @@ -1,320 +0,0 @@ -#ifndef __BOOL_EXPR_PARSER_H -#define __BOOL_EXPR_PARSER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define NUM_OP 11 - -class boolExprException : public std::exception { -public: - virtual const char* what() const throw() { - return "boolExprException was thrown"; - } -} beException; - -// boolean expression parser accepting the following -// EXAMPLE RULE : -// ( key1 && ( ! key2 ) ) || ( key3 >= -2 ) && ( key4 < 5 ) -// EXAMPLE INPUT : -// key1;key2;key3=3.54;key4=2 -class boolExprParser { - public: - // available operators - enum BOOLOP { LBR = -1, RBR = -2, AND = -3, OR = -4, NOT = -5, GT = -6, GTE = -7, LT = -8, LTE = -9, EQ = -10, NE = -11 }; - static const char* RULESTR[NUM_OP]; - static double DBL_NAN; - - std::vector rules; // BOOLOP or index for keys - std::vector keys; // substring keyword - std::vector lkeys; // length of keyword - std::vector mkeys; // match status of keyword - std::vector opkeys; // operator of key - std::vector vkeys; // value to be compared - char* pEnd; - - // example expression : ( ANNO=nonsynynmous:LDLR || ANNO=stopgain:LDLR ) && INDEL - // construct boolean parser - boolExprParser(const char* s) { - if ( s == NULL ) return; - // srand(std::time(0)); // for debugging - - std::stringstream ss(s); - std::string tok; - for(int i=0; ss >> tok; ++i ) { - // if known operator is observed, convert them as 'rules' - if ( tok == "(" ) { rules.push_back(LBR); } - else if ( tok == ")" ) { rules.push_back(RBR); } - else if ( tok == "&&" ) { rules.push_back(AND); } - else if ( tok == "||" ) { rules.push_back(OR); } - else if ( tok == "!" ) { rules.push_back(NOT); } - else if ( tok == ">" ) { - if ( opkeys.back() < 0 ) throw beException; - opkeys.back() = GT; - } - else if ( tok == ">=" ) { - if ( opkeys.back() < 0 ) throw beException; - opkeys.back() = GTE; - } - else if ( tok == "<" ) { - if ( opkeys.back() < 0 ) throw beException; - opkeys.back() = LT; - } - else if ( tok == "<=" ) { - if ( opkeys.back() < 0 ) throw beException; - opkeys.back() = LTE; - } - else if ( tok == "==" ) { - if ( opkeys.back() < 0 ) throw beException; - opkeys.back() = EQ; - } - else if ( tok == "!=" ) { - if ( opkeys.back() < 0 ) throw beException; - opkeys.back() = NE; - } - else { - if ( !opkeys.empty() && opkeys.back() < 0 && rules.back() >= 0 ) { - double dtok = parse_numeric(tok); - if ( isnan(dtok) ) { - fprintf(stderr,"ERROR: Cannot parse %s\n",tok.c_str()); - throw beException; - } - vkeys.back() = dtok; - } - else { - rules.push_back((int)keys.size()); - keys.push_back(tok); - lkeys.push_back((int)tok.size()); - mkeys.push_back(0); - opkeys.push_back(0); - vkeys.push_back(DBL_NAN); - } - - // warn if operator is not delimited by whitespace - for(int i=0; i < NUM_OP; ++i) { - if (tok.find(RULESTR[i]) != std::string::npos) { - std::cerr << "WARNING: Operator " << RULESTR[i] << " was found in the token " << tok << ". All operators must be delimited with whitespace" << std::endl; - } - } - //ans.push_back((rand()/(RAND_MAX+1.) < 0.5) ? true : false); // for debugging - } - //std::cerr << "#" << i << "\t" << rules[i] << "\t" << tok << std::endl; - } - } - - // print the current rule and values - void print(std::ostream& o, bool runeval = true) { - int n = (int)rules.size(); - o << "RULE:"; - for(int i=0; i < n; ++i) { - o << "\t"; - if ( rules[i] < 0 ) { - o << (const char*)RULESTR[0-(int)rules[i]-1]; - } - else { - o << keys[rules[i]]; - } - } - o << std::endl; - - o << "VALUE:"; - for(int i=0; i < n; ++i) { - o << "\t"; - if ( rules[i] < 0 ) { - o << RULESTR[0-rules[i]-1]; - } - else { - o << (mkeys[rules[i]] < 0 ? "TRUE" : "FALSE"); - } - } - if ( runeval ) o << "\t=\t" << eval(); - o << std::endl; - } - - static void reduce(std::vector& stack, int r) { - while ( (! stack.empty()) && ( stack.back() != LBR ) ) { - if ( stack.back() == NOT ) { - stack.pop_back(); - r = 1-r; - } - else { - int op = stack.back(); stack.pop_back(); // retrieve the operator - int l = stack.back(); stack.pop_back(); // left operand - if ( l < 0 ) { - std::cerr << "Error in the rule parsing : " << std::endl; - //print(std::cerr,false); - abort(); - } - else { - if ( op == AND ) { - //stack.push_back((r && l) ? 1 : 0); - r = ((r && l) ? 1 : 0); - } - else if ( op == OR ) { - //stack.push_back((r || l) ? 1 : 0); - r = ((r || l) ? 1 : 0); - //std::cerr << "[ foo " << l << " " << r << " " << stack.back() << " ]" << std::endl; - } - else { - std::cerr << "Error in the rule parsing : " << std::endl; - //print(std::cerr,false); - abort(); - } - } - } - } - stack.push_back(r); - } - - // parse a rule string - bool parse(const char* s, int n = -1) { - // if no rule is specified, default is TRUE - if ( rules.empty() ) return true; - - int ns = (int)keys.size(); - int t; - for(t=0; t < ns; ++t) { - mkeys[t] = 0; - } - char* p = (char*)s; - char* nch = ( n < 0 ) ? NULL : p + n; - int nm = 0; - double strd; - while( nch ? (p < nch) : (*p & 0xf0) ) { - for(t=0; t < ns; ++t) { - if ( mkeys[t] < 0 ) { // if already matches, do nothing - } - else if ( *p == keys[t][mkeys[t]] ) { // if being matched, keep going on - ++mkeys[t]; - if ( mkeys[t] == lkeys[t] ) { // substring match happened - if ( opkeys[t] < 0 ) { // if comparison operator is related - // check if the next character is '=' - if ( p[1] == '=' ) { - // parse the value - strd = parse_numeric(p+2); - switch(opkeys[t]) { - case GT: - if ( strd > vkeys[t] ) { mkeys[t] = -1; ++nm; } - else { mkeys[t] = 0; } - break; - case GTE: - if ( strd >= vkeys[t] ) { mkeys[t] = -1; ++nm; } - else { mkeys[t] = 0; } - break; - case LT: - if ( strd < vkeys[t] ) { mkeys[t] = -1; ++nm; } - else { mkeys[t] = 0; } - break; - case LTE: - if ( strd <= vkeys[t] ) { mkeys[t] = -1; ++nm; } - else { mkeys[t] = 0; } - break; - case EQ: - if ( strd == vkeys[t] ) { mkeys[t] = -1; ++nm; } - else { mkeys[t] = 0; } - break; - case NE: - if ( strd != vkeys[t] ) { mkeys[t] = -1; ++nm; } - else { mkeys[t] = 0; } - break; - default: - fprintf(stderr,"Cannot recognize operator %d\n",opkeys[t]); - throw beException; - } - } - else { - mkeys[t] == 0; // declare mismatch - } - } - else { - mkeys[t] = -1; // the substring was found - ++nm; - } - if ( nm == ns ) break; // if all matches - } - } - else { - mkeys[t] = 0; - } - } - ++p; - } - pEnd = p; - return eval(); - } - - // evaluate the boolean expression - bool eval() { - std::vector stack; - for(int i=0; i < (int)rules.size(); ++i) { - //fprintf(stderr,"**** %d %d %s\n",i,rules[i],subs[i].c_str()); - - switch(rules[i]) { - case LBR: - case AND: - case OR: - case NOT: - stack.push_back(rules[i]); // simply insert the rule to stack before the next operand comes in - break; - case RBR: // search for the matching brace - if ( stack.size() < 2 ) { - std::cerr << "Error in the rule parsing : empty between braces" << std::endl; - print(std::cerr,false); - abort(); - } - else { - int v = stack.back(); stack.pop_back(); // value to return - int lbr = stack.back(); stack.pop_back(); // should match LBR - if ( ( lbr != LBR ) || ( v < 0 ) ) { - std::cerr << "Error in the rule parsing : " << std::endl; - print(std::cerr,false); - abort(); - } - reduce(stack, v); - } - break; - default: // resolve the rule - int r = ( mkeys[rules[i]] < 0 ? 1 : 0 ); - reduce(stack, r); - } - } - if ( stack.size() != 1 ) { - std::cerr << "Error in the rule parsing : " << std::endl; - print(std::cerr,false); - abort(); - } - else { - return ( stack.back() > 0 ? true : false ); - } - } - - static double parse_numeric(const std::string& str) { - return parse_numeric(str.c_str(), (int)str.size()); - } - - static double parse_numeric(const char* s, int n) { - char* pEnd; - double d = strtod(s,&pEnd); - if ( pEnd-s == n ) { return d; } - else { return DBL_NAN; } - } - - static double parse_numeric(const char* s) { - char* pEnd; - double d = strtod(s,&pEnd); - if ( pEnd-s > 0 ) { return d; } - else { return DBL_NAN; } - } -}; - -const char* boolExprParser::RULESTR[NUM_OP] = { "(", ")", "&&", "||", "!", ">", ">=", "<", "<=", "==", "!=" }; -double boolExprParser::DBL_NAN = sqrt(-1.); - -#endif // __BOOL_EXPR_PARSER_H diff --git a/src/boolParser.h b/src/boolParser.h deleted file mode 100644 index 9929e17..0000000 --- a/src/boolParser.h +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef __BOOL_PARSER_H -#define __BOOL_PARSER_H - -#include -#include -#include -#include -#include - -#define NUM_OP 5 - -// boolean parser accepting the following C-style expressions -// EVERY RULE has to written with whitespace -// ( expr1 && ( ! exprs2 ) ) || ( exprs3 ) ) && exprs4 -class boolParser { - public: - std::vector subs; - std::vector subl; - std::vector subm; - //std::vector ans; - std::vector rules; // -1 : ( , -2 : ), -3 : &&, -4 : ||, -5 : ! - - enum RULE { LBR = -1, RBR = -2, AND = -3, OR = -4, NOT = -5 }; - static const char* RULESTR[NUM_OP]; //= { "(", ")", "&&", "||", "!" }; - - // example expression : ( ANNO=nonsynynmous:LDLR || ANNO=stopgain:LDLR ) && INDEL - boolParser() {} - - // construct boolean parser - boolParser(const char* s) { - if ( s == NULL ) return; - // srand(std::time(0)); // for debugging - - std::stringstream ss(s); - std::string tok; - for(int i=0; ss >> tok; ++i ) { - if ( tok == "(" ) { - rules.push_back(LBR); - } - else if ( tok == ")" ) { - rules.push_back(RBR); - } - else if ( tok == "&&" ) { - rules.push_back(AND); - } - else if ( tok == "||" ) { - rules.push_back(OR); - } - else if ( tok == "!" ) { - rules.push_back(NOT); - } - else { - // check whether the operator is not separated by whitespace - rules.push_back((int)subs.size()); - subs.push_back(tok); - subl.push_back((int)tok.size()); - subm.push_back(0); - //ans.push_back(false); - - for(int i=0; i < NUM_OP; ++i) { - if (tok.find(RULESTR[i]) != std::string::npos) { - std::cerr << "WARNING: Operator " << RULESTR[i] << " was found in the token " << tok << ". All operators must be delimited with whitespace" << std::endl; - } - } - //ans.push_back((rand()/(RAND_MAX+1.) < 0.5) ? true : false); // for debugging - } - //std::cerr << "#" << i << "\t" << rules[i] << "\t" << tok << std::endl; - } - } - - // print the current rule and values - void print(std::ostream& o, bool runeval = true) { - int n = (int)rules.size(); - o << "RULE:"; - for(int i=0; i < n; ++i) { - o << "\t"; - if ( rules[i] < 0 ) { - o << (const char*)RULESTR[0-(int)rules[i]-1]; - } - else { - o << subs[rules[i]]; - } - } - o << std::endl; - - o << "VALUE:"; - for(int i=0; i < n; ++i) { - o << "\t"; - if ( rules[i] < 0 ) { - o << RULESTR[0-rules[i]-1]; - } - else { - o << (subm[rules[i]] < 0 ? "TRUE" : "FALSE"); - } - } - if ( runeval ) o << "\t=\t" << eval(); - o << std::endl; - } - - static void reduce(std::vector& stack, int r) { - while ( (! stack.empty()) && ( stack.back() != LBR ) ) { - if ( stack.back() == NOT ) { - stack.pop_back(); - r = 1-r; - } - else { - int op = stack.back(); stack.pop_back(); // retrieve the operator - int l = stack.back(); stack.pop_back(); // left operand - if ( l < 0 ) { - std::cerr << "Error in the rule parsing : " << std::endl; - //print(std::cerr,false); - abort(); - } - else { - if ( op == AND ) { - //stack.push_back((r && l) ? 1 : 0); - r = ((r && l) ? 1 : 0); - } - else if ( op == OR ) { - //stack.push_back((r || l) ? 1 : 0); - r = ((r || l) ? 1 : 0); - //std::cerr << "[ foo " << l << " " << r << " " << stack.back() << " ]" << std::endl; - } - else { - std::cerr << "Error in the rule parsing : " << std::endl; - //print(std::cerr,false); - abort(); - } - } - } - } - stack.push_back(r); - } - - bool parse(const char* s) { - //print(std::cout,true); - - if ( rules.empty() ) return true; - - int ns = (int)subs.size(); - int t; - for(t=0; t < ns; ++t) { - subm[t] = 0; - } - char* p = (char*)s; - int nm = 0; - while( *p != '\0' ) { - for(t=0; t < ns; ++t) { - if ( subm[t] < 0 ) { - // do nothing - } - else if ( *p == subs[t][subm[t]] ) { - ++subm[t]; - if ( subm[t] == subl[t] ) { - subm[t] = -1; // the substring was found - ++nm; - if ( nm == ns ) break; // if all matches - } - } - else { - subm[t] = 0; - } - } - ++p; - } - return eval(); - } - - bool parse(const char* s, int n) { - //print(std::cout,true); - - if ( rules.empty() ) return true; - - int ns = (int)subs.size(); - int t; - for(t=0; t < ns; ++t) { - subm[t] = 0; - } - char* p = (char*)s; - char* nch = p + n; - int nm = 0; - while( p < nch ) { - for(t=0; t < ns; ++t) { - if ( subm[t] < 0 ) { - // do nothing - } - else if ( *p == subs[t][subm[t]] ) { - ++subm[t]; - if ( subm[t] == subl[t] ) { - subm[t] = -1; // the substring was found - ++nm; - if ( nm == ns ) break; - } - } - else { - subm[t] = 0; - } - } - ++p; - } - return eval(); - } - - // evaluate the boolean expression - bool eval() { - std::vector stack; - for(int i=0; i < (int)rules.size(); ++i) { - //fprintf(stderr,"**** %d %d %s\n",i,rules[i],subs[i].c_str()); - - switch(rules[i]) { - case LBR: - case AND: - case OR: - case NOT: - stack.push_back(rules[i]); // simply insert the rule to stack before the next operand comes in - break; - case RBR: // search for the matching brace - if ( stack.size() < 2 ) { - std::cerr << "Error in the rule parsing : empty between braces" << std::endl; - print(std::cerr,false); - abort(); - } - else { - int v = stack.back(); stack.pop_back(); // value to return - int lbr = stack.back(); stack.pop_back(); // should match LBR - if ( ( lbr != LBR ) || ( v < 0 ) ) { - std::cerr << "Error in the rule parsing : " << std::endl; - print(std::cerr,false); - abort(); - } - reduce(stack, v); - } - break; - default: // resolve the rule - int r = ( subm[rules[i]] < 0 ? 1 : 0 ); - reduce(stack, r); - } - } - if ( stack.size() != 1 ) { - std::cerr << "Error in the rule parsing : " << std::endl; - print(std::cerr,false); - abort(); - } - else { - return ( stack.back() > 0 ? true : false ); - } - } -}; - -const char* boolParser::RULESTR[NUM_OP] = { "(", ")", "&&", "||", "!" }; - -#endif // __BOOL_PARSER_H diff --git a/src/cdsStat.h b/src/cdsStat.h deleted file mode 100644 index 5043dea..0000000 --- a/src/cdsStat.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef __CDS_STAT_H__ -#define __CDS_STAT_H__ - -#include -#include -#include - -#include "codonHelper.h" -#include "Error.h" - -class cdsKey { -public: - int scorebin; - uint8_t cpg; - uint8_t deg; - uint8_t pos; - uint8_t aa; - - cdsKey(int _scorebin, int _cpg, int _deg, int _pos, int _aa) { - scorebin = _scorebin; - cpg = (_cpg == -1) ? 255 : (uint8_t)_cpg; - deg = (_deg == -1) ? 255 : (uint8_t)_deg; - pos = (_pos == -1) ? 255 : (uint8_t)_pos; - aa = (_aa == -1) ? 255 : (uint8_t)_aa; - } - - bool operator< (const cdsKey& x) const { - if ( scorebin == x.scorebin ) { - if ( cpg == x.cpg ) { - if ( deg == x.deg ) { - if ( pos == x.pos ) { - return ( aa < x.aa ); - } - else return (pos < x.pos); - } - else return (deg < x.deg); - } - else return (cpg < x.cpg); - } - else return (scorebin < x.scorebin); - } -}; - -class cdsStat { - public: - static const double NAN_DBL; - - int nBase; - int nPass; - int nInds; - double sumCons; - double sqCons; - std::vector etas; - std::vector cnts; - std::vector coms; - - cdsStat() : nBase(0), nPass(0), nInds(0), sumCons(0), sqCons(0) {} - void setN(int n) { - nInds = n; - etas.clear(); - etas.resize(8*n,0); - cnts.resize(4,0); - coms.resize(4,0); - } - - void addBase(bool pass, float score) { - ++nBase; - if ( pass ) { - ++nPass; - sumCons += score; - sqCons += (score*score); - } - } - - void addVariant(uint8_t altAllele, int altCount) { - //notice("addVariant(%d,%d), ++etas[%d];",altAllele,altCount,(altAllele-1) * 2 * nInds + (altCount-1)); - if ( altCount > 0 ) { - if ( ( altAllele > 0 ) && ( altAllele < 5 ) ) { - ++etas[(altAllele-1) * (2 * nInds) + (altCount-1)]; - if ( altCount < 2*nInds ) ++cnts[(altAllele-1)]; - if ( ( altCount >= 0.005*2*nInds ) && ( altCount <= 0.995*2*nInds ) ) ++coms[(altAllele-1)]; // AF>.5% - } - else { - error("altAllele must be between 1 and 4"); - } - } - } - - // SE is estimated with one pseudo-count - // mean = n/N - // SD = sqrt((n+1)/(N+1)*((N-n)/(N+1))/(N+1)) - std::pair allDensity(int altAllele = 0) { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { - int n = (altAllele == 0) ? (cnts[0]+cnts[1]+cnts[2]+cnts[3]) : cnts[(altAllele-1)]; - double p = (double)n / (double)nPass; - double sd = sqrt((n+1.) * (nPass-n) / (nPass+1.))/(nPass+1.); - return std::pair (p,sd); - } - } - - // SE is estimated with one pseudo-count - // mean = n/N - // SD = sqrt((n+1)/(N+1)*((N-n)/(N+1))/(N+1)) - std::pair comDensity(int altAllele = 0) { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { - int n = (altAllele == 0) ? (coms[0]+coms[1]+coms[2]+coms[3]) : coms[(altAllele-1)]; - double p = (double)n / (double)nPass; - double sd = sqrt((n+1.) * (nPass-n) / (nPass+1.))/(nPass+1.); - return std::pair (p,sd); - } - } - - std::pair avgCons() { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { return std::pair ( sumCons / nPass, sqrt( (sqCons/nPass - sumCons*sumCons/nPass/nPass) / nPass ) ); } - } - - std::pair theta(int altAllele = 0) { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { - double sum = 0; - //double altMono = etas[0*2*nInds+2*nInds-1]+etas[1*2*nInds+2*nInds-1]+etas[2*2*nInds+2*nInds-1]+etas[3*2*nInds+2*nInds-1]; - for(int i=1; i < nInds*2; ++i) { - sum += ((double)i*(nInds+nInds-i)*(double)(altAllele == 0 ? (etas[0*(2*nInds)+i-1]+etas[1*(2*nInds)+i-1]+etas[2*(2*nInds)+i-1]+etas[3*(2*nInds)+i-1]) : etas[(altAllele-1)*(2*nInds)+i-1])); - } - //notice("sum=%lf\n",sum); - double theta = (sum == 0) ? ((nInds+nInds-1.)*(1./(2.0*nInds*(2.0*nInds-1.0)))/(double)nPass) : (sum * (2./(2.0*nInds*(2.0*nInds-1.0))/(double)nPass) ); - double seTheta = sqrt( (2.0*nInds+1.0)/(6.0*nInds-3.0)*theta + 2.0*(4.0*nInds*nInds+2.0*nInds+3.)/(18.0*nInds*(2.0*nInds-1.0))*theta*theta ); - return std::pair (theta,seTheta); - } - } -}; - -const double cdsStat::NAN_DBL = sqrt(-1.); // assign double NAN value - -#endif diff --git a/src/codonHelper.cpp b/src/codonHelper.cpp deleted file mode 100644 index 85d7693..0000000 --- a/src/codonHelper.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#include "codonHelper.h" - -codonHelper codonHelp; - - - diff --git a/src/codonHelper.h b/src/codonHelper.h deleted file mode 100644 index 007e74f..0000000 --- a/src/codonHelper.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#ifndef __CODONHELPER_H__ -#define __CODONHELPER_H__ - -#include -#include -#include -#include - -//#include - -class codonHelper -{ - public: - std::map cAMap; // 3-letters to AA char - std::vector nAMap; // 0-63 to AA char - std::map > cDMap; // 3 letters to degeneracy - std::vector nDMap; // codon (0-63) * npos (0-2) to degeneracy - std::vector n2c; - std::map c2n; - - char b2n[5]; - int n2b[256]; - - char getVarAA(const char* codon, int pos, char varnt) { - std::string c(codon); - c[pos] = varnt; - return cAMap[c]; - } - - uint8_t getDegeneracy(char aa, char aaA, char aaC, char aaG, char aaT) { - uint8_t ret = 0; - if ( aa == aaA ) ++ret; - if ( aa == aaC ) ++ret; - if ( aa == aaG ) ++ret; - if ( aa == aaT ) ++ret; - return ret; - } - - codonHelper() { - // build string codon table - cAMap["TTT"] = 'F'; - cAMap["TTC"] = 'F'; - cAMap["TCT"] = 'S'; - cAMap["TCC"] = 'S'; - cAMap["TAT"] = 'Y'; - cAMap["TAC"] = 'Y'; - cAMap["TGT"] = 'C'; - cAMap["TGC"] = 'C'; - cAMap["TTA"] = 'L'; - cAMap["TCA"] = 'S'; - cAMap["TAA"] = '*'; - cAMap["TGA"] = '*'; - cAMap["TTG"] = 'L'; - cAMap["TCG"] = 'S'; - cAMap["TAG"] = '*'; - cAMap["TGG"] = 'W'; - cAMap["CTT"] = 'L'; - cAMap["CTC"] = 'L'; - cAMap["CCT"] = 'P'; - cAMap["CCC"] = 'P'; - cAMap["CAT"] = 'H'; - cAMap["CAC"] = 'H'; - cAMap["CGT"] = 'R'; - cAMap["CGC"] = 'R'; - cAMap["CTA"] = 'L'; - cAMap["CTG"] = 'L'; - cAMap["CCA"] = 'P'; - cAMap["CCG"] = 'P'; - cAMap["CAA"] = 'Q'; - cAMap["CAG"] = 'Q'; - cAMap["CGA"] = 'R'; - cAMap["CGG"] = 'R'; - cAMap["ATT"] = 'I'; - cAMap["ATC"] = 'I'; - cAMap["ACT"] = 'T'; - cAMap["ACC"] = 'T'; - cAMap["AAT"] = 'N'; - cAMap["AAC"] = 'N'; - cAMap["AGT"] = 'S'; - cAMap["AGC"] = 'S'; - cAMap["ATA"] = 'I'; - cAMap["ACA"] = 'T'; - cAMap["AAA"] = 'K'; - cAMap["AGA"] = 'R'; - cAMap["ATG"] = 'M'; - cAMap["ACG"] = 'T'; - cAMap["AAG"] = 'K'; - cAMap["AGG"] = 'R'; - cAMap["GTT"] = 'V'; - cAMap["GTC"] = 'V'; - cAMap["GCT"] = 'A'; - cAMap["GCC"] = 'A'; - cAMap["GAT"] = 'D'; - cAMap["GAC"] = 'D'; - cAMap["GGT"] = 'G'; - cAMap["GGC"] = 'G'; - cAMap["GTA"] = 'V'; - cAMap["GTG"] = 'V'; - cAMap["GCA"] = 'A'; - cAMap["GCG"] = 'A'; - cAMap["GAA"] = 'E'; - cAMap["GAG"] = 'E'; - cAMap["GGA"] = 'G'; - cAMap["GGG"] = 'G'; - - b2n[0] = 'A'; b2n[1] = 'C'; b2n[2] = 'G'; b2n[3] = 'T'; b2n[4] = 'N'; - for(int i=0; i < 256; ++i) { - n2b[i] = 4; - } - for(int i=0; i < 4; ++i) { - n2b[(int)b2n[i]] = i; - } - char codon[4] = {'N','N','N','\0'}; - - nAMap.resize(64,'\0'); - nDMap.resize(64*3,'\0'); - n2c.resize(64); - for(int i=0; i < 4; ++i) { - codon[0] = b2n[i]; - for(int j=0; j < 4; ++j) { - codon[1] = b2n[j]; - for(int k=0; k < 4; ++k) { - codon[2] = b2n[k]; - int nCodon = i*16+j*4+k; - nAMap[nCodon] = cAMap[codon]; // build integer codon table - n2c[nCodon] = codon; // convert integer codons to string - c2n[codon] = nCodon; // convert string codons to integer - } - } - } - - for(int i=0; i < 4; ++i) { - codon[0] = b2n[i]; - for(int j=0; j < 4; ++j) { - codon[1] = b2n[j]; - for(int k=0; k < 4; ++k) { - codon[2] = b2n[k]; - int nCodon = i*16+j*4+k; - cDMap[codon].resize(3); // build degeneracy table - // check the first position; - cDMap[codon][0] = nDMap[nCodon*3+0] = getDegeneracy(nAMap[nCodon],nAMap[0*16+j*4+k],nAMap[1*16+j*4+k],nAMap[2*16+j*4+k],nAMap[3*16+j*4+k]); - cDMap[codon][1] = nDMap[nCodon*3+1] = getDegeneracy(nAMap[nCodon],nAMap[i*16+0*4+k],nAMap[i*16+1*4+k],nAMap[i*16+2*4+k],nAMap[i*16+3*4+k]); - cDMap[codon][2] = nDMap[nCodon*3+2] = getDegeneracy(nAMap[nCodon],nAMap[i*16+j*4+0],nAMap[i*16+j*4+1],nAMap[i*16+j*4+2],nAMap[i*16+j*4+3]); - } - } - } - } -}; - -extern codonHelper codonHelp; - -#endif diff --git a/src/fVcf.h b/src/fVcf.h deleted file mode 100644 index da4a8bd..0000000 --- a/src/fVcf.h +++ /dev/null @@ -1,1482 +0,0 @@ -#ifndef __TABIXED_VCF_H -#define __TAXBIED_VCF_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pFile.h" -#include "wFile.h" -#include "Error.h" -#include "boolParser.h" -#include "PhredHelper.h" - -class fVcf { -public: - // member variables - int nInds; // number of individuals subselected - int nMarkers; // number of markers - std::string key; // key string - boolParser parser; // per-marker pattern matching parser - bool passOnly; // filtering option - bool hardGenotype; // hard/soft genotypes - pFile tf; // file handle - std::vector inds; // individual IDs - std::vector markers; // marker IDs - std::vector chroms; // chromosome names - std::vector pos1s; // marker positions - std::vector refs; // reference alleles - std::vector alts; // non-reference alleles - std::vector genos; // GT : genotypes - std::vector phases; // haplotype phases unphased/noinfo/0|1/1|0 - std::vector GPs; // GP : genotype probabilities - std::vector PLs; // GL or PL : genotype likelihoods - //std::vector depths; // GD or DP : genotype depth - std::vector numAlleles; // AN - std::vector sumAlleles; // AC - std::vector sumsqAlleles; // squared sum of AC - std::vector icols; // individual indices to subset - std::vector AFs; // allele frequency estimates - std::vector< std::vector > covs; - - std::set markerSet; - std::string groupID, groupChrom; - int groupBeg, groupEnd; - std::vector headers; - - bool glFlag; - bool phredFlag; - bool gpFlag; - std::vector p2e; - - static const float NAN_FLT; - static const double NAN_DBL; - - static int parseMarkerID(const char* markerID, std::string& chrom, std::string& beg, std::string& end, std::string& name, std::string& anno) { - const char* pp = markerID; - const char* pn = markerID; - size_t found; - int step = 0; // 0 : CHROM[:], 1 : BEG [-_], 2 : END [_], 3 : NAME [:] - char buf[255]; - anno.clear(); - while( *pn != '\0' ) { - switch(step) { - case 0: // CHROM[:] - if ( *pn == ':' ) { // END PARSING - chrom.assign( pp, pn - pp ); // copy chrom - step = 1; - pp = pn+1; - } - // otherwise, just skip else {} - break; - case 1: // BEG - if ( *pn == '-' ) { // INTERVAL is given - beg.assign( pp, pn - pp ); - step = 2; - pp = pn+1; - } - else if ( *pn == '_' ) { // BEG==END - beg.assign( pp, pn - pp ); - end = beg; - step = 3; - pp = pn+1; - } - break; - case 2: // END - if ( *pn == '_' ) { // BEG==END - end.assign( pp, pn - pp ); - step = 3; - pp = pn+1; - } - break; - case 3: // NAME - if ( *pn == '_' ) { - name.assign( pp, pn - pp ); - step = 4; - pp = pn+1; - } - break; - } - ++pn; - } - - if ( pn > pp ) { - switch(step) { - case 0: - chrom.assign( pp, pn - pp ); - break; - case 1: - beg.assign( pp, pn - pp ); - end = beg; - step = 2; - break; - case 2: - end.assign( pp, pn - pp ); - break; - case 3: - name.assign( pp, pn - pp ); - found = name.find('/'); - if ( ( found != std::string::npos ) && ( found != 1 ) ) { - sprintf(buf, "%d", atoi(beg.c_str()) + (int)found - 1); - end = buf; - } - break; - case 4: - anno.assign( pp, pn - pp ); - break; - } - } - return step; - } - - void init(const char* vcf, const char* region, const char* _key, const char* rule, bool pass) { - nInds = 0; - nMarkers = 0; - key = _key; - parser = rule; - passOnly = pass; - hardGenotype = ( key == "GT" ? true : false); - tf.load(vcf, region, true); - - if ( key == "GL" ) { - glFlag = true; - phredFlag = false; - } - else if ( key == "PL" ) { - glFlag = phredFlag = true; - } - else { - glFlag = phredFlag = false; - } - gpFlag = false; - } - - void load(const char* vcf, const char* region, const char* _key, const char* rule, bool pass, const char* indf) { - // read indf files if needed - std::set idset; - char* line = NULL; - if ( indf != NULL ) { - pFile tind(indf); - while( (line = (char*)tind.getLine()) != NULL ) { - if ( line[0] == '#' ) continue; - char* p = line; - while( ( *p != ' ' ) && ( *p & 0xf0 ) ) { ++p; } - std::string id(line,p-line); - if ( idset.find(id) != idset.end() ) { - error("ERROR: Duplicate individual ID %s in %s",id.c_str(),indf); - } - idset.insert(id); - } - } - load(vcf, region, _key, rule, pass, idset); - } - - void load(const char* vcf, const char* region, const char* _key, const char* rule, bool pass, std::set& idset) { - init(vcf, region, _key, rule, pass); - - // read VCF header - char* line; - //int nc; - while ( (line = (char*)tf.getLine()) != NULL ) { - //nc = tf.getLength(); - if ( line[0] == '#' ) { - if ( strncmp(line,"#CHROM",6) == 0 ) { - nInds = parseInds(line, idset); - break; - } - else if ( line[1] == '#' ) { - // store meta lines; - headers.push_back(line); - } - } - else { - error("Non-header line %s is observed before #CHROM in %s",line,vcf); - } - } - - if ( ( idset.size() > 0 ) && ( idset.size() != icols.size() ) ) { - warning("Identified %d individuals from index file, and only %d overlaps with VCF",(int)idset.size(),(int)icols.size()); - } - } - - void load(const char* vcf, const char* region, const char* _key, const char* rule, bool pass, std::vector& subcols) { - init(vcf, region, _key, rule, pass); - - // read VCF header - char* line; - //int nc; - while ( (line = (char*)tf.getLine()) != NULL ) { - //nc = tf.getLength(); - if ( line[0] == '#' ) { - if ( strncmp(line,"#CHROM",6) == 0 ) { - nInds = parseInds(line, subcols); - break; - } - else if ( line[1] == '#' ) { - // parse meta line??? - } - } - else { - error("Non-header line %s is observed before #CHROM in %s",line,vcf); - } - } - - if ( ( subcols.size() > 0 ) && ( (int)subcols.size() != nInds ) ) { - warning("Identified %d individuals from index file, and nInds = %d",(int)subcols.size(),nInds); - } - } - - fVcf() : nInds(0), nMarkers(0), passOnly(false) {} - - void clear() { - markers.clear(); - chroms.clear(); - pos1s.clear(); - refs.clear(); - alts.clear(); - genos.clear(); - phases.clear(); - GPs.clear(); - PLs.clear(); - //depths.clear(); - numAlleles.clear(); - sumAlleles.clear(); - sumsqAlleles.clear(); - //icols.clear(); - AFs.clear(); - markerSet.clear(); - covs.clear(); - nMarkers = 0; - } - - float callRate(int m) { - return nInds > 0 ? ((float)numAlleles[m] / (float)nInds / 2.) : 1.; - } - - float alleleVar(int m, bool allN = false) { - if ( allN ) { - return(sumsqAlleles[m]/nInds - sumAlleles[m]*sumAlleles[m]/nInds/nInds); - } - else if ( numAlleles[m] > 0 ) { - return(sumsqAlleles[m]/numAlleles[m] - sumAlleles[m]*sumAlleles[m]/numAlleles[m]/numAlleles[m]); - } - else { - return 1e-6; - } - } - - float alleleSD(int m, bool allN = false) { - return sqrtf(alleleVar(m,allN)); - } - - float alleleFreq(int m) { - if ( glFlag ) { - if ( (int)AFs.size() < m + 1 ) { - AFs.resize(m+1,-1); - } - if ( AFs[m] < 0 ) { - AFs[m] = (float)(emAF(m,1e-6).first); - } - return AFs[m]; - } - else { - return ( numAlleles[m] > 0 ) ? (sumAlleles[m] / (float)numAlleles[m]) : 0; - } - } - - int MAC(int m) { - return (int)floor(((sumAlleles[m] < numAlleles[m]-sumAlleles[m]) ? sumAlleles[m] : numAlleles[m]-sumAlleles[m])+.5); - } - - // works only for discrete genotypes - // numAlleles[m] = r + h + a - // sumAlleles[m] = h + 2a - // sumsqAlleles[m] = h + 4a - // a = ((h+4a)-(h+2a))/2 - // r = (r+h+a) - (h+2a) + ((h+4a)-(h+2a))/2 - // = (r+h+a) - 1.5(h+2a) + 0.5(h+4a) - int HOMMINC(int m) { - if ( hardGenotype ) { - return ((int)floor( ((sumAlleles[m] < numAlleles[m]-sumAlleles[m]) ? (sumsqAlleles[m]-sumAlleles[m])/2. : ( numAlleles[m] - 1.5 * sumAlleles[m] + 0.5 * sumsqAlleles[m] )) + .5)); - } - else { - float g; - int cnts[3] = {0,0,0}; - for(int j=0; j < nInds; ++j) { - g = genos[m*nInds + j]; - if ( !isnan(g) ) { // do not count missing at any place - if ( g < 0.5 ) ++cnts[0]; - else if ( g >= 1.5 ) ++cnts[2]; - else ++cnts[1]; - } - } - return cnts[2]; - } - } - - // works only - // numAlleles[m] = 2*(r + h + a) - // sumAlleles[m] = h + 2a - // sumsqAlleles[m] = h + 4a - // a = ((h+4a)-(h+2a))/2 - // r = (r+h+a) - (h+2a) + ((h+4a)-(h+2a))/2 - // = (r+h+a) - 1.5(h+2a) + 0.5(h+4a) - // h = (r+h+a) - a - r - void GENOCNT(int m, int* cnts) { - if ( hardGenotype ) { - cnts[0] = (int)(( numAlleles[m]/2 - 1.5 * sumAlleles[m] + 0.5 * sumsqAlleles[m] ) + 0.5); - cnts[2] = (int)((sumsqAlleles[m]-sumAlleles[m])/2.+0.5); - cnts[1] = numAlleles[m]/2 - cnts[0] - cnts[2]; - } - else { - float g; - cnts[0] = cnts[1] = cnts[2] = 0; - for(int j=0; j < nInds; ++j) { - g = genos[m*nInds + j]; - if ( !isnan(g) ) { // do not count missing at any place - if ( g < 0.5 ) ++cnts[0]; - else if ( g >= 1.5 ) ++cnts[2]; - else ++cnts[1]; - } - } - } - } - - void CASECTRLCNT(int m, int* cnts, std::vector& isCases) { - float g; - cnts[0] = cnts[1] = cnts[2] = cnts[3] = cnts[4] = cnts[5] = 0; - for(int j=0; j < nInds; ++j) { - g = genos[m*nInds + j]; - if ( !isnan(g) ) { // do not count missing at any place - if ( g < 0.5 ) ++cnts[0+isCases[j]*3]; - else if ( g >= 1.5 ) ++cnts[2+isCases[j]*3]; - else ++cnts[1+isCases[j]*3]; - } - } - } - - float MAF(int m) { - float f = alleleFreq(m); - return (f > .5 ? 1.-f : f); - } - - float RSQ(int m) { - int n = numAlleles[m]/2; - if ( n > 1 ) { - float s = sumAlleles[m]; - float varObs = (sumsqAlleles[m]-s*s/n)/(n-1); // var(x) - float varExp = 2. * s * ( n + n - s ) / ( n * n ); // 2pq - return (varObs > varExp) ? 1.0 : varObs/varExp; - } - else { - return 0; - } - } - - void print(FILE* fp) { - float v; - //fprintf(stderr,"%d %d %s\n",nInds,nMarkers,inds[nInds-1].c_str()); - if ( inds.size() > 0 ) { - fprintf(fp, "#MARKER"); - for(int i=0; i < nInds; ++i) { - if ( inds.empty() ) { - fprintf(fp, "\tID%d", i+1); - } - else { - fprintf(fp, "\t%s", inds[i].c_str()); - } - } - fprintf(fp,"\n"); - } - for(int i=0; i < nMarkers; ++i) { - fprintf(fp, "%s", markers[i].c_str()); - for(int j=0; j < nInds; ++j) { - v = genos[i*nInds + j]; - if ( isnan(v) ) { - fprintf(fp,"\tNA"); - } - else { - fprintf(fp, "\t%.4f", genos[i*nInds + j]); - } - } - fprintf(fp,"\n"); - } - } - - int parseMarkers(char* line, int startIdx = 9) { - //notice("fVcf::parseMarkers() called"); - //, std::vector& m, std::vector& v, int startIdx = 9, const char* key = "GT", const char** infoSubstrs = NULL, int nSubstr = 0) { - char* p; - char* n; - char* pch = line; - char* nch = NULL; - std::string chrom; - std::string pos; - std::string ref; - std::string alt; - std::string markerId; - std::string markerKey; - std::string s; - int keyIdx = 0; - int i, j, k; - int lKey = (int)key.size(); - int AN = 0; - float AC = 0, sqAC = 0; - float f; - - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( i < startIdx ) { - if ( i < 7 ) { - if ( nch == NULL ) s.assign( pch ); - else s.assign( pch, nch - pch ); - - switch(i) { - case 0: // copy chromosomes - chrom = s; break; - case 1: // copy pos - pos = s; break; - case 2: // marker_id - markerId = s; break; - case 3: // reference allele - ref = s; break; - case 4: // non-reference alleles - alt = s; // if it is not in the predefined markerSet, skip the marker - if ( ! markerSet.empty() ) { - markerKey = chrom+":"+pos+"_"+ref+"/"+alt; - if ( markerSet.find(markerKey) == markerSet.end() ) { - return -1; - } - } - break; - case 6: - if ( ( passOnly ) && ( s != "PASS" ) ) return -1; - } - } - else if ( i == 7 ) { // parse INFO field - if ( nch == NULL ) { - // If the VCF is site only, parse AC & AN information - // from the INFO field, if exists - char* ic; - AC = AN = 0; - if ( (ic = strstr(pch, "AC=")) != NULL ) { - AC = (float)atoi(ic+3); - } - if ( (ic = strstr(pch, "AN=")) != NULL ) { - AN = atoi(ic+3); - } - if ( AN == 0 ) { - error("AN is not observed in INFO field in site only VCF"); - } - else { - double af = (double)AC/(double)AN; - sqAC = floor(2*AN*af*(1.+af)+.5); // assumes HWE sqAC = p^2 * 4 + 2p(1-p) = 2p(1+p) - } - - if ( !parser.parse( pch ) ) return -1; - } - else { if ( !parser.parse( pch, nch - pch ) ) return -1; } - } - else if ( i == 8 ) { // parse FORMAT field - if ( pch[0] == key[0] && pch[1] == key[1] && ( ( nch == pch + 2 ) || ( pch[2] == ':' ) ) ) { // comparing two characters are not exactly right - keyIdx = 0; - } - else if ( nch == NULL ) { - error("VCF has FORMAT field but does not have any genotype"); - } - else { - k = 0; - keyIdx = 0; - p = pch; - while( p < nch ) { - if ( *p == ':' ) { - if ( k >= lKey ) { - break; - } - else { - ++keyIdx; - k = 0; - } - } - else { - //if ( ( k == 2 ) || ( key[k] == *p ) ) { - if ( key[k] == *p ) { - ++k; - } - else { - k = 0; - } - } - ++p; - } - if ( ( p == nch ) && ( k != lKey ) ) { - warning("Cannot find %s in the FORMAT field at marker %s:%s_%s/%s .. Skipping",key.c_str(),chrom.c_str(),pos.c_str(),ref.c_str(),alt.c_str()); - return -1; - } - } - } - } - else { - if ( icols.empty() || ( ( j < (int)icols.size() ) && ( icols[j] == i - startIdx ) ) ) { - p = pch; - n = NULL; - - // reach to the key index - if ( keyIdx > 0 ) { - for(int i=0; (i < keyIdx) && (p != NULL); ++i) { - n = strchr(p, ':'); - p = (n == NULL) ? NULL : n+1; - } - } - - // if the field contains '/' or '|', add two values - // if the field is '.', return NA - // otherwise, convert the field into float and return - if ( ( p == NULL ) || ( p[0] == '.' ) ) { // missing - if ( glFlag ) { - PLs.push_back(0); - PLs.push_back(0); - PLs.push_back(0); - } - else { - genos.push_back(NAN_FLT); - phases.push_back(0); // unphased - } - } - else if ( ( p[1] == '/' ) || ( p[1] == '|' ) ) { - f = (float)((p[0] - '0') + ( p[2] - '0' )); // ignore phase info - genos.push_back(f); - phases.push_back((p[1] == '|') ? ( (p[0] == p[2]) ? 1 : (p[0] < p[2] ? 2 : 3) ) : 0); - AN += 2; - AC += f; - sqAC += f*f; - } - else { // Genotypes are not in 0|0 format - if ( glFlag ) { // search for three commas - char* c1 = strchr(p,','); - if ( c1 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - char* c2 = strchr(c1+1,','); - if ( c2 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - if ( phredFlag ) { - int pl = atoi(p); - if ( pl > 255 ) pl = 255; - PLs.push_back(pl); - pl = atoi(c1+1); - if ( pl > 255 ) pl = 255; - PLs.push_back(pl); - pl = atoi(c2+1); - if ( pl > 255 ) pl = 255; - PLs.push_back(pl); - } - else { - float gl = strtof(p,NULL); - if ( gl < -25.5 ) PLs.push_back(255); - else PLs.push_back((int)(-10*gl+.5)); - - gl = strtof(c1+1,NULL); - if ( gl < -25.5 ) PLs.push_back(255); - else PLs.push_back((int)(-10*gl+.5)); - - gl = strtof(c2+1,NULL); - if ( gl < -25.5 ) PLs.push_back(255); - else PLs.push_back((int)(-10*gl+.5)); - } - } - else { // take genos as dosages - f = strtof(p,NULL); - genos.push_back(f); - phases.push_back(0); - AN += 2; - AC += f; - sqAC += f*f; - } - } - ++j; - } - else { - //std::cout << "Skipping " << i << "\t" << j << std::endl; - } - } - pch = ( nch == NULL ) ? NULL : nch + 1; - } - - if ( (nInds == 0) && icols.empty() && ((int)genos.size() == j) ) nInds = j; - - if ( nInds != j ) { - fprintf(stderr,"i=%d, j=%d, nInds=%d, icols.size()=%d, genos.back()=%d\n",i,j,nInds,(int)icols.size(),(int)genos.back()); - abort(); - } - - // if GL or PL flag is set, automatically put dosage as quantitative genotypes - if ( glFlag ) { - //notice("fVcf::parseMarkers() - glFlag is on"); - - // set allele frequency - int m = markers.size(); //notice("fVcf::parseMarkers() - m = %d",m); - float af = (float)(emAF(m,1e-6).first); //notice("fVcf::parseMarkers() - af = %f",af); - if ( (int)AFs.size() > m ) { AFs[m] = af; } - else if ( (int)AFs.size() == m ) { AFs.push_back(af); } - else { error("fVcf::parseMarkers() -- AFs.size() < m"); } - - double p0,p1,p2; - int kos; - for(int k=0; k < j; ++k) { - // calculate genotype dosages under HWE - // Pr(G|D) = Pr(D|G)Pr(G) - kos = 3*(m*nInds+k); - p0 = phredConv.phred2Err[PLs[kos+0]] * (1.-AFs[m]) * (1.-AFs[m]); - p1 = phredConv.phred2Err[PLs[kos+1]] * 2. * AFs[m] * (1.-AFs[m]); - p2 = phredConv.phred2Err[PLs[kos+2]] * AFs[m] * AFs[m]; - if ( p0+p1+p2 > 0 ) { - genos.push_back((p1+2*p2)/(p0+p1+p2)); - phases.push_back(0); - } - else { - genos.push_back(AFs[m]*2.); - phases.push_back(0); - } - if ( gpFlag ) { GPs.push_back(p0); GPs.push_back(p1); GPs.push_back(p2); } - - AN += 2; - AC += genos.back(); - sqAC += genos.back()*genos.back(); - } - } - - //notice("AC=%f, AN=%d, sqAC=%f",AC,AN,sqAC); - - if ( markerId == "." ) { - markers.push_back(chrom+":"+pos+"_"+ref+"/"+alt); - } - else { - markers.push_back(chrom+":"+pos+"_"+ref+"/"+alt+"_"+markerId); - } - - chroms.push_back(chrom); - pos1s.push_back(atoi(pos.c_str())); - refs.push_back(ref); - alts.push_back(alt); - numAlleles.push_back(AN); - sumAlleles.push_back(AC); - sumsqAlleles.push_back(sqAC); - - //fprintf(stderr,"%s\n",markers.back().c_str()); - - return j; - } - - /* - // Parse GT : GD/DP : GL/PL - int fullParseMarkers(char* line, int startIdx = 9) { - char* p; - char* n; - char* pch = line; - char* nch = NULL; - std::string chrom; - std::string pos; - std::string ref; - std::string alt; - std::string markerId; - std::string markerKey; - std::string s; - - int GTidx = -1, PLidx = -1, GLidx = -1, DPidx = -1, GDidx = -1; - - int i, j; - int AN = 0; - float AC = 0, sqAC = 0; - float gt, gl; - int dp, pl; - int pls[3]; - uint8_t phase = 0; - char *c1, *c2; - - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( i < startIdx ) { - if ( i < 7 ) { - if ( nch == NULL ) s.assign( pch ); - else s.assign( pch, nch - pch ); - switch(i) { - case 0: // copy chromosomes - chrom = s; break; - case 1: // copy pos - pos = s; break; - case 2: // marker_id - markerId = s; break; - case 3: // reference allele - ref = s; break; - case 4: // non-reference alleles - alt = s; // if it is not in the predefined markerSet, skip the marker - if ( ! markerSet.empty() ) { - markerKey = chrom+":"+pos+"_"+ref+"/"+alt; - if ( markerSet.find(markerKey) == markerSet.end() ) { - return -1; - } - } - break; - case 6: - if ( ( passOnly ) && ( s != "PASS" ) ) return -1; - } - } - else if ( i == 7 ) { // parse INFO field - if ( nch == NULL ) { if ( !parser.parse( pch ) ) return -1; } - else { if ( !parser.parse( pch, nch - pch ) ) return -1; } - } - else if ( i == 8 ) { // parse FORMAT field - if ( nch == NULL ) { - error("VCF has FORMAT field but does not have any genotype"); - } - else { - int ncolons = 0; - p = pch-1; - while(p < nch) { - if ( ( p < pch ) || ( *p == ':' ) ) { - if ( ( p+3 >= nch ) || ( p[3] == ':' ) ) { - switch(p[1]) { - case 'G': - if ( p[2] == 'T' ) GTidx = ncolons; - else if ( p[2] == 'D' ) GDidx = ncolons; - else if ( p[2] == 'L' ) GLidx = ncolons; - break; - case 'P': - if ( p[2] == 'L' ) PLidx = ncolons; - break; - case 'D': - if ( p[2] == 'P' ) DPidx = ncolons; - break; - } - } - ++ncolons; - } - ++p; - } - } - } - } - else { - if ( icols.empty() || ( ( j < (int)icols.size() ) && ( icols[j] == i - startIdx ) ) ) { - p = pch; - n = NULL; - - gt = NAN_FLT; - phase = 0; - dp = 0; - pls[0] = pls[1] = pls[2] = 0; - - for(int i2=0; ((nch == NULL ) || (p < nch)) && (p != NULL); ++i2) { - if ( GTidx == i2 ) { - if ( ( p[1] == '/' ) || ( p[1] == '|' ) ) { - gt = (float)((p[0] - '0') + ( p[2] - '0' )); // ignore phase info - phase = ((p[1] == '|') ? ( (p[0] == p[2]) ? 1 : ((p[0] < p[2]) ? 2 : 3) ) : 0); - } - } - else if ( ( GDidx == i2 ) || ( DPidx == i2 ) ) { - dp = atoi(p); - } - else if ( GLidx == i2 ) { - c1 = strchr(p,','); - if ( c1 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - c2 = strchr(c1+1,','); - if ( c2 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - - gl = strtof(p,NULL); - if ( gl < -25.5 ) pls[0] = 255; - else pls[0] = (int)(-10*gl+.5); - - gl = strtof(c1+1,NULL); - if ( gl < -25.5 ) pls[1] = 255; - else pls[1] = (int)(-10*gl+.5); - - gl = strtof(c2+1,NULL); - if ( gl < -25.5 ) pls[2] = 255; - else pls[2] = (int)(-10*gl+.5); - } - else if ( PLidx == i2 ) { - c1 = strchr(p,','); - if ( c1 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - c2 = strchr(c1+1,','); - if ( c2 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - - pl = atoi(p); - if ( pl > 255 ) pl = 255; - pls[0] = pl; - - pl = atoi(c1+1); - if ( pl > 255 ) pl = 255; - pls[1] = pl; - - pl = atoi(c2+1); - if ( pl > 255 ) pl = 255; - pls[2] = pl; - } - n = strchr(p, ':'); - p = (n == NULL) ? NULL : n+1; - } - - genos.push_back(gt); - phases.push_back(phase); - PLs.push_back(pls[0]); - PLs.push_back(pls[1]); - PLs.push_back(pls[2]); - depths.push_back(dp); - if ( !isnan(gt) ) { - AN += 2; - AC += gt; - sqAC += (gt*gt); - } - ++j; - } - else { - //std::cout << "Skipping " << i << "\t" << j << std::endl; - } - } - pch = ( nch == NULL ) ? NULL : nch + 1; - } - - //error("depths.size() = %d, PLs.size() = %d / %f %d %d %d %d %d / %d",(int)depths.size(),(int)PLs.size(), genos.back(), depths.back(), (int)PLs.back(), (int)pls[0], (int)pls[1], (int)pls[2], j); - - if ( (nInds == 0) && icols.empty() && ((int)genos.size() == j) ) nInds = j; - - if ( nInds != j ) { - fprintf(stderr,"i=%d, j=%d, nInds=%d, icols.size()=%d, genos.back()=%d\n",i,j,nInds,(int)icols.size(),(int)genos.back()); - abort(); - } - - if ( markerId == "." ) { - markers.push_back(chrom+":"+pos+"_"+ref+"/"+alt); - } - else { - markers.push_back(chrom+":"+pos+"_"+ref+"/"+alt+"_"+markerId); - } - chroms.push_back(chrom); - pos1s.push_back(atoi(pos.c_str())); - refs.push_back(ref); - alts.push_back(alt); - numAlleles.push_back(AN); - sumAlleles.push_back(AC); - sumsqAlleles.push_back(sqAC); - - //fprintf(stderr,"%s\n",markers.back().c_str()); - - return j; - } -*/ - - /* - int multiParseMarkers(char* line, int startIdx = 9, std::vector< std::string >& fieldNames ) { - char* p; - char* n; - char* pch = line; - char* nch = NULL; - std::string chrom; - std::string pos; - std::string ref; - std::string alt; - std::string markerId; - std::string markerKey; - std::string s; - - std::vector iNames; - std::vector iFields; - - int GTidx = -1, PLidx = -1, GLidx = -1, DPidx = -1, GDidx = -1; - - int i, j; - int AN = 0; - float AC = 0, sqAC = 0; - float gt, gl; - int dp, pl; - int pls[3]; - uint8_t phase = 0; - char *c1, *c2; - - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( i < startIdx ) { - if ( i < 7 ) { - if ( nch == NULL ) s.assign( pch ); - else s.assign( pch, nch - pch ); - switch(i) { - case 0: // copy chromosomes - chrom = s; break; - case 1: // copy pos - pos = s; break; - case 2: // marker_id - markerId = s; break; - case 3: // reference allele - ref = s; break; - case 4: // non-reference alleles - alt = s; // if it is not in the predefined markerSet, skip the marker - if ( ! markerSet.empty() ) { - markerKey = chrom+":"+pos+"_"+ref+"/"+alt; - if ( markerSet.find(markerKey) == markerSet.end() ) { - return -1; - } - } - break; - case 6: - if ( ( passOnly ) && ( s != "PASS" ) ) return -1; - } - } - else if ( i == 7 ) { // parse INFO field - if ( nch == NULL ) { if ( !parser.parse( pch ) ) return -1; } - else { if ( !parser.parse( pch, nch - pch ) ) return -1; } - } - else if ( i == 8 ) { // parse FORMAT field - if ( nch == NULL ) { - error("VCF has FORMAT field but does not have any genotype"); - } - else { - int ncolons = 0; - p = pch-1; - while(p < nch) { - if ( ( p < pch ) || ( *p == ':' ) ) { - if ( ( p+3 >= nch ) || ( p[3] == ':' ) ) { - switch(p[1]) { - case 'G': - if ( p[2] == 'T' ) GTidx = ncolons; - else if ( p[2] == 'D' ) GDidx = ncolons; - else if ( p[2] == 'L' ) GLidx = ncolons; - break; - case 'P': - if ( p[2] == 'L' ) PLidx = ncolons; - break; - case 'D': - if ( p[2] == 'P' ) DPidx = ncolons; - break; - } - } - ++ncolons; - } - ++p; - } - } - } - } - else { - if ( icols.empty() || ( ( j < (int)icols.size() ) && ( icols[j] == i - startIdx ) ) ) { - p = pch; - n = NULL; - - gt = NAN_FLT; - phase = 0; - dp = 0; - pls[0] = pls[1] = pls[2] = 0; - - for(int i2=0; ((nch == NULL ) || (p < nch)) && (p != NULL); ++i2) { - if ( GTidx == i2 ) { - if ( ( p[1] == '/' ) || ( p[1] == '|' ) ) { - gt = (float)((p[0] - '0') + ( p[2] - '0' )); // ignore phase info - phase = ((p[1] == '|') ? ( (p[0] == p[2]) ? 1 : ((p[0] < p[2]) ? 2 : 3) ) : 0); - } - } - else if ( ( GDidx == i2 ) || ( DPidx == i2 ) ) { - dp = atoi(p); - } - else if ( GLidx == i2 ) { - c1 = strchr(p,','); - if ( c1 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - c2 = strchr(c1+1,','); - if ( c2 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - - gl = strtof(p,NULL); - if ( gl < -25.5 ) pls[0] = 255; - else pls[0] = (int)(-10*gl+.5); - - gl = strtof(c1+1,NULL); - if ( gl < -25.5 ) pls[1] = 255; - else pls[1] = (int)(-10*gl+.5); - - gl = strtof(c2+1,NULL); - if ( gl < -25.5 ) pls[2] = 255; - else pls[2] = (int)(-10*gl+.5); - } - else if ( PLidx == i2 ) { - c1 = strchr(p,','); - if ( c1 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - c2 = strchr(c1+1,','); - if ( c2 == NULL ) error("Cannot parse %s field (currently suppports only biallelic autosomal variants",key.c_str()); - - pl = atoi(p); - if ( pl > 255 ) pl = 255; - pls[0] = pl; - - pl = atoi(c1+1); - if ( pl > 255 ) pl = 255; - pls[1] = pl; - - pl = atoi(c2+1); - if ( pl > 255 ) pl = 255; - pls[2] = pl; - } - n = strchr(p, ':'); - p = (n == NULL) ? NULL : n+1; - } - - genos.push_back(gt); - phases.push_back(phase); - PLs.push_back(pls[0]); - PLs.push_back(pls[1]); - PLs.push_back(pls[2]); - depths.push_back(dp); - if ( !isnan(gt) ) { - AN += 2; - AC += gt; - sqAC += (gt*gt); - } - ++j; - } - else { - //std::cout << "Skipping " << i << "\t" << j << std::endl; - } - } - pch = ( nch == NULL ) ? NULL : nch + 1; - } - - //error("depths.size() = %d, PLs.size() = %d / %f %d %d %d %d %d / %d",(int)depths.size(),(int)PLs.size(), genos.back(), depths.back(), (int)PLs.back(), (int)pls[0], (int)pls[1], (int)pls[2], j); - - if ( (nInds == 0) && icols.empty() && ((int)genos.size() == j) ) nInds = j; - - if ( nInds != j ) { - fprintf(stderr,"i=%d, j=%d, nInds=%d, icols.size()=%d, genos.back()=%d\n",i,j,nInds,(int)icols.size(),(int)genos.back()); - abort(); - } - - if ( markerId == "." ) { - markers.push_back(chrom+":"+pos+"_"+ref+"/"+alt); - } - else { - markers.push_back(chrom+":"+pos+"_"+ref+"/"+alt+"_"+markerId); - } - chroms.push_back(chrom); - pos1s.push_back(atoi(pos.c_str())); - refs.push_back(ref); - alts.push_back(alt); - numAlleles.push_back(AN); - sumAlleles.push_back(AC); - sumsqAlleles.push_back(sqAC); - - //fprintf(stderr,"%s\n",markers.back().c_str()); - - return j; - } - */ - - // Parse GT : GD/DP : GL/PL - int writeSubsetMarker(wFile& wf, const char* line, int startIdx = 9) { - // this assumes that GT field was calculated already using parseMarker() - int i,j,k; - const char *p; - const char* pch = line; - const char* nch = NULL; - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( nch == NULL ) { nch = pch + strlen(pch); } - if ( i < startIdx ) { - if ( i > 0 ) wf.putc('\t'); - if ( ( i < 7 ) || (i == 8 ) ) { // copy until FILTER field - for(p=pch; p < nch; ++p) { wf.putc(*p); } - } - else if ( i == 7 ) { // special handling for INFO field - // remove AC, AN, AF columns if exists - std::vector tokens; - std::string info( pch, nch - pch ); - pFile::tokenizeLine(info.c_str(),";",tokens); - wf.printf("AC=%d;AN=%d;NS=%d;AF=%.5f",(int)sumAlleles.back(),(int)numAlleles.back(),(int)numAlleles.back()/2,( numAlleles.back() > 0 ) ? (sumAlleles.back() / (float)numAlleles.back()) : 0); - for(k=0; k < (int)tokens.size(); ++k) { - if ( ( tokens[k].compare(0,3,"AC=") == 0 ) || - ( tokens[k].compare(0,3,"AN=") == 0 ) || - ( tokens[k].compare(0,3,"NS=") == 0 ) || - ( tokens[k].compare(0,3,"AF=") == 0 ) ) { - // skip - } - else { - wf.printf(";%s",tokens[k].c_str()); - } - } - } - } - else { - if ( icols.empty() || ( ( j < (int)icols.size() ) && ( icols[j] == i - startIdx ) ) ) { - wf.putc('\t'); - for(p=pch; p < nch; ++p) { wf.putc(*p); } - ++j; - } - } - pch = ( *nch == '\0' ) ? NULL : nch+1; - } - wf.putc('\n'); - //error("foo"); - return j; - } - - int parseInds(char* line, std::set& idset, int startIdx = 9) { - char* pch = line; - char* nch = NULL; - int i, j; - - icols.clear(); - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( i >= startIdx ) { - std::string id = (nch == NULL) ? std::string(pch) : std::string(pch,nch-pch); - if ( idset.empty() || (idset.find(id) != idset.end()) ) { - icols.push_back(i - startIdx); - inds.push_back(id); - ++j; - } - } - pch = ( nch == NULL ) ? NULL : nch + 1; - } - //notice("icols.size() = %d",(int)icols.size()); - return j; - } - - int parseInds(char* line, std::vector& subids, int startIdx = 9) { - char* pch = line; - char* nch = NULL; - int i, j; - - icols.clear(); - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( i >= startIdx ) { - std::string id = (nch == NULL) ? std::string(pch) : std::string(pch,nch-pch); - if ( subids[(int)icols.size()] == id ) { - icols.push_back(i - startIdx); - inds.push_back(id); - ++j; - } - } - pch = ( nch == NULL ) ? NULL : nch + 1; - } - if ( j != (int)subids.size() ) { - error("ERROR in fVcf::parseInds() - not all subids matches"); - } - return j; - } - - int parseInds(char* line, std::vector& subcols, int startIdx = 9) { - //notice("fVcf::parseInds(char*, std::vector&) called"); - - char* pch = line; - char* nch = NULL; - int i, j; - - icols.clear(); - for(i=0, j=0; pch != NULL; ++i) { - nch = strchr(pch, '\t'); - if ( i >= startIdx ) { - if ( subcols.empty() || - ( ( j < (int)subcols.size() ) && ( subcols[j] == i - startIdx ) ) ) { - icols.push_back(i - startIdx); - std::string id = (nch == NULL) ? std::string(pch) : std::string(pch,nch-pch); - inds.push_back(id); - ++j; - } - else { // Skip the individual - //std::cerr << "Skipping " << i << "\t" << j << std::endl; - //abort(); - } - } - pch = ( nch == NULL ) ? NULL : nch + 1; - } - return j; - } - - // read markers until reach the end of file - int readMarkerGroup(const char** pMarkers, int nMarkers, int startIndex = 0, bool sepchr = false) { - std::vector markerIDs; - for(int i=0; i < nMarkers; ++i) { - markerIDs.push_back(pMarkers[i]); - } - return readMarkerGroup(markerIDs,startIndex,sepchr); - } - - int readMarkerGroup(std::vector& markerIDs, - int startIndex = 0, bool sepchr = false) - { - //int nc; - char* line = NULL; - - std::string curChrom; - int beg = 1000000000, end = 0; - - std::vector tokens; - for(int i=startIndex; i < (int)markerIDs.size(); ++i) { - pFile::tokenizeLine(markerIDs[i].c_str(),":_/",tokens); - if ( tokens.size() != 4 ) { - error("Cannot parse markerID %s",markerIDs[i].c_str()); - } - std::string region(tokens[0]); - region += ":"; - region += tokens[1]; - region += "-"; - region += tokens[1]; - - if ( i == startIndex ) { - curChrom = tokens[0]; - beg = end = atoi(tokens[1].c_str()); - } - else { - if ( curChrom != tokens[0] ) { - curChrom = "multichrs"; - beg = end = 0; - //error("Currently group across different chromosomes are not supported"); - } - else { - int bp = atoi(tokens[1].c_str()); - if ( beg > bp ) { beg = bp; } - if ( end < bp ) { end = bp; } - } - } - - tf.updateRegion(region.c_str(),sepchr); - - markerSet.clear(); - markerSet.insert(markerIDs[i]); - while ( (line = (char*)tf.getLine()) != NULL ) { - //nc = tf.getLength(); - int cols2 = parseMarkers(line); - if ( cols2 >= 0 ) { - if ( nInds != cols2 ) { - error("fVcf::readMarkers() : Column size does not match : %d vs %d at marker %s", nInds, cols2, markers[markers.size()-1].c_str() ); - abort(); - } - ++nMarkers; - } - } - } - - if ( startIndex > 0 ) { - char tmp[1024]; - sprintf(tmp,"%s:%d-%d_%s",curChrom.c_str(),beg,end,markerIDs[0].c_str()); - //markerIDs[0] = tmp; - groupID = tmp; - groupChrom = curChrom; - groupBeg = beg; - groupEnd = end; - } - return nMarkers; - } - - // read markers until reach the end of file - int readMarkers(int m = 0, bool del = true) { - //int nc; - char* line = NULL; - - if ( del ) clear(); - - int mStart = nMarkers; - - //fprintf(stderr,"fVcf::readMarkers(%d) called",m); - - while ( (line = (char*)tf.getLine()) != NULL ) { - //notice("bar"); - //nc = tf.getLength(); - //fprintf(stderr,"nMarkers=%d, line[0] = %c, icols.size() = %d, nc=%d\n",nMarkers,line[0],(int)icols.size(), nc); - if ( line[0] == '#' ) { - if ( strncmp(line,"#CHROM",6) == 0 ) { - nInds = parseInds(line, icols); - } - } - else { - int cols2 = parseMarkers(line); - //notice("cols2 = %d",cols2); - if ( cols2 >= 0 ) { - if ( nInds != cols2 ) { - error("fVcf::readMarkers() : Column size does not match : %d vs %d at marker %s", nInds, cols2, markers[markers.size()-1].c_str() ); - abort(); - } - ++nMarkers; - if ( ( m > 0 ) && ( m <= nMarkers - mStart ) ) break; - } - } - } - //notice("Returning %d",nMarkers-mStart); - return ( nMarkers-mStart ); - }; - - /* - // read markers until reach the end of file - int fullReadMarkers(int m = 0, bool del = true) { - //int nc; - char* line = NULL; - - if ( del ) clear(); - - int mStart = nMarkers; - - //notice("fVcf::readMarkers(%d) called",m); - - while ( (line = (char*)tf.getLine()) != NULL ) { - //notice("bar"); - //nc = tf.getLength(); - //notice("nMarkers=%d, line[0] = %c, icols.size() = %d, nc=%d",nMarkers,line[0],(int)icols.size(), nc); - if ( line[0] == '#' ) { - if ( strncmp(line,"#CHROM",6) == 0 ) { - nInds = parseInds(line, icols); - } - } - else { - int cols2 = fullParseMarkers(line); - //notice("cols2 = %d",cols2); - if ( cols2 >= 0 ) { - if ( nInds != cols2 ) { - error("fVcf::fullReadMarkers() : Column size does not match : %d vs %d at marker %s", nInds, cols2, markers[markers.size()-1].c_str() ); - abort(); - } - ++nMarkers; - if ( ( m > 0 ) && ( m <= nMarkers - mStart ) ) break; - } - } - } - //notice("Returning %d",nMarkers-mStart); - return ( nMarkers-mStart ); - }; -*/ - - void close() { - tf.close(); - } - - /* - static FILE* openVCF(const char* filename, const char* region = NULL, const char* tabix = "/usr/cluster/bin/tabix" ) { - // check if the file exists - if ( exists(filename) == 0 ) { - std::cerr << "Cannot open file " << filename << " for reading" << std::endl; - return NULL; - } - - std::string fn(filename); - FILE* fp; - if ( fn.substr(fn.size()-3) == ".gz" ) { - std::string cmd = tabix; - if ( region == NULL ) { - cmd = "zcat "; - } - else if ( exists(tabix) == 0 ) { - std::cerr << "Cannot find tabix binary " << tabix << ". Failed opening with region specified"; - return NULL; - } - else { - cmd += " -h "; - } - cmd += fn; - if ( region != NULL ) { - cmd += " "; - cmd += region; - } - //std::cout << cmd << std::endl; - fp = popen(cmd.c_str(),"r"); - return fp; - } - else { - fp = fopen(filename,"r"); - return fp; - } - } - */ - - /** - Computes HWE allele frequencies using EM algorithm - Input: - 1)Genotype Likelihoods (qscores) - - Output: - 1) estimated HWE allele frequencies - 2) sample size - */ - std::pair emAF(int m, double eps) { - // initial step : start from randomly assigned allele frequencies - std::vector indices; - for(int i=0; i < nInds; ++i) { - indices.push_back(i); - } - return emAF(m, indices,eps); - } - - std::pair emAF(int m, std::vector& indices, double eps) { - // initialization : pick an arbitrary AF from - //notice("fVcf::emAF(%d, %d, %lf), p2e.size() = %d",m,(int)indices.size(),eps,(int)p2e.size()); - - std::vector::iterator it; - int i, c, n, r; - double p = .5 + rand()/(RAND_MAX+1.)*.3; // random AF - double q; - double f0,f1,f2, fsum, sum; - double llk = 0; - std::vector post; - n = (int)indices.size(); - post.resize(n*3); - - for(r = 0; r < 100; ++r) { - sum = 0; - c = 0; - q = 1.-p; - - //notice("fVcf::emAF() - r = %d, p = %lf",r,p); - - for(it = indices.begin(); it != indices.end(); ++it) { - i = 3*m*nInds + (*it)*3; - f0 = q * q * phredConv.phred2Err[PLs[i]]; - f1 = 2. * p * q * phredConv.phred2Err[PLs[i+1]]; - f2 = p * p * phredConv.phred2Err[PLs[i+2]]; - fsum = f0+f1+f2; - post[c++] = f0/fsum; - sum += (post[c++] = f1/fsum); - sum += (2 * (post[c++] = f2/fsum)); - } - p = sum / (2*n); - - if ( fabs(p + q - 1.) < eps ) break; - } - - //notice("fVcf::emAF() - p = %.10lf",p); - //if ( p < 1e-4 ) p = 1e-4; - //else if ( p > 0.9999 ) p = 0.9999; - - // Pr(Data|AF) = \sum_g Pr(Data|g)Pr(g|AF) - q = 1.-p; - for(it = indices.begin(); it != indices.end(); ++it) { - i = 3*m*nInds + (*it)*3; - f0 = q * q * phredConv.phred2Err[PLs[i]]; - f1 = 2 * p * q * phredConv.phred2Err[PLs[i+1]]; - f2 = p * p * phredConv.phred2Err[PLs[i+2]]; - fsum = f0+f1+f2; - llk += log(fsum); - } - - //notice("fVcf::emAF() finished - returning (%.9lf, %lf)",p,llk); - return std::pair(p,llk); - } - - double LRT(int m, std::vector& g1, std::vector& g2, double& af1, double& af2) { - std::vector g; - std::pair p; - for(int i=0; i < (int)g1.size(); ++i) { g.push_back(g1[i]); } - for(int i=0; i < (int)g2.size(); ++i) { g.push_back(g2[i]); } - double llk0 = emAF(m, g, 1e-6).second; - p = emAF(m, g1, 1e-6); - af1 = p.first; - double llk1 = p.second; - p = emAF(m, g2, 1e-6); - af2 = p.first; - llk1 += p.second; - - //printf("%d\t%lf\t%lf\t%lf\n",m,llk0,llk1,llk1-llk0); - - return( 2*(llk1 - llk0) ); - } -}; - -const float fVcf::NAN_FLT = sqrtf(-1.); // assign float NAN value -const double fVcf::NAN_DBL = sqrt(-1.); // assign double NAN value - -#endif // __TABIXED_VCF_H diff --git a/src/genomeLoci.h b/src/genomeLoci.h deleted file mode 100644 index 00010a8..0000000 --- a/src/genomeLoci.h +++ /dev/null @@ -1,210 +0,0 @@ -#include -#include -#include -#include -#include -#include "Error.h" - -class genomeLocus { - public: - std::string chrom; - int beg1; // includes 1-based, excludes 0-based - int end0; // excludes 1-based, includes 0-based - char buf[255]; - - genomeLocus(const char* c, int b, int e) : chrom(c), beg1(b), end0(e) { - sprintf(buf,"%s:%d-%d",c,b,e); - } - - genomeLocus(const char* region) { - strcpy(buf,region); - const char* pcolon = strchr(region,':'); - const char* pminus = strchr(pcolon+1,'-'); - if ( ( pcolon == NULL ) || ( pminus == NULL ) ) - error("Cannot parse %s in genomeLocus::genomeLocus()"); - chrom = std::string(region,0,pcolon-region); - beg1 = atoi(pcolon+1); - end0 = atoi(pminus+1); - } - - const char* toString() const { - return buf; - } - - bool operator< (const genomeLocus& l) const { - if ( chrom == l.chrom ) { - if ( beg1 == l.beg1 ) { - return ( end0 < l.end0 ); - } - else { - return ( beg1 < l.beg1 ); - } - } - else { - int n1 = atoi(chrom.c_str()); - int n2 = atoi(l.chrom.c_str()); - if ( ( n1 == 0 ) && ( n2 == 0 ) ) { - return chrom < l.chrom; - } - else if ( ( n1 > 0 ) && ( n2 > 0 ) ) { - return n1 < n2; - } - else { // treat n1 == 0 as infinite - return ( n1 > 0 ) ? true : false; - } - } - } - - unsigned long length() const { return end0-beg1+1; } - - bool overlaps (const genomeLocus& l) const { - if ( chrom == l.chrom ) { - if ( ( beg1 <= l.end0 ) && ( l.beg1 <= end0 ) ) { - return true; - } - else { - return false; - } - } - else { - return false; - } - } - - bool merge (const genomeLocus& l) { - if ( chrom == l.chrom ) { - if ( ( beg1-1 <= l.end0 ) && ( l.beg1-1 <= end0 ) ) { - if ( l.beg1 < beg1 ) beg1 = l.beg1; - if ( l.end0 > end0 ) end0 = l.end0; - return true; - } - else { - return false; - } - } - else { - return false; - } - } - - bool contains0(const char* chr, int pos0) const { return contains1(chr,pos0+1); } - - bool contains1(const char* chr, int pos1) const { - if ( chrom == chr ) { - return ( ( pos1 >= beg1 ) && ( pos1 <= end0 ) ); - } - else { - return false; - } - } -}; - -class genomeLoci { - public: - std::set loci; - std::set::iterator it; - bool overlapResolved; - - genomeLoci() : overlapResolved(false) {} - - void rewind() { it = loci.begin(); } - bool next() { ++it; return ( it != loci.end() ); } - bool isend() { return ( it == loci.end() ); } - const genomeLocus& currentLocus() { return (*it); } - bool empty() { return loci.empty(); } - - int numLocus() const { return (int)loci.size(); } - - bool add(const char* chr, int beg1, int end0) { - overlapResolved = false; - return loci.insert(genomeLocus(chr,beg1,end0)).second; - } - - bool add(const char* region) { - overlapResolved = false; - return loci.insert(genomeLocus(region)).second; - } - - int resolveOverlaps() { - if ( !overlapResolved ) { - std::set::iterator it; - std::set::iterator prev; - int numMerged = 0; - for(it = loci.begin(); it != loci.end(); ++it) { - if ( it != loci.begin() ) { - if ( prev->overlaps(*it) ) { - // if overlaps, erase both and insert merged one - genomeLocus locus = *prev; - locus.merge(*it); - loci.erase(it); - loci.erase(prev); - prev = it = loci.insert(locus).first; - ++numMerged; - } - else { - prev = it; - } - } - else { - prev = it; - } - } - overlapResolved = true; - return numMerged; - } - else { - return 0; - } - return 0; - } - - unsigned long totalLength() const { - //resolveOverlaps(); - unsigned long sz = 0; - std::set::iterator it; - for(it = loci.begin(); it != loci.end(); ++it) { - sz += it->length(); - } - return sz; - } - - bool moveTo(const char* chr, int pos1) { - genomeLocus locus(chr, pos1, pos1); - it = loci.lower_bound(locus); - if ( it == loci.begin() ) { // do nothing - return (it->contains1(chr,pos1)); - } - else if ( it == loci.end() ) { - std::set::iterator i = it; - --i; - if ( i->contains1(chr,pos1) ) { it = i; return true; } - else { return false; } - } - else { - if ( it->contains1(chr,pos1) ) return true; - else { - std::set::iterator i = it; - --i; - if ( i->contains1(chr,pos1) ) { it = i; return true; } - else { return false; } - } - } - } - - bool contains1(const char* chr, int pos1) { - genomeLocus locus(chr, pos1, pos1); - std::set::iterator i = loci.lower_bound(locus); - --i; - //std::set::iterator it = loci.lower_bound(locus); - if ( i != loci.end() ) { - //if ( ( i->chrom == chr ) && ( i->beg1 <= pos1 ) && ( i->end0 >= pos1 ) ) { - //notice("%s %s %d %d %d %d",i->chrom.c_str(), chr, i->beg1, i->end0, pos1, ( i->chrom == chr ) && ( i->beg1 <= pos1 ) && ( i->end0 >= pos1 ) ); - //} - - return ( ( it->chrom == chr ) && ( it->beg1 <= pos1 ) && ( it->end0 >= pos1 ) ); - } - else { - return false; - } - } -}; diff --git a/src/genomePosition.cpp b/src/genomePosition.cpp deleted file mode 100644 index 5868d13..0000000 --- a/src/genomePosition.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include -#include "genomePosition.h" -#include "pFile.h" -#include "Error.h" - -#define DEFAULT_NUM_CHRS 25 - -genomePosition genomePos; - -genomePosition::genomePosition() { - // hg19 by default - const char* _chrs[DEFAULT_NUM_CHRS] = {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","X","Y","MT"}; - uint64_t _szs[DEFAULT_NUM_CHRS] = { - 249250621 - ,243199373 - ,198022430 - ,191154276 - ,180915260 - ,171115067 - ,159138663 - ,146364022 - ,141213431 - ,135534747 - ,135006516 - ,133851895 - ,115169878 - ,107349540 - ,102531392 - ,90354753 - ,81195210 - ,78077248 - ,59128983 - ,63025520 - ,48129895 - ,51304566 - ,155270560 - ,59373566 - ,16569 - }; - - uint64_t cum = 0; - for(int i=0; i < DEFAULT_NUM_CHRS; ++i) { - mChrs[_chrs[i]] = (int)chrs.size(); - chrs.push_back(_chrs[i]); - szChrs.push_back(_szs[i]); - cum += _szs[i]; - cumChrs.push_back(cum); - } -} - -void genomePosition::loadFastaIndex(const char* fai) { - pFile pf(fai); - const char* line = NULL; - std::vector tokens; - chrs.clear(); - szChrs.clear(); - cumChrs.clear(); - mChrs.clear(); - uint64_t sz = 0, cum = 0; - while( ( line = pf.getLine() ) != NULL ) { - pFile::tokenizeLine(line," \t\r\n", tokens); - if ( tokens.size() < 2 ) error("Cannot parse fai file %s - observed line is '%s'",fai,line); - sz = atoi(tokens[1].c_str()); - mChrs[tokens[0]] = (int)chrs.size(); - chrs.push_back(tokens[0]); - szChrs.push_back(sz); - cum += sz; - } -} - -uint64_t genomePosition::fromPos(const std::string& chr, int pos) { - std::map::iterator it = mChrs.find(chr); - if ( it == mChrs.end() ) { - warning("genomePosition::fromPos() Cannot find chromosome %s",chr.c_str()); - return 0; - } - else { - return ( cumChrs[it->second] - szChrs[it->second] + (uint64_t)pos ); - } -} - -uint64_t genomePosition::fromPos(const char* chr, int pos) { - std::string schr(chr); - return fromPos(schr,pos); -} - -std::pair genomePosition::toPos(uint64_t upos) { - for(int i=0; i < (int)chrs.size(); ++i) { - if ( upos < cumChrs[i] ) { - return std::pair (chrs[i],(int)(upos-(cumChrs[i]-szChrs[i]))); - } - } - error("UPOS %llu exceeds the size of the genome",upos); - return std::pair ("NA",0); -} - diff --git a/src/genomePosition.h b/src/genomePosition.h deleted file mode 100644 index 171a890..0000000 --- a/src/genomePosition.h +++ /dev/null @@ -1,231 +0,0 @@ -#ifndef __GENOME_POSITION_H__ -#define __GENOME_POSITION_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "Error.h" - -class genomePosition -{ - protected: - std::map mChrs; - std::vector chrs; - std::vector szChrs; - std::vector cumChrs; - -public: - genomePosition(); - void loadFastaIndex(const char* fai); - uint64_t fromPos(const char* chr, int pos); - uint64_t fromPos(const std::string& chr, int pos); - std::pair toPos(uint64_t upos); - uint64_t genomeSize() { return cumChrs.back(); } -}; - -extern genomePosition genomePos; - -class genomePosLocus { - public: - uint64_t ubeg1; - uint64_t uend0; - - genomePosLocus(uint64_t b, uint64_t e) : ubeg1(b), uend0(e) {} - - genomePosLocus(const char* c, int b, int e) { - ubeg1 = genomePos.fromPos(c,b); - uend0 = genomePos.fromPos(c,e); - } - - genomePosLocus(const char* region) { - const char* pcolon = strchr(region,':'); - const char* pminus = strchr(pcolon+1,'-'); - if ( ( pcolon == NULL ) || ( pminus == NULL ) ) - error("Cannot parse %s in genomePosLocus::genomePosLocus()",region); - std::string chrom = std::string(region,0,pcolon-region); - ubeg1 = genomePos.fromPos(chrom,atoi(pcolon+1)); - uend0 = genomePos.fromPos(chrom,atoi(pminus+1)); - } - - bool operator< (const genomePosLocus& l) const { - if ( ubeg1 == l.ubeg1 ) { - return ( uend0 < l.uend0 ); - } - else { - return ( ubeg1 < l.ubeg1 ); - } - } - - uint64_t length() const { - //error("%lld\t%lld\t%lld",uend0,ubeg1,uend0-ubeg1+1); - if ( uend0 < ubeg1 ) { - error("genomePosLocus::length() - %llu\t%llu",ubeg1,uend0); - } - return (uend0-ubeg1+1); - } - - bool overlaps (const genomePosLocus& l) const { - if ( ( ubeg1 <= l.uend0 ) && ( l.ubeg1 <= uend0 ) ) { - return true; - } - else { - return false; - } - } - - bool merge (const genomePosLocus& l) { - if ( ( ubeg1-1 <= l.uend0 ) && ( l.ubeg1-1 <= uend0 ) ) { - if ( l.ubeg1 < ubeg1 ) ubeg1 = l.ubeg1; - if ( l.uend0 > uend0 ) uend0 = l.uend0; - return true; - } - else { - return false; - } - } - - bool contains0(uint64_t upos0) const { - return contains1(upos0+1); - } - - bool contains0(const char* chr, int pos0) const { - return contains1(chr,pos0+1); - } - - bool contains1(const char* chr, int pos1) const { - return contains1(genomePos.fromPos(chr,pos1)); - } - - bool contains1(uint64_t upos1) const { - return ( ( upos1 >= ubeg1 ) && ( upos1 <= uend0 ) ); - } -}; - -class genomePosLoci { - public: - std::set loci; - std::set::iterator it; - bool overlapResolved; - - genomePosLoci() : overlapResolved(false) {} - - void rewind() { it = loci.begin(); } - bool next() { ++it; return ( it != loci.end() ); } - bool isend() { return ( it == loci.end() ); } - const genomePosLocus& currentLocus() { return (*it); } - bool empty() { return loci.empty(); } - - int numLocus() const { return (int)loci.size(); } - - bool add(const char* chr, int beg1, int end0) { - overlapResolved = false; - if ( beg1 > end0 ) error("genomePosLoci::add() Negative interval %s:%d-%d",chr,beg1,end0); - return loci.insert(genomePosLocus(chr,beg1,end0)).second; - } - - bool add(const char* region) { - overlapResolved = false; - return loci.insert(genomePosLocus(region)).second; - } - - bool add(uint64_t ubeg1, uint64_t uend0) { - overlapResolved = false; - if ( ubeg1 > uend0 ) error("genomePosLoci::add() Negative interval %llu-%llu",ubeg1,uend0); - return loci.insert(genomePosLocus(ubeg1,uend0)).second; - } - - int resolveOverlaps() { - if ( !overlapResolved ) { - std::set::iterator it; - std::set::iterator prev; - int numMerged = 0; - for(it = loci.begin(); it != loci.end(); ++it) { - if ( it != loci.begin() ) { - if ( prev->overlaps(*it) ) { - // if overlaps, erase both and insert merged one - genomePosLocus locus = *prev; - locus.merge(*it); - loci.erase(it); - loci.erase(prev); - prev = it = loci.insert(locus).first; - ++numMerged; - } - else { - prev = it; - } - } - else { - prev = it; - } - } - overlapResolved = true; - return numMerged; - } - else { - return 0; - } - return 0; - } - - uint64_t totalLength() const { - uint64_t sz = 0; - std::set::iterator it; - for(it = loci.begin(); it != loci.end(); ++it) { - sz += it->length(); - //notice("%llu\t%llu\t%llu\t%llu",it->ubeg1,it->uend0,it->length(),sz); - } - return sz; - } - - bool moveTo(uint64_t upos1) { - genomePosLocus locus(upos1,upos1); - it = loci.lower_bound(locus); - if ( it == loci.begin() ) { // do nothing - return (it->contains1(upos1)); - } - else if ( it == loci.end() ) { - std::set::iterator i = it; - --i; - if ( i->contains1(upos1) ) { it = i; return true; } - else { return false; } - } - else { - if ( it->contains1(upos1) ) return true; - else { - std::set::iterator i = it; - --i; - if ( i->contains1(upos1) ) { it = i; return true; } - else { return false; } - } - } - } - - bool moveTo(const char* chr, int pos1) { - return moveTo(genomePos.fromPos(chr,pos1)); - } - - bool contains1(uint64_t upos1) { - genomePosLocus locus(upos1,upos1); - std::set::iterator i = loci.lower_bound(locus); - --i; - if ( i != loci.end() ) { - return ( ( it->ubeg1 <= upos1 ) && ( it->uend0 >= upos1 ) ); - } - else { - return false; - } - } - - bool contains1(const char* chr, int pos1) { - return contains1(genomePos.fromPos(chr,pos1)); - } -}; - -#endif - - diff --git a/src/genomeScore.h b/src/genomeScore.h deleted file mode 100644 index 62f2c93..0000000 --- a/src/genomeScore.h +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include -#include - -class genomeScore { - std::string dir; - std::map fpmap; - std::string curChrom; - - bool openChr(const char* chrom) { - if ( fpmap.find(chrom) != fpmap.end() ) { - // file pointer already exist. Do nothing - return false; - } - else { - std::string fname = dir + "/chr" + chrom + ".fbin"; - FILE* fp = fopen(fname.c_str(),"rb"); - if ( fp == NULL ) { - error("Cannot open genomeScore file %s",fname.c_str()); - return false; - } - fpmap[chrom] = fp; - return true; - } - } - - public: - genomeScore() {} - genomeScore(const char* _dir) : dir(_dir) {} - - bool empty() { return dir.empty(); } - - void setDir(const char* _dir) { - if ( !dir.empty() ) { - for(std::map::iterator it = fpmap.begin(); - it != fpmap.end(); ++it) { - fclose(it->second); - } - fpmap.clear(); - } - dir = _dir; - } - - ~genomeScore() { - for(std::map::iterator it = fpmap.begin(); - it != fpmap.end(); ++it) { - fclose(it->second); - } - fpmap.clear(); - } - - float baseScore(const char* chrom, int pos) { - openChr(chrom); - FILE* fp = fpmap[chrom]; - if ( fseek(fp, (pos-1)*4, SEEK_SET) != 0 ) { - warning("Cannot access base position %s:%d in %s",chrom,pos,dir.c_str()); - return 0; - } - float ret; - if ( fread(&ret,sizeof(float),1,fp) == 0 ) { - warning("Cannot read base position %s:%d in %s",chrom,pos,dir.c_str()); - return 0; - } - //error("baseScore(%s,%d)=%f",chrom,pos,ret); - return ret; - } - - float baseScore(const char* markerID) { - char* pcolon = strchr((char*)markerID,':'); - if ( pcolon == NULL) { - warning("Cannot parse marker %s in %s",markerID,dir.c_str()); - return 0; - } - std::string chrom(markerID,pcolon-markerID); - int pos = atoi(pcolon+1); - return baseScore(chrom.c_str(),pos); - } -}; diff --git a/src/hDist.h b/src/hDist.h deleted file mode 100644 index 5a4b151..0000000 --- a/src/hDist.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef __H_DIST_H -#define __H_DIST_H - -/* - * Lower tail quantile for standard normal distribution function. - * - * This function returns an approximation of the inverse cumulative - * standard normal distribution function. I.e., given P, it returns - * an approximation to the X satisfying P = Pr{Z <= X} where Z is a - * random variable from the standard normal distribution. - * - * The algorithm uses a minimax approximation by rational functions - * and the result has a relative error whose absolute value is less - * than 1.15e-9. - * - * Author: Peter J. Acklam - * Time-stamp: 2002-06-09 18:45:44 +0200 - * E-mail: jacklam@math.uio.no - * WWW URL: http://www.math.uio.no/~jacklam - * - * C implementation adapted from Peter's Perl version - */ - -#include -#include - -#define LOW 0.02425 -#define HIGH 0.97575 - -/* Coefficients in rational approximations. */ -static const double a[] = { - -3.969683028665376e+01, - 2.209460984245205e+02, - -2.759285104469687e+02, - 1.383577518672690e+02, - -3.066479806614716e+01, - 2.506628277459239e+00 -}; - -static const double b[] = { - -5.447609879822406e+01, - 1.615858368580409e+02, - -1.556989798598866e+02, - 6.680131188771972e+01, - -1.328068155288572e+01 -}; - -static const double c[] = { - -7.784894002430293e-03, - -3.223964580411365e-01, - -2.400758277161838e+00, - -2.549732539343734e+00, - 4.374664141464968e+00, - 2.938163982698783e+00 -}; - -static const double d[] = { - 7.784695709041462e-03, - 3.224671290700398e-01, - 2.445134137142996e+00, - 3.754408661907416e+00 -}; - -class hDist { - public: - static double pval2z(double p) { // convert p-value to z-score scale, handling boundary condition properly - // when p-value is zero or less than 1e-300, consider them as 1e-300 - // when p-value is 1, consider them as 0.999 - if ( p < 1e-300 ) return 38.06579; - //else if ( p > 0.999 ) return -2.090232; - else return 0-ltqnorm(p/2.); - } - - static double ltqnorm(double p) { - double q, r; - - errno = 0; - - if (p < 0 || p > 1) { - errno = EDOM; - return 0.0; - } - else if (p == 0) { - errno = ERANGE; - return -HUGE_VAL /* minus "infinity" */; - } - else if (p == 1) { - errno = ERANGE; - return HUGE_VAL /* "infinity" */; - } - else if (p < LOW) { - /* Rational approximation for lower region */ - q = sqrt(-2*log(p)); - return (((((c[0]*q+c[1])*q+c[2])*q+c[3])*q+c[4])*q+c[5]) / - ((((d[0]*q+d[1])*q+d[2])*q+d[3])*q+1); - } - else if (p > HIGH) { - /* Rational approximation for upper region */ - q = sqrt(-2*log(1-p)); - return -(((((c[0]*q+c[1])*q+c[2])*q+c[3])*q+c[4])*q+c[5]) / - ((((d[0]*q+d[1])*q+d[2])*q+d[3])*q+1); - } - else { - /* Rational approximation for central region */ - q = p - 0.5; - r = q*q; - return (((((a[0]*r+a[1])*r+a[2])*r+a[3])*r+a[4])*r+a[5])*q / - (((((b[0]*r+b[1])*r+b[2])*r+b[3])*r+b[4])*r+1); - } - } -}; - -#endif // __H_DIST_H diff --git a/src/index.c b/src/index.c deleted file mode 100644 index 15cd65e..0000000 --- a/src/index.c +++ /dev/null @@ -1,967 +0,0 @@ -#include -#include -#include -#include "khash.h" -#include "ksort.h" -#include "kstring.h" -#include "bam_endian.h" -#ifdef _USE_KNETFILE -#include "knetfile.h" -#endif -#include "tabix.h" - -#define TAD_MIN_CHUNK_GAP 32768 -// 1<<14 is the size of minimum bin. -#define TAD_LIDX_SHIFT 14 - -typedef struct { - uint64_t u, v; -} pair64_t; - -#define pair64_lt(a,b) ((a).u < (b).u) -KSORT_INIT(offt, pair64_t, pair64_lt) - -typedef struct { - uint32_t m, n; - pair64_t *list; -} ti_binlist_t; - -typedef struct { - int32_t n, m; - uint64_t *offset; -} ti_lidx_t; - -KHASH_MAP_INIT_INT(i, ti_binlist_t) -KHASH_MAP_INIT_STR(s, int) - -struct __ti_index_t { - ti_conf_t conf; - int32_t n, max; - khash_t(s) *tname; - khash_t(i) **index; - ti_lidx_t *index2; -}; - -struct __ti_iter_t { - int from_first; // read from the first record; no random access - int tid, beg, end, n_off, i, finished; - uint64_t curr_off; - kstring_t str; - const ti_index_t *idx; - pair64_t *off; -}; - -typedef struct { - int tid, beg, end, bin; -} ti_intv_t; - -ti_conf_t ti_conf_gff = { 0, 1, 4, 5, '#', 0 }; -ti_conf_t ti_conf_bed = { TI_FLAG_UCSC, 1, 2, 3, '#', 0 }; -ti_conf_t ti_conf_psltbl = { TI_FLAG_UCSC, 15, 17, 18, '#', 0 }; -ti_conf_t ti_conf_sam = { TI_PRESET_SAM, 3, 4, 0, '@', 0 }; -ti_conf_t ti_conf_vcf = { TI_PRESET_VCF, 1, 2, 0, '#', 0 }; - -/*************** - * read a line * - ***************/ - -/* -int ti_readline(BGZF *fp, kstring_t *str) -{ - int c, l = 0; - str->l = 0; - while ((c = bgzf_getc(fp)) >= 0 && c != '\n') { - ++l; - if (c != '\r') kputc(c, str); - } - if (c < 0 && l == 0) return -1; // end of file - return str->l; -} -*/ - -/* Below is a faster implementation largely equivalent to the one - * commented out above. */ -int ti_readline(BGZF *fp, kstring_t *str) -{ - return bgzf_getline(fp, '\n', str); -} - -/************************************* - * get the interval from a data line * - *************************************/ - -static inline int ti_reg2bin(uint32_t beg, uint32_t end) -{ - --end; - if (beg>>14 == end>>14) return 4681 + (beg>>14); - if (beg>>17 == end>>17) return 585 + (beg>>17); - if (beg>>20 == end>>20) return 73 + (beg>>20); - if (beg>>23 == end>>23) return 9 + (beg>>23); - if (beg>>26 == end>>26) return 1 + (beg>>26); - return 0; -} - -static int get_tid(ti_index_t *idx, const char *ss) -{ - khint_t k; - int tid; - k = kh_get(s, idx->tname, ss); - if (k == kh_end(idx->tname)) { // a new target sequence - int ret, size; - // update idx->n, ->max, ->index and ->index2 - if (idx->n == idx->max) { - idx->max = idx->max? idx->max<<1 : 8; - idx->index = realloc(idx->index, idx->max * sizeof(void*)); - idx->index2 = realloc(idx->index2, idx->max * sizeof(ti_lidx_t)); - } - memset(&idx->index2[idx->n], 0, sizeof(ti_lidx_t)); - idx->index[idx->n++] = kh_init(i); - // update ->tname - tid = size = kh_size(idx->tname); - k = kh_put(s, idx->tname, strdup(ss), &ret); - kh_value(idx->tname, k) = size; - assert(idx->n == kh_size(idx->tname)); - } else tid = kh_value(idx->tname, k); - return tid; -} - -int ti_get_intv(const ti_conf_t *conf, int len, char *line, ti_interval_t *intv) -{ - int i, b = 0, id = 1, ncols = 0; - char *s; - intv->ss = intv->se = 0; intv->beg = intv->end = -1; - for (i = 0; i <= len; ++i) { - if (line[i] == '\t' || line[i] == 0) { - ++ncols; - if (id == conf->sc) { - intv->ss = line + b; intv->se = line + i; - } else if (id == conf->bc) { - // here ->beg is 0-based. - intv->beg = intv->end = strtol(line + b, &s, 0); - if (!(conf->preset&TI_FLAG_UCSC)) --intv->beg; - else ++intv->end; - if (intv->beg < 0) intv->beg = 0; - if (intv->end < 1) intv->end = 1; - } else { - if ((conf->preset&0xffff) == TI_PRESET_GENERIC) { - if (id == conf->ec) intv->end = strtol(line + b, &s, 0); - } else if ((conf->preset&0xffff) == TI_PRESET_SAM) { - if (id == 6) { // CIGAR - int l = 0, op; - char *t; - for (s = line + b; s < line + i;) { - long x = strtol(s, &t, 10); - op = toupper(*t); - if (op == 'M' || op == 'D' || op == 'N') l += x; - s = t + 1; - } - if (l == 0) l = 1; - intv->end = intv->beg + l; - } - } else if ((conf->preset&0xffff) == TI_PRESET_VCF) { - // FIXME: the following is NOT tested and is likely to be buggy - if (id == 4) { - if (b < i) intv->end = intv->beg + (i - b); - } else if (id == 8) { // look for "END=" - int c = line[i]; - line[i] = 0; - s = strstr(line + b, "END="); - if (s == line + b) s += 4; - else if (s) { - s = strstr(line + b, ";END="); - if (s) s += 5; - } - if (s) intv->end = strtol(s, &s, 0); - line[i] = c; - } - } - } - b = i + 1; - ++id; - } - } -/* - if (ncols < conf->sc || ncols < conf->bc || ncols < conf->ec) { - if (ncols == 1) fprintf(stderr,"[get_intv] Is the file tab-delimited? The line has %d field only: %s\n", ncols, line); - else fprintf(stderr,"[get_intv] The line has %d field(s) only: %s\n", ncols, line); - exit(1); - } -*/ - if (intv->ss == 0 || intv->se == 0 || intv->beg < 0 || intv->end < 0) return -1; - return 0; -} - -static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv) -{ - ti_interval_t x; - intv->tid = intv->beg = intv->end = intv->bin = -1; - if (ti_get_intv(&idx->conf, str->l, str->s, &x) == 0) { - int c = *x.se; - *x.se = '\0'; intv->tid = get_tid(idx, x.ss); *x.se = c; - intv->beg = x.beg; intv->end = x.end; - intv->bin = ti_reg2bin(intv->beg, intv->end); - return (intv->tid >= 0 && intv->beg >= 0 && intv->end >= 0)? 0 : -1; - } else { - fprintf(stderr, "[%s] the following line cannot be parsed and skipped: %s\n", __func__, str->s); - return -1; - } -} - -/************ - * indexing * - ************/ - -// requirement: len <= LEN_MASK -static inline void insert_offset(khash_t(i) *h, int bin, uint64_t beg, uint64_t end) -{ - khint_t k; - ti_binlist_t *l; - int ret; - k = kh_put(i, h, bin, &ret); - l = &kh_value(h, k); - if (ret) { // not present - l->m = 1; l->n = 0; - l->list = (pair64_t*)calloc(l->m, 16); - } - if (l->n == l->m) { - l->m <<= 1; - l->list = (pair64_t*)realloc(l->list, l->m * 16); - } - l->list[l->n].u = beg; l->list[l->n++].v = end; -} - -static inline uint64_t insert_offset2(ti_lidx_t *index2, int _beg, int _end, uint64_t offset) -{ - int i, beg, end; - beg = _beg >> TAD_LIDX_SHIFT; - end = (_end - 1) >> TAD_LIDX_SHIFT; - if (index2->m < end + 1) { - int old_m = index2->m; - index2->m = end + 1; - kroundup32(index2->m); - index2->offset = (uint64_t*)realloc(index2->offset, index2->m * 8); - memset(index2->offset + old_m, 0, 8 * (index2->m - old_m)); - } - if (beg == end) { - if (index2->offset[beg] == 0) index2->offset[beg] = offset; - } else { - for (i = beg; i <= end; ++i) - if (index2->offset[i] == 0) index2->offset[i] = offset; - } - if (index2->n < end + 1) index2->n = end + 1; - return (uint64_t)beg<<32 | end; -} - -static void merge_chunks(ti_index_t *idx) -{ - khash_t(i) *index; - int i, l, m; - khint_t k; - for (i = 0; i < idx->n; ++i) { - index = idx->index[i]; - for (k = kh_begin(index); k != kh_end(index); ++k) { - ti_binlist_t *p; - if (!kh_exist(index, k)) continue; - p = &kh_value(index, k); - m = 0; - for (l = 1; l < p->n; ++l) { - if (p->list[m].v>>16 == p->list[l].u>>16) p->list[m].v = p->list[l].v; - else p->list[++m] = p->list[l]; - } // ~for(l) - p->n = m + 1; - } // ~for(k) - } // ~for(i) -} - -static void fill_missing(ti_index_t *idx) -{ - int i, j; - for (i = 0; i < idx->n; ++i) { - ti_lidx_t *idx2 = &idx->index2[i]; - for (j = 1; j < idx2->n; ++j) - if (idx2->offset[j] == 0) - idx2->offset[j] = idx2->offset[j-1]; - } -} - -ti_index_t *ti_index_core(BGZF *fp, const ti_conf_t *conf) -{ - int ret; - ti_index_t *idx; - uint32_t last_bin, save_bin; - int32_t last_coor, last_tid, save_tid; - uint64_t save_off, last_off, lineno = 0, offset0 = (uint64_t)-1, tmp; - kstring_t *str; - - str = calloc(1, sizeof(kstring_t)); - - idx = (ti_index_t*)calloc(1, sizeof(ti_index_t)); - idx->conf = *conf; - idx->n = idx->max = 0; - idx->tname = kh_init(s); - idx->index = 0; - idx->index2 = 0; - - save_bin = save_tid = last_tid = last_bin = 0xffffffffu; - save_off = last_off = bgzf_tell(fp); last_coor = 0xffffffffu; - while ((ret = ti_readline(fp, str)) >= 0) { - ti_intv_t intv; - ++lineno; - if (lineno <= idx->conf.line_skip || str->s[0] == idx->conf.meta_char) { - last_off = bgzf_tell(fp); - continue; - } - get_intv(idx, str, &intv); - if ( intv.beg<0 || intv.end<0 ) - { - fprintf(stderr,"[ti_index_core] the indexes overlap or are out of bounds\n"); - exit(1); - } - if (last_tid != intv.tid) { // change of chromosomes - if (last_tid>intv.tid ) - { - fprintf(stderr,"[ti_index_core] the chromosome blocks not continuous at line %llu, is the file sorted? [pos %d]\n",(unsigned long long)lineno,intv.beg+1); - exit(1); - } - last_tid = intv.tid; - last_bin = 0xffffffffu; - } else if (last_coor > intv.beg) { - fprintf(stderr, "[ti_index_core] the file out of order at line %llu\n", (unsigned long long)lineno); - exit(1); - } - tmp = insert_offset2(&idx->index2[intv.tid], intv.beg, intv.end, last_off); - if (last_off == 0) offset0 = tmp; - if (intv.bin != last_bin) { // then possibly write the binning index - if (save_bin != 0xffffffffu) // save_bin==0xffffffffu only happens to the first record - insert_offset(idx->index[save_tid], save_bin, save_off, last_off); - save_off = last_off; - save_bin = last_bin = intv.bin; - save_tid = intv.tid; - if (save_tid < 0) break; - } - if (bgzf_tell(fp) <= last_off) { - fprintf(stderr, "[ti_index_core] bug in BGZF: %llx < %llx\n", - (unsigned long long)bgzf_tell(fp), (unsigned long long)last_off); - exit(1); - } - last_off = bgzf_tell(fp); - last_coor = intv.beg; - } - if (save_tid >= 0) insert_offset(idx->index[save_tid], save_bin, save_off, bgzf_tell(fp)); - merge_chunks(idx); - fill_missing(idx); - if (offset0 != (uint64_t)-1 && idx->n && idx->index2[0].offset) { - int i, beg = offset0>>32, end = offset0&0xffffffffu; - for (i = beg; i <= end; ++i) idx->index2[0].offset[i] = 0; - } - - free(str->s); free(str); - return idx; -} - -void ti_index_destroy(ti_index_t *idx) -{ - khint_t k; - int i; - if (idx == 0) return; - // destroy the name hash table - for (k = kh_begin(idx->tname); k != kh_end(idx->tname); ++k) { - if (kh_exist(idx->tname, k)) - free((char*)kh_key(idx->tname, k)); - } - kh_destroy(s, idx->tname); - // destroy the binning index - for (i = 0; i < idx->n; ++i) { - khash_t(i) *index = idx->index[i]; - ti_lidx_t *index2 = idx->index2 + i; - for (k = kh_begin(index); k != kh_end(index); ++k) { - if (kh_exist(index, k)) - free(kh_value(index, k).list); - } - kh_destroy(i, index); - free(index2->offset); - } - free(idx->index); - // destroy the linear index - free(idx->index2); - free(idx); -} - -/****************** - * index file I/O * - ******************/ - -void ti_index_save(const ti_index_t *idx, BGZF *fp) -{ - int32_t i, size, ti_is_be; - khint_t k; - ti_is_be = bam_is_big_endian(); - bgzf_write(fp, "TBI\1", 4); - if (ti_is_be) { - uint32_t x = idx->n; - bgzf_write(fp, bam_swap_endian_4p(&x), 4); - } else bgzf_write(fp, &idx->n, 4); - assert(sizeof(ti_conf_t) == 24); - if (ti_is_be) { // write ti_conf_t; - uint32_t x[6]; - memcpy(x, &idx->conf, 24); - for (i = 0; i < 6; ++i) bgzf_write(fp, bam_swap_endian_4p(&x[i]), 4); - } else bgzf_write(fp, &idx->conf, sizeof(ti_conf_t)); - { // write target names - char **name; - int32_t l = 0; - name = calloc(kh_size(idx->tname), sizeof(void*)); - for (k = kh_begin(idx->tname); k != kh_end(idx->tname); ++k) - if (kh_exist(idx->tname, k)) - name[kh_value(idx->tname, k)] = (char*)kh_key(idx->tname, k); - for (i = 0; i < kh_size(idx->tname); ++i) - l += strlen(name[i]) + 1; - if (ti_is_be) bgzf_write(fp, bam_swap_endian_4p(&l), 4); - else bgzf_write(fp, &l, 4); - for (i = 0; i < kh_size(idx->tname); ++i) - bgzf_write(fp, name[i], strlen(name[i]) + 1); - free(name); - } - for (i = 0; i < idx->n; ++i) { - khash_t(i) *index = idx->index[i]; - ti_lidx_t *index2 = idx->index2 + i; - // write binning index - size = kh_size(index); - if (ti_is_be) { // big endian - uint32_t x = size; - bgzf_write(fp, bam_swap_endian_4p(&x), 4); - } else bgzf_write(fp, &size, 4); - for (k = kh_begin(index); k != kh_end(index); ++k) { - if (kh_exist(index, k)) { - ti_binlist_t *p = &kh_value(index, k); - if (ti_is_be) { // big endian - uint32_t x; - x = kh_key(index, k); bgzf_write(fp, bam_swap_endian_4p(&x), 4); - x = p->n; bgzf_write(fp, bam_swap_endian_4p(&x), 4); - for (x = 0; (int)x < p->n; ++x) { - bam_swap_endian_8p(&p->list[x].u); - bam_swap_endian_8p(&p->list[x].v); - } - bgzf_write(fp, p->list, 16 * p->n); - for (x = 0; (int)x < p->n; ++x) { - bam_swap_endian_8p(&p->list[x].u); - bam_swap_endian_8p(&p->list[x].v); - } - } else { - bgzf_write(fp, &kh_key(index, k), 4); - bgzf_write(fp, &p->n, 4); - bgzf_write(fp, p->list, 16 * p->n); - } - } - } - // write linear index (index2) - if (ti_is_be) { - int x = index2->n; - bgzf_write(fp, bam_swap_endian_4p(&x), 4); - } else bgzf_write(fp, &index2->n, 4); - if (ti_is_be) { // big endian - int x; - for (x = 0; (int)x < index2->n; ++x) - bam_swap_endian_8p(&index2->offset[x]); - bgzf_write(fp, index2->offset, 8 * index2->n); - for (x = 0; (int)x < index2->n; ++x) - bam_swap_endian_8p(&index2->offset[x]); - } else bgzf_write(fp, index2->offset, 8 * index2->n); - } -} - -static ti_index_t *ti_index_load_core(BGZF *fp) -{ - int i, ti_is_be; - char magic[4]; - ti_index_t *idx; - ti_is_be = bam_is_big_endian(); - if (fp == 0) { - fprintf(stderr, "[ti_index_load_core] fail to load index.\n"); - return 0; - } - bgzf_read(fp, magic, 4); - if (strncmp(magic, "TBI\1", 4)) { - fprintf(stderr, "[ti_index_load] wrong magic number.\n"); - return 0; - } - idx = (ti_index_t*)calloc(1, sizeof(ti_index_t)); - bgzf_read(fp, &idx->n, 4); - if (ti_is_be) bam_swap_endian_4p(&idx->n); - idx->tname = kh_init(s); - idx->index = (khash_t(i)**)calloc(idx->n, sizeof(void*)); - idx->index2 = (ti_lidx_t*)calloc(idx->n, sizeof(ti_lidx_t)); - // read idx->conf - bgzf_read(fp, &idx->conf, sizeof(ti_conf_t)); - if (ti_is_be) { - bam_swap_endian_4p(&idx->conf.preset); - bam_swap_endian_4p(&idx->conf.sc); - bam_swap_endian_4p(&idx->conf.bc); - bam_swap_endian_4p(&idx->conf.ec); - bam_swap_endian_4p(&idx->conf.meta_char); - bam_swap_endian_4p(&idx->conf.line_skip); - } - { // read target names - int j, ret; - kstring_t *str; - int32_t l; - uint8_t *buf; - bgzf_read(fp, &l, 4); - if (ti_is_be) bam_swap_endian_4p(&l); - buf = calloc(l, 1); - bgzf_read(fp, buf, l); - str = calloc(1, sizeof(kstring_t)); - for (i = j = 0; i < l; ++i) { - if (buf[i] == 0) { - khint_t k = kh_put(s, idx->tname, strdup(str->s), &ret); - kh_value(idx->tname, k) = j++; - str->l = 0; - } else kputc(buf[i], str); - } - free(str->s); free(str); free(buf); - } - for (i = 0; i < idx->n; ++i) { - khash_t(i) *index; - ti_lidx_t *index2 = idx->index2 + i; - uint32_t key, size; - khint_t k; - int j, ret; - ti_binlist_t *p; - index = idx->index[i] = kh_init(i); - // load binning index - bgzf_read(fp, &size, 4); - if (ti_is_be) bam_swap_endian_4p(&size); - for (j = 0; j < (int)size; ++j) { - bgzf_read(fp, &key, 4); - if (ti_is_be) bam_swap_endian_4p(&key); - k = kh_put(i, index, key, &ret); - p = &kh_value(index, k); - bgzf_read(fp, &p->n, 4); - if (ti_is_be) bam_swap_endian_4p(&p->n); - p->m = p->n; - p->list = (pair64_t*)malloc(p->m * 16); - bgzf_read(fp, p->list, 16 * p->n); - if (ti_is_be) { - int x; - for (x = 0; x < p->n; ++x) { - bam_swap_endian_8p(&p->list[x].u); - bam_swap_endian_8p(&p->list[x].v); - } - } - } - // load linear index - bgzf_read(fp, &index2->n, 4); - if (ti_is_be) bam_swap_endian_4p(&index2->n); - index2->m = index2->n; - index2->offset = (uint64_t*)calloc(index2->m, 8); - bgzf_read(fp, index2->offset, index2->n * 8); - if (ti_is_be) - for (j = 0; j < index2->n; ++j) bam_swap_endian_8p(&index2->offset[j]); - } - return idx; -} - -ti_index_t *ti_index_load_local(const char *fnidx) -{ - BGZF *fp; - fp = bgzf_open(fnidx, "r"); - if (fp) { - ti_index_t *idx = ti_index_load_core(fp); - bgzf_close(fp); - return idx; - } else return 0; -} - -#ifdef _USE_KNETFILE -static void download_from_remote(const char *url) -{ - const int buf_size = 1 * 1024 * 1024; - char *fn; - FILE *fp; - uint8_t *buf; - knetFile *fp_remote; - int l; - if (strstr(url, "ftp://") != url && strstr(url, "http://") != url) return; - l = strlen(url); - for (fn = (char*)url + l - 1; fn >= url; --fn) - if (*fn == '/') break; - ++fn; // fn now points to the file name - fp_remote = knet_open(url, "r"); - if (fp_remote == 0) { - fprintf(stderr, "[download_from_remote] fail to open remote file.\n"); - return; - } - if ((fp = fopen(fn, "w")) == 0) { - fprintf(stderr, "[download_from_remote] fail to create file in the working directory.\n"); - knet_close(fp_remote); - return; - } - buf = (uint8_t*)calloc(buf_size, 1); - while ((l = knet_read(fp_remote, buf, buf_size)) != 0) - fwrite(buf, 1, l, fp); - free(buf); - fclose(fp); - knet_close(fp_remote); -} -#else -static void download_from_remote(const char *url) -{ - return; -} -#endif - -static char *get_local_version(const char *fn) -{ - struct stat sbuf; - char *fnidx = (char*)calloc(strlen(fn) + 5, 1); - strcat(strcpy(fnidx, fn), ".tbi"); - if ((strstr(fnidx, "ftp://") == fnidx || strstr(fnidx, "http://") == fnidx)) { - char *p, *url; - int l = strlen(fnidx); - for (p = fnidx + l - 1; p >= fnidx; --p) - if (*p == '/') break; - url = fnidx; fnidx = strdup(p + 1); - if (stat(fnidx, &sbuf) == 0) { - free(url); - return fnidx; - } - fprintf(stderr, "[%s] downloading the index file...\n", __func__); - download_from_remote(url); - free(url); - } - if (stat(fnidx, &sbuf) == 0) return fnidx; - free(fnidx); return 0; -} - -const char **ti_seqname(const ti_index_t *idx, int *n) -{ - const char **names; - khint_t k; - *n = idx->n; - names = calloc(idx->n, sizeof(void*)); - for (k = kh_begin(idx->tname); k < kh_end(idx->tname); ++k) - if (kh_exist(idx->tname, k)) - names[kh_val(idx->tname, k)] = kh_key(idx->tname, k); - return names; -} - -ti_index_t *ti_index_load(const char *fn) -{ - ti_index_t *idx; - char *fname = get_local_version(fn); - if (fname == 0) return 0; - idx = ti_index_load_local(fname); - if (idx == 0) fprintf(stderr, "[ti_index_load] fail to load the index: %s\n", fname); - free(fname); - return idx; -} - -int ti_index_build2(const char *fn, const ti_conf_t *conf, const char *_fnidx) -{ - char *fnidx; - BGZF *fp, *fpidx; - ti_index_t *idx; - if ((fp = bgzf_open(fn, "r")) == 0) { - fprintf(stderr, "[ti_index_build2] fail to open the file: %s\n", fn); - return -1; - } - idx = ti_index_core(fp, conf); - bgzf_close(fp); - if (_fnidx == 0) { - fnidx = (char*)calloc(strlen(fn) + 5, 1); - strcpy(fnidx, fn); strcat(fnidx, ".tbi"); - } else fnidx = strdup(_fnidx); - fpidx = bgzf_open(fnidx, "w"); - if (fpidx == 0) { - fprintf(stderr, "[ti_index_build2] fail to create the index file.\n"); - free(fnidx); - return -1; - } - ti_index_save(idx, fpidx); - ti_index_destroy(idx); - bgzf_close(fpidx); - free(fnidx); - return 0; -} - -int ti_index_build(const char *fn, const ti_conf_t *conf) -{ - return ti_index_build2(fn, conf, 0); -} - -/******************************************** - * parse a region in the format chr:beg-end * - ********************************************/ - -int ti_get_tid(const ti_index_t *idx, const char *name) -{ - khiter_t iter; - const khash_t(s) *h = idx->tname; - iter = kh_get(s, h, name); /* get the tid */ - if (iter == kh_end(h)) return -1; - return kh_value(h, iter); -} - -int ti_parse_region(const ti_index_t *idx, const char *str, int *tid, int *begin, int *end) -{ - char *s, *p; - int i, l, k; - l = strlen(str); - p = s = (char*)malloc(l+1); - /* squeeze out "," */ - for (i = k = 0; i != l; ++i) - if (str[i] != ',' && !isspace(str[i])) s[k++] = str[i]; - s[k] = 0; - for (i = 0; i != k; ++i) if (s[i] == ':') break; - s[i] = 0; - if ((*tid = ti_get_tid(idx, s)) < 0) { - free(s); - return -1; - } - if (i == k) { /* dump the whole sequence */ - *begin = 0; *end = 1<<29; free(s); - return 0; - } - for (p = s + i + 1; i != k; ++i) if (s[i] == '-') break; - *begin = atoi(p); - if (i < k) { - p = s + i + 1; - *end = atoi(p); - } else *end = 1<<29; - if (*begin > 0) --*begin; - free(s); - if (*begin > *end) return -1; - return 0; -} - -/******************************* - * retrieve a specified region * - *******************************/ - -#define MAX_BIN 37450 // =(8^6-1)/7+1 - -static inline int reg2bins(uint32_t beg, uint32_t end, uint16_t list[MAX_BIN]) -{ - int i = 0, k; - if (beg >= end) return 0; - if (end >= 1u<<29) end = 1u<<29; - --end; - list[i++] = 0; - for (k = 1 + (beg>>26); k <= 1 + (end>>26); ++k) list[i++] = k; - for (k = 9 + (beg>>23); k <= 9 + (end>>23); ++k) list[i++] = k; - for (k = 73 + (beg>>20); k <= 73 + (end>>20); ++k) list[i++] = k; - for (k = 585 + (beg>>17); k <= 585 + (end>>17); ++k) list[i++] = k; - for (k = 4681 + (beg>>14); k <= 4681 + (end>>14); ++k) list[i++] = k; - return i; -} - -ti_iter_t ti_iter_first() -{ - ti_iter_t iter; - iter = calloc(1, sizeof(struct __ti_iter_t)); - iter->from_first = 1; - return iter; -} - -ti_iter_t ti_iter_query(const ti_index_t *idx, int tid, int beg, int end) -{ - uint16_t *bins; - int i, n_bins, n_off; - pair64_t *off; - khint_t k; - khash_t(i) *index; - uint64_t min_off; - ti_iter_t iter = 0; - - if (beg < 0) beg = 0; - if (end < beg) return 0; - // initialize the iterator - iter = calloc(1, sizeof(struct __ti_iter_t)); - iter->idx = idx; iter->tid = tid; iter->beg = beg; iter->end = end; iter->i = -1; - // random access - bins = (uint16_t*)calloc(MAX_BIN, 2); - n_bins = reg2bins(beg, end, bins); - index = idx->index[tid]; - if (idx->index2[tid].n > 0) { - min_off = (beg>>TAD_LIDX_SHIFT >= idx->index2[tid].n)? idx->index2[tid].offset[idx->index2[tid].n-1] - : idx->index2[tid].offset[beg>>TAD_LIDX_SHIFT]; - if (min_off == 0) { // improvement for index files built by tabix prior to 0.1.4 - int n = beg>>TAD_LIDX_SHIFT; - if (n > idx->index2[tid].n) n = idx->index2[tid].n; - for (i = n - 1; i >= 0; --i) - if (idx->index2[tid].offset[i] != 0) break; - if (i >= 0) min_off = idx->index2[tid].offset[i]; - } - } else min_off = 0; // tabix 0.1.2 may produce such index files - for (i = n_off = 0; i < n_bins; ++i) { - if ((k = kh_get(i, index, bins[i])) != kh_end(index)) - n_off += kh_value(index, k).n; - } - if (n_off == 0) { - free(bins); return iter; - } - off = (pair64_t*)calloc(n_off, 16); - for (i = n_off = 0; i < n_bins; ++i) { - if ((k = kh_get(i, index, bins[i])) != kh_end(index)) { - int j; - ti_binlist_t *p = &kh_value(index, k); - for (j = 0; j < p->n; ++j) - if (p->list[j].v > min_off) off[n_off++] = p->list[j]; - } - } - if (n_off == 0) { - free(bins); free(off); return iter; - } - free(bins); - { - int l; - ks_introsort(offt, n_off, off); - // resolve completely contained adjacent blocks - for (i = 1, l = 0; i < n_off; ++i) - if (off[l].v < off[i].v) - off[++l] = off[i]; - n_off = l + 1; - // resolve overlaps between adjacent blocks; this may happen due to the merge in indexing - for (i = 1; i < n_off; ++i) - if (off[i-1].v >= off[i].u) off[i-1].v = off[i].u; - { // merge adjacent blocks - for (i = 1, l = 0; i < n_off; ++i) { - if (off[l].v>>16 == off[i].u>>16) off[l].v = off[i].v; - else off[++l] = off[i]; - } - n_off = l + 1; - } - } - iter->n_off = n_off; iter->off = off; - return iter; -} - -const char *ti_iter_read(BGZF *fp, ti_iter_t iter, int *len) -{ - if (iter->finished) return 0; - if (iter->from_first) { - int ret; - if ((ret = ti_readline(fp, &iter->str)) < 0) { - iter->finished = 1; - return 0; - } else { - if (len) *len = iter->str.l; - return iter->str.s; - } - } - if (iter->n_off == 0) return 0; - while (1) { - int ret; - if (iter->curr_off == 0 || iter->curr_off >= iter->off[iter->i].v) { // then jump to the next chunk - if (iter->i == iter->n_off - 1) break; // no more chunks - if (iter->i >= 0) assert(iter->curr_off == iter->off[iter->i].v); // otherwise bug - if (iter->i < 0 || iter->off[iter->i].v != iter->off[iter->i+1].u) { // not adjacent chunks; then seek - bgzf_seek(fp, iter->off[iter->i+1].u, SEEK_SET); - iter->curr_off = bgzf_tell(fp); - } - ++iter->i; - } - if ((ret = ti_readline(fp, &iter->str)) >= 0) { - ti_intv_t intv; - iter->curr_off = bgzf_tell(fp); - if (iter->str.s[0] == iter->idx->conf.meta_char) continue; - get_intv((ti_index_t*)iter->idx, &iter->str, &intv); - if (intv.tid != iter->tid || intv.beg >= iter->end) break; // no need to proceed - else if (intv.end > iter->beg && iter->end > intv.beg) { - if (len) *len = iter->str.l; - return iter->str.s; - } - } else break; // end of file - } - iter->finished = 1; - return 0; -} - -void ti_iter_destroy(ti_iter_t iter) -{ - if (iter) { - free(iter->str.s); free(iter->off); - free(iter); - } -} - -int ti_fetch(BGZF *fp, const ti_index_t *idx, int tid, int beg, int end, void *data, ti_fetch_f func) -{ - ti_iter_t iter; - const char *s; - int len; - iter = ti_iter_query(idx, tid, beg, end); - while ((s = ti_iter_read(fp, iter, &len)) != 0) - func(len, s, data); - ti_iter_destroy(iter); - return 0; -} - -const ti_conf_t *ti_get_conf(ti_index_t *idx) { return idx? &idx->conf : 0; } - -/******************* - * High-level APIs * - *******************/ - -tabix_t *ti_open(const char *fn, const char *fnidx) -{ - tabix_t *t; - BGZF *fp; - if ((fp = bgzf_open(fn, "r")) == 0) return 0; - t = calloc(1, sizeof(tabix_t)); - t->fn = strdup(fn); - if (fnidx) t->fnidx = strdup(fnidx); - t->fp = fp; - return t; -} - -void ti_close(tabix_t *t) -{ - if (t) { - bgzf_close(t->fp); - if (t->idx) ti_index_destroy(t->idx); - free(t->fn); free(t->fnidx); - free(t); - } -} - -int ti_lazy_index_load(tabix_t *t) -{ - if (t->idx == 0) { // load index - if (t->fnidx) t->idx = ti_index_load_local(t->fnidx); - else t->idx = ti_index_load(t->fn); - if (t->idx == 0) return -1; // fail to load index - } - return 0; -} - -ti_iter_t ti_queryi(tabix_t *t, int tid, int beg, int end) -{ - if (tid < 0) return ti_iter_first(); - if (ti_lazy_index_load(t) != 0) return 0; - return ti_iter_query(t->idx, tid, beg, end); -} - -ti_iter_t ti_querys(tabix_t *t, const char *reg) -{ - int tid, beg, end; - if (reg == 0) return ti_iter_first(); - if (ti_lazy_index_load(t) != 0) return 0; - if (ti_parse_region(t->idx, reg, &tid, &beg, &end) < 0) return 0; - return ti_iter_query(t->idx, tid, beg, end); -} - -ti_iter_t ti_query(tabix_t *t, const char *name, int beg, int end) -{ - int tid; - if (name == 0) return ti_iter_first(); - // then need to load the index - if (ti_lazy_index_load(t) != 0) return 0; - if ((tid = ti_get_tid(t->idx, name)) < 0) return 0; - return ti_iter_query(t->idx, tid, beg, end); -} - -const char *ti_read(tabix_t *t, ti_iter_t iter, int *len) -{ - return ti_iter_read(t->fp, iter, len); -} diff --git a/src/khash.h b/src/khash.h deleted file mode 100644 index 1d583ef..0000000 --- a/src/khash.h +++ /dev/null @@ -1,486 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Genome Research Ltd (GRL). - - 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 AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -/* Contact: Heng Li */ - -/* - An example: - -#include "khash.h" -KHASH_MAP_INIT_INT(32, char) -int main() { - int ret, is_missing; - khiter_t k; - khash_t(32) *h = kh_init(32); - k = kh_put(32, h, 5, &ret); - if (!ret) kh_del(32, h, k); - kh_value(h, k) = 10; - k = kh_get(32, h, 10); - is_missing = (k == kh_end(h)); - k = kh_get(32, h, 5); - kh_del(32, h, k); - for (k = kh_begin(h); k != kh_end(h); ++k) - if (kh_exist(h, k)) kh_value(h, k) = 1; - kh_destroy(32, h); - return 0; -} -*/ - -/* - 2008-09-19 (0.2.3): - - * Corrected the example - * Improved interfaces - - 2008-09-11 (0.2.2): - - * Improved speed a little in kh_put() - - 2008-09-10 (0.2.1): - - * Added kh_clear() - * Fixed a compiling error - - 2008-09-02 (0.2.0): - - * Changed to token concatenation which increases flexibility. - - 2008-08-31 (0.1.2): - - * Fixed a bug in kh_get(), which has not been tested previously. - - 2008-08-31 (0.1.1): - - * Added destructor -*/ - - -#ifndef __AC_KHASH_H -#define __AC_KHASH_H - -/*! - @header - - Generic hash table library. - - @copyright Heng Li - */ - -#define AC_VERSION_KHASH_H "0.2.2" - -#include -#include -#include - -typedef uint32_t khint_t; -typedef khint_t khiter_t; - -#define __ac_HASH_PRIME_SIZE 32 -static const uint32_t __ac_prime_list[__ac_HASH_PRIME_SIZE] = -{ - 0ul, 3ul, 11ul, 23ul, 53ul, - 97ul, 193ul, 389ul, 769ul, 1543ul, - 3079ul, 6151ul, 12289ul, 24593ul, 49157ul, - 98317ul, 196613ul, 393241ul, 786433ul, 1572869ul, - 3145739ul, 6291469ul, 12582917ul, 25165843ul, 50331653ul, - 100663319ul, 201326611ul, 402653189ul, 805306457ul, 1610612741ul, - 3221225473ul, 4294967291ul -}; - -#define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2) -#define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1) -#define __ac_iseither(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&3) -#define __ac_set_isdel_false(flag, i) (flag[i>>4]&=~(1ul<<((i&0xfU)<<1))) -#define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2ul<<((i&0xfU)<<1))) -#define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1))) -#define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1)) - -static const double __ac_HASH_UPPER = 0.77; - -#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ - typedef struct { \ - khint_t n_buckets, size, n_occupied, upper_bound; \ - uint32_t *flags; \ - khkey_t *keys; \ - khval_t *vals; \ - } kh_##name##_t; \ - static inline kh_##name##_t *kh_init_##name() { \ - return (kh_##name##_t*)calloc(1, sizeof(kh_##name##_t)); \ - } \ - static inline void kh_destroy_##name(kh_##name##_t *h) \ - { \ - if (h) { \ - free(h->keys); free(h->flags); \ - free(h->vals); \ - free(h); \ - } \ - } \ - static inline void kh_clear_##name(kh_##name##_t *h) \ - { \ - if (h && h->flags) { \ - memset(h->flags, 0xaa, ((h->n_buckets>>4) + 1) * sizeof(uint32_t)); \ - h->size = h->n_occupied = 0; \ - } \ - } \ - static inline khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \ - { \ - if (h->n_buckets) { \ - khint_t inc, k, i, last; \ - k = __hash_func(key); i = k % h->n_buckets; \ - inc = 1 + k % (h->n_buckets - 1); last = i; \ - while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ - if (i + inc >= h->n_buckets) i = i + inc - h->n_buckets; \ - else i += inc; \ - if (i == last) return h->n_buckets; \ - } \ - return __ac_iseither(h->flags, i)? h->n_buckets : i; \ - } else return 0; \ - } \ - static inline void kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \ - { \ - uint32_t *new_flags = 0; \ - khint_t j = 1; \ - { \ - khint_t t = __ac_HASH_PRIME_SIZE - 1; \ - while (__ac_prime_list[t] > new_n_buckets) --t; \ - new_n_buckets = __ac_prime_list[t+1]; \ - if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 0; \ - else { \ - new_flags = (uint32_t*)malloc(((new_n_buckets>>4) + 1) * sizeof(uint32_t)); \ - memset(new_flags, 0xaa, ((new_n_buckets>>4) + 1) * sizeof(uint32_t)); \ - if (h->n_buckets < new_n_buckets) { \ - h->keys = (khkey_t*)realloc(h->keys, new_n_buckets * sizeof(khkey_t)); \ - if (kh_is_map) \ - h->vals = (khval_t*)realloc(h->vals, new_n_buckets * sizeof(khval_t)); \ - } \ - } \ - } \ - if (j) { \ - for (j = 0; j != h->n_buckets; ++j) { \ - if (__ac_iseither(h->flags, j) == 0) { \ - khkey_t key = h->keys[j]; \ - khval_t val; \ - if (kh_is_map) val = h->vals[j]; \ - __ac_set_isdel_true(h->flags, j); \ - while (1) { \ - khint_t inc, k, i; \ - k = __hash_func(key); \ - i = k % new_n_buckets; \ - inc = 1 + k % (new_n_buckets - 1); \ - while (!__ac_isempty(new_flags, i)) { \ - if (i + inc >= new_n_buckets) i = i + inc - new_n_buckets; \ - else i += inc; \ - } \ - __ac_set_isempty_false(new_flags, i); \ - if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { \ - { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \ - if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \ - __ac_set_isdel_true(h->flags, i); \ - } else { \ - h->keys[i] = key; \ - if (kh_is_map) h->vals[i] = val; \ - break; \ - } \ - } \ - } \ - } \ - if (h->n_buckets > new_n_buckets) { \ - h->keys = (khkey_t*)realloc(h->keys, new_n_buckets * sizeof(khkey_t)); \ - if (kh_is_map) \ - h->vals = (khval_t*)realloc(h->vals, new_n_buckets * sizeof(khval_t)); \ - } \ - free(h->flags); \ - h->flags = new_flags; \ - h->n_buckets = new_n_buckets; \ - h->n_occupied = h->size; \ - h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \ - } \ - } \ - static inline khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \ - { \ - khint_t x; \ - if (h->n_occupied >= h->upper_bound) { \ - if (h->n_buckets > (h->size<<1)) kh_resize_##name(h, h->n_buckets - 1); \ - else kh_resize_##name(h, h->n_buckets + 1); \ - } \ - { \ - khint_t inc, k, i, site, last; \ - x = site = h->n_buckets; k = __hash_func(key); i = k % h->n_buckets; \ - if (__ac_isempty(h->flags, i)) x = i; \ - else { \ - inc = 1 + k % (h->n_buckets - 1); last = i; \ - while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ - if (__ac_isdel(h->flags, i)) site = i; \ - if (i + inc >= h->n_buckets) i = i + inc - h->n_buckets; \ - else i += inc; \ - if (i == last) { x = site; break; } \ - } \ - if (x == h->n_buckets) { \ - if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site; \ - else x = i; \ - } \ - } \ - } \ - if (__ac_isempty(h->flags, x)) { \ - h->keys[x] = key; \ - __ac_set_isboth_false(h->flags, x); \ - ++h->size; ++h->n_occupied; \ - *ret = 1; \ - } else if (__ac_isdel(h->flags, x)) { \ - h->keys[x] = key; \ - __ac_set_isboth_false(h->flags, x); \ - ++h->size; \ - *ret = 2; \ - } else *ret = 0; \ - return x; \ - } \ - static inline void kh_del_##name(kh_##name##_t *h, khint_t x) \ - { \ - if (x != h->n_buckets && !__ac_iseither(h->flags, x)) { \ - __ac_set_isdel_true(h->flags, x); \ - --h->size; \ - } \ - } - -/* --- BEGIN OF HASH FUNCTIONS --- */ - -/*! @function - @abstract Integer hash function - @param key The integer [uint32_t] - @return The hash value [khint_t] - */ -#define kh_int_hash_func(key) (uint32_t)(key) -/*! @function - @abstract Integer comparison function - */ -#define kh_int_hash_equal(a, b) ((a) == (b)) -/*! @function - @abstract 64-bit integer hash function - @param key The integer [uint64_t] - @return The hash value [khint_t] - */ -#define kh_int64_hash_func(key) (uint32_t)((key)>>33^(key)^(key)<<11) -/*! @function - @abstract 64-bit integer comparison function - */ -#define kh_int64_hash_equal(a, b) ((a) == (b)) -/*! @function - @abstract const char* hash function - @param s Pointer to a null terminated string - @return The hash value - */ -static inline khint_t __ac_X31_hash_string(const char *s) -{ - khint_t h = *s; - if (h) for (++s ; *s; ++s) h = (h << 5) - h + *s; - return h; -} -/*! @function - @abstract Another interface to const char* hash function - @param key Pointer to a null terminated string [const char*] - @return The hash value [khint_t] - */ -#define kh_str_hash_func(key) __ac_X31_hash_string(key) -/*! @function - @abstract Const char* comparison function - */ -#define kh_str_hash_equal(a, b) (strcmp(a, b) == 0) - -/* --- END OF HASH FUNCTIONS --- */ - -/* Other necessary macros... */ - -/*! - @abstract Type of the hash table. - @param name Name of the hash table [symbol] - */ -#define khash_t(name) kh_##name##_t - -/*! @function - @abstract Initiate a hash table. - @param name Name of the hash table [symbol] - @return Pointer to the hash table [khash_t(name)*] - */ -#define kh_init(name) kh_init_##name() - -/*! @function - @abstract Destroy a hash table. - @param name Name of the hash table [symbol] - @param h Pointer to the hash table [khash_t(name)*] - */ -#define kh_destroy(name, h) kh_destroy_##name(h) - -/*! @function - @abstract Reset a hash table without deallocating memory. - @param name Name of the hash table [symbol] - @param h Pointer to the hash table [khash_t(name)*] - */ -#define kh_clear(name, h) kh_clear_##name(h) - -/*! @function - @abstract Resize a hash table. - @param name Name of the hash table [symbol] - @param h Pointer to the hash table [khash_t(name)*] - @param s New size [khint_t] - */ -#define kh_resize(name, h, s) kh_resize_##name(h, s) - -/*! @function - @abstract Insert a key to the hash table. - @param name Name of the hash table [symbol] - @param h Pointer to the hash table [khash_t(name)*] - @param k Key [type of keys] - @param r Extra return code: 0 if the key is present in the hash table; - 1 if the bucket is empty (never used); 2 if the element in - the bucket has been deleted [int*] - @return Iterator to the inserted element [khint_t] - */ -#define kh_put(name, h, k, r) kh_put_##name(h, k, r) - -/*! @function - @abstract Retrieve a key from the hash table. - @param name Name of the hash table [symbol] - @param h Pointer to the hash table [khash_t(name)*] - @param k Key [type of keys] - @return Iterator to the found element, or kh_end(h) is the element is absent [khint_t] - */ -#define kh_get(name, h, k) kh_get_##name(h, k) - -/*! @function - @abstract Remove a key from the hash table. - @param name Name of the hash table [symbol] - @param h Pointer to the hash table [khash_t(name)*] - @param k Iterator to the element to be deleted [khint_t] - */ -#define kh_del(name, h, k) kh_del_##name(h, k) - - -/*! @function - @abstract Test whether a bucket contains data. - @param h Pointer to the hash table [khash_t(name)*] - @param x Iterator to the bucket [khint_t] - @return 1 if containing data; 0 otherwise [int] - */ -#define kh_exist(h, x) (!__ac_iseither((h)->flags, (x))) - -/*! @function - @abstract Get key given an iterator - @param h Pointer to the hash table [khash_t(name)*] - @param x Iterator to the bucket [khint_t] - @return Key [type of keys] - */ -#define kh_key(h, x) ((h)->keys[x]) - -/*! @function - @abstract Get value given an iterator - @param h Pointer to the hash table [khash_t(name)*] - @param x Iterator to the bucket [khint_t] - @return Value [type of values] - @discussion For hash sets, calling this results in segfault. - */ -#define kh_val(h, x) ((h)->vals[x]) - -/*! @function - @abstract Alias of kh_val() - */ -#define kh_value(h, x) ((h)->vals[x]) - -/*! @function - @abstract Get the start iterator - @param h Pointer to the hash table [khash_t(name)*] - @return The start iterator [khint_t] - */ -#define kh_begin(h) (khint_t)(0) - -/*! @function - @abstract Get the end iterator - @param h Pointer to the hash table [khash_t(name)*] - @return The end iterator [khint_t] - */ -#define kh_end(h) ((h)->n_buckets) - -/*! @function - @abstract Get the number of elements in the hash table - @param h Pointer to the hash table [khash_t(name)*] - @return Number of elements in the hash table [khint_t] - */ -#define kh_size(h) ((h)->size) - -/*! @function - @abstract Get the number of buckets in the hash table - @param h Pointer to the hash table [khash_t(name)*] - @return Number of buckets in the hash table [khint_t] - */ -#define kh_n_buckets(h) ((h)->n_buckets) - -/* More conenient interfaces */ - -/*! @function - @abstract Instantiate a hash set containing integer keys - @param name Name of the hash table [symbol] - */ -#define KHASH_SET_INIT_INT(name) \ - KHASH_INIT(name, uint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal) - -/*! @function - @abstract Instantiate a hash map containing integer keys - @param name Name of the hash table [symbol] - @param khval_t Type of values [type] - */ -#define KHASH_MAP_INIT_INT(name, khval_t) \ - KHASH_INIT(name, uint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal) - -/*! @function - @abstract Instantiate a hash map containing 64-bit integer keys - @param name Name of the hash table [symbol] - */ -#define KHASH_SET_INIT_INT64(name) \ - KHASH_INIT(name, uint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal) - -/*! @function - @abstract Instantiate a hash map containing 64-bit integer keys - @param name Name of the hash table [symbol] - @param khval_t Type of values [type] - */ -#define KHASH_MAP_INIT_INT64(name, khval_t) \ - KHASH_INIT(name, uint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal) - -typedef const char *kh_cstr_t; -/*! @function - @abstract Instantiate a hash map containing const char* keys - @param name Name of the hash table [symbol] - */ -#define KHASH_SET_INIT_STR(name) \ - KHASH_INIT(name, kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal) - -/*! @function - @abstract Instantiate a hash map containing const char* keys - @param name Name of the hash table [symbol] - @param khval_t Type of values [type] - */ -#define KHASH_MAP_INIT_STR(name, khval_t) \ - KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal) - -#endif /* __AC_KHASH_H */ diff --git a/src/knetfile.c b/src/knetfile.c deleted file mode 100644 index 7c96a3e..0000000 --- a/src/knetfile.c +++ /dev/null @@ -1,632 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Genome Research Ltd (GRL). - - 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 AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -/* Contact: Heng Li */ - -/* Probably I will not do socket programming in the next few years and - therefore I decide to heavily annotate this file, for Linux and - Windows as well. -lh3 */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 -#include -#else -#include -#include -#include -#endif - -#include "knetfile.h" - -/* In winsock.h, the type of a socket is SOCKET, which is: "typedef - * u_int SOCKET". An invalid SOCKET is: "(SOCKET)(~0)", or signed - * integer -1. In knetfile.c, I use "int" for socket type - * throughout. This should be improved to avoid confusion. - * - * In Linux/Mac, recv() and read() do almost the same thing. You can see - * in the header file that netread() is simply an alias of read(). In - * Windows, however, they are different and using recv() is mandatory. - */ - -/* This function tests if the file handler is ready for reading (or - * writing if is_read==0). */ -static int socket_wait(int fd, int is_read) -{ - fd_set fds, *fdr = 0, *fdw = 0; - struct timeval tv; - int ret; - tv.tv_sec = 5; tv.tv_usec = 0; // 5 seconds time out - FD_ZERO(&fds); - FD_SET(fd, &fds); - if (is_read) fdr = &fds; - else fdw = &fds; - ret = select(fd+1, fdr, fdw, 0, &tv); -#ifndef _WIN32 - if (ret == -1) perror("select"); -#else - if (ret == 0) - fprintf(stderr, "select time-out\n"); - else if (ret == SOCKET_ERROR) - fprintf(stderr, "select: %d\n", WSAGetLastError()); -#endif - return ret; -} - -#ifndef _WIN32 -/* This function does not work with Windows due to the lack of - * getaddrinfo() in winsock. It is addapted from an example in "Beej's - * Guide to Network Programming" (http://beej.us/guide/bgnet/). */ -static int socket_connect(const char *host, const char *port) -{ -#define __err_connect(func) do { perror(func); freeaddrinfo(res); return -1; } while (0) - - int on = 1, fd; - struct linger lng = { 0, 0 }; - struct addrinfo hints, *res; - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - /* In Unix/Mac, getaddrinfo() is the most convenient way to get - * server information. */ - if (getaddrinfo(host, port, &hints, &res) != 0) __err_connect("getaddrinfo"); - if ((fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) __err_connect("socket"); - /* The following two setsockopt() are used by ftplib - * (http://nbpfaus.net/~pfau/ftplib/). I am not sure if they - * necessary. */ - if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) __err_connect("setsockopt"); - if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &lng, sizeof(lng)) == -1) __err_connect("setsockopt"); - if (connect(fd, res->ai_addr, res->ai_addrlen) != 0) __err_connect("connect"); - freeaddrinfo(res); - return fd; -} -#else -/* MinGW's printf has problem with "%lld" */ -char *int64tostr(char *buf, int64_t x) -{ - int cnt; - int i = 0; - do { - buf[i++] = '0' + x % 10; - x /= 10; - } while (x); - buf[i] = 0; - for (cnt = i, i = 0; i < cnt/2; ++i) { - int c = buf[i]; buf[i] = buf[cnt-i-1]; buf[cnt-i-1] = c; - } - return buf; -} - -int64_t strtoint64(const char *buf) -{ - int64_t x; - for (x = 0; *buf != '\0'; ++buf) - x = x * 10 + ((int64_t) *buf - 48); - return x; -} -/* In windows, the first thing is to establish the TCP connection. */ -int knet_win32_init() -{ - WSADATA wsaData; - return WSAStartup(MAKEWORD(2, 2), &wsaData); -} -void knet_win32_destroy() -{ - WSACleanup(); -} -/* A slightly modfied version of the following function also works on - * Mac (and presummably Linux). However, this function is not stable on - * my Mac. It sometimes works fine but sometimes does not. Therefore for - * non-Windows OS, I do not use this one. */ -static SOCKET socket_connect(const char *host, const char *port) -{ -#define __err_connect(func) \ - do { \ - fprintf(stderr, "%s: %d\n", func, WSAGetLastError()); \ - return -1; \ - } while (0) - - int on = 1; - SOCKET fd; - struct linger lng = { 0, 0 }; - struct sockaddr_in server; - struct hostent *hp = 0; - // open socket - if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) __err_connect("socket"); - if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on)) == -1) __err_connect("setsockopt"); - if (setsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&lng, sizeof(lng)) == -1) __err_connect("setsockopt"); - // get host info - if (isalpha(host[0])) hp = gethostbyname(host); - else { - struct in_addr addr; - addr.s_addr = inet_addr(host); - hp = gethostbyaddr((char*)&addr, 4, AF_INET); - } - if (hp == 0) __err_connect("gethost"); - // connect - server.sin_addr.s_addr = *((unsigned long*)hp->h_addr); - server.sin_family= AF_INET; - server.sin_port = htons(atoi(port)); - if (connect(fd, (struct sockaddr*)&server, sizeof(server)) != 0) __err_connect("connect"); - // freehostent(hp); // strangely in MSDN, hp is NOT freed (memory leak?!) - return fd; -} -#endif - -static off_t my_netread(int fd, void *buf, off_t len) -{ - off_t rest = len, curr, l = 0; - /* recv() and read() may not read the required length of data with - * one call. They have to be called repeatedly. */ - while (rest) { - if (socket_wait(fd, 1) <= 0) break; // socket is not ready for reading - curr = netread(fd, buf + l, rest); - /* According to the glibc manual, section 13.2, a zero returned - * value indicates end-of-file (EOF), which should mean that - * read() will not return zero if EOF has not been met but data - * are not immediately available. */ - if (curr == 0) break; - l += curr; rest -= curr; - } - return l; -} - -/************************* - * FTP specific routines * - *************************/ - -static int kftp_get_response(knetFile *ftp) -{ -#ifndef _WIN32 - unsigned char c; -#else - char c; -#endif - int n = 0; - char *p; - if (socket_wait(ftp->ctrl_fd, 1) <= 0) return 0; - while (netread(ftp->ctrl_fd, &c, 1)) { // FIXME: this is *VERY BAD* for unbuffered I/O - //fputc(c, stderr); - if (n >= ftp->max_response) { - ftp->max_response = ftp->max_response? ftp->max_response<<1 : 256; - ftp->response = realloc(ftp->response, ftp->max_response); - } - ftp->response[n++] = c; - if (c == '\n') { - if (n >= 4 && isdigit(ftp->response[0]) && isdigit(ftp->response[1]) && isdigit(ftp->response[2]) - && ftp->response[3] != '-') break; - n = 0; - continue; - } - } - if (n < 2) return -1; - ftp->response[n-2] = 0; - return strtol(ftp->response, &p, 0); -} - -static int kftp_send_cmd(knetFile *ftp, const char *cmd, int is_get) -{ - if (socket_wait(ftp->ctrl_fd, 0) <= 0) return -1; // socket is not ready for writing - netwrite(ftp->ctrl_fd, cmd, strlen(cmd)); - return is_get? kftp_get_response(ftp) : 0; -} - -static int kftp_pasv_prep(knetFile *ftp) -{ - char *p; - int v[6]; - kftp_send_cmd(ftp, "PASV\r\n", 1); - for (p = ftp->response; *p && *p != '('; ++p); - if (*p != '(') return -1; - ++p; - sscanf(p, "%d,%d,%d,%d,%d,%d", &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]); - memcpy(ftp->pasv_ip, v, 4 * sizeof(int)); - ftp->pasv_port = (v[4]<<8&0xff00) + v[5]; - return 0; -} - - -static int kftp_pasv_connect(knetFile *ftp) -{ - char host[80], port[10]; - if (ftp->pasv_port == 0) { - fprintf(stderr, "[kftp_pasv_connect] kftp_pasv_prep() is not called before hand.\n"); - return -1; - } - sprintf(host, "%d.%d.%d.%d", ftp->pasv_ip[0], ftp->pasv_ip[1], ftp->pasv_ip[2], ftp->pasv_ip[3]); - sprintf(port, "%d", ftp->pasv_port); - ftp->fd = socket_connect(host, port); - if (ftp->fd == -1) return -1; - return 0; -} - -int kftp_connect(knetFile *ftp) -{ - ftp->ctrl_fd = socket_connect(ftp->host, ftp->port); - if (ftp->ctrl_fd == -1) return -1; - kftp_get_response(ftp); - kftp_send_cmd(ftp, "USER anonymous\r\n", 1); - kftp_send_cmd(ftp, "PASS kftp@\r\n", 1); - kftp_send_cmd(ftp, "TYPE I\r\n", 1); - return 0; -} - -int kftp_reconnect(knetFile *ftp) -{ - if (ftp->ctrl_fd != -1) { - netclose(ftp->ctrl_fd); - ftp->ctrl_fd = -1; - } - netclose(ftp->fd); - ftp->fd = -1; - return kftp_connect(ftp); -} - -// initialize ->type, ->host, ->retr and ->size -knetFile *kftp_parse_url(const char *fn, const char *mode) -{ - knetFile *fp; - char *p; - int l; - if (strstr(fn, "ftp://") != fn) return 0; - for (p = (char*)fn + 6; *p && *p != '/'; ++p); - if (*p != '/') return 0; - l = p - fn - 6; - fp = calloc(1, sizeof(knetFile)); - fp->type = KNF_TYPE_FTP; - fp->fd = -1; - /* the Linux/Mac version of socket_connect() also recognizes a port - * like "ftp", but the Windows version does not. */ - fp->port = strdup("21"); - fp->host = calloc(l + 1, 1); - if (strchr(mode, 'c')) fp->no_reconnect = 1; - strncpy(fp->host, fn + 6, l); - fp->retr = calloc(strlen(p) + 8, 1); - sprintf(fp->retr, "RETR %s\r\n", p); - fp->size_cmd = calloc(strlen(p) + 8, 1); - sprintf(fp->size_cmd, "SIZE %s\r\n", p); - fp->seek_offset = 0; - return fp; -} -// place ->fd at offset off -int kftp_connect_file(knetFile *fp) -{ - int ret; - long long file_size; - if (fp->fd != -1) { - netclose(fp->fd); - if (fp->no_reconnect) kftp_get_response(fp); - } - kftp_pasv_prep(fp); - kftp_send_cmd(fp, fp->size_cmd, 1); -#ifndef _WIN32 - if ( sscanf(fp->response,"%*d %lld", &file_size) != 1 ) - { - fprintf(stderr,"[kftp_connect_file] %s\n", fp->response); - return -1; - } -#else - const char *p = fp->response; - while (*p != ' ') ++p; - while (*p < '0' || *p > '9') ++p; - file_size = strtoint64(p); -#endif - fp->file_size = file_size; - if (fp->offset>=0) { - char tmp[32]; -#ifndef _WIN32 - sprintf(tmp, "REST %lld\r\n", (long long)fp->offset); -#else - strcpy(tmp, "REST "); - int64tostr(tmp + 5, fp->offset); - strcat(tmp, "\r\n"); -#endif - kftp_send_cmd(fp, tmp, 1); - } - kftp_send_cmd(fp, fp->retr, 0); - kftp_pasv_connect(fp); - ret = kftp_get_response(fp); - if (ret != 150) { - fprintf(stderr, "[kftp_connect_file] %s\n", fp->response); - netclose(fp->fd); - fp->fd = -1; - return -1; - } - fp->is_ready = 1; - return 0; -} - - -/************************** - * HTTP specific routines * - **************************/ - -knetFile *khttp_parse_url(const char *fn, const char *mode) -{ - knetFile *fp; - char *p, *proxy, *q; - int l; - if (strstr(fn, "http://") != fn) return 0; - // set ->http_host - for (p = (char*)fn + 7; *p && *p != '/'; ++p); - l = p - fn - 7; - fp = calloc(1, sizeof(knetFile)); - fp->http_host = calloc(l + 1, 1); - strncpy(fp->http_host, fn + 7, l); - fp->http_host[l] = 0; - for (q = fp->http_host; *q && *q != ':'; ++q); - if (*q == ':') *q++ = 0; - // get http_proxy - proxy = getenv("http_proxy"); - // set ->host, ->port and ->path - if (proxy == 0) { - fp->host = strdup(fp->http_host); // when there is no proxy, server name is identical to http_host name. - fp->port = strdup(*q? q : "80"); - fp->path = strdup(*p? p : "/"); - } else { - fp->host = (strstr(proxy, "http://") == proxy)? strdup(proxy + 7) : strdup(proxy); - for (q = fp->host; *q && *q != ':'; ++q); - if (*q == ':') *q++ = 0; - fp->port = strdup(*q? q : "80"); - fp->path = strdup(fn); - } - fp->type = KNF_TYPE_HTTP; - fp->ctrl_fd = fp->fd = -1; - fp->seek_offset = 0; - return fp; -} - -int khttp_connect_file(knetFile *fp) -{ - int ret, l = 0; - char *buf, *p; - if (fp->fd != -1) netclose(fp->fd); - fp->fd = socket_connect(fp->host, fp->port); - buf = calloc(0x10000, 1); // FIXME: I am lazy... But in principle, 64KB should be large enough. - l += sprintf(buf + l, "GET %s HTTP/1.0\r\nHost: %s\r\n", fp->path, fp->http_host); - l += sprintf(buf + l, "Range: bytes=%lld-\r\n", (long long)fp->offset); - l += sprintf(buf + l, "\r\n"); - netwrite(fp->fd, buf, l); - l = 0; - while (netread(fp->fd, buf + l, 1)) { // read HTTP header; FIXME: bad efficiency - if (buf[l] == '\n' && l >= 3) - if (strncmp(buf + l - 3, "\r\n\r\n", 4) == 0) break; - ++l; - } - buf[l] = 0; - if (l < 14) { // prematured header - netclose(fp->fd); - fp->fd = -1; - return -1; - } - ret = strtol(buf + 8, &p, 0); // HTTP return code - if (ret == 200 && fp->offset>0) { // 200 (complete result); then skip beginning of the file - off_t rest = fp->offset; - while (rest) { - off_t l = rest < 0x10000? rest : 0x10000; - rest -= my_netread(fp->fd, buf, l); - } - } else if (ret != 206 && ret != 200) { - free(buf); - fprintf(stderr, "[khttp_connect_file] fail to open file (HTTP code: %d).\n", ret); - netclose(fp->fd); - fp->fd = -1; - return -1; - } - free(buf); - fp->is_ready = 1; - return 0; -} - -/******************** - * Generic routines * - ********************/ - -knetFile *knet_open(const char *fn, const char *mode) -{ - knetFile *fp = 0; - if (mode[0] != 'r') { - fprintf(stderr, "[kftp_open] only mode \"r\" is supported.\n"); - return 0; - } - if (strstr(fn, "ftp://") == fn) { - fp = kftp_parse_url(fn, mode); - if (fp == 0) return 0; - if (kftp_connect(fp) == -1) { - knet_close(fp); - return 0; - } - kftp_connect_file(fp); - } else if (strstr(fn, "http://") == fn) { - fp = khttp_parse_url(fn, mode); - if (fp == 0) return 0; - khttp_connect_file(fp); - } else { // local file -#ifdef _WIN32 - /* In windows, O_BINARY is necessary. In Linux/Mac, O_BINARY may - * be undefined on some systems, although it is defined on my - * Mac and the Linux I have tested on. */ - int fd = open(fn, O_RDONLY | O_BINARY); -#else - int fd = open(fn, O_RDONLY); -#endif - if (fd == -1) { - perror("open"); - return 0; - } - fp = (knetFile*)calloc(1, sizeof(knetFile)); - fp->type = KNF_TYPE_LOCAL; - fp->fd = fd; - fp->ctrl_fd = -1; - } - if (fp && fp->fd == -1) { - knet_close(fp); - return 0; - } - return fp; -} - -knetFile *knet_dopen(int fd, const char *mode) -{ - knetFile *fp = (knetFile*)calloc(1, sizeof(knetFile)); - fp->type = KNF_TYPE_LOCAL; - fp->fd = fd; - return fp; -} - -off_t knet_read(knetFile *fp, void *buf, off_t len) -{ - off_t l = 0; - if (fp->fd == -1) return 0; - if (fp->type == KNF_TYPE_FTP) { - if (fp->is_ready == 0) { - if (!fp->no_reconnect) kftp_reconnect(fp); - kftp_connect_file(fp); - } - } else if (fp->type == KNF_TYPE_HTTP) { - if (fp->is_ready == 0) - khttp_connect_file(fp); - } - if (fp->type == KNF_TYPE_LOCAL) { // on Windows, the following block is necessary; not on UNIX - off_t rest = len, curr; - while (rest) { - curr = read(fp->fd, buf + l, rest); - if (curr == 0) break; - l += curr; rest -= curr; - } - } else l = my_netread(fp->fd, buf, len); - fp->offset += l; - return l; -} - -off_t knet_seek(knetFile *fp, int64_t off, int whence) -{ - if (whence == SEEK_SET && off == fp->offset) return 0; - if (fp->type == KNF_TYPE_LOCAL) { - /* Be aware that lseek() returns the offset after seeking, - * while fseek() returns zero on success. */ - off_t offset = lseek(fp->fd, off, whence); - if (offset == -1) { - // Be silent, it is OK for knet_seek to fail when the file is streamed - // fprintf(stderr,"[knet_seek] %s\n", strerror(errno)); - return -1; - } - fp->offset = offset; - return 0; - } - else if (fp->type == KNF_TYPE_FTP) - { - if (whence==SEEK_CUR) - fp->offset += off; - else if (whence==SEEK_SET) - fp->offset = off; - else if ( whence==SEEK_END) - fp->offset = fp->file_size+off; - fp->is_ready = 0; - return 0; - } - else if (fp->type == KNF_TYPE_HTTP) - { - if (whence == SEEK_END) { // FIXME: can we allow SEEK_END in future? - fprintf(stderr, "[knet_seek] SEEK_END is not supported for HTTP. Offset is unchanged.\n"); - errno = ESPIPE; - return -1; - } - if (whence==SEEK_CUR) - fp->offset += off; - else if (whence==SEEK_SET) - fp->offset = off; - fp->is_ready = 0; - return fp->offset; - } - errno = EINVAL; - fprintf(stderr,"[knet_seek] %s\n", strerror(errno)); - return -1; -} - -int knet_close(knetFile *fp) -{ - if (fp == 0) return 0; - if (fp->ctrl_fd != -1) netclose(fp->ctrl_fd); // FTP specific - if (fp->fd != -1) { - /* On Linux/Mac, netclose() is an alias of close(), but on - * Windows, it is an alias of closesocket(). */ - if (fp->type == KNF_TYPE_LOCAL) close(fp->fd); - else netclose(fp->fd); - } - free(fp->host); free(fp->port); - free(fp->response); free(fp->retr); free(fp->size_cmd); // FTP specific - free(fp->path); free(fp->http_host); // HTTP specific - free(fp); - return 0; -} - -#ifdef KNETFILE_MAIN -int main(void) -{ - char *buf; - knetFile *fp; - int type = 4, l; -#ifdef _WIN32 - knet_win32_init(); -#endif - buf = calloc(0x100000, 1); - if (type == 0) { - fp = knet_open("knetfile.c", "r"); - knet_seek(fp, 1000, SEEK_SET); - } else if (type == 1) { // NCBI FTP, large file - fp = knet_open("ftp://ftp.ncbi.nih.gov/1000genomes/ftp/data/NA12878/alignment/NA12878.chrom6.SLX.SRP000032.2009_06.bam", "r"); - knet_seek(fp, 2500000000ll, SEEK_SET); - l = knet_read(fp, buf, 255); - } else if (type == 2) { - fp = knet_open("ftp://ftp.sanger.ac.uk/pub4/treefam/tmp/index.shtml", "r"); - knet_seek(fp, 1000, SEEK_SET); - } else if (type == 3) { - fp = knet_open("http://www.sanger.ac.uk/Users/lh3/index.shtml", "r"); - knet_seek(fp, 1000, SEEK_SET); - } else if (type == 4) { - fp = knet_open("http://www.sanger.ac.uk/Users/lh3/ex1.bam", "r"); - knet_read(fp, buf, 10000); - knet_seek(fp, 20000, SEEK_SET); - knet_seek(fp, 10000, SEEK_SET); - l = knet_read(fp, buf+10000, 10000000) + 10000; - } - if (type != 4 && type != 1) { - knet_read(fp, buf, 255); - buf[255] = 0; - printf("%s\n", buf); - } else write(fileno(stdout), buf, l); - knet_close(fp); - free(buf); - return 0; -} -#endif diff --git a/src/knetfile.h b/src/knetfile.h deleted file mode 100644 index 0a0e66f..0000000 --- a/src/knetfile.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef KNETFILE_H -#define KNETFILE_H - -#include -#include - -#ifndef _WIN32 -#define netread(fd, ptr, len) read(fd, ptr, len) -#define netwrite(fd, ptr, len) write(fd, ptr, len) -#define netclose(fd) close(fd) -#else -#include -#define netread(fd, ptr, len) recv(fd, ptr, len, 0) -#define netwrite(fd, ptr, len) send(fd, ptr, len, 0) -#define netclose(fd) closesocket(fd) -#endif - -// FIXME: currently I/O is unbuffered - -#define KNF_TYPE_LOCAL 1 -#define KNF_TYPE_FTP 2 -#define KNF_TYPE_HTTP 3 - -typedef struct knetFile_s { - int type, fd; - int64_t offset; - char *host, *port; - - // the following are for FTP only - int ctrl_fd, pasv_ip[4], pasv_port, max_response, no_reconnect, is_ready; - char *response, *retr, *size_cmd; - int64_t seek_offset; // for lazy seek - int64_t file_size; - - // the following are for HTTP only - char *path, *http_host; -} knetFile; - -#define knet_tell(fp) ((fp)->offset) -#define knet_fileno(fp) ((fp)->fd) - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _WIN32 - int knet_win32_init(); - void knet_win32_destroy(); -#endif - - knetFile *knet_open(const char *fn, const char *mode); - - /* - This only works with local files. - */ - knetFile *knet_dopen(int fd, const char *mode); - - /* - If ->is_ready==0, this routine updates ->fd; otherwise, it simply - reads from ->fd. - */ - off_t knet_read(knetFile *fp, void *buf, off_t len); - - /* - This routine only sets ->offset and ->is_ready=0. It does not - communicate with the FTP server. - */ - off_t knet_seek(knetFile *fp, int64_t off, int whence); - int knet_close(knetFile *fp); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/kseq.h b/src/kseq.h deleted file mode 100644 index 82face0..0000000 --- a/src/kseq.h +++ /dev/null @@ -1,227 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Genome Research Ltd (GRL). - - 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 AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -/* Contact: Heng Li */ - -/* - 2009-07-16 (lh3): in kstream_t, change "char*" to "unsigned char*" - */ - -/* Last Modified: 12APR2009 */ - -#ifndef AC_KSEQ_H -#define AC_KSEQ_H - -#include -#include -#include - -#define KS_SEP_SPACE 0 // isspace(): \t, \n, \v, \f, \r -#define KS_SEP_TAB 1 // isspace() && !' ' -#define KS_SEP_MAX 1 - -#define __KS_TYPE(type_t) \ - typedef struct __kstream_t { \ - unsigned char *buf; \ - int begin, end, is_eof; \ - type_t f; \ - } kstream_t; - -#define ks_eof(ks) ((ks)->is_eof && (ks)->begin >= (ks)->end) -#define ks_rewind(ks) ((ks)->is_eof = (ks)->begin = (ks)->end = 0) - -#define __KS_BASIC(type_t, __bufsize) \ - static inline kstream_t *ks_init(type_t f) \ - { \ - kstream_t *ks = (kstream_t*)calloc(1, sizeof(kstream_t)); \ - ks->f = f; \ - ks->buf = malloc(__bufsize); \ - return ks; \ - } \ - static inline void ks_destroy(kstream_t *ks) \ - { \ - if (ks) { \ - free(ks->buf); \ - free(ks); \ - } \ - } - -#define __KS_GETC(__read, __bufsize) \ - static inline int ks_getc(kstream_t *ks) \ - { \ - if (ks->is_eof && ks->begin >= ks->end) return -1; \ - if (ks->begin >= ks->end) { \ - ks->begin = 0; \ - ks->end = __read(ks->f, ks->buf, __bufsize); \ - if (ks->end < __bufsize) ks->is_eof = 1; \ - if (ks->end == 0) return -1; \ - } \ - return (int)ks->buf[ks->begin++]; \ - } - -#ifndef KSTRING_T -#define KSTRING_T kstring_t -typedef struct __kstring_t { - size_t l, m; - char *s; -} kstring_t; -#endif - -#ifndef kroundup32 -#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) -#endif - -#define __KS_GETUNTIL(__read, __bufsize) \ - static int ks_getuntil(kstream_t *ks, int delimiter, kstring_t *str, int *dret) \ - { \ - if (dret) *dret = 0; \ - str->l = 0; \ - if (ks->begin >= ks->end && ks->is_eof) return -1; \ - for (;;) { \ - int i; \ - if (ks->begin >= ks->end) { \ - if (!ks->is_eof) { \ - ks->begin = 0; \ - ks->end = __read(ks->f, ks->buf, __bufsize); \ - if (ks->end < __bufsize) ks->is_eof = 1; \ - if (ks->end == 0) break; \ - } else break; \ - } \ - if (delimiter > KS_SEP_MAX) { \ - for (i = ks->begin; i < ks->end; ++i) \ - if (ks->buf[i] == delimiter) break; \ - } else if (delimiter == KS_SEP_SPACE) { \ - for (i = ks->begin; i < ks->end; ++i) \ - if (isspace(ks->buf[i])) break; \ - } else if (delimiter == KS_SEP_TAB) { \ - for (i = ks->begin; i < ks->end; ++i) \ - if (isspace(ks->buf[i]) && ks->buf[i] != ' ') break; \ - } else i = 0; /* never come to here! */ \ - if (str->m - str->l < i - ks->begin + 1) { \ - str->m = str->l + (i - ks->begin) + 1; \ - kroundup32(str->m); \ - str->s = (char*)realloc(str->s, str->m); \ - } \ - memcpy(str->s + str->l, ks->buf + ks->begin, i - ks->begin); \ - str->l = str->l + (i - ks->begin); \ - ks->begin = i + 1; \ - if (i < ks->end) { \ - if (dret) *dret = ks->buf[i]; \ - break; \ - } \ - } \ - if (str->l == 0) { \ - str->m = 1; \ - str->s = (char*)calloc(1, 1); \ - } \ - str->s[str->l] = '\0'; \ - return str->l; \ - } - -#define KSTREAM_INIT(type_t, __read, __bufsize) \ - __KS_TYPE(type_t) \ - __KS_BASIC(type_t, __bufsize) \ - __KS_GETC(__read, __bufsize) \ - __KS_GETUNTIL(__read, __bufsize) - -#define __KSEQ_BASIC(type_t) \ - static inline kseq_t *kseq_init(type_t fd) \ - { \ - kseq_t *s = (kseq_t*)calloc(1, sizeof(kseq_t)); \ - s->f = ks_init(fd); \ - return s; \ - } \ - static inline void kseq_rewind(kseq_t *ks) \ - { \ - ks->last_char = 0; \ - ks->f->is_eof = ks->f->begin = ks->f->end = 0; \ - } \ - static inline void kseq_destroy(kseq_t *ks) \ - { \ - if (!ks) return; \ - free(ks->name.s); free(ks->comment.s); free(ks->seq.s); free(ks->qual.s); \ - ks_destroy(ks->f); \ - free(ks); \ - } - -/* Return value: - >=0 length of the sequence (normal) - -1 end-of-file - -2 truncated quality string - */ -#define __KSEQ_READ \ - static int kseq_read(kseq_t *seq) \ - { \ - int c; \ - kstream_t *ks = seq->f; \ - if (seq->last_char == 0) { /* then jump to the next header line */ \ - while ((c = ks_getc(ks)) != -1 && c != '>' && c != '@'); \ - if (c == -1) return -1; /* end of file */ \ - seq->last_char = c; \ - } /* the first header char has been read */ \ - seq->comment.l = seq->seq.l = seq->qual.l = 0; \ - if (ks_getuntil(ks, 0, &seq->name, &c) < 0) return -1; \ - if (c != '\n') ks_getuntil(ks, '\n', &seq->comment, 0); \ - while ((c = ks_getc(ks)) != -1 && c != '>' && c != '+' && c != '@') { \ - if (isgraph(c)) { /* printable non-space character */ \ - if (seq->seq.l + 1 >= seq->seq.m) { /* double the memory */ \ - seq->seq.m = seq->seq.l + 2; \ - kroundup32(seq->seq.m); /* rounded to next closest 2^k */ \ - seq->seq.s = (char*)realloc(seq->seq.s, seq->seq.m); \ - } \ - seq->seq.s[seq->seq.l++] = (char)c; \ - } \ - } \ - if (c == '>' || c == '@') seq->last_char = c; /* the first header char has been read */ \ - seq->seq.s[seq->seq.l] = 0; /* null terminated string */ \ - if (c != '+') return seq->seq.l; /* FASTA */ \ - if (seq->qual.m < seq->seq.m) { /* allocate enough memory */ \ - seq->qual.m = seq->seq.m; \ - seq->qual.s = (char*)realloc(seq->qual.s, seq->qual.m); \ - } \ - while ((c = ks_getc(ks)) != -1 && c != '\n'); /* skip the rest of '+' line */ \ - if (c == -1) return -2; /* we should not stop here */ \ - while ((c = ks_getc(ks)) != -1 && seq->qual.l < seq->seq.l) \ - if (c >= 33 && c <= 127) seq->qual.s[seq->qual.l++] = (unsigned char)c; \ - seq->qual.s[seq->qual.l] = 0; /* null terminated string */ \ - seq->last_char = 0; /* we have not come to the next header line */ \ - if (seq->seq.l != seq->qual.l) return -2; /* qual string is shorter than seq string */ \ - return seq->seq.l; \ - } - -#define __KSEQ_TYPE(type_t) \ - typedef struct { \ - kstring_t name, comment, seq, qual; \ - int last_char; \ - kstream_t *f; \ - } kseq_t; - -#define KSEQ_INIT(type_t, __read) \ - KSTREAM_INIT(type_t, __read, 4096) \ - __KSEQ_TYPE(type_t) \ - __KSEQ_BASIC(type_t) \ - __KSEQ_READ - -#endif diff --git a/src/ksort.h b/src/ksort.h deleted file mode 100644 index 16a03fd..0000000 --- a/src/ksort.h +++ /dev/null @@ -1,271 +0,0 @@ -/* The MIT License - - Copyright (c) 2008 Genome Research Ltd (GRL). - - 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 AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -/* Contact: Heng Li */ - -/* - 2008-11-16 (0.1.4): - - * Fixed a bug in introsort() that happens in rare cases. - - 2008-11-05 (0.1.3): - - * Fixed a bug in introsort() for complex comparisons. - - * Fixed a bug in mergesort(). The previous version is not stable. - - 2008-09-15 (0.1.2): - - * Accelerated introsort. On my Mac (not on another Linux machine), - my implementation is as fast as std::sort on random input. - - * Added combsort and in introsort, switch to combsort if the - recursion is too deep. - - 2008-09-13 (0.1.1): - - * Added k-small algorithm - - 2008-09-05 (0.1.0): - - * Initial version - -*/ - -#ifndef AC_KSORT_H -#define AC_KSORT_H - -#include -#include - -typedef struct { - void *left, *right; - int depth; -} ks_isort_stack_t; - -#define KSORT_SWAP(type_t, a, b) { register type_t t=(a); (a)=(b); (b)=t; } - -#define KSORT_INIT(name, type_t, __sort_lt) \ - void ks_mergesort_##name(size_t n, type_t array[], type_t temp[]) \ - { \ - type_t *a2[2], *a, *b; \ - int curr, shift; \ - \ - a2[0] = array; \ - a2[1] = temp? temp : (type_t*)malloc(sizeof(type_t) * n); \ - for (curr = 0, shift = 0; (1ul<> 1) - 1; i != (size_t)(-1); --i) \ - ks_heapadjust_##name(i, lsize, l); \ - } \ - void ks_heapsort_##name(size_t lsize, type_t l[]) \ - { \ - size_t i; \ - for (i = lsize - 1; i > 0; --i) { \ - type_t tmp; \ - tmp = *l; *l = l[i]; l[i] = tmp; ks_heapadjust_##name(0, i, l); \ - } \ - } \ - inline void __ks_insertsort_##name(type_t *s, type_t *t) \ - { \ - type_t *i, *j, swap_tmp; \ - for (i = s + 1; i < t; ++i) \ - for (j = i; j > s && __sort_lt(*j, *(j-1)); --j) { \ - swap_tmp = *j; *j = *(j-1); *(j-1) = swap_tmp; \ - } \ - } \ - void ks_combsort_##name(size_t n, type_t a[]) \ - { \ - const double shrink_factor = 1.2473309501039786540366528676643; \ - int do_swap; \ - size_t gap = n; \ - type_t tmp, *i, *j; \ - do { \ - if (gap > 2) { \ - gap = (size_t)(gap / shrink_factor); \ - if (gap == 9 || gap == 10) gap = 11; \ - } \ - do_swap = 0; \ - for (i = a; i < a + n - gap; ++i) { \ - j = i + gap; \ - if (__sort_lt(*j, *i)) { \ - tmp = *i; *i = *j; *j = tmp; \ - do_swap = 1; \ - } \ - } \ - } while (do_swap || gap > 2); \ - if (gap != 1) __ks_insertsort_##name(a, a + n); \ - } \ - void ks_introsort_##name(size_t n, type_t a[]) \ - { \ - int d; \ - ks_isort_stack_t *top, *stack; \ - type_t rp, swap_tmp; \ - type_t *s, *t, *i, *j, *k; \ - \ - if (n < 1) return; \ - else if (n == 2) { \ - if (__sort_lt(a[1], a[0])) { swap_tmp = a[0]; a[0] = a[1]; a[1] = swap_tmp; } \ - return; \ - } \ - for (d = 2; 1ul<>1) + 1; \ - if (__sort_lt(*k, *i)) { \ - if (__sort_lt(*k, *j)) k = j; \ - } else k = __sort_lt(*j, *i)? i : j; \ - rp = *k; \ - if (k != t) { swap_tmp = *k; *k = *t; *t = swap_tmp; } \ - for (;;) { \ - do ++i; while (__sort_lt(*i, rp)); \ - do --j; while (i <= j && __sort_lt(rp, *j)); \ - if (j <= i) break; \ - swap_tmp = *i; *i = *j; *j = swap_tmp; \ - } \ - swap_tmp = *i; *i = *t; *t = swap_tmp; \ - if (i-s > t-i) { \ - if (i-s > 16) { top->left = s; top->right = i-1; top->depth = d; ++top; } \ - s = t-i > 16? i+1 : t; \ - } else { \ - if (t-i > 16) { top->left = i+1; top->right = t; top->depth = d; ++top; } \ - t = i-s > 16? i-1 : s; \ - } \ - } else { \ - if (top == stack) { \ - free(stack); \ - __ks_insertsort_##name(a, a+n); \ - return; \ - } else { --top; s = (type_t*)top->left; t = (type_t*)top->right; d = top->depth; } \ - } \ - } \ - } \ - /* This function is adapted from: http://ndevilla.free.fr/median/ */ \ - /* 0 <= kk < n */ \ - type_t ks_ksmall_##name(size_t n, type_t arr[], size_t kk) \ - { \ - type_t *low, *high, *k, *ll, *hh, *mid; \ - low = arr; high = arr + n - 1; k = arr + kk; \ - for (;;) { \ - if (high <= low) return *k; \ - if (high == low + 1) { \ - if (__sort_lt(*high, *low)) KSORT_SWAP(type_t, *low, *high); \ - return *k; \ - } \ - mid = low + (high - low) / 2; \ - if (__sort_lt(*high, *mid)) KSORT_SWAP(type_t, *mid, *high); \ - if (__sort_lt(*high, *low)) KSORT_SWAP(type_t, *low, *high); \ - if (__sort_lt(*low, *mid)) KSORT_SWAP(type_t, *mid, *low); \ - KSORT_SWAP(type_t, *mid, *(low+1)); \ - ll = low + 1; hh = high; \ - for (;;) { \ - do ++ll; while (__sort_lt(*ll, *low)); \ - do --hh; while (__sort_lt(*low, *hh)); \ - if (hh < ll) break; \ - KSORT_SWAP(type_t, *ll, *hh); \ - } \ - KSORT_SWAP(type_t, *low, *hh); \ - if (hh <= k) low = ll; \ - if (hh >= k) high = hh - 1; \ - } \ - } - -#define ks_mergesort(name, n, a, t) ks_mergesort_##name(n, a, t) -#define ks_introsort(name, n, a) ks_introsort_##name(n, a) -#define ks_combsort(name, n, a) ks_combsort_##name(n, a) -#define ks_heapsort(name, n, a) ks_heapsort_##name(n, a) -#define ks_heapmake(name, n, a) ks_heapmake_##name(n, a) -#define ks_heapadjust(name, i, n, a) ks_heapadjust_##name(i, n, a) -#define ks_ksmall(name, n, a, k) ks_ksmall_##name(n, a, k) - -#define ks_lt_generic(a, b) ((a) < (b)) -#define ks_lt_str(a, b) (strcmp((a), (b)) < 0) - -typedef const char *ksstr_t; - -#define KSORT_INIT_GENERIC(type_t) KSORT_INIT(type_t, type_t, ks_lt_generic) -#define KSORT_INIT_STR KSORT_INIT(str, ksstr_t, ks_lt_str) - -#endif diff --git a/src/kstring.c b/src/kstring.c deleted file mode 100644 index e0203fa..0000000 --- a/src/kstring.c +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include -#include -#include -#include -#include "kstring.h" - -int ksprintf(kstring_t *s, const char *fmt, ...) -{ - va_list ap; - int l; - va_start(ap, fmt); - l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap); // This line does not work with glibc 2.0. See `man snprintf'. - va_end(ap); - if (l + 1 > s->m - s->l) { - s->m = s->l + l + 2; - kroundup32(s->m); - s->s = (char*)realloc(s->s, s->m); - va_start(ap, fmt); - l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap); - } - va_end(ap); - s->l += l; - return l; -} - -// s MUST BE a null terminated string; l = strlen(s) -int ksplit_core(char *s, int delimiter, int *_max, int **_offsets) -{ - int i, n, max, last_char, last_start, *offsets, l; - n = 0; max = *_max; offsets = *_offsets; - l = strlen(s); - -#define __ksplit_aux do { \ - if (_offsets) { \ - s[i] = 0; \ - if (n == max) { \ - max = max? max<<1 : 2; \ - offsets = (int*)realloc(offsets, sizeof(int) * max); \ - } \ - offsets[n++] = last_start; \ - } else ++n; \ - } while (0) - - for (i = 0, last_char = last_start = 0; i <= l; ++i) { - if (delimiter == 0) { - if (isspace(s[i]) || s[i] == 0) { - if (isgraph(last_char)) __ksplit_aux; // the end of a field - } else { - if (isspace(last_char) || last_char == 0) last_start = i; - } - } else { - if (s[i] == delimiter || s[i] == 0) { - if (last_char != 0 && last_char != delimiter) __ksplit_aux; // the end of a field - } else { - if (last_char == delimiter || last_char == 0) last_start = i; - } - } - last_char = s[i]; - } - *_max = max; *_offsets = offsets; - return n; -} - -/********************** - * Boyer-Moore search * - **********************/ - -// reference: http://www-igm.univ-mlv.fr/~lecroq/string/node14.html -int *ksBM_prep(const uint8_t *pat, int m) -{ - int i, *suff, *prep, *bmGs, *bmBc; - prep = calloc(m + 256, 1); - bmGs = prep; bmBc = prep + m; - { // preBmBc() - for (i = 0; i < 256; ++i) bmBc[i] = m; - for (i = 0; i < m - 1; ++i) bmBc[pat[i]] = m - i - 1; - } - suff = calloc(m, sizeof(int)); - { // suffixes() - int f = 0, g; - suff[m - 1] = m; - g = m - 1; - for (i = m - 2; i >= 0; --i) { - if (i > g && suff[i + m - 1 - f] < i - g) - suff[i] = suff[i + m - 1 - f]; - else { - if (i < g) g = i; - f = i; - while (g >= 0 && pat[g] == pat[g + m - 1 - f]) --g; - suff[i] = f - g; - } - } - } - { // preBmGs() - int j = 0; - for (i = 0; i < m; ++i) bmGs[i] = m; - for (i = m - 1; i >= 0; --i) - if (suff[i] == i + 1) - for (; j < m - 1 - i; ++j) - if (bmGs[j] == m) - bmGs[j] = m - 1 - i; - for (i = 0; i <= m - 2; ++i) - bmGs[m - 1 - suff[i]] = m - 1 - i; - } - free(suff); - return prep; -} - -int *ksBM_search(const uint8_t *str, int n, const uint8_t *pat, int m, int *_prep, int *n_matches) -{ - int i, j, *prep, *bmGs, *bmBc; - int *matches = 0, mm = 0, nm = 0; - prep = _prep? _prep : ksBM_prep(pat, m); - bmGs = prep; bmBc = prep + m; - j = 0; - while (j <= n - m) { - for (i = m - 1; i >= 0 && pat[i] == str[i+j]; --i); - if (i < 0) { - if (nm == mm) { - mm = mm? mm<<1 : 1; - matches = realloc(matches, mm * sizeof(int)); - } - matches[nm++] = j; - j += bmGs[0]; - } else { - int max = bmBc[str[i+j]] - m + 1 + i; - if (max < bmGs[i]) max = bmGs[i]; - j += max; - } - } - *n_matches = nm; - if (_prep == 0) free(prep); - return matches; -} - -#ifdef KSTRING_MAIN -#include -int main() -{ - kstring_t *s; - int *fields, n, i; - s = (kstring_t*)calloc(1, sizeof(kstring_t)); - // test ksprintf() - ksprintf(s, " abcdefg: %d ", 100); - printf("'%s'\n", s->s); - // test ksplit() - fields = ksplit(s, 0, &n); - for (i = 0; i < n; ++i) - printf("field[%d] = '%s'\n", i, s->s + fields[i]); - free(s); - - { - static char *str = "abcdefgcdg"; - static char *pat = "cd"; - int n, *matches; - matches = ksBM_search(str, strlen(str), pat, strlen(pat), 0, &n); - printf("%d: \n", n); - for (i = 0; i < n; ++i) - printf("- %d\n", matches[i]); - free(matches); - } - return 0; -} -#endif diff --git a/src/kstring.h b/src/kstring.h deleted file mode 100644 index f4e5a99..0000000 --- a/src/kstring.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef KSTRING_H -#define KSTRING_H - -#include -#include -#include - -#ifndef kroundup32 -#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) -#endif - -#ifndef KSTRING_T -#define KSTRING_T kstring_t -typedef struct __kstring_t { - size_t l, m; - char *s; -} kstring_t; -#endif - -int ksprintf(kstring_t *s, const char *fmt, ...); -int ksplit_core(char *s, int delimiter, int *_max, int **_offsets); - -// calculate the auxiliary array, allocated by calloc() -int *ksBM_prep(const uint8_t *pat, int m); - -/* Search pat in str and returned the list of matches. The size of the - * list is returned as n_matches. _prep is the array returned by - * ksBM_prep(). If it is a NULL pointer, ksBM_prep() will be called. */ -int *ksBM_search(const uint8_t *str, int n, const uint8_t *pat, int m, int *_prep, int *n_matches); - -static inline int kputsn(const char *p, int l, kstring_t *s) -{ - if (s->l + l + 1 >= s->m) { - s->m = s->l + l + 2; - kroundup32(s->m); - s->s = (char*)realloc(s->s, s->m); - } - strncpy(s->s + s->l, p, l); - s->l += l; - s->s[s->l] = 0; - return l; -} - -static inline int kputs(const char *p, kstring_t *s) -{ - return kputsn(p, strlen(p), s); -} - -static inline int kputc(int c, kstring_t *s) -{ - if (s->l + 1 >= s->m) { - s->m = s->l + 2; - kroundup32(s->m); - s->s = (char*)realloc(s->s, s->m); - } - s->s[s->l++] = c; - s->s[s->l] = 0; - return c; -} - -static inline int *ksplit(kstring_t *s, int delimiter, int *n) -{ - int max = 0, *offsets = 0; - *n = ksplit_core(s->s, delimiter, &max, &offsets); - return offsets; -} - -#endif diff --git a/src/ncStat.h b/src/ncStat.h deleted file mode 100644 index 7d2a3c8..0000000 --- a/src/ncStat.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef __NC_STAT_H__ -#define __NC_STAT_H__ - -#include -#include -#include - -#include "codonHelper.h" -#include "Error.h" - -class ncKey { -public: - int scorebin; - uint8_t cpg; - uint8_t ref; - uint16_t kmer; - - ncKey(int _scorebin, int _cpg, int _ref, int _kmer) { - scorebin = _scorebin; - cpg = (_cpg == -1) ? 255 : (uint8_t)_cpg; - ref = (_ref == -1) ? 255 : (uint8_t)_ref; - kmer = (_kmer == -1) ? 65535 : (uint16_t)_kmer; - } - - bool operator< (const ncKey& x) const { - if ( scorebin == x.scorebin ) { - if ( cpg == x.cpg ) { - if ( ref == x.ref ) { - return (kmer < x.kmer); - } - else return (ref < x.ref); - } - else return (cpg < x.cpg); - } - else return (scorebin < x.scorebin); - } -}; - -class ncStat { - public: - static const double NAN_DBL; - - int nBase; - int nPass; - int nInds; - double sumCons; - double sqCons; - std::vector etas; - std::vector cnts; - std::vector coms; - - ncStat() : nBase(0), nPass(0), nInds(0), sumCons(0), sqCons(0) {} - void setN(int n) { - nInds = n; - etas.clear(); - etas.resize(8*n,0); - cnts.resize(4,0); - coms.resize(4,0); - } - - void addBase(bool pass, float score) { - ++nBase; - if ( pass ) { - ++nPass; - sumCons += score; - sqCons += (score*score); - } - } - - void addVariant(uint8_t altAllele, int altCount) { - if ( altCount > 0 ) { - if ( ( altAllele > 0 ) && ( altAllele < 5 ) ) { - ++etas[(altAllele-1) * (2 * nInds) + (altCount-1)]; - if ( altCount < 2*nInds ) ++cnts[(altAllele-1)]; - if ( ( altCount >= 0.005*2*nInds ) && ( altCount <= 0.995*2*nInds ) ) ++coms[(altAllele-1)]; // AF>.5% - } - else { - error("altAllele must be between 1 and 4"); - } - } - } - - // SE is estimated with one pseudo-count - // mean = n/N - // SD = sqrt((n+1)/(N+1)*((N-n)/(N+1))/(N+1)) - std::pair allDensity(int altAllele = 0) { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { - int n = (altAllele == 0) ? (cnts[0]+cnts[1]+cnts[2]+cnts[3]) : cnts[(altAllele-1)]; - double p = (double)n / (double)nPass; - double sd = sqrt((n+1.) * (nPass-n) / (nPass+1.))/(nPass+1.); - return std::pair (p,sd); - } - } - - // SE is estimated with one pseudo-count - // mean = n/N - // SD = sqrt((n+1)/(N+1)*((N-n)/(N+1))/(N+1)) - std::pair comDensity(int altAllele = 0) { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { - int n = (altAllele == 0) ? (coms[0]+coms[1]+coms[2]+coms[3]) : coms[(altAllele-1)]; - double p = (double)n / (double)nPass; - double sd = sqrt((n+1.) * (nPass-n) / (nPass+1.))/(nPass+1.); - return std::pair (p,sd); - } - } - - std::pair avgCons() { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { return std::pair ( sumCons / nPass, sqrt( (sqCons/nPass - sumCons*sumCons/nPass/nPass) / nPass ) ); } - } - - std::pair theta(int altAllele = 0) { - if ( nPass == 0 ) { return std::pair (0,NAN_DBL); } - else { - double sum = 0; - //double altMono = etas[0*2*nInds+2*nInds-1]+etas[1*2*nInds+2*nInds-1]+etas[2*2*nInds+2*nInds-1]+etas[3*2*nInds+2*nInds-1]; - for(int i=1; i < nInds*2; ++i) { - sum += ((double)i*(nInds+nInds-i)*(double)(altAllele == 0 ? (etas[0*(2*nInds)+i-1]+etas[1*(2*nInds)+i-1]+etas[2*(2*nInds)+i-1]+etas[3*(2*nInds)+i-1]) : etas[(altAllele-1)*(2*nInds)+i-1])); - } - //notice("sum=%lf\n",sum); - double theta = (sum == 0) ? ((nInds+nInds-1.)*(1./(2.0*nInds*(2.0*nInds-1.0)))/(double)nPass) : (sum * (2./(2.0*nInds*(2.0*nInds-1.0))/(double)nPass) ); - double seTheta = sqrt( (2.0*nInds+1.0)/(6.0*nInds-3.0)*theta + 2.0*(4.0*nInds*nInds+2.0*nInds+3.)/(18.0*nInds*(2.0*nInds-1.0))*theta*theta ); - return std::pair (theta,seTheta); - } - } -}; - -const double ncStat::NAN_DBL = sqrt(-1.); // assign double NAN value - -#endif diff --git a/src/pException.h b/src/pException.h deleted file mode 100644 index 858e7e2..0000000 --- a/src/pException.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __PLUG_EXCEPTION_H -#define __PLUG_EXCEPTION_H - -#include - -class pException : public std::exception { -public: - virtual const char* what() const throw() { - return "Exception was thrown"; - } -} pexception; - -#endif // __PLUG_EXCEPTION_H diff --git a/src/pFile.h b/src/pFile.h deleted file mode 100644 index e0e3a62..0000000 --- a/src/pFile.h +++ /dev/null @@ -1,377 +0,0 @@ -#ifndef __TABIXED_FILE__H -#define __TABIXED_FILE__H - -#include -#include -#include -#include - -#include "bgzf.h" -#include "tabix.h" - -#include "Error.h" - -// class to read tabixed -class pFile { - protected: - FILE *fp; - gzFile gf; - tabix_t *t; - int tid; - int beg; - int end; - int len; - - std::string fname; - std::string chrom; - std::string reg; - bool head; - ti_iter_t iter; - int type; - char* line; - const ti_conf_t *idxconf; - static const int MAX_LINE_SIZE = 10000000L; - - public: - ~pFile() { - close(); // TODO : calling close() generates error. Don't know why - } - - static void tokenizeLine(const char* s, const char* delims, std::vector& tokens) { - const char* p = s; - const char* c = p; - int ndelims = strlen(delims); - int i; - tokens.clear(); - - //fprintf(stderr,"s = '%s', strlen(s) = %d, delims = '%s'\n",s,(int)strlen(s), delims); - while( *p != '\0' ) { - for(i=0; i < ndelims; ++i) { if ( *p == delims[i] ) break; } - if ( i != ndelims ) { // delimiter found - if ( c < p ) { // unless delimiter is consencutive - //std::string s1(c,p-c); - tokens.push_back(std::string(c,p-c)); - } - c = p+1; - } - ++p; - } - if ( c < p ) { - tokens.push_back(std::string(c,p-c)); - } - } - - // return 0 if not gzip, 1 if gz but not bgzf, 2 if bgzf, -1 if 10 bytes cannot be read - static int fileType(const char *fn) - { - FILE* fp; - //fprintf(stderr,"foo\n"); - uint8_t buf[10], magic[11]="\037\213\010\4\0\0\0\0\0\377"; - int n; - - if ( strcmp(fn,"-") == 0 ) { return 0; } - - if ((fp = fopen(fn, "rb")) == NULL) - { - return -1; - } - n = fread(buf, 1, 10, fp); - - //fprintf(stderr,"bar\n"); - - fclose(fp); - - if ( n!=10 ) return -1; - if ( !memcmp(magic, buf, 10) ) return 2; - if ( !memcmp(magic, buf, 2) ) { - return 1; - } - return 0; - } - - void load(const char* filename, const char* region = NULL, bool printHeader = false) { - head = printHeader; - if ( region != NULL ) reg = region; - open(filename); - if ( reg.empty() ) { - head = false; // head flag is valid only with specified region - loadAll(); - } - else if ( head ) { // head flag is set with region specified - loadIndex(); - loadAll(); // load the header first, and will load the region later - } - else { - loadIndex(); - loadRegion(); // load the region right away - } - } - - pFile() : head(false), iter(NULL), type(-1), line(NULL), idxconf(NULL) { - } - - // read specifying one region - pFile(const char* filename, const char* region = NULL, bool printHeader = false) : head(printHeader), iter(NULL), type(-1), line(NULL), idxconf(NULL) { - load(filename, region, printHeader); - /* - // open the file - if ( region != NULL ) reg = region; - open(filename); - if ( reg.empty() ) { - head = false; // head flag is valid only with specified region - loadAll(); - } - else if ( head ) { // head flag is set with region specified - loadIndex(); - loadAll(); // load the header first, and will load the region later - } - else { - loadIndex(); - loadRegion(); // load the region right away - } - */ - } - - void updateRegion(const char* region, bool sepchr = false) { - reg = region; - if ( reg.empty() ) { - loadAll(); - } - else { - if ( idxconf == NULL ) loadIndex(); - loadRegion(sepchr); - } - } - - int getLength() { - return len; - } - - int read(void* ptr, size_t count) { - switch(type) { - case 0: - return (int)fread(ptr, 1, count, fp); - case 1: - return gzread(gf, ptr, count); - case 2: // bgzipped files - return bgzf_read(t->fp, ptr, count); - default: - error("pFile::read() - unknown type %d\n",type); - } - return 0; - } - - const char* peekLine() { return line; } - - const char* getLine() { - //fprintf(stderr,"gerLine() called\n"); - - switch(type) { - case 0: - if ( line == NULL ) line = new char[MAX_LINE_SIZE]; - if ( fgets(line, MAX_LINE_SIZE, fp) != NULL ) { - //fputs(line,stderr); - len = strlen(line); // TODO : convert to lazy evaluation - if ( line[len-1] == '\n' ) { - line[len-1] = '\0'; - --len; - } - } - else { - if ( line != NULL ) delete [] line; - len = 0; - line = NULL; - } - return line; - /* - size_t tn; - //if ( line == NULL ) line = new char[MAX_LINE_SIZE]; - if ( (len = getline(&line, &tn, fp)) != -1 ) { - if ( line[len-1] == '\n' ) { - line[len-1] = '\0'; // update carriage return to null character - --len; - } - return line; - } - else { - //if ( line != NULL ) delete [] line; - len = 0; - return NULL; - } - */ - case 1: - if ( line == NULL ) line = new char[MAX_LINE_SIZE]; - if ( gzgets(gf, line, MAX_LINE_SIZE) > 0 ) { - len = strlen(line); // TODO : convert to lazy evaluation - if ( line[len-1] == '\n' ) { - line[len-1] = '\0'; - --len; - } - } - else { - if ( line != NULL ) delete [] line; - len = 0; - line = NULL; - } - return line; - case 2: - if ( iter == NULL ) return NULL; - line = (char*)ti_read(t, iter, &len); - if ( head ) { // if reached the end of the header - if ( (int)(*line) != idxconf->meta_char ) { - //if ( iter != NULL ) ti_iter_destroy(iter); // close existing iterator - head = false; - loadRegion(); - return getLine(); - } - } - else if ( line == NULL ) { - //fprintf(stderr,"foo\n"); - ti_iter_destroy(iter); - iter = NULL; - return NULL; - } - return line; - default: - warning("Attempt to read empty file unknown file type.\n"); - return NULL; - } - } - - bool open(const char* filename, bool forcegz = false) { // return true if gzipped, false otherwise - fname = filename; - type = fileType(filename); - if ( forcegz ) type = 1; - switch(type) { - case 0: - t = NULL; - gf = NULL; - if ( strcmp(filename,"-") == 0 ) { - fp = stdin; - } - else { - fp = fopen(filename,"r"); - } - return (fp != NULL); - case 1: - t = NULL; - gf = gzopen(filename,"rb"); - fp = NULL; - return (gf != NULL); - case 2: - //notice("open() is called"); - if ( (t = ti_open(filename,0)) == 0 ) { - warning("Cannot open %s with tabix..\n",filename); - return false; - } - gf = NULL; - fp = NULL; - //notice("open() is successful"); - return true; - default: - warning("Cannot open %s. File is not accessible\n",filename); - return false; - break; - } - if ( !reg.empty() && type < 2 ) { - error("File %s is not indexed, so cannot be acessed with specified region",filename); - } - } - - void close() { - switch( type ) { - case 0: - if ( fp != NULL ) fclose(fp); - fp = NULL; - break; - case 1: - if ( gf != NULL ) gzclose(gf); - if ( line != NULL ) delete [] line; - gf = NULL; - line = NULL; - break; - case 2: - //notice("close() is called %d %d",iter,t->idx); - //if ( iter != NULL ) ti_iter_destroy(iter); - if ( t != NULL ) { - //ti_index_destroy(t->idx); - ti_close(t); - } - idxconf = NULL; - t = NULL; - iter = NULL; - break; - } - } - - void loadAll() { - if ( type == 2 ) { - iter = ti_query(t,0,0,0); - } - } - - void loadIndex() { - if (ti_lazy_index_load(t) < 0 ) { - error("Failed to load the index file"); - } - idxconf = ti_get_conf(t->idx); - } - - void loadRegion(bool sepchr = false) { - //notice("ti_parse_region( %s )",reg.c_str()); - if ( iter != NULL ) ti_iter_destroy(iter); // close existing iterator - if ( ti_parse_region(t->idx, reg.c_str(), &tid, &beg, &end) != 0 ) { - if ( sepchr ) { - // changes all "chrAA." to "chrBB." from the files - std::string newfname; - int pos = 0; - size_t ichr = 0; - while ( (ichr = fname.find("chr",pos)) != std::string::npos ) { - size_t idot = fname.find_first_of("-_./",ichr); - std::string newchr = reg.substr(0,reg.find(':')); - if ( idot == std::string::npos ) - error("Cannot find '.','_','-', or '/' after chr in the filename with --sepchr option"); - newfname += (fname.substr(pos,ichr-pos) + "chr" + newchr); - pos = idot; - } - newfname += fname.substr(pos); - fname = newfname; - - notice("Changing the VCF file name to %s",fname.c_str()); - - /* - //notice("loadRegion(true) %s",reg.c_str()); - // assume that current filename is [prefix]chr[chr].[suffix] - int ichr = fname.find("chr"); - int idot = fname.find('.',ichr); - std::string newchr = reg.substr(0,reg.find(':')); - std::string prefix = fname.substr(0,ichr); - std::string suffix = fname.substr(idot); - fname = prefix + "chr" + newchr + suffix; - //notice("open(%s)",fname.c_str()); - */ - - if ( fileType(fname.c_str()) < 0 ) { - warning("Cannot parse region %s.. Returning empty",reg.c_str()); - iter = NULL; - } - else { - close(); - open(fname.c_str()); - loadIndex(); - loadRegion(); - } - } - else { - warning("Cannot parse region %s.. Returning empty",reg.c_str()); - iter = NULL; - } - } - else { - //notice("ti_query(%x, %d, %d, %d)",t,tid,beg,end); - iter = ti_queryi(t,tid,beg,end); - } - } -}; - -#endif // __TABIXED_FILE diff --git a/src/params.cpp b/src/params.cpp deleted file mode 100644 index e37bd88..0000000 --- a/src/params.cpp +++ /dev/null @@ -1,628 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#include "params.h" -#include "Constant.h" -#include "Error.h" - -#include -#include -#include -#include -#include -#include - -int param::nameCol = 30; -int param::statusCol = 15; -int param::helpCol = 20; - -// constructor -- assign initial values -param::param(char c, const char * desc, void * v, const char* help) - : ch((char)tolower(c)), - description(desc == NULL ? "" : desc), - var(v), - helpstring(help == NULL ? "" : help), - errors(NULL), - messages(NULL) -{ -} - -// ??? -int param::TranslateExtras(const char * , const char *) -{ - return -1; -} - -// set parameter speficific errors -void param::error(const char * format, ...) -{ - va_list ap; - va_start(ap, format); - char buf[65535]; - vsprintf(buf, format, ap); - va_end(ap); - - if (errors == NULL) { - ::error(buf); - } - else { - (*errors) += buf; - } -} - -// set parameter speficific errors -void param::message(const char * format, ...) -{ - va_list ap; - va_start(ap, format); - char buf[65535]; - vsprintf(buf, format, ap); - va_end(ap); - - if (messages == NULL) { - ::printf(buf); - } - else { - (*messages) += buf; - } -} - -// constructor of long parameter -longParams::longParams(const char * desc, longParamList * lst) - : param('-', desc, NULL) -{ - list = lst; - - index.clear(); - group_len = 0; - name_len = 0; - - longParamList * ptr = list + 1; // first parameter - - while (ptr->desc != NULL) { // unless it is non-informative - if (ptr->value != NULL) { // if it is a real parameter - index[ptr->desc] = ptr; // map string to param - int tmp = strlen(ptr->desc); // if it is just a group - if (tmp > name_len) name_len = tmp; // modify group_len - } - else { - int tmp = strlen(ptr->desc); // if it is just a group - if (tmp > group_len) group_len = tmp; // modify group_len - } - - ptr++; - } - - precision = 2; // ??? -} - -// cstr is [option_name] and extra is value -int longParams::TranslateExtras(const char * cstr, const char * extras) -{ - std::map::iterator it = index.find(cstr); - - if ( it != index.end() ) { // keyword was found - longParamList* ptr = it->second; - switch(ptr->type) { - case LP_BOOL_PARAM: - if ( ptr->touched ) error("Redundant use of option --%s or its exclusive neighbor is not allowed",cstr); - if ( *(bool*)ptr->value == true ) - message("Option --%s specified when it is [ON] by default. The argument has no effect and the variable will be still [ON]",cstr); - *(bool *) ptr->value = true; - ptr->touched = true; - if ( ptr->exclusive ) { - for (int i = -1; ptr[i].exclusive; i--) { - *(bool *)ptr[i].value = false; - ptr[i].touched = true; - } - for (int i = 1; ptr[i].exclusive; i++) { - *(bool *)ptr[i].value = false; - ptr[i].touched = true; - } - } - return 0; - case LP_INT_PARAM: - if ( !CheckInteger(extras) ) error("Invalid argument --%s %s. Integer was expected", cstr, extras); - else if ( ptr->touched ) error("Redundant use of option --%s is not allowed",cstr); - else { - *(int *) ptr->value = atoi(extras); - ptr->touched = true; - } - return 1; - case LP_DOUBLE_PARAM: - if ( !CheckDouble(extras) ) error("Invalid argument --%s %s. Double was expected", cstr, extras); - else if ( ptr->touched ) error("Redundant use of option --%s is not allowed",cstr); - else { - *(double *) ptr->value = atof(extras); - ptr->touched = true; - } - return 1; - case LP_STRING_PARAM: - if ( extras == NULL ) error("Invalid argument --%s %s. String was expected", cstr, extras); - else if ( ptr->touched ) error("Redundant use of option --%s is not allowed",cstr); - else { - *(std::string *) ptr->value = extras; - ptr->touched = true; - } - return 1; - case LP_MULTI_INT_PARAM: - if ( !CheckInteger(extras) ) error("Invalid argument --%s %s. Integer was expected", cstr, extras); - else - ((std::vector *) ptr->value)->push_back(atoi(extras)); - return 1; - case LP_MULTI_DOUBLE_PARAM: - if ( !CheckDouble(extras) ) error("Invalid argument --%s %s. Double was expected", cstr, extras); - else - ((std::vector *) ptr->value)->push_back(atof(extras)); - return 1; - case LP_MULTI_STRING_PARAM: - if ( extras == NULL ) - error("Invalid argument --%s %s. String was expected", cstr, extras); - else - ((std::vector *) ptr->value)->push_back(extras); - return 1; - default: - return -1; // ignore? - } - } - else { - return -1; // ignore? - } -} - -// Print the status of parameter List -void longParams::Status(longParamList * ptr, int & line_len, bool & need_a_comma) -{ - std::string state; - int line_start = group_len ? group_len + 5 : 0; - int i; - - if (ptr->value == NULL) { // if group parameter, end previous group (if exists) - fprintf(stderr, "%s %*s :", need_a_comma ? "\n" : "", group_len + 2, ptr->desc); - need_a_comma = false; - line_len = line_start; - } - else { // otherwise, print argument name and - switch(ptr->type) { - case LP_BOOL_PARAM: - state = * (bool *) ptr->value ? " [ON]" : ""; - break; - case LP_INT_PARAM: - if (((* (int *) ptr->value == 1) && (ptr->exclusive)) || (* (int *) ptr->value == 0)) - state = *(int *) ptr->value ? " [ON]" : ""; - else - catprintf(state," [%d]",*(int*)ptr->value); - break; - case LP_DOUBLE_PARAM: - if (* (double *) ptr->value != _NAN_) { - double value = * (double *) ptr->value; - - state = " ["; - if (value == 0.0 || value >= 0.01) - catprintf(state, "%.*f", precision, value); - else - catprintf(state, "%.1e", value); - state += ']'; - } - else - state = ""; - break; - case LP_STRING_PARAM: - if ( ((std::string*) ptr->value)->empty() ) - state = ""; - else - state = " [" + * (std::string *) ptr->value + "]"; - break; - case LP_MULTI_INT_PARAM: - { - std::vector* v = (std::vector*) ptr->value; - if ( v->empty() ) - state = ""; - else { - state = " ["; - for(i=0; i < (int)v->size(); ++i) { - if ( i > 0 ) - catprintf(state, ", %d", v->at(i)); - else - catprintf(state, "%d", v->at(i)); - } - state += ']'; - } - break; - } - case LP_MULTI_DOUBLE_PARAM: - { - std::vector* v = (std::vector*) ptr->value; - if ( v->empty() ) - state = ""; - else { - state = " ["; - for(i=0; i < (int)v->size(); ++i) { - if ( i > 0 ) - state += ", "; - - if (v->at(i) == 0.0 || v->at(i) >= 0.01) - catprintf(state, "%.*f", precision, v->at(i)); - else - catprintf(state, "%.1e", v->at(i)); - } - state += ']'; - } - break; - } - case LP_MULTI_STRING_PARAM: - { - std::vector* v = (std::vector*) ptr->value; - if ( v->empty() ) - state = ""; - else { - state = " ["; - for(i=0; i < (int)v->size(); ++i) { - if ( i > 0 ) - state += ", "; - state += v->at(i); - } - state += ']'; - } - break; - } - default: - error("Cannot recognize the parameter type %d",ptr->type); - } - - int item_len = 3 + strlen(ptr->desc) + need_a_comma + state.size(); - - if (item_len + line_len > 78 && line_len > line_start) - { - line_len = line_start; - fprintf(stderr, "%s\n%*s", need_a_comma ? "," : "", line_len, ""); - need_a_comma = 0; - item_len -= 1; - } - - fprintf(stderr, "%s --%s%s", need_a_comma ? "," : (need_a_comma = true, ""), - ptr->desc, state.c_str()); - - need_a_comma = true; - line_len += item_len; - } -} - -// Print the status of parameter List -void longParams::HelpMessage(longParamList * ptr) -{ - std::string state; - int i; - - if (ptr->value == NULL) { // if group parameter, end previous group (if exists) - fprintf(stderr, "\n%s%s%s\n", ptr->desc, ptr->help ? " - " : "", ptr->help ? ptr->help : ""); - } - else { // otherwise, print argument name and - switch(ptr->type) { - case LP_BOOL_PARAM: - state = * (bool *) ptr->value ? " [FLG: ON]" : " [FLG: OFF]"; - break; - case LP_INT_PARAM: - if (((* (int *) ptr->value == 1) && (ptr->exclusive)) || (* (int *) ptr->value == 0)) - state = *(int *) ptr->value ? " [INT: ON]" : " [INT: 0]"; - else - catprintf(state," [INT: %d]",*(int*)ptr->value); - break; - case LP_DOUBLE_PARAM: - if (* (double *) ptr->value != _NAN_) { - double value = * (double *) ptr->value; - - state = " [FLT: "; - if (value == 0.0 || value >= 0.01) - catprintf(state, "%.*f", precision, value); - else - catprintf(state, "%.1e", value); - state += ']'; - } - else - state = " [FLT: NaN]"; - break; - case LP_STRING_PARAM: - if ( ((std::string*) ptr->value)->empty() ) - state = " [STR: ]"; - else - state = " [STR: " + * (std::string *) ptr->value + "]"; - break; - case LP_MULTI_INT_PARAM: - { - std::vector* v = (std::vector*) ptr->value; - if ( v->empty() ) - state = " [V_INT: ]"; - else { - state = " [V_INT: "; - for(i=0; i < (int)v->size(); ++i) { - if ( i > 0 ) - catprintf(state, ", %d", v->at(i)); - else - catprintf(state, "%d", v->at(i)); - } - state += ']'; - } - break; - } - case LP_MULTI_DOUBLE_PARAM: - { - std::vector* v = (std::vector*) ptr->value; - if ( v->empty() ) - state = " [V_FLT: ]"; - else { - state = " [V_FLT: "; - for(i=0; i < (int)v->size(); ++i) { - if ( i > 0 ) - state += ", "; - - if (v->at(i) == 0.0 || v->at(i) >= 0.01) - catprintf(state, "%.*f", precision, v->at(i)); - else - catprintf(state, "%.1e", v->at(i)); - } - state += ']'; - } - break; - } - case LP_MULTI_STRING_PARAM: - { - std::vector* v = (std::vector*) ptr->value; - if ( v->empty() ) - state = " [V_STR: ]"; - else { - state = " [V_STR: "; - for(i=0; i < (int)v->size(); ++i) { - if ( i > 0 ) - state += ", "; - state += v->at(i); - } - state += ']'; - } - break; - } - default: - error("Cannot recognize the parameter type %d",ptr->type); - } - - - fprintf(stderr, " --%-*s%-*s%s%s%s\n", name_len, ptr->desc, param::helpCol, state.c_str(), " : ", ptr->help ? ptr->help : "", ptr->exclusive ? (ptr->help ? " (EXCLUSIVE PARAMETER)" : "(EXCLUSIVE PARAMETER)") : ""); - } -} - -// print the status of the parameter -void longParams::HelpMessage() -{ - if (!description.empty() && description[0] != 0) // group option - fprintf(stderr, "\n%s\n\n", description.c_str()); - //fprintf(stderr, "\n%s - %s\n", description.c_str(), helpstring.c_str()); - - // for the rest of the group, print parameters - for (longParamList * ptr = list + 1; ptr->desc != NULL; ptr++) - HelpMessage(ptr); - - fprintf(stderr, "\n"); -} - -// print the status of the parameter -void longParams::Status() -{ - if (!description.empty() && description[0] != 0) { // group option - fprintf(stderr, "\n%s\n\n", description.c_str()); - - fprintf(stderr, "The following parameters are available. Ones with \"[]\" are in effect:\n"); - } - - bool need_a_comma = false; - int line_len = 0; - - // for the rest of the group, print parameters - for (longParamList * ptr = list + 1; ptr->desc != NULL; ptr++) - Status(ptr, line_len, need_a_comma); - - fprintf(stderr, "\n"); -} - -// Add parameter -void paramList::Add(param * p) -{ - p->SetErrorBuffer(errors); - p->SetMessageBuffer(messages); - pl.push_back(p); -}; - -// Read parameters from argument -void paramList::Read(int argc, char ** argv, int start) -{ - int i, j; - // iterate from first argument - for (i=start; i < argc; i++) { - bool success = false; - - if (argv[i][0] == '-' && argv[i][1]) { // first is -, second is non-null - if ( ( argv[i][1] == 'h' ) || ( strcmp(argv[i],"--help") == 0 ) ) { // printing help requested - HelpMessage(); - if ( messages.empty() ) - fprintf(stderr,"NOTES:\n"); - fprintf(stderr, "When --help was included in the argument. The program prints the help message but do not actually run\n"); - exit(1); - } - - for (j=0; j<(int)pl.size(); j++) { // compare with all available parameters - success = tolower(argv[i][1]) == pl[j]->ch; // option should match - if (success) { - // see if it can be parsed using two consecutive arguments - //if ((i+1 < argc) && pl[j]->TranslateExtras(argv[i]+2, argv[i+1])) - int ret = pl[j]->TranslateExtras(argv[i]+2, argv[i+1]); - if ( ret >= 0 ) { - if ( ret == 1 ) i++; - break; - } - } - } - - if ( j == (int)pl.size() ) { - catprintf(errors, "Command line parameter %s (#%d) not recognized\n", argv[i], i); - } - } - else { - catprintf(errors, "Cannot correspond command line parameter %s (#%d) to any of the options\n", argv[i], i); - } - } -} - - - -int paramList::ReadWithTrailer(int argc, char ** argv, int start) -{ - int last_success = start - 1; - bool split = false; - - for (int i=start; i < argc; i++) - { - bool success = false; - - if (argv[i][0] == '-' && argv[i][1]) - for (int j=0; j<(int)pl.size(); j++) - { - success = tolower(argv[i][1]) == pl[j]->ch; - - if (success) - { - if ((i+1 < argc) && pl[j]->TranslateExtras(argv[i]+2, argv[i+1])) - split = true; - break; - } - } - - if (success) - for (last_success++; last_success < i; last_success++) - catprintf(errors,"Command line parameter %s (#%d) ignored\n", - argv[last_success], last_success); - - if (split) - { - split = false; - last_success++; - i++; - } - } - - return last_success; -}; - -void paramList::HelpMessage() -{ - fprintf(stderr, "\nDetailed instructions of parameters are available. Ones with \"[]\" are in effect:\n"); - - for (int i=0; i<(int)pl.size(); i++) - pl[i]->HelpMessage(); - - fprintf(stderr, "\n"); - - if (errors.size()) - { - ::error("Problems encountered parsing command line:\n\n%s", - errors.c_str()); - errors.clear(); - } - - if (messages.size()) - { - ::printf("NOTES:\n%s\n", messages.c_str()); - //messages.clear(); - } -} - -// Print the total parameter list -void paramList::Status() -{ - //fprintf(stderr, "\nThe following parameters are available. Ones with \"[]\" are in effect:\n"); - - for (int i=0; i<(int)pl.size(); i++) - pl[i]->Status(); - - fprintf(stderr, "\nRun with --help for more detailed help messages of each argument.\n"); - fprintf(stderr, "\n"); - - if (errors.size()) - { - ::error("Problems encountered parsing command line:\n\n%s", - errors.c_str()); - errors.clear(); - } - - if (messages.size()) - { - ::printf("NOTES:\n%s\n", messages.c_str()); - messages.clear(); - } -} - -// - -paramList::~paramList() -{ - for (int i = 0; i < (int)pl.size(); i++) - delete pl[i]; -}; - -bool param::CheckInteger(const char * value) -{ - if ( value == NULL ) return false; - if (value[0] != '+' && value[0] != '-' && - (value[0] < '0' || value[0] > '9')) - return false; - - int pos = 1; - while (value[pos] != 0) - if (value[pos] < '0' || value[pos] > '9') - return false; - else - pos++; - - return true; -} - -bool param::CheckDouble(const char * value) -{ - if ( value == NULL ) return false; - if (value[0] != '+' && value[0] != '-' && value[0] != '.' && - (value[0] < '0' || value[0] > '9')) - { - return false; - } - - bool decimal = value[0] == '.'; - - for (int pos = 1; value[pos] != 0; pos++) - { - if (value[pos] < '0' || value[pos] > '9') - { - if (!decimal && value[pos] == '.') - { - decimal = true; - } - else if (value[pos] == 'e' || value[pos] == 'E') - { - return CheckInteger(value + pos + 1); - } - } - } - - return true; -} diff --git a/src/params.h b/src/params.h deleted file mode 100644 index 6befbb2..0000000 --- a/src/params.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (C) 2010 Regents of the University of Michigan - * - * 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 . - */ - -#ifndef __PARAM_H__ -#define __PARAM_H__ - -#include -#include -#include -#include -#include - -typedef std::map StringMap; -typedef std::map::iterator StringMapIterator; - -class paramList; // list of parameters - -class param // represent each parameter - an abstract class -{ - protected: - char ch; // single character to represent the option - std::string description; // full name of the option - void * var; // pointer to store actual value - std::string helpstring; // detailed description of the option - - static int nameCol; // length of name column - static int statusCol; // length of status column - static int helpCol; // length of the help column - - // get option by full string - virtual int TranslateExtras(const char * value, const char * extras); - - static bool CheckInteger(const char * value); - static bool CheckDouble(const char * value); - - std::string * errors; - std::string * messages; - - public: - - // constructor - param(char c, const char * desc, void * v, const char * help = NULL); - - // destructor - virtual ~param() {} - - // Read argn-th argument and assing values - //virtual bool Read(int argc, char ** argv, int argn) {} - - // virtual function which prints the name and values - virtual void Status() = 0; - virtual void HelpMessage() = 0; - - // modify nameCol - static void SetNameLen(int len) - { - nameCol = len; - } - - // modify statusCol - static void SetStatusLen(int len) - { - statusCol = len; - } - - // set error buffer - void SetErrorBuffer(std::string & buffer) - { - errors = &buffer; - } - - // set error buffer - void SetMessageBuffer(std::string & buffer) - { - messages = &buffer; - } - - // function printing warning - void error(const char * format, ...); - void message(const char * format, ...); - - // give full access to paramList class - friend class paramList; -}; - -// contents for long parameter list -struct longParamList -{ - const char * desc; - void * value; - bool exclusive; - int type; - bool touched; - const char * help; -}; - -#define LP_BOOL_PARAM 1 -#define LP_INT_PARAM 2 -#define LP_DOUBLE_PARAM 3 -#define LP_STRING_PARAM 4 -#define LP_MULTI_INT_PARAM 12 -#define LP_MULTI_DOUBLE_PARAM 13 -#define LP_MULTI_STRING_PARAM 14 - -#define BEGIN_LONG_PARAMS(array) longParamList array[] = { \ - { NULL, NULL, false, 0, 0, NULL}, - -#define LONG_PARAM_GROUP(label, help) { label, NULL, false, 0, 0, help}, - -#define LONG_PARAM(label,boolptr, help) { label, boolptr, false, LP_BOOL_PARAM, 0, help}, -#define EXCLUSIVE_PARAM(label,boolptr, help) { label, boolptr, true, LP_BOOL_PARAM, 0, help}, -#define LONG_INT_PARAM(label,intptr, help) { label, intptr, false, LP_INT_PARAM, 0, help}, -#define LONG_SMARTINT_PARAM(label,intptr, help) { label, intptr, true, LP_INT_PARAM, 0, help}, -#define LONG_DOUBLE_PARAM(label,doubleptr, help) { label, doubleptr, false, LP_DOUBLE_PARAM, 0, help}, -#define LONG_STRING_PARAM(label,stringptr, help) { label, stringptr, false, LP_STRING_PARAM, 0, help}, - -#define LONG_MULTI_INT_PARAM(label, intvecptr, help) { label, intvecptr, false, LP_MULTI_INT_PARAM, 0, help == NULL ? label : help}, -#define LONG_MULTI_DOUBLE_PARAM(label, dblvecptr, help) { label, dblvecptr, false, LP_MULTI_DOUBLE_PARAM, 0, help == NULL ? label : help}, -#define LONG_MULTI_STRING_PARAM(label, strvecptr, help) { label, strvecptr, false, LP_MULTI_STRING_PARAM, 0, help == NULL ? label : help}, - -#define END_LONG_PARAMS() { NULL, NULL, false, 0, 0, 0 }}; - -// long parameter class -class longParams : public param -{ - public: - longParams(const char * desc, longParamList * list); // constructor - - virtual void Status(); // Print the status - virtual void HelpMessage(); // Print the status - - longParams * SetPrecision(int precision) // Set precision for output - { - this->precision = precision; - - return this; - } - - protected: - std::map index; - std::map legacyIndex; - - longParamList * list; - int group_len; - int name_len; - int precision; - - //virtual void Translate(const char * value); - virtual int TranslateExtras(const char * value, const char * extras); - - void Status(longParamList * ptr, int & line_len, bool & need_a_comma); - void HelpMessage(longParamList * ptr); -}; - -// List of parameters -class paramList -{ - protected: - bool help; - std::vector pl; // vector of pointers; - - public: - - paramList() : help(false) {} - - virtual ~paramList(); - - void Add(param * p); - - // Tries to process all command line arguments - virtual void Read(int argc, char ** argv, int start = 1); - - // Allows for trailing, unprocessed, filenames in the command line - // The number of translated argv[] items is returned - virtual int ReadWithTrailer(int argc, char ** argv, int start = 1); - - // Outputs summary of parameter switches and settings - virtual void Status(); - virtual void HelpMessage(); - - // Keeps track of warnings generated during parameter processing - std::string errors; - std::string messages; -}; - -#endif // Params.h diff --git a/src/tabix.c b/src/tabix.c deleted file mode 100644 index ab2e174..0000000 --- a/src/tabix.c +++ /dev/null @@ -1,338 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "bgzf.h" -#include "tabix.h" -#include "knetfile.h" - -#define PACKAGE_VERSION "0.2.5 (r1005)" - -#define error(...) { fprintf(stderr,__VA_ARGS__); return -1; } - -int reheader_file(const char *header, const char *file, int meta) -{ - BGZF *fp = bgzf_open(file,"r"); - if (bgzf_read_block(fp) != 0 || !fp->block_length) - return -1; - - char *buffer = fp->uncompressed_block; - int skip_until = 0; - - if ( buffer[0]==meta ) - { - skip_until = 1; - - // Skip the header - while (1) - { - if ( buffer[skip_until]=='\n' ) - { - skip_until++; - if ( skip_until>=fp->block_length ) - { - if (bgzf_read_block(fp) != 0 || !fp->block_length) - error("no body?\n"); - skip_until = 0; - } - // The header has finished - if ( buffer[skip_until]!=meta ) break; - } - skip_until++; - if ( skip_until>=fp->block_length ) - { - if (bgzf_read_block(fp) != 0 || !fp->block_length) - error("no body?\n"); - skip_until = 0; - } - } - } - - FILE *fh = fopen(header,"r"); - if ( !fh ) - error("%s: %s", header,strerror(errno)); - int page_size = getpagesize(); - char *buf = valloc(page_size); - BGZF *bgzf_out = bgzf_dopen(fileno(stdout), "w"); - ssize_t nread; - while ( (nread=fread(buf,1,page_size-1,fh))>0 ) - { - if ( nreaderrcode); - } - fclose(fh); - - if ( fp->block_length - skip_until > 0 ) - { - if (bgzf_write(bgzf_out, buffer+skip_until, fp->block_length-skip_until) < 0) - error("Error: %d\n",fp->errcode); - } - if (bgzf_flush(bgzf_out) < 0) - error("Error: %d\n",bgzf_out->errcode); - - while (1) - { -#ifdef _USE_KNETFILE - nread = knet_read(fp->fp, buf, page_size); -#else - nread = fread(buf, 1, page_size, fp->fp); -#endif - if ( nread<=0 ) - break; - - int count = fwrite(buf, 1, nread, bgzf_out->fp); - if (count != nread) - error("Write failed, wrote %d instead of %d bytes.\n", count,(int)nread); - } - - if (bgzf_close(bgzf_out) < 0) - error("Error: %d\n",bgzf_out->errcode); - - return 0; -} - - -int main(int argc, char *argv[]) -{ - int c, skip = -1, meta = -1, list_chrms = 0, force = 0, print_header = 0, print_only_header = 0, bed_reg = 0; - ti_conf_t conf = ti_conf_gff, *conf_ptr = NULL; - const char *reheader = NULL; - while ((c = getopt(argc, argv, "p:s:b:e:0S:c:lhHfBr:")) >= 0) { - switch (c) { - case 'B': bed_reg = 1; break; - case '0': conf.preset |= TI_FLAG_UCSC; break; - case 'S': skip = atoi(optarg); break; - case 'c': meta = optarg[0]; break; - case 'p': - if (strcmp(optarg, "gff") == 0) conf_ptr = &ti_conf_gff; - else if (strcmp(optarg, "bed") == 0) conf_ptr = &ti_conf_bed; - else if (strcmp(optarg, "sam") == 0) conf_ptr = &ti_conf_sam; - else if (strcmp(optarg, "vcf") == 0 || strcmp(optarg, "vcf4") == 0) conf_ptr = &ti_conf_vcf; - else if (strcmp(optarg, "psltbl") == 0) conf_ptr = &ti_conf_psltbl; - else { - fprintf(stderr, "[main] unrecognized preset '%s'\n", optarg); - return 1; - } - break; - case 's': conf.sc = atoi(optarg); break; - case 'b': conf.bc = atoi(optarg); break; - case 'e': conf.ec = atoi(optarg); break; - case 'l': list_chrms = 1; break; - case 'h': print_header = 1; break; - case 'H': print_only_header = 1; break; - case 'f': force = 1; break; - case 'r': reheader = optarg; break; - } - } - if (optind == argc) { - fprintf(stderr, "\n"); - fprintf(stderr, "Program: tabix (TAB-delimited file InderXer)\n"); - fprintf(stderr, "Version: %s\n\n", PACKAGE_VERSION); - fprintf(stderr, "Usage: tabix [region1 [region2 [...]]]\n\n"); - fprintf(stderr, "Options: -p STR preset: gff, bed, sam, vcf, psltbl [gff]\n"); - fprintf(stderr, " -s INT sequence name column [1]\n"); - fprintf(stderr, " -b INT start column [4]\n"); - fprintf(stderr, " -e INT end column; can be identical to '-b' [5]\n"); - fprintf(stderr, " -S INT skip first INT lines [0]\n"); - fprintf(stderr, " -c CHAR symbol for comment/meta lines [#]\n"); - fprintf(stderr, " -r FILE replace the header with the content of FILE [null]\n"); - fprintf(stderr, " -B region1 is a BED file (entire file will be read)\n"); - fprintf(stderr, " -0 zero-based coordinate\n"); - fprintf(stderr, " -h print also the header lines\n"); - fprintf(stderr, " -H print only the header lines\n"); - fprintf(stderr, " -l list chromosome names\n"); - fprintf(stderr, " -f force to overwrite the index\n"); - fprintf(stderr, "\n"); - return 1; - } - if ( !conf_ptr ) - { - int l = strlen(argv[optind]); - int strcasecmp(const char *s1, const char *s2); - if (l>=7 && strcasecmp(argv[optind]+l-7, ".gff.gz") == 0) conf_ptr = &ti_conf_gff; - else if (l>=7 && strcasecmp(argv[optind]+l-7, ".bed.gz") == 0) conf_ptr = &ti_conf_bed; - else if (l>=7 && strcasecmp(argv[optind]+l-7, ".sam.gz") == 0) conf_ptr = &ti_conf_sam; - else if (l>=7 && strcasecmp(argv[optind]+l-7, ".vcf.gz") == 0) conf_ptr = &ti_conf_vcf; - else if (l>=10 && strcasecmp(argv[optind]+l-10, ".psltbl.gz") == 0) conf_ptr = &ti_conf_psltbl; - } - if ( conf_ptr ) - conf = *conf_ptr; - - if (skip >= 0) conf.line_skip = skip; - if (meta >= 0) conf.meta_char = meta; - if (list_chrms) { - ti_index_t *idx; - int i, n; - const char **names; - idx = ti_index_load(argv[optind]); - if (idx == 0) { - fprintf(stderr, "[main] fail to load the index file.\n"); - return 1; - } - names = ti_seqname(idx, &n); - for (i = 0; i < n; ++i) printf("%s\n", names[i]); - free(names); - ti_index_destroy(idx); - return 0; - } - if (reheader) - return reheader_file(reheader,argv[optind],conf.meta_char); - - struct stat stat_tbi,stat_vcf; - char *fnidx = calloc(strlen(argv[optind]) + 5, 1); - strcat(strcpy(fnidx, argv[optind]), ".tbi"); - - if (optind + 1 == argc && !print_only_header) { - if (force == 0) { - if (stat(fnidx, &stat_tbi) == 0) - { - // Before complaining, check if the VCF file isn't newer. This is a common source of errors, - // people tend not to notice that tabix failed - stat(argv[optind], &stat_vcf); - if ( stat_vcf.st_mtime <= stat_tbi.st_mtime ) - { - fprintf(stderr, "[tabix] the index file exists. Please use '-f' to overwrite.\n"); - free(fnidx); - return 1; - } - } - } - if ( bgzf_is_bgzf(argv[optind])!=1 ) - { - fprintf(stderr,"[tabix] was bgzip used to compress this file? %s\n", argv[optind]); - free(fnidx); - return 1; - } - if ( !conf_ptr ) - { - // Building the index but the file type was neither recognised nor given. If no custom change - // has been made, warn the user that GFF is used - if ( conf.preset==ti_conf_gff.preset - && conf.sc==ti_conf_gff.sc - && conf.bc==ti_conf_gff.bc - && conf.ec==ti_conf_gff.ec - && conf.meta_char==ti_conf_gff.meta_char - && conf.line_skip==ti_conf_gff.line_skip ) - fprintf(stderr,"[tabix] The file type not recognised and -p not given, using the preset [gff].\n"); - } - return ti_index_build(argv[optind], &conf); - } - { // retrieve - tabix_t *t; - // On some systems, stat on non-existent files returns undefined value for sm_mtime, the user had to use -f - int is_remote = (strstr(fnidx, "ftp://") == fnidx || strstr(fnidx, "http://") == fnidx) ? 1 : 0; - if ( !is_remote ) - { - // Common source of errors: new VCF is used with an old index - stat(fnidx, &stat_tbi); - stat(argv[optind], &stat_vcf); - if ( force==0 && stat_vcf.st_mtime > stat_tbi.st_mtime ) - { - fprintf(stderr, "[tabix] the index file either does not exist or is older than the vcf file. Please reindex.\n"); - free(fnidx); - return 1; - } - } - free(fnidx); - - if ((t = ti_open(argv[optind], 0)) == 0) { - fprintf(stderr, "[main] fail to open the data file.\n"); - return 1; - } - if ( print_only_header ) - { - ti_iter_t iter; - const char *s; - int len; - if (ti_lazy_index_load(t) < 0 && bed_reg == 0) { - fprintf(stderr,"[tabix] failed to load the index file.\n"); - return 1; - } - const ti_conf_t *idxconf = ti_get_conf(t->idx); - iter = ti_query(t, 0, 0, 0); - while ((s = ti_read(t, iter, &len)) != 0) { - if ((int)(*s) != idxconf->meta_char) break; - fputs(s, stdout); fputc('\n', stdout); - } - ti_iter_destroy(iter); - return 0; - } - - if (strcmp(argv[optind+1], ".") == 0) { // retrieve all - ti_iter_t iter; - const char *s; - int len; - iter = ti_query(t, 0, 0, 0); - while ((s = ti_read(t, iter, &len)) != 0) { - fputs(s, stdout); fputc('\n', stdout); - } - ti_iter_destroy(iter); - } else { // retrieve from specified regions - int i, len; - ti_iter_t iter; - const char *s; - const ti_conf_t *idxconf; - - if (ti_lazy_index_load(t) < 0 && bed_reg == 0) { - fprintf(stderr,"[tabix] failed to load the index file.\n"); - return 1; - } - idxconf = ti_get_conf(t->idx); - - if ( print_header ) - { - // If requested, print the header lines here - iter = ti_query(t, 0, 0, 0); - while ((s = ti_read(t, iter, &len)) != 0) { - if ((int)(*s) != idxconf->meta_char) break; - fputs(s, stdout); fputc('\n', stdout); - } - ti_iter_destroy(iter); - } - if (bed_reg) { - extern int bed_overlap(const void *_h, const char *chr, int beg, int end); - extern void *bed_read(const char *fn); - extern void bed_destroy(void *_h); - - const ti_conf_t *conf_ = idxconf? idxconf : &conf; // use the index file if available - void *bed = bed_read(argv[optind+1]); // load the BED file - ti_interval_t intv; - - if (bed == 0) { - fprintf(stderr, "[main] fail to read the BED file.\n"); - return 1; - } - iter = ti_query(t, 0, 0, 0); - while ((s = ti_read(t, iter, &len)) != 0) { - int c; - ti_get_intv(conf_, len, (char*)s, &intv); - c = *intv.se; *intv.se = '\0'; - if (bed_overlap(bed, intv.ss, intv.beg, intv.end)) { - *intv.se = c; - puts(s); - } - *intv.se = c; - } - ti_iter_destroy(iter); - bed_destroy(bed); - } else { - for (i = optind + 1; i < argc; ++i) { - int tid, beg, end; - if (ti_parse_region(t->idx, argv[i], &tid, &beg, &end) == 0) { - iter = ti_queryi(t, tid, beg, end); - while ((s = ti_read(t, iter, &len)) != 0) { - fputs(s, stdout); fputc('\n', stdout); - } - ti_iter_destroy(iter); - } - // else fprintf(stderr, "[main] invalid region: unknown target name or minus interval.\n"); - } - } - } - ti_close(t); - } - return 0; -} diff --git a/src/tabix.h b/src/tabix.h deleted file mode 100644 index 7b4497a..0000000 --- a/src/tabix.h +++ /dev/null @@ -1,145 +0,0 @@ -/* The MIT License - - Copyright (c) 2009 Genome Research Ltd (GRL), 2010 Broad Institute - - 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 AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -/* Contact: Heng Li */ - -#ifndef __TABIDX_H -#define __TABIDX_H - -#include -#include "kstring.h" -#include "bgzf.h" - -#define TI_PRESET_GENERIC 0 -#define TI_PRESET_SAM 1 -#define TI_PRESET_VCF 2 - -#define TI_FLAG_UCSC 0x10000 - -typedef int (*ti_fetch_f)(int l, const char *s, void *data); - -struct __ti_index_t; -typedef struct __ti_index_t ti_index_t; - -struct __ti_iter_t; -typedef struct __ti_iter_t *ti_iter_t; - -typedef struct { - BGZF *fp; - ti_index_t *idx; - char *fn, *fnidx; -} tabix_t; - -typedef struct { - int32_t preset; - int32_t sc, bc, ec; // seq col., beg col. and end col. - int32_t meta_char, line_skip; -} ti_conf_t; - -typedef struct { - int beg, end; - char *ss, *se; -} ti_interval_t; - -extern ti_conf_t ti_conf_gff, ti_conf_bed, ti_conf_psltbl, ti_conf_vcf, ti_conf_sam; // preset - -#ifdef __cplusplus -extern "C" { -#endif - - /******************* - * High-level APIs * - *******************/ - - tabix_t *ti_open(const char *fn, const char *fnidx); - int ti_lazy_index_load(tabix_t *t); - void ti_close(tabix_t *t); - ti_iter_t ti_query(tabix_t *t, const char *name, int beg, int end); - ti_iter_t ti_queryi(tabix_t *t, int tid, int beg, int end); - ti_iter_t ti_querys(tabix_t *t, const char *reg); - const char *ti_read(tabix_t *t, ti_iter_t iter, int *len); - - /* Destroy the iterator */ - void ti_iter_destroy(ti_iter_t iter); - - /* Get the list of sequence names. Each "char*" pointer points to a - * internal member of the index, so DO NOT modify the returned - * pointer; otherwise the index will be corrupted. The returned - * pointer should be freed by a single free() call by the routine - * calling this function. The number of sequences is returned at *n. */ - const char **ti_seqname(const ti_index_t *idx, int *n); - - /****************** - * Low-level APIs * - ******************/ - - /* Build the index for file . File .tbi will be generated - * and overwrite the file of the same name. Return -1 on failure. */ - int ti_index_build(const char *fn, const ti_conf_t *conf); - - /* Load the index from file .tbi. If is a URL and the index - * file is not in the working directory, .tbi will be - * downloaded. Return NULL on failure. */ - ti_index_t *ti_index_load(const char *fn); - - ti_index_t *ti_index_load_local(const char *fnidx); - - /* Destroy the index */ - void ti_index_destroy(ti_index_t *idx); - - /* Parse a region like: chr2, chr2:100, chr2:100-200. Return -1 on failure. */ - int ti_parse_region(const ti_index_t *idx, const char *str, int *tid, int *begin, int *end); - - int ti_get_tid(const ti_index_t *idx, const char *name); - - /* Get the iterator pointing to the first record at the current file - * position. If the file is just openned, the iterator points to the - * first record in the file. */ - ti_iter_t ti_iter_first(void); - - /* Get the iterator pointing to the first record in region tid:beg-end */ - ti_iter_t ti_iter_query(const ti_index_t *idx, int tid, int beg, int end); - - /* Get the data line pointed by the iterator and iterate to the next record. */ - const char *ti_iter_read(BGZF *fp, ti_iter_t iter, int *len); - - const ti_conf_t *ti_get_conf(ti_index_t *idx); - int ti_get_intv(const ti_conf_t *conf, int len, char *line, ti_interval_t *intv); - - /******************* - * Deprecated APIs * - *******************/ - - /* The callback version for random access */ - int ti_fetch(BGZF *fp, const ti_index_t *idx, int tid, int beg, int end, void *data, ti_fetch_f func); - - /* Read one line. */ - int ti_readline(BGZF *fp, kstring_t *str); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/tinyfast.cpp b/src/tinyfast.cpp deleted file mode 100644 index b1b1852..0000000 --- a/src/tinyfast.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "params.h" -#include "Error.h" -#include "wFile.h" -#include "pFile.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -int runGlfDepthSum(int argc, char** argv) { - paramList pl; - - int minMapQ = 0; - bool countN = false; - int depthCap = 255; - int minDepth = 0; - int beg = 0; - int end = 0x7fffffff; - std::string xChr("X"); - std::string yChr("Y"); - int xStart = 2699520; - int xStop = 154931044; - std::string inf("/dev/stdin"); - std::string outf("/dev/stdout"); - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("Input and Output", NULL) - LONG_STRING_PARAM("in",&inf,"Input File") - LONG_STRING_PARAM("out",&outf,"Output File") - - LONG_PARAM_GROUP("Filtering bases", NULL) - LONG_INT_PARAM("minMQ",&minMapQ, "Minimum mapping quality thresholds") - LONG_PARAM("countN",&countN,"Do not exclude based where the reference is N") - LONG_INT_PARAM("beg",&beg,"Base position to begin calculating depth") - LONG_INT_PARAM("end",&end,"Base position to end calculating depth") - LONG_INT_PARAM("depth-cap",&depthCap,"Maximum depth to be capped to") - LONG_INT_PARAM("min-depth",&minDepth,"Minimum depth to be included as eligible") - - LONG_PARAM_GROUP("Sex chromosome options", NULL) - LONG_STRING_PARAM("xChr",&xChr,"X chromosome label") - LONG_STRING_PARAM("yChr",&yChr,"Y chromosome label") - LONG_INT_PARAM("xStart",&xStart,"Start base position of non-PAR chromosome X") - LONG_INT_PARAM("xStop",&xStop,"Stop base position of non-PAR chromosome X") - END_LONG_PARAMS(); - - pl.Add(new longParams("tinyfast glf-depth-sum - Depth calculator from glf file\n\nThe usage is\n\t$(GOTCLOUD_ROOT)/bin/samtools-hybrid glfview [input.glf] | tinyfast glf-depth-sum [options]\n\n* The output is the total number of eligible bases in the region (denominator) and the sum of the depths across the region (numerator)\n* When reading sex chromosomes, it calculates depth excluding PAR", longParameters)); - pl.Read(argc, argv); - pl.Status(); - - // take the input from STDIN - pFile pf(inf.c_str()); - wFile wf(outf.c_str()); - const char* line = NULL; - const char* ws[6]; - int l, i; - int64_t numBases = 0; - int64_t sumDepth = 0; - - for( l=0; ( line = pf.getLine() ) != NULL; ++l ) { - if ( !isdigit(line[0]) && !isalpha(line[0]) ) continue; - - ws[0] = line-1; - for(i=0; i < 5; ++i) { - ws[i+1] = strchr(ws[i]+1,'\t'); - } - - if ( l == 0 ) { // check chromosome - if ( ( ws[1] - ws[0] == (int)xChr.size() + 1 ) && ( xChr.compare(0, ws[1]-ws[0]-1, line) == 0 ) ) { - beg = xStart; - end = xStop; - } - } - - if ( ( beg > 0 ) || ( end < 0x7fffffff ) ) { // check position; - int pos = atoi(&ws[1][1]); - if ( ( pos < beg ) || ( pos > end ) ) - continue; // skip the position - } - - if ( ws[2][1] == '*' ) continue; - if ( ( !countN ) && toupper(ws[2][1]) == 'N' ) continue; - - if ( ( minMapQ > 0 ) && ( atoi(&ws[4][1]) < minMapQ ) ) continue; - - int depth = atoi(&ws[3][1]); - - if ( depth < minDepth ) continue; - - if ( depth > depthCap ) - depth = depthCap; - - ++numBases; - sumDepth += depth; - } - - wf.printf("%lld\t%lld\t%.4lf\n",numBases,sumDepth,(double)sumDepth/(double)numBases); - - return 0; -} - -int main(int argc, char** argv) { - if ( argc < 2 ) { - printf("tinyfast -- Fast analytic tools for small tasks \n"); - printf("Copyright (c) 2015 Hyun Min Kang\n"); - printf("\nUsage : %s [command] [options]\n\n",argv[0]); - printf("\tType one of the following commands below to get detailed usage\n\n"); - printf("\t%s glf-depth-sum [options] : Calculate sum of depth piped from GLF files\n",argv[0]); - printf("\n"); - } - else { - std::string cmd(argv[1]); - if ( cmd == "glf-depth-sum" ) { - return runGlfDepthSum(argc-1,argv+1); - } - else { - error("Unrecognized command %s\n",argv[0]); - } - } - return 0; -} diff --git a/src/vcfast.cpp b/src/vcfast.cpp deleted file mode 100644 index 3dcc769..0000000 --- a/src/vcfast.cpp +++ /dev/null @@ -1,2025 +0,0 @@ -#include "params.h" -#include "genomeLoci.h" -#include "genomeScore.h" -#include "Error.h" -#include "fVcf.h" -#include "wFile.h" -#include "hDist.h" -#include "genomePosition.h" -//#include "Rmath.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "IO.h" -#include "TypeConversion.h" -#include "GenomeSequence.h" -#include "cdsStat.h" -#include "ncStat.h" -#include "bgzf.h" - -#define WINDOW_SIZE 65536 - -class pVPHArgs { -public: - // VCF-related string arguments - std::string vcf; - std::string region; - std::string rule; - std::string field; - std::string scoref; - - // Other input files - std::string indf; - std::string itvf; - std::string bedf; - std::string genef; - std::string ref; - - std::string outf; - int unit; - bool verbose; - bool ignoreFilter; - bool ignoreMissing; - bool includeMultiAllelic; - - int minAC; - int minMAC; - int maxAC; - double minMAF; - double maxMAF; - double minCallRate; - - bool genoFlag; - bool acFlag; - bool anFlag; - bool aldFlag; - bool tstvFlag; - - bool sepchr; - - static int const DEFAULT_UNIT = 10000L; - static double const DEFAULT_MIN = 1e-6; - static double const DEFAULT_MAX_MAF = 1; - - pVPHArgs() : - unit(DEFAULT_UNIT), verbose(false), ignoreFilter(false), ignoreMissing(false), includeMultiAllelic(false), minAC(0), minMAC(0), maxAC(INT_MAX), minMAF(DEFAULT_MIN), maxMAF(DEFAULT_MAX_MAF), minCallRate(DEFAULT_MIN), genoFlag(false), acFlag(false), anFlag(false), aldFlag(false), tstvFlag(false),sepchr(false) - {} -}; - -class vcfHashKey { -public: - std::string genos; - int ac; - int an; - int ald; - int tstv; - - vcfHashKey(fVcf& vcf, int i, bool genoFlag, bool acFlag, bool anFlag, bool aldFlag, bool tstvFlag, bool ignoreMissing) { - if ( genoFlag ) { - float g; - genos.resize(vcf.nInds); - for(int j=0; j < vcf.nInds; ++j) { - g = vcf.genos[i * vcf.nInds + j]; - if ( isnanf(g) ) { - genos[j] = ignoreMissing ? '0' : '.'; - } - else { - genos[j] = (int)(g+.5) + '0'; - } - } - } - if ( acFlag ) { ac = vcf.sumAlleles[i]; } - if ( anFlag ) { an = vcf.numAlleles[i]; } - if ( aldFlag || tstvFlag ) { - int i_us = vcf.markers[i].find_first_of('_'); - int i_sl = vcf.markers[i].find_first_of('/',i_us+1); - int l = (int)vcf.markers[i].size(); - - if ( aldFlag ) { ald = (l-i_sl-i_sl+i_us); } - if ( tstvFlag ) { - if ( ( i_sl-i_us-1 == 1 ) && ( l-i_sl-1 == 1 ) ) { - tstv = determineTsTv(vcf.markers[i][i_us+1],vcf.markers[i][i_sl+1]); - } - else { - tstv = -1; - } - } - } - } - - static int determineTsTv(char ref, char alt) { - switch(ref) { - case 'A': - switch(alt) { - case 'A': return -1; - case 'C': return 0; - case 'G': return 1; - case 'T': return 0; - default: return -1; - } - case 'C': - switch(alt) { - case 'A': return 0; - case 'C': return -1; - case 'G': return 0; - case 'T': return 1; - default: return -1; - } - case 'G': - switch(alt) { - case 'A': return 1; - case 'C': return 0; - case 'G': return -1; - case 'T': return 0; - default: return -1; - } - case 'T': - switch(alt) { - case 'A': return 0; - case 'C': return 1; - case 'G': return 0; - case 'T': return -1; - default: return -1; - } - default: - return -1; - } - } - - bool operator< (const vcfHashKey& x) const { - int c = genos.compare(x.genos); - if ( c != 0 ) { - return c < 0 ? true : false; - } - if ( ac != x.ac ) { - return ac < x.ac ? true : false; - } - if ( an != x.an ) { - return an < x.an ? true : false; - } - if ( ald != x.ald ) { - return ald < x.ald ? true : false; - } - if ( tstv != x.tstv ) { - return tstv < x.tstv ? true : false; - } - return false; - } - - void print(wFile& wf, bool genoFlag, bool acFlag, bool anFlag, bool aldFlag, bool tstvFlag) const { - bool tabFlag = false; - if ( genoFlag ) { wf.printf("%s",genos.c_str()); tabFlag = true; } - if ( tabFlag ) wf.printf("\t"); - if ( acFlag ) { wf.printf("%d",ac); tabFlag = true; } - if ( tabFlag ) wf.printf("\t"); - if ( anFlag ) { wf.printf("%d",an); tabFlag = true; } - if ( tabFlag ) wf.printf("\t"); - if ( aldFlag ) { wf.printf("%d",ald); tabFlag = true; } - if ( tabFlag ) wf.printf("\t"); - if ( tstvFlag ) { - switch(tstv) { - case 0: - wf.printf("TS"); - break; - case 1: - wf.printf("TV"); - break; - default: - wf.printf("OTHER"); - break; - } - tabFlag = true; - } - } -}; - -void hashBit(fVcf& vcf, unsigned char* bytes, int isnp) { - // we fill from the higher order - float g; - int nbytes = (vcf.nInds + 3) / 4; - for(int i=0; i < vcf.nInds; ++i) { - g = vcf.genos[isnp * vcf.nInds + i]; - unsigned char ng = 0x00; - if ( ( !isnanf(g) ) && ( g > 0 ) ) { // missing genotypes are converted to HOMREF - ng = (g == 1.) ? 0x01 : 0x02; - } - if ( i % 4 == 0 ) bytes[i] = 0; - bytes[nbytes * isnp + i] |= (ng << (6 - (i % 4) * 2)); - } -} - -int runSummary(int argc, char** argv) { - pVPHArgs arg; - paramList pl; - double minScore = 0; - bool fullAFS = false; - - bool biallelicOnly = false; - bool allvar = false; - bool snps = false; - bool nonsnps = false; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("VCF Input Options", NULL) - LONG_STRING_PARAM("vcf",&arg.vcf, "Input VCF file") - LONG_STRING_PARAM("region",&arg.region, "Region to focus on in 'chr:beg-end' format") - LONG_STRING_PARAM("indf",&arg.indf,"File containing individual IDs to focus on") - LONG_STRING_PARAM("rule",&arg.rule,"Rule to parse INFO field to subset variants") - LONG_DOUBLE_PARAM("minMAF",&arg.minMAF,"Minumum minor allele frequency cutoff") - LONG_DOUBLE_PARAM("minCallRate",&arg.minCallRate,"Minimum call rate threshold") - LONG_PARAM("ignoreFilter",&arg.ignoreFilter,"Ignore filter and consider non-PASS variants") - LONG_STRING_PARAM("scoref",&arg.scoref,"Genome score file") - LONG_DOUBLE_PARAM("minScore",&minScore,"Minimum genome score threshold (use with --scoref)") - LONG_INT_PARAM("minAC",&arg.minAC,"Minimum non-reference allele count cutoff") - LONG_INT_PARAM("maxAC",&arg.maxAC,"Maximum non-reference allele count cutoff") - LONG_PARAM("full-afs",&fullAFS,"Create full allele frequency spectrum") - LONG_PARAM("biallelic-only",&biallelicOnly,"Skip multi-allelic variants") - - LONG_PARAM_GROUP("Variant Types", NULL) - EXCLUSIVE_PARAM("all-variants",&allvar,"Focus on all types of variants") - EXCLUSIVE_PARAM("snps-only",&snps,"Focus on SNPs only") - EXCLUSIVE_PARAM("exclude-snps",&nonsnps,"Focus on non-SNP variants") - - LONG_PARAM_GROUP("Output Options", NULL) - LONG_STRING_PARAM("out",&arg.outf,"Output file name") - LONG_PARAM("verbose",&arg.verbose,"Turn on verbose mode") - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc, argv); - pl.Status(); - - // sanity check of input arguments - if ( arg.vcf.empty() || arg.outf.empty() ) { - error("--vcf, --out are required parameters (--indf are also recommended)"); - } - - fVcf tvcf; - tvcf.load(arg.vcf.c_str(), arg.region.c_str(), "GT", arg.rule.c_str(), !arg.ignoreFilter, arg.indf.empty() ? NULL : arg.indf.c_str()); - int n = tvcf.nInds; - int i = 0, m = 0, j = 0; - double af, maf; - - std::vector cnts(n * (3 * 7 + 1), 0); // Ts/Tv/Oth, REF/HET/ALT/SNG/DBL - std::vector acnts; - if ( fullAFS ) acnts.resize(n * (n+n+1) * 3, 0); // Ts/Tv/Oth, REF/HET/ALT/SNG/DBL - - //fprintf(stderr,"acnts.size() = %d\n",(int)acnts.size()); - - genomeScore gScore; - if ( !arg.scoref.empty() ) { - gScore.setDir(arg.scoref.c_str()); - } - - for(int M=0; tvcf.readMarkers(arg.unit); ) { - M += tvcf.nMarkers; - fprintf(stderr,"Processing %d markers across %d individuals..\n", M, tvcf.nInds); - for(i=0, m=0; i < tvcf.nMarkers; ++i) { // for each marker - af = tvcf.alleleFreq(i); - maf = af > 0.5 ? 1-af : af; - if ( ( maf >= arg.minMAF ) && - ( tvcf.callRate(i) >= arg.minCallRate ) && - ( tvcf.sumAlleles[i] >= arg.minAC ) && - ( tvcf.sumAlleles[i] <= arg.maxAC ) && - ( arg.scoref.empty() || ( gScore.baseScore(tvcf.chroms[i].c_str(), tvcf.pos1s[i]) >= minScore ) ) - ) - { // if pass the criteria - int vt = 0; // 0 OTHER 1 Ts 2 Tv - int frq = 0; // 0 COMMON 1 SING 2 DBL - - bool is_multi = (tvcf.alts[i].find(',') == std::string::npos) ? false : true; - bool is_snp = ( ( tvcf.refs[i].length() == 1 ) && ( ( tvcf.alts[i].length() == 1 ) || ( ( tvcf.alts[i].length() == 3 ) && is_multi ) ) ) ? true : false; - - if ( ( nonsnps && is_snp ) || ( snps && ( !is_snp ) ) ) continue; // skip variants that does not have matching types - if ( is_multi && biallelicOnly ) continue; - - if ( ( tvcf.refs[i].length() == 1 ) && ( tvcf.alts[i].length() == 1 ) ) { - switch(tvcf.refs[i][0]) { - case 'A': - if ( tvcf.alts[i][0] == 'G' ) { vt = 1; } - else if ( tvcf.alts[i][0] == 'C' ) { vt = 2; } - else if ( tvcf.alts[i][0] == 'T' ) { vt = 2; } - break; - case 'C': - if ( tvcf.alts[i][0] == 'T' ) { vt = 1; } - else if ( tvcf.alts[i][0] == 'A' ) { vt = 2; } - else if ( tvcf.alts[i][0] == 'G' ) { vt = 2; } - break; - case 'G': - if ( tvcf.alts[i][0] == 'A' ) { vt = 1; } - else if ( tvcf.alts[i][0] == 'C' ) { vt = 2; } - else if ( tvcf.alts[i][0] == 'T' ) { vt = 2; } - break; - case 'T': - if ( tvcf.alts[i][0] == 'C' ) { vt = 1; } - else if ( tvcf.alts[i][0] == 'A' ) { vt = 2; } - else if ( tvcf.alts[i][0] == 'G' ) { vt = 2; } - break; - } - } - - frq = (tvcf.sumAlleles[i] == 1) ? 1 : (tvcf.sumAlleles[i] == 2) ? 2 : 0; - for(j=0; j < n; ++j) { - float v = tvcf.genos[i*n + j]; - if ( !isnan(v) ) { - int g = (v == 0 ? 0 : ( v == 1 ) ? 1 : 2 ); - ++cnts[g * 3 + vt + j * 22]; - if ( ( frq > 0 ) && ( g > 0 ) ) { - ++cnts[6 + frq * 3 + vt + j * 22]; - } - if ( g > 0 ) { - if ( af >= 0.005 ) { - ++cnts[18 + vt + j * 22]; - } - else { - ++cnts[15 + vt + j * 22]; - } - } - if ( fullAFS ) ++acnts[j*(n+n+1)*3 + (int)(tvcf.sumAlleles[i])*3 + g]; - } - else { - ++cnts[21 + j * 22]; - } - } - ++m; - } - } - } - - wFile wf(arg.outf.c_str()); - wf.printf("#IND_ID\t#SNPS\t#SING\t#DBL\t#AF<.5%\tAF>.5%\t#REF\t#HET\t#ALT\tMISS\tREFTsTv\tHETTsTv\tALTTsTv\tSNGTsTv\tRARTsTv\n"); - for(j=0; j < n; ++j) { - wf.printf("%s",tvcf.inds[j].c_str()); - wf.printf("\t%d",cnts[j*22+3]+cnts[j*22+4]+cnts[j*22+5]+cnts[j*22+6]+cnts[j*22+7]+cnts[j*22+8]); - wf.printf("\t%d",cnts[j*22+9]+cnts[j*22+10]+cnts[j*22+11]); - wf.printf("\t%d",cnts[j*22+12]+cnts[j*22+13]+cnts[j*22+14]); - wf.printf("\t%d",cnts[j*22+15]+cnts[j*22+16]+cnts[j*22+17]); - wf.printf("\t%d",cnts[j*22+18]+cnts[j*22+19]+cnts[j*22+20]); - wf.printf("\t%d",cnts[j*22+0]+cnts[j*22+1]+cnts[j*22+2]); - wf.printf("\t%d",cnts[j*22+3]+cnts[j*22+4]+cnts[j*22+5]); - wf.printf("\t%d",cnts[j*22+6]+cnts[j*22+7]+cnts[j*22+8]); - wf.printf("\t%d",cnts[j*22+21]); - wf.printf("\t%.3lf",(double)(cnts[j*22+1]+.1)/(cnts[j*22+2]+.2)); - wf.printf("\t%.3lf",(double)(cnts[j*22+4]+.1)/(cnts[j*22+5]+.2)); - wf.printf("\t%.3lf",(double)(cnts[j*22+7]+.1)/(cnts[j*22+8]+.2)); - wf.printf("\t%.3lf",(double)(cnts[j*22+10]+.1)/(cnts[j*22+11]+.2)); - wf.printf("\t%.3lf",(double)(cnts[j*22+16]+.1)/(cnts[j*22+17]+.2)); - wf.printf("\n"); - } - wf.close(); - - if ( fullAFS ) { - wFile acf((arg.outf+".indAFS").c_str()); - acf.printf("#IND_ID"); - for(j=0; j <= n+n; ++j) { - acf.printf("\t%d",j); - } - acf.printf("\n"); - - for(j=0; j < n; ++j) { - acf.printf("%s",tvcf.inds[j].c_str()); - for(m=0; m <= n+n; ++m) { - acf.printf("\t%d,%d,%d",acnts[j*(n+n+1)*3+m*3+0],acnts[j*(n+n+1)*3+m*3+1],acnts[j*(n+n+1)*3+m*3+2]); - } - acf.printf("\n"); - } - acf.close(); - } - - return 0; -} - -int schr2nchr(const char* schr) { - int n = atoi(schr); - if ( n > 0 ) { return n; } - else if ( strcmp(schr,"X") == 0 ) { return 23; } - else if ( strcmp(schr,"Y") == 0 ) { return 24; } - else if ( strcmp(schr,"XY") == 0 ) { return 25; } - else if ( ( strcmp(schr,"MT") == 0 ) || ( strcmp(schr,"M") == 0 ) || ( strcmp(schr,"mt") == 0 ) ) { return 26; } - else if ( strncmp(schr,"chr",3) == 0 ) { return schr2nchr(schr+3); } - else { error("Cannot convert chromosome %s into PLINK format",schr); return 0; } -} - -// variable threshold test -int runConvert(int argc, char** argv) { - // Parse the input arguments - bool outvcf = false; - bool outplink = false; - bool outmatrix = true; - double maxR2 = 1; - int winR2 = 0; - pVPHArgs arg; - arg.field = "GT"; - std::string markerId; - paramList pl; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("VCF Input Options", NULL) - LONG_STRING_PARAM("vcf",&arg.vcf, "Input VCF file") - LONG_STRING_PARAM("region",&arg.region, "Region to focus on in 'chr:beg-end' format") - LONG_STRING_PARAM("indf",&arg.indf,"File containing individual IDs to focus on") - LONG_STRING_PARAM("bedf",&arg.bedf, "BED file containing the regions to focus on") - LONG_STRING_PARAM("field",&arg.field, "VCF field to extract") - LONG_STRING_PARAM("marker-id",&markerId, "List of marker ids to focus on") - LONG_STRING_PARAM("rule",&arg.rule,"Rule to parse INFO field to subset variants") - LONG_DOUBLE_PARAM("minMAF",&arg.minMAF,"Minumum minor allele frequency cutoff") - LONG_DOUBLE_PARAM("maxMAF",&arg.maxMAF,"Maximum minor allele frequency cutoff") - LONG_INT_PARAM("minMAC",&arg.minMAC,"Minimum minor allele count cutoff") - LONG_DOUBLE_PARAM("minCallRate",&arg.minCallRate,"Minimum call rate cutoff") - LONG_PARAM("ignoreFilter",&arg.ignoreFilter,"Ignore filter and consider non-PASS variants") - LONG_PARAM("sepchr",&arg.sepchr,"Separate VCF files by chromosomes, with chr1, chr2, .. in the file names") - - LONG_PARAM_GROUP("LD pruning Options", NULL) - LONG_INT_PARAM("win-r2",&winR2, "Window of r2 calculation") - LONG_DOUBLE_PARAM("max-r2",&maxR2, "Maximum r2 to retain in LD-pruning") - - LONG_PARAM_GROUP("Output format", NULL) - EXCLUSIVE_PARAM("outvcf",&outvcf, "Output in VCF format") - EXCLUSIVE_PARAM("outplink",&outplink, "Output in PLINK binary format") - EXCLUSIVE_PARAM("outmatrix",&outmatrix, "Output in R-compatible matrix format") - - LONG_PARAM_GROUP("Output Options", NULL) - LONG_STRING_PARAM("out",&arg.outf, "Output file name or prefix") - LONG_PARAM("verbose",&arg.verbose, "Turn on verbose mode") - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc,argv); - pl.Status(); - - // sanity check of input arguments - if ( arg.vcf.empty() || arg.outf.empty() ) { - error("--vcf, --out are required parameters (--indf are also recommended)"); - } - - if ( !( outvcf || outplink || outmatrix ) ) { - warning("Default option --outmatrix was turned off. Turning in again.."); - outmatrix = true; - } - - bool gtFlag = (arg.field == "GT"); - fVcf tvcf; - - if ( ( !arg.region.empty() ) && ( !markerId.empty() ) ) { - error("--region and --marker-id cannot be combined together"); - } - - std::string markerIdRef, markerIdAlt; - if ( !markerId.empty() ) { - std::vector tokens; - pFile::tokenizeLine(markerId.c_str(),":_/",tokens); - arg.region = tokens[0] + ":" + tokens[1] + "-" + tokens[1]; - if ( tokens.size() > 2 ) { - markerIdRef = tokens[2]; - markerIdAlt = tokens[3]; - } - } - - if ( ( !arg.region.empty() ) && ( !arg.bedf.empty() ) ) { - error("--region and --bedf cannot be combined together"); - } - - tvcf.load(arg.vcf.c_str(), arg.region.c_str(), arg.field.c_str(), arg.rule.c_str(), !arg.ignoreFilter, arg.indf.empty() ? NULL : arg.indf.c_str()); - - int n = tvcf.nInds; - int i,m,j,k; - wFile *bimf = NULL; - if ( outplink) { - if ( !gtFlag ) error("--field GT must be set with --outplink option"); - //error("--outplink is not implemented yet"); - bimf = new wFile((arg.outf+".bim").c_str()); - wFile famf((arg.outf+".fam").c_str()); - for(i=0; i < n; ++i) { - famf.printf("%d\t%s\t0\t0\t0\t-9\n",tvcf.inds[i].c_str(),tvcf.inds[i].c_str()); - } - famf.close(); - arg.outf += ".bed"; - } - wFile wf(arg.outf.c_str()); - if ( outplink ) { - //error("--outplink is not implemented yet"); - // write headers - char magicNumbers[3] = {0x6c,0x1b,0x01}; - wf.write(magicNumbers,3); - } - else if ( outmatrix ) { - //wf.printf("#MARKER"); - for(j=0; j < n; ++j) { - if ( j > 0 ) wf.printf("\t"); - wf.printf("%s",tvcf.inds[j].c_str()); - } - wf.printf("\n"); - } - else if ( outvcf ) { - //error("--outvcf is not implemented yet"); - // write headers - for(j=0; j < (int)tvcf.headers.size(); ++j) { - wf.printf("%s\n",tvcf.headers[j].c_str()); - } - wf.printf("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT"); - for(j=0; j < n; ++j) { - wf.printf("\t%s",tvcf.inds[j].c_str()); - } - wf.printf("\n"); - arg.unit = 1; - } - - float geno; - int ngeno; - double af, maf; - int nbytes = (n+3)/4; - char* genos = outplink ? new char[nbytes]() : NULL; - - genomeLoci loci; - if ( !arg.region.empty() ) { - loci.add(arg.region.c_str()); - } - else if ( !arg.bedf.empty() ) { - const char* line = NULL; - pFile bedf(arg.bedf.c_str()); - std::vector tokens; - while( (line = bedf.getLine()) != NULL ) { - pFile::tokenizeLine(line, " \t\r\n", tokens); - if ( tokens.size() < 3 ) - error("bed file must have three columns"); - - if ( tokens[0].compare(0,3,"chr") == 0 ) { - tokens[0] = tokens[0].substr(3); - } - - int beg1 = atoi(tokens[1].c_str()) + 1; - int end0 = atoi(tokens[2].c_str()); - - loci.add(tokens[0].c_str(),beg1,end0); - } - loci.resolveOverlaps(); // make the bed files non-overlapping - } - - if ( !loci.empty() ) { - loci.rewind(); - } - - std::vector r2G; - std::vector r2P; - if ( winR2 > 0 ) { - r2G.resize(winR2 * n, 0); - r2P.resize(winR2, false); - } - - int M = 0, nout = 0; - double mu, sigma, r2 = 0; - do { - if ( !loci.empty() ) { - tvcf.tf.updateRegion(loci.currentLocus().toString(), arg.sepchr); - //notice("Extracing region %s..",loci.currentLocus().toString()); - } - - for(m = 0; tvcf.readMarkers(arg.unit); ) { - if ( M / 10000 < (M + tvcf.nMarkers) / 10000 ) { - fprintf(stderr,"Reading %d of %d markers and writing %d markers across %d individuals..\n", m, M + tvcf.nMarkers, nout, tvcf.nInds); - } - M += tvcf.nMarkers; - //if ( ( arg.unit > 1 ) || ( M % 10000 == 0 ) ) - for(i=0; i < tvcf.nMarkers; ++i) { // for each marker - af = tvcf.alleleFreq(i); - maf = af > 0.5 ? 1-af : af; - if ( maf < 0 ) maf = 0; - mu = 2*af; - sigma = tvcf.alleleSD(i,true); - - if ( !markerIdRef.empty() ) { - if ( ( tvcf.refs[i] != markerIdRef ) || ( tvcf.alts[i] != markerIdAlt ) ) { - continue; - } - } - - if ( ( maf >= arg.minMAF ) && - ( tvcf.callRate(i) >= arg.minCallRate ) && - ( tvcf.sumAlleles[i] >= arg.minAC ) && - ( tvcf.sumAlleles[i] <= arg.maxAC ) ) - { // if pass the criteria - if ( winR2 > 0 ) { - // fill the genotype matrix - int offset = (m % winR2) * n; - for(j=0; j < n; ++j) { - geno = tvcf.genos[j + n*i]; - if ( isnan(geno) ) { - r2G[offset+j] = 0; - } - else { - r2G[offset+j] = (geno-mu)/sigma; - } - } - // calculate sliding-window r2 - r2 = 0; - for(j=0; j < winR2; ++j) { - if ( ( r2P[j] ) && ( j != (m % winR2) ) ) { - double r = 0; - for(k=0; k < n; ++k) { - r += ((r2G[offset+k] * r2G[j*n + k])/n); - } - if ( r*r > r2 ) r2 = r*r; - } - } - if ( r2 < maxR2 ) { r2P[m % winR2] = true; } - else { r2P[m % winR2] = false; } - //fprintf(stderr,"r2=%lf\n",r2); - } - - if ( ( winR2 == 0 ) || ( r2P[m % winR2] ) ) { - if ( outplink ) { - //error("--outplink is not implemented yet"); - for(j=0; j < n; ++j) { - geno = tvcf.genos[j + n*i]; - ngeno = isnan(geno) ? 0 : ((int)floor(geno)+1); - switch(ngeno) { - case 0: - genos[j/4] |= (0x1 << ((j%4)*2)); - break; - case 1: - genos[j/4] |= (0x0 << ((j%4)*2)); - break; - case 2: - genos[j/4] |= (0x2 << ((j%4)*2)); - break; - case 3: - genos[j/4] |= (0x3 << ((j%4)*2)); - break; - default: - warning("Cannot correctly parse non-biallelic SNP, treating as HOMALT"); - genos[j/4] |= (0x3 << ((j%4)*2)); - } - } - wf.write(genos,nbytes); - memset(genos,0,nbytes); - bimf->printf("%d\t%s\t0\t%d\t%s\t%s\n",schr2nchr(tvcf.chroms[i].c_str()),tvcf.markers[i].c_str(),tvcf.pos1s[i],tvcf.refs[i].c_str(),tvcf.alts[i].c_str()); - } - else if ( outmatrix ) { - wf.printf("%s",tvcf.markers[i].c_str()); - for(j=0; j < n; ++j) { - geno = tvcf.genos[j + n*i]; - if ( isnan(geno) ) { - wf.printf("\tNA"); - } - else { - if ( gtFlag ) { - wf.printf("\t%d",(int)floor(geno)); - } - else { - wf.printf("\t%.3lf",geno); - } - } - } - wf.printf("\n"); - } - else if ( outvcf ) { - //error("--outvcf is not implemented yet"); - //fprintf(stderr,"foo %d\n",M); - tvcf.writeSubsetMarker(wf, tvcf.tf.peekLine()); - //fprintf(stderr,"bar %d\n",M); - //if ( arg.verbose) - //fprintf(stderr,"fVcf::writeSubsetMarker() finished, M= %d",M); - } - ++nout; - } - ++m; - } - } - } - } - while ( (!loci.empty()) && loci.next() ); - - wf.close(); - if ( outplink ) { - bimf->close(); - delete bimf; - delete [] genos; - } - return 0; -} - -// variable threshold test -int runPairLD(int argc, char** argv) { - double minR2 = 1; - int winR2 = 1000; - pVPHArgs arg; - bool ignorePhase = false; - arg.field = "GT"; - paramList pl; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("VCF Input Options", NULL) - LONG_STRING_PARAM("vcf",&arg.vcf, "Input VCF file") - LONG_STRING_PARAM("region",&arg.region, "Region to focus on in 'chr:beg-end' format") - LONG_STRING_PARAM("indf",&arg.indf,"File containing individual IDs to focus on") - LONG_STRING_PARAM("rule",&arg.rule,"Rule to parse INFO field to subset variants") - LONG_DOUBLE_PARAM("minMAF",&arg.minMAF,"Minumum minor allele frequency cutoff") - LONG_DOUBLE_PARAM("maxMAF",&arg.maxMAF,"Maximum minor allele frequency cutoff") - LONG_INT_PARAM("minMAC",&arg.minMAC, "Mininum minor allele count cutoff") - LONG_DOUBLE_PARAM("minCallRate",&arg.minCallRate,"Minimum call rate threshold") - LONG_PARAM("ignoreFilter",&arg.ignoreFilter,"Ignore filter and consider non-PASS variants") - LONG_PARAM("ignorePhase",&ignorePhase, "Ignore phase information when calculating LD") - - LONG_PARAM_GROUP("LD pruning Options", NULL) - LONG_INT_PARAM("win-r2",&winR2, "Window of r2 calculation") - LONG_DOUBLE_PARAM("min-r2",&minR2, "Minimum r2 cutoff to report") - - LONG_PARAM_GROUP("Output Options", NULL) - LONG_STRING_PARAM("out",&arg.outf, "Output file name or prefix") - LONG_PARAM("verbose",&arg.verbose, "Turn on verbose mode") - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc,argv); - pl.Status(); - - // sanity check of input arguments - if ( arg.vcf.empty() || arg.outf.empty() ) { - error("--vcf, --out are required parameters (--indf are also recommended)"); - } - - bool gtFlag = (arg.field == "GT"); - fVcf tvcf; - - tvcf.load(arg.vcf.c_str(), arg.region.c_str(), arg.field.c_str(), arg.rule.c_str(), !arg.ignoreFilter, arg.indf.empty() ? NULL : arg.indf.c_str()); - - int n = tvcf.nInds; - std::vector r2G; - std::vector r2AF; - std::vector r2ID; - if ( winR2 > 0 ) { - r2G.resize(winR2 * n * 2, 0); - r2ID.resize(winR2); - r2AF.resize(winR2); - } - - int i, j, k, m, M = 0, ngeno, phase, offset, offset2; - double mu, af, maf, sigma, sigmaA, r, r2 = 0, h0, h1; - bool phased = false; - float geno; - - wFile wf(arg.outf.c_str()); - wf.printf("#MARKER1\tMARKER2\tAF1\tAF2\tR2\tR\n"); - - for(m = 0; tvcf.readMarkers(arg.unit); ) { - if ( M / 10000 < (M + tvcf.nMarkers) / 10000 ) { - fprintf(stderr,"Reading %d / %d markers across %d individuals..\n", m, M + tvcf.nMarkers, tvcf.nInds); - } - M += tvcf.nMarkers; - - //if ( m == 0 ) { phased = (gtFlag && (tvcf.phases[0] > 0) && (!ignorePhase)); } - //if ( ( arg.unit > 1 ) || ( M % 10000 == 0 ) ) - for(i=0; i < tvcf.nMarkers; ++i) { // for each marker - af = tvcf.alleleFreq(i); - maf = af > 0.5 ? 1-af : af; - mu = 2*af; - - //notice("i=%d, phased = %d",i,phased); - - if ( ( maf >= arg.minMAF ) && - ( tvcf.callRate(i) >= arg.minCallRate ) && - ( tvcf.sumAlleles[i] >= arg.minAC ) && - ( tvcf.sumAlleles[i] <= arg.maxAC ) ) - { - - offset = (m % winR2) * (n*2); - r2ID[m % winR2] = tvcf.markers[i]; - r2AF[m % winR2] = af; - sigma = sqrt(af*(1.-af)); - sigmaA = tvcf.alleleSD(i,true); - h0 = (0-af)/sigma; - h1 = (1.-af)/sigma; - for(j=0; j < n; ++j) { - phased = (gtFlag && (tvcf.phases[j + n*i] > 0) && (!ignorePhase)); - if ( phased ) { - geno = tvcf.genos[j + n*i]; - if ( isnan(geno) ) { error("Missing genotype was observed in phased VCF"); } - ngeno = (int)geno; - phase = tvcf.phases[j + n*i]; - switch(ngeno) { - case 0: - r2G[offset+j+j] = r2G[offset+j+j+1] = h0; - break; - case 1: - if ( phase == 2 ) { r2G[offset+j+j] = h0; r2G[offset+j+j+1] = h1; } - else if ( phase == 3 ) { r2G[offset+j+j] = h1; r2G[offset+j+j+1] = h0; } - else { error("Incompatible phase information %d at heterozygous genotypes",phase); } - break; - case 2: - r2G[offset+j+j] = r2G[offset+j+j+1] = h1; - break; - default: - error("Incompatible genotype %d in phased VCF",ngeno); - } - } - else { - geno = tvcf.genos[j + n*i]; - if ( isnan(geno) ) { - r2G[offset+j+j] = r2G[offset+j+j+1] = 0; - } - else { - r2G[offset+j+j] = r2G[offset+j+j+1] = (geno-mu)/sigmaA; - } - } - } - -// offset = (m % winR2) * (n*2); -// r2ID[m % winR2] = tvcf.markers[i]; -// r2AF[m % winR2] = af; -// if ( phased ) { -// sigma = sqrt(af*(1.-af)); -// for(j=0; j < n; ++j) { -// geno = tvcf.genos[j + n*i]; -// if ( isnan(geno) ) { error("Missing genotype was observed in phased VCF"); } -// ngeno = (int)geno; -// phase = tvcf.phases[j + n*i]; -// switch(ngeno) { -// case 0: -// r2G[offset+j+j] = r2G[offset+j+j+1] = (0-af)/sigma; -// break; -// case 1: -// if ( phase == 2 ) { r2G[offset+j+j] = (0-af)/sigma; r2G[offset+j+j+1] = (1.-af)/sigma; } -// else if ( phase == 3 ) { r2G[offset+j+j] = (1.-af)/sigma; r2G[offset+j+j+1] = (0-af)/sigma; } -// else { error("Incompatible phase information %d at heterozygous genotypes",phase); } -// break; -// case 2: -// r2G[offset+j+j] = r2G[offset+j+j+1] = (1.-af)/sigma; -// break; -// default: -// error("Incompatible genotype %d in phased VCF",ngeno); -// } -// } -// } -// else { -// sigma = tvcf.alleleSD(i,true); -// for(j=0; j < n; ++j) { -// geno = tvcf.genos[j + n*i]; -// if ( isnan(geno) ) { -// r2G[offset+j] = 0; -// } -// else { -// r2G[offset+j] = (geno-mu)/sigma; -// } -// } -// } - - // calculate sliding-window r2 matrix - r2 = r = 0; - for(j=1; j < winR2; ++j) { - //notice("foo %d %d %d %d",j,offset2,k); - offset2 = ((m + j) % winR2) * (n*2); - if ( r2AF[(m+j) % winR2] > 0 ) { - for(k=0; k < n + n; ++k) { - //for(k=0; k < (phased ? n+n : n); ++k) { - r += (r2G[offset + k] * r2G[offset2 + k]); - } - r /= (double)(n+n); - - // handle boundary condition - if ( r > 1 ) r = 1.; - else if ( r < -1 ) r = -1.; - - r2 = r*r; - if ( r2 >= minR2 ) { - wf.printf("%s\t%s\t%.5lf\t%.5lf\t%.5lf\t%.5lf\n",r2ID[(m+j) % winR2].c_str(),r2ID[m % winR2].c_str(),r2AF[(m+j) % winR2],r2AF[m % winR2],r2,r); - } - } - } - ++m; - } - } - } - wf.close(); - return 0; -} - -// create the list of r2 and -int runIndexLD(int argc, char** argv) { - // Parse the input arguments - std::string index; - double minR2 = 0; - int win = 1000000; - pVPHArgs arg; - arg.field = "GT"; - bool ignorePhase = false; - paramList pl; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("VCF Input Options", NULL) - LONG_STRING_PARAM("vcf",&arg.vcf, "Input VCF file") - LONG_STRING_PARAM("field",&arg.field, "VCF field to extract") - LONG_STRING_PARAM("region",&arg.region, "Region to focus on in 'chr:beg-end' format") - LONG_STRING_PARAM("indf",&arg.indf,"File containing individual IDs to focus on") - LONG_STRING_PARAM("rule",&arg.rule,"Rule to parse INFO field to subset variants") - LONG_DOUBLE_PARAM("minMAF",&arg.minMAF,"Minumum minor allele frequency cutoff") - LONG_DOUBLE_PARAM("maxMAF",&arg.maxMAF,"Maximum minor allele frequency cutoff") - LONG_DOUBLE_PARAM("minCallRate",&arg.minCallRate,"Minimum call rate threshold") - LONG_INT_PARAM("minAC",&arg.minAC,"Minimum non-reference allele count cutoff") - LONG_PARAM("ignoreFilter",&arg.ignoreFilter,"Ignore filter and consider non-PASS variants") - LONG_PARAM("ignorePhase",&ignorePhase, "Ignore phase information when calculating LD") - LONG_PARAM("sepchr",&arg.sepchr,"Separate VCF files by chromosomes, with chr1, chr2, .. in the file names") - - LONG_PARAM_GROUP("Index SNP position", NULL) - LONG_STRING_PARAM("index",&index, "index SNP") - LONG_INT_PARAM("win",&win, "window size") - LONG_DOUBLE_PARAM("min-r2",&minR2, "minimum r2 threshold") - - LONG_PARAM_GROUP("Output Options", NULL) - LONG_STRING_PARAM("out",&arg.outf, "Output file name or prefix") - LONG_PARAM("verbose",&arg.verbose, "Turn on verbose mode") - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc,argv); - pl.Status(); - - // sanity check of input arguments - if ( arg.vcf.empty() || index.empty() || arg.outf.empty() ) { - error("--vcf, --index, --out are required parameters (--indf are also recommended)"); - } - - fVcf tvcf; - - // parse index SNP info and convert it into regions - std::vector tokens; - pFile::tokenizeLine(index.c_str(), ":", tokens); - if ( tokens.size() != 2 ) { error("Cannot parse --indx %s parameter",index.c_str()); } - std::string indexChr = tokens[0]; - std::string indexSPos = tokens[1]; - int indexNPos = atoi(indexSPos.c_str()); - std::string indexRegion = index + "-" + indexSPos; - - // load index SNP - tvcf.load(arg.vcf.c_str(), NULL, arg.field.c_str(), arg.rule.c_str(), !arg.ignoreFilter, arg.indf.empty() ? NULL : arg.indf.c_str()); - int n = tvcf.nInds; - - tvcf.tf.updateRegion(indexRegion.c_str(), arg.sepchr); - - if ( tvcf.readMarkers(1) == 0 ) { - error("Cannot find a SNP at marker position %s",index.c_str()); - } - - int j, k, m; - double af = 0, maf, r, mu, sigma, sigmaA; - int ngeno, phase; - float geno; - std::vector iG(n*2,0); - std::vector tG(n*2,0); - bool phased; // = (( tvcf.phases[0] > 0 ) && ( !ignorePhase )); - double h0, h1; - - af = tvcf.alleleFreq(0); - sigma = sqrt(af*(1.-af)); - mu = 2*af; - sigmaA = tvcf.alleleSD(0,true); - h0 = (0.0-af)/sigma; - h1 = (1.0-af)/sigma; - //notice("af=%lf sigma=%lf sigmaA=%lf",af,sigma,sigmaA); - for(j=0; j < n; ++j) { - geno = tvcf.genos[j]; - phased = (( tvcf.phases[j] > 0 ) && ( !ignorePhase )); - if ( phased ) { - if ( isnan(geno) ) { error("Missing genotype was observed in phased VCF"); } - ngeno = (int)geno; - phase = tvcf.phases[j]; - switch(ngeno) { - case 0: - iG[j+j] = iG[j+j+1] = h0; - break; - case 1: - if ( phase == 2 ) { iG[j+j] = h0; iG[j+j+1] = h1; } - else if ( phase == 3 ) { iG[j+j] = h1; iG[j+j+1] = h0; } - else { error("Incompatible phase information %d at heterozygous genotypes",phase); } - break; - case 2: - iG[j+j] = iG[j+j+1] = h1; - break; - default: - error("Incompatible genotype %d in phased VCF",ngeno); - } - //af = (double)cd/(double)(ab+cd); - } - else { - for(j=0; j < n; ++j) { - geno = tvcf.genos[j]; - if ( isnan(geno) ) { iG[j+j] = iG[j+j+1] = 0; } - else { iG[j+j] = iG[j+j+1] = (geno-mu)/sigmaA; } - } - } - } - - notice("Found index SNP %s in the VCF at AF=%.5lf",index.c_str(),af); - - if ( arg.region.empty() ) { - char buf[255]; - sprintf(buf,"%s:%d-%d",indexChr.c_str(),indexNPos-win,indexNPos+win); - arg.region = buf; - } - - notice("Retrieving the genomic region %s",arg.region.c_str()); - tvcf.tf.updateRegion(arg.region.c_str(), arg.sepchr); - - wFile wf(arg.outf.c_str()); - wf.printf("##INDEX=%s\n",index.c_str()); - wf.printf("##AF=%.5lf\n",af); - wf.printf("#CHROM\tPOS\tID\tREF\tALT\tAF\tR2\tR\n"); - - int nout = 0; - int M = 0; - for(m = 0; tvcf.readMarkers(arg.unit); ) { - if ( M / 10000 < (M + tvcf.nMarkers) / 10000 ) { - fprintf(stderr,"Reading %d of %d markers and writing %d markers across %d individuals..\n", m, M + tvcf.nMarkers, nout, tvcf.nInds); - } - M += tvcf.nMarkers; - - for(int i=0; i < tvcf.nMarkers; ++i) { // for each marker - af = tvcf.alleleFreq(i); - maf = af > 0.5 ? 1-af : af; - - if ( ( maf >= arg.minMAF ) && - ( tvcf.callRate(i) >= arg.minCallRate ) && - ( tvcf.sumAlleles[i] >= arg.minAC ) && - ( tvcf.sumAlleles[i] <= arg.maxAC ) ) { // if pass the criteria - mu = 2*af; - sigma = sqrt(af*(1.-af)); - sigmaA = tvcf.alleleSD(0,true); - h0 = (0.0-af)/sigma; - h1 = (1.0-af)/sigma; - for(j=0; j < n; ++j) { - geno = tvcf.genos[j + n*i]; - phased = (( tvcf.phases[j + n*i] > 0 ) && ( !ignorePhase )); - if ( phased ) { // assume phased, non-missing genotypes - if ( isnan(geno) ) { error("Missing genotype was observed in phased VCF"); } - ngeno = (int)geno; - phase = tvcf.phases[j + n*i]; - switch(ngeno) { - case 0: - tG[2*j] = tG[2*j+1] = h0; - break; - case 1: - if ( phase == 2 ) { tG[j+j] = h0; tG[j+j+1] = h1; } - else if ( phase == 3 ) { tG[j+j] = h1; tG[j+j+1] = h0; } - else { error("Incompatible phase information %d at heterozygous genotypes",phase); } - break; - case 2: - tG[j+j] = tG[j+j+1] = h1; - break; - default: - error("Incompatible genotype %d in phased VCF",ngeno); - } - } - else { - geno = tvcf.genos[j + n*i]; - if ( isnan(geno) ) { - tG[j+j] = tG[j+j+1] = 0; - } - else { - tG[j+j] = tG[j+j+1] = (geno-mu)/sigmaA; - } - } - } - - // calculate r2 with index SNP - r = 0; - for(k=0; k < n+n; ++k) { - r += (tG[k] * iG[k]); - //notice("%d\t%lf\t%lf",k,iG[k],tG[k]); - } - r /= (double)(n+n); - //error("r=%lf",r); - if ( r*r >= minR2 ) { // print out R2 - wf.printf("%s\t%d\t.\t%s\t%s\t%.5lf\t%.5lf\t%.5lf\n",tvcf.chroms[i].c_str(), tvcf.pos1s[i], tvcf.refs[i].c_str(), tvcf.alts[i].c_str(), af, r*r, r); - ++nout; - } - } - } - } - - notice("Successfully wrote %d variants at r2 threshold %f",nout,minR2); - wf.close(); - return 0; -} - -// create the list of r2 and -int runPeakShift(int argc, char** argv) { - // Parse the input arguments - std::string score; // score file contains [CHROM] [POS1] [SCOREF] - std::string bed; // BED file contains [CHROM] [BEG-0] [END-0] [SCORE or CATEGORY] - std::string mpu; // DEPTH file contains [CHROM] [POS] [REF] [DEPTH] - int win = 1000000; // Window to extend from the index bp - std::string region; // Region to be explorered - std::string chrpos; // chromposomal position of index SNPs - //bool quantitiative = false; // use quantitative scores - int maxShift = 100000; // maximum shift - int minDepth = 1; // minimum depth - std::string mask; // genome mask - std::string out; // output files - int seed = 0; // random seed - int nperm = 1000; // number of permutations - bool ucsc = false; - char buf[65535]; - bool noAvgFlag = false; - - paramList pl; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("Input Files", NULL) - LONG_STRING_PARAM("score",&score, "score file containing [CHROM] [POS1] [SCOREF]") - LONG_STRING_PARAM("bed",&bed, "BED file contains [CHROM] [BEG-0] [END-0] [SCORE or CATEGORY]" ) - LONG_STRING_PARAM("mpu",&mpu, "DEPTH file contains [CHROM] [POS] [REF] [DEPTH]") - LONG_STRING_PARAM("mask",&mask, "Genome mask") - LONG_PARAM("ucsc",&ucsc, "Assume that BED file is in UCSC format") - - LONG_PARAM_GROUP("Input Options", NULL) - LONG_PARAM("no-avg",&noAvgFlag, "Take sum instead of average") - LONG_INT_PARAM("seed",&seed, "Random seed") - LONG_INT_PARAM("nperm",&nperm, "Number of Permutations") - - LONG_PARAM_GROUP("Regions to focus", NULL) - LONG_STRING_PARAM("region",®ion, "Region to focus on in 'chr:beg-end' format'") - LONG_STRING_PARAM("chrpos",&chrpos, "Chromosome and position in 'chr:pos' format") - LONG_INT_PARAM("win",&win, "Window size in bp") - LONG_INT_PARAM("max-shift",&maxShift, "Maximum base pair to shift/shuffle") - LONG_INT_PARAM("min-depth",&minDepth, "Minimum depth") - - LONG_PARAM_GROUP("Output Options", NULL) - LONG_STRING_PARAM("out",&out, "Output file") - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc,argv); - pl.Status(); - - // sanity check of input arguments - if ( score.empty() || out.empty() ) { - error("--score and --out are required parameters"); - } - if ( mpu.empty() && bed.empty() ) { - error("Either --mpu or --bed are required parameters"); - } - if ( !mpu.empty() && !bed.empty() ) { - error("Only one of --mpu or --bed are required parameters"); - } - if ( !region.empty() && !chrpos.empty() ) { - error("Only one of --region or --chrpos can be specified"); - } - - // open the score file first - std::vector tokens; - if ( !chrpos.empty() ) { - pFile::tokenizeLine(chrpos.c_str(),":",tokens); - std::string chr = tokens[0]; - int pos = atoi(tokens[1].c_str()); - int beg = pos - win; - int end = pos + win; - sprintf(buf,"%s%s:%d-%d",ucsc ? "chr" : "",chr.c_str(),beg,end); - region = buf; - } - - pFile scoref(score.c_str()); - //if ( !region.empty() ) scoref.updateRegion(region.c_str()); - - std::map pos2score; - std::string chr; - std::string bedchr; - int minpos = 1e9; - int maxpos = 0; - int firstpos, newpos; - const char* line = NULL; - while( ( line = scoref.getLine() ) != NULL ) { - pFile::tokenizeLine(line, " \t\r\n", tokens); - if ( tokens.size() < 3 ) error("bed file must have three columns"); - - if ( chr.empty() ) { chr = tokens[0]; } - else if ( chr != tokens[0] ) error("Multiple chromosomes - %s and %s - are not supported",chr.c_str(),tokens[0].c_str()); - int bp = atoi(tokens[1].c_str()); - if ( minpos > bp ) minpos = bp; - if ( maxpos < bp ) maxpos = bp; - pos2score[bp] = atof(tokens[2].c_str()); - } - bedchr = ucsc ? "chr"+chr : chr; - int length = (maxpos-minpos+1); - sprintf(buf,"%s:%d-%d",bedchr.c_str(),minpos,maxpos); - region = buf; - - //error("%s:%d-%d",bedchr.c_str(),minpos,maxpos); - - // read BED file - std::map mLoci; // BED regions with predicted category - if ( !bed.empty() ) { - notice("Reading BED file...%s",bed.c_str()); - pFile bedf(bed.c_str(), region.c_str()); - int sz = 0; - int nregions = 0; - while( (line = bedf.getLine()) != NULL ) { - pFile::tokenizeLine(line, " \t\r\n", tokens); - std::string key("ALL"); - //double f = 1.; - if ( tokens.size() < 3 ) { - error("BED file must have at least three columns"); - } - else if ( tokens.size() > 3 ) { - key = tokens[3]; - //if ( tokens.size() > 4 ) { - //f = atof(tokens[4].c_str()); - //} - } - int beg = atoi(tokens[1].c_str())+1; - int end = atoi(tokens[2].c_str()); - if ( beg < minpos ) beg = minpos; - if ( end > maxpos ) end = maxpos; - sz += (end-beg+1); - mLoci[key].add(tokens[0].c_str(), beg, end); - ++nregions; - } - notice("Identified %d regions of %d base pairs across %d categories", nregions, sz, mLoci.size()); - } - else { // PEAK file should be available - notice("Reading peak files...\n"); - pFile mpuf(mpu.c_str(), region.c_str()); - while( ( line = mpuf.getLine() ) != NULL ) { - if ( tokens.size() < 4 ) { - error("MPU file must have at least four columns"); - } - std::string key("ALL"); - int pos = atoi(tokens[1].c_str()); - if ( ( pos < minpos ) || ( pos > maxpos ) ) continue; - int depth = atoi(tokens[3].c_str()); - if ( depth >= minDepth ) - mLoci[key].add(tokens[0].c_str(), pos, pos); - } - notice("Identified region of %d base pairs with depth %d or greater",mLoci.size(),minDepth); - } - notice("Resolving Overlaps..."); - for(std::map::iterator it = mLoci.begin(); it != mLoci.end(); ++it) { - it->second.resolveOverlaps(); - //notice("%s = %d",it->first.c_str(), it->second.totalLength()); - } - - notice("Generating random offsets...\n"); - // Generate random offsets - if ( seed == 0 ) srand(std::time(0)); - else srand(seed); - std::vector offsets; - offsets.push_back(0); - for(int i=1; i < nperm; ++i) { - offsets.push_back( rand() % maxShift - maxShift / 2 ); - } - - // For each offset, evaluate the scores - // what would be the best scores? we will simply take the summation here - notice("Performing peak-shifting test..."); - std::map > sumScores; - std::map > numScores; - for(int i=0; i < nperm; ++i) { - if ( i % 100 == 0 ) notice("Iteration %d",i+1); - for(std::map::iterator it = mLoci.begin(); it != mLoci.end(); ++it) { - double sum = 0; - int num = 0; - genomeLoci& loci = it->second; - - std::map::iterator jt = pos2score.begin(); - firstpos = newpos = ( jt->first - minpos + offsets[i] ) % length + minpos; - // move to the position we need - loci.moveTo(bedchr.c_str(), newpos); - //notice("++ %s %d %d %d %d %d %d",it->first.c_str(),loci.isend(),loci.it == loci.loci.begin(),loci.loci.size(),loci.it->beg1,firstpos,loci.it->end0); - while ( jt != pos2score.end() && firstpos <= newpos ) { - while( !loci.isend() && loci.it->end0 < newpos ) { loci.next(); } - if ( ( loci.it->beg1 <= newpos ) && ( loci.it->end0 >= newpos ) ) { - //if ( jt->second > 0.01 ) notice("** %d %d %d %d %.5lf",loci.it->beg1,newpos,loci.it->end0,i, jt->second); - sum += jt->second; - ++num; - } - ++jt; - newpos = ( jt->first - minpos + offsets[i] ) % length + minpos; - } - loci.rewind(); - while( jt != pos2score.end() ) { - while( !loci.isend() && loci.it->end0 < newpos ) { loci.next(); } - if ( ( loci.it->beg1 <= newpos ) && ( loci.it->end0 >= newpos ) ) { - //if ( jt->second > 0.01 ) notice("** %d %d %d %d %.5lf",loci.it->beg1,newpos,loci.it->end0,i, jt->second); - sum += jt->second; - ++num; - } - ++jt; - newpos = ( jt->first - minpos + offsets[i] ) % length + minpos; - } - /* - for(std::map::iterator jt = pos2score.begin(); jt != pos2score.end(); ++jt) { - newpos = ( jt->first - minpos + offsets[i] ) % length + minpos; - if ( it->second.contains1(bedchr.c_str(), newpos) ) { // ??? - sum += jt->second; - ++num; - } - } - */ - //notice("sum = %lf, num = %d",sum,num); - sumScores[it->first].push_back(noAvgFlag ? sum : sum/(num+1e-10)); - numScores[it->first].push_back(num); - } - //error("offset = %d",offsets[i]); - } - - notice("Computing permutation-based p-values..."); - wFile wf(out.c_str()); // output file - wf.printf("#KEY\tFRACBP\tFRACSNP\tSCORE\tSUM\tMIDP\tMAXP\tRANDP\n"); - for(std::map >::iterator it = sumScores.begin(); it != sumScores.end(); ++it) { - std::vector& s = it->second; - int countGreater = 0; - int countSame = 0; - for(int i=0; i < (int)s.size(); ++i) { - if ( s[i] == s[0]) ++countSame; - else if ( s[i] > s[0] ) ++countGreater; - //printf("%s\t%d\t%.3lg\t%d\t%d\t%d\n",it->first.c_str(), i, s[i], s[i] == s[0], s[i] > s[0], offsets[i]); - } - double mpmid = (double)(countGreater + countSame/2.)/(double)nperm; - double mpmax = (double)(countGreater + countSame)/(double)nperm; - double mprnd = (double)(countGreater + ((double)rand()/(double)(RAND_MAX+0.5))*countSame)/(double)nperm; - wf.printf("%s\t%.5lf\t%.5lf\t%.2lg\t%.2lg\t%.5lf\t%.5lf\t%.5lf\n",it->first.c_str(), (double)mLoci[it->first].totalLength()/(double)length,(double)numScores[it->first][0]/(double)pos2score.size(), s[0], noAvgFlag ? s[0] : s[0] * numScores[it->first][0], mpmid, mpmax, mprnd); - - if ( it->first == "5" ) { - for(int i=1; i < 100; ++i) { - //wf.printf("--%s\t%.5lf\t%.5lf\t%.2lg\t%.2lg\t%d\t%d\n",it->first.c_str(), (double)mLoci[it->first].totalLength()/(double)length,(double)numScores[it->first][i]/(double)pos2score.size(), s[i], noAvgFlag ? s[i] : s[i] * numScores[it->first][i], s[i] > s[0], s[i] >= s[0]); - } - } - } - wf.close(); - return 0; -} - -// Enrichment test criteria -// 1. How to summarize the distribution of p-values within a region -// 1) z-score, posterior, .. -// 2) accounting for LD -// 2. How to create the null distribution -// 1) contiguity -// 2) number of variants -// 3) size of regions -// 3) number of variants after LD correction -// 4) MAF distribution -// 5) distance to TSS -// 6) genomic features, such as mappability -// 7) background region -/* -int runBedEnrich2(int argc, char** argv) { - bool ldIgnore = false, ldWeight = true, ldPrune = false; - bool matchBaseCounts = true, matchVariantCounts = false; - bool averageScore = true, sumScore = false; - bool oddsRatio = false, stouffer = true, posterior = false; - double maxP = 1, minP = 0; - std::string score; // EPACTS file containing PVALUE, MAF, LD-adjusted WEIGHTS - std::string fgBed; // foreground BED file - std::string bgBed; // background BED file - std::string maskFa; // mask FASTA file - int nperm = 1000; // number of permutations - bool ucsc = false; - double minMAF = 1e-10; // minimum MAF; - double maxMAF = 1; // maximum MAF - int nperm; -} -*/ - -// run enrichment test -int runBedEnrich(int argc, char** argv) { - // Parse the input arguments - std::string score; // EPACTS file containing PVALUE and MAF information - std::string bed; // BED file contains [CHROM] [BEG-0] [END-0] [SCORE or CATEGORY] - int win = 1000000; // Window to extend from the index bp - std::string region; // Region to be focused - std::string chrpos; // chromposomal position of index SNPs - int maxShift = 1000000; // maximum shift - int minDepth = 1; // minimum depth - std::string mask; // genome mask - std::string out; // output files - std::string outDetail; // detailed output files - std::string outPost; // output posterior file - int rawz = 0; // use raw z scores instead of converting to posterior probability - int seed = 0; // random seed - int nperm = 1000; // number of permutations - bool ucsc = false; - char buf[65535]; - bool noAvgFlag = false; - double minMAF = 1e-9; // minimum MAF - double maxMAF = 1; // maximum MAF - double thresP = 1; // p-value threshold to consider - double maxP = 1e-5; // maximum p-value when there is no significant SNPs around (e.g. 1e-5) - double minP = 0; // fix min P - int binLD = 100000; // bin for defining LD - int winLD = 1000000; // bin for defining maximum LD with causal SNPs - - std::string pvalcol("PVALUE"); - std::string weightcol("WEIGHT"); - std::string mafcol("MAF"); - std::string grp; - - paramList pl; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("Input Files", NULL) - LONG_STRING_PARAM("score",&score, "score file containing [CHROM] [POS1] [SCOREF]") - LONG_STRING_PARAM("bed",&bed, "BED file contains [CHROM] [BEG-0] [END-0] [SCORE or CATEGORY]" ) - LONG_STRING_PARAM("grp",&grp, "Group name") - LONG_STRING_PARAM("mask",&mask, "Genome mask") - LONG_PARAM("ucsc",&ucsc, "Assume that BED file is in UCSC format") - LONG_STRING_PARAM("pval-col",&pvalcol, "Label of p-value column") - LONG_STRING_PARAM("maf-col",&mafcol, "Label of minor allele frequency column") - LONG_STRING_PARAM("weight-col",&weightcol, "Label of weight column") - - LONG_PARAM_GROUP("Input Options", NULL) - LONG_PARAM("no-avg",&noAvgFlag, "Take sum instead of average") - LONG_INT_PARAM("seed",&seed, "Random seed") - LONG_INT_PARAM("nperm",&nperm, "Number of Permutations") - LONG_DOUBLE_PARAM("min-maf",&minMAF, "Minimum minor allele frequency") - LONG_DOUBLE_PARAM("max-maf",&maxMAF, "Maximum minor allele frequency") - LONG_PARAM("raw",&rawz, "Take raw z-score rather than pvalues") - LONG_DOUBLE_PARAM("min-pval",&minP, "minimum p-value cutoff") - LONG_DOUBLE_PARAM("thres-pval",&thresP, "Maximum threshold to consider for p-value") - LONG_DOUBLE_PARAM("max-peak-pval",&maxP, "Maximum peak p-value to consider") - - LONG_PARAM_GROUP("Regions to focus", NULL) - LONG_STRING_PARAM("region",®ion, "Region to focus on") - LONG_STRING_PARAM("chrpos",&chrpos, "Chromosome and position label") - LONG_INT_PARAM("win",&win, "Window size in bp") - LONG_INT_PARAM("max-shift",&maxShift, "Maximum base pair to shift/shuffle") - LONG_INT_PARAM("min-depth",&minDepth, "Minimum depth") - - LONG_PARAM_GROUP("Output Options", NULL) - LONG_STRING_PARAM("out",&out, "Output file name") - LONG_STRING_PARAM("out-detail",&outDetail, "Output file name to store details") - LONG_STRING_PARAM("out-post",&outPost, "Output file to store posteror probability") - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc,argv); - pl.Status(); - - // sanity check of input arguments - if ( score.empty() || out.empty() ) { - error("--score and --out are required parameters"); - } - if ( bed.empty() ) { - error("--bed is required parameters"); - } - if ( !region.empty() && !chrpos.empty() ) { - error("Only one of --region or --chrpos can be specified"); - } - - // open the score file first - std::vector tokens; - if ( !chrpos.empty() ) { - pFile::tokenizeLine(chrpos.c_str(),":",tokens); - std::string chr = tokens[0]; - int pos = atoi(tokens[1].c_str()); - int beg = pos - win; - int end = pos + win; - sprintf(buf,"%s:%d-%d",chr.c_str(),beg,end); - region = buf; - } - - std::map > keyGroups; - if ( ! grp.empty() ) { - pFile grpf; - grpf.load(grp.c_str(), NULL, true); - const char* line = NULL; - while( ( line = grpf.getLine() ) != NULL ) { - pFile::tokenizeLine(line," \t\r\n",tokens); - for(int i=1; i < (int)tokens.size(); ++i) { - keyGroups[tokens[i]].push_back(tokens[0]); - } - } - } - - - // open EPACTS output - pFile scoref; - scoref.load(score.c_str(), region.c_str(), true); - - // read the header line - const char* line = scoref.getLine(); - if ( line[0] != '#' ) { - error("Cannot find the header line in %s",score.c_str()); - } - - // determine the columns of PVALUE and MAF - int ipval = -1; - int imaf = -1; - int iweight = -1; - pFile::tokenizeLine(line," \t\r\n",tokens); - - for(int i=0; i < (int)tokens.size(); ++i) { - if ( tokens[i].compare(pvalcol) == 0 ) { - if ( ipval == -1 ) ipval = i; - else error("Multiple %s column is defined",pvalcol.c_str()); - } - if ( tokens[i].compare(mafcol) == 0 ) { - if ( imaf == -1 ) imaf = i; - else error("Multiple %s column is defined",mafcol.c_str()); - } - if ( tokens[i].compare(weightcol) == 0 ) { - if ( iweight == -1 ) iweight = i; - else error("Multiple %s column is defined",weightcol.c_str()); - } - } - - if ( ipval < 0 ) error("Cannot find PVALUE column from %s",score.c_str()); - if ( imaf < 0 ) error("Cannot find MAF column from %s",score.c_str()); - if ( iweight < 0 ) warning("WEIGHT column is not found.. Assume 1 for every variant"); - - // read the p-value files and convert them into posterior probability scale - std::map upos2score; - std::map upos2pvalue; - std::map upos2weight; - uint64_t minupos = 18446744073709551615ULL; - uint64_t maxupos = 0; - double maf, pval, zscore, weight; - //double maxz = 0; - std::map maxzs; // stores maximum z in LD window - //if ( minP > 0 ) maxz = hDist::ltqnorm(minP/2.); - double minPZ = hDist::pval2z(minP); - double maxPZ = hDist::pval2z(maxP); - while( ( line = scoref.getLine() ) != NULL ) { // Read EPACTS output file - pFile::tokenizeLine(line, " \t\r\n", tokens); - if ( tokens[ipval].compare("NA") != 0 ) { - uint64_t upos = genomePos.fromPos(tokens[0],atoi(tokens[1].c_str())); - if ( upos == 0 ) continue; - if ( minupos > upos ) minupos = upos; - if ( maxupos < upos ) maxupos = upos; - maf = atof(tokens[imaf].c_str()); - if ( ( maf >= minMAF ) && ( maf <= maxMAF ) ) { - pval = atof(tokens[ipval].c_str()); - //zscore = 0-hDist::ltqnorm(pval/2.); - zscore = hDist::pval2z(pval); - - if ( pval > thresP ) zscore = 0; - if ( zscore > minPZ ) zscore = minPZ; - - if ( !rawz ) { - // set max-z for every possible bins - for( int64_t win = 0-winLD; win <= winLD; win += binLD ) { - uint64_t key = (upos + win)/binLD; - if ( maxzs.find(key) == maxzs.end() ) { // not found - maxzs[key] = maxPZ; // default maxz is defined by maxP - } - if ( maxzs[key] < zscore ) - maxzs[key] = zscore; - } - } - /* - if ( pval > thresP ) zscore = 0; - if ( maxz < zscore ) { - if ( minP == 0 ) { - maxz = zscore; // max z is based on min P - } - else { - zscore = maxz; // max z is a fixed value - } - } - */ - upos2score[upos] = zscore; - upos2pvalue[upos] = pval; - if ( iweight >= 0 ) { - weight = atof(tokens[iweight].c_str()); - upos2weight[upos] = weight; - } - } - } - } - - wFile* postf = outPost.empty() ? NULL : new wFile(outPost.c_str()); - if ( postf != NULL ) { - postf->printf("#CHR\tPOS\tSCORE\tWEIGHT\n"); - } - - double psum = 0; - double maxz = 0; - if ( !rawz ) { - for(std::map::iterator it = upos2score.begin(); - it != upos2score.end(); ++it) { - //it->second = exp(0.5 * (it->second * it->second - maxz * maxz)); - maxz = maxzs[it->first/binLD]; - it->second = exp(0.5 * (it->second * it->second - maxz * maxz)); - psum += (it->second); - } - - for(std::map::iterator it = upos2score.begin(); - it != upos2score.end(); ++it) { - it->second /= psum; - if ( postf != NULL ) { - std::pair pos = genomePos.toPos(it->first); - postf->printf("%s\t%d\t%.4lg\t%.4lf\n",pos.first.c_str(),pos.second,it->second,iweight >= 0 ? upos2weight[it->first] : 1.0); - } - } - } - - // check whether genome-wide or not - std::pair minpos = genomePos.toPos(minupos); - std::pair maxpos = genomePos.toPos(maxupos); - uint64_t length = 0; - if ( minpos.first == maxpos.first ) { // same chromosome - std::string bedchr = ucsc ? "chr"+minpos.first : minpos.first; - length = (maxpos.second-minpos.second+1); - sprintf(buf,"%s:%d-%d",bedchr.c_str(),minpos.second,maxpos.second); - region = buf; - notice("Detected single chromosomal region %s",buf); - } - else { - region = ""; - length = genomePos.genomeSize(); - notice("Detected whole genome region spanning multiple chromosomes"); - } - - // read BED file - uint64_t firstupos, newupos; - std::map mLoci; // BED regions with predicted category - notice("Reading BED file...%s on %s",bed.c_str(),region.c_str()); - pFile bedf(bed.c_str(), region.c_str()); - int sz = 0; - int nregions = 0; - int ngroups = 0; - while( (line = bedf.getLine()) != NULL ) { - pFile::tokenizeLine(line, " \t\r\n", tokens); - std::string key("ALL"); - if ( tokens.size() < 3 ) { - error("BED file must have at least three columns"); - } - else if ( tokens.size() > 3 ) { - key = tokens[3]; - } - std::string chr = ucsc ? tokens[0].substr(3) : tokens[0]; - uint64_t ubeg = genomePos.fromPos(chr,atoi(tokens[1].c_str())+1); - uint64_t uend = genomePos.fromPos(chr,atoi(tokens[2].c_str())); - if ( ( ubeg == 0 ) || ( uend == 0 ) ) continue; - if ( ubeg < minupos ) ubeg = minupos; - if ( uend > maxupos ) uend = maxupos; - if ( ubeg > uend ) { - continue; - //error("Invalid interval %s",line); - } - sz += (uend-ubeg+1); - - if ( grp.empty() ) { - mLoci[key].add(ubeg, uend); - ++ngroups; - } - else { - std::vector& v = keyGroups[key]; - for(int i=0; i < (int)v.size(); ++i) { - mLoci[v[i]].add(ubeg, uend); - ++ngroups; - } - } - ++nregions; - } - notice("Identified %d regions over %d groups of %llu base pairs across %d categories", nregions, ngroups, length, mLoci.size()); - - notice("Resolving Overlaps..."); - for(std::map::iterator it = mLoci.begin(); it != mLoci.end(); ++it) { - //notice("%s\t%llu",it->first.c_str(),it->second.totalLength()); - it->second.resolveOverlaps(); - //notice("%s\t%llu",it->first.c_str(),it->second.totalLength()); - //error("%s\t%llu",it->first.c_str(),it->second.totalLength()); - } - - if ( maxShift == 0 ) { - maxShift = (maxupos-minupos+1); - } - - notice("Generating random offsets... with max-shift=%d\n", maxShift); - if ( seed == 0 ) srand(std::time(0)); - else srand(seed); - std::vector offsets; - offsets.push_back(0); - for(int i=1; i < nperm; ++i) { - offsets.push_back( rand() % maxShift - maxShift / 2 ); - } - - // For each offset, evaluate the scores - // what would be the best scores? we will simply take the summation here - notice("Performing peak-shifting test..."); - std::map > sumScores; - std::map > numScores; - std::map minPvalue; - for(int i=0; i < nperm; ++i) { - if ( i % 100 == 0 ) notice("Iteration %d",i+1); - for(std::map::iterator it = mLoci.begin(); it != mLoci.end(); ++it) { - double minpval = 1; - double sum = 0; - double num = 0; - genomePosLoci& loci = it->second; - - std::map::iterator jt = upos2score.begin(); - firstupos = newupos = ( jt->first - minupos + offsets[i] ) % length + minupos; - // move to the position we need - loci.moveTo(newupos); - while ( jt != upos2score.end() && firstupos <= newupos ) { - while( !loci.isend() && loci.it->uend0 < newupos ) { loci.next(); } - if ( ( loci.it->ubeg1 <= newupos ) && ( loci.it->uend0 >= newupos ) ) { - sum += (iweight < 0) ? jt->second : (jt->second * upos2weight[jt->first]); - num += (iweight < 0) ? 1.0 : (upos2weight[jt->first]); - if ( i == 0 ) { - double p = upos2pvalue[jt->first]; - if ( p < minpval ) minpval = p; - } - } - ++jt; - newupos = ( jt->first - minupos + offsets[i] ) % length + minupos; - } - loci.rewind(); - while( jt != upos2score.end() ) { - while( !loci.isend() && loci.it->uend0 < newupos ) { loci.next(); } - if ( ( loci.it->ubeg1 <= newupos ) && ( loci.it->uend0 >= newupos ) ) { - sum += (iweight < 0) ? jt->second : (jt->second * upos2weight[jt->first]); - num += (iweight < 0) ? 1.0 : (upos2weight[jt->first]); - if ( i == 0 ) { - double p = upos2pvalue[jt->first]; - if ( p < minpval ) minpval = p; - } - } - ++jt; - newupos = ( jt->first - minupos + offsets[i] ) % length + minupos; - } - sumScores[it->first].push_back(noAvgFlag ? sum : sum/(num+1e-10)); - numScores[it->first].push_back(num); - if ( i == 0 ) { - minPvalue[it->first] = minpval; - } - } - } - - notice("Computing permutation-based p-values..."); - wFile wf(out.c_str()); // output file - wf.printf("#KEY\tFRACBP\tFRACSNP\tMINPVAL\tSCORE\tSUM\tMIDP\tMAXP\tRANDP\n"); - wFile* pwdf = outDetail.empty() ? NULL : new wFile(outDetail.c_str()); - - for(std::map >::iterator it = sumScores.begin(); it != sumScores.end(); ++it) { - std::vector& s = it->second; - int countGreater = 0; - int countSame = 0; - - if ( pwdf ) pwdf->printf("%s",it->first.c_str()); - - for(int i=0; i < (int)s.size(); ++i) { - if ( s[i] == s[0]) ++countSame; - else if ( s[i] > s[0] ) ++countGreater; - - if ( pwdf ) pwdf->printf("\t%.6lg",s[i]); - } - - if ( pwdf ) pwdf->printf("\n"); - - double mpmid = (double)(countGreater + countSame/2.)/(double)nperm; - double mpmax = (double)(countGreater + countSame)/(double)nperm; - double mprnd = (double)(countGreater + ((double)rand()/(double)(RAND_MAX+0.5))*countSame)/(double)nperm; - wf.printf("%s\t%.5lf\t%.5lf\t%.2lg\t%.2lg\t%.2lg\t%.5lf\t%.5lf\t%.5lf\n",it->first.c_str(), (double)mLoci[it->first].totalLength()/(double)length,(double)numScores[it->first][0]/(double)upos2score.size(), minPvalue[it->first], s[0], noAvgFlag ? s[0] : s[0] * numScores[it->first][0], mpmid, mpmax, mprnd); - } - wf.close(); - if ( pwdf ) { - pwdf->close(); - delete pwdf; - } - return 0; -} - -/* -int runBGZIndex(int argc, char** argv) { - paramList pl; - std::string gzf; - std::string outf("-"); - std::string sbyte("0"); - int nelems = 1; - - bool indexFlag = false; - bool readFlag = true; - bool forceFlag = false; - - bool uint8_t_Flag = true; - bool uint16_t_Flag = false; - bool uint32_t_Flag = false; - bool uint64_t_Flag = false; - bool int8_t_Flag = false; - bool int16_t_Flag = false; - bool int32_t_Flag = false; - bool int64_t_Flag = false; - bool char_t_Flag = false; - bool float_t_Flag = false; - bool double_t_Flag = false; - - bool verbose = false; - - BEGIN_LONG_PARAMS(longParameters) - LONG_PARAM_GROUP("Input Options", NULL) - LONG_STRING_PARAM("in",&gzf, "Input file in bgzip format") - LONG_STRING_PARAM("offset",&sbyte, "Offset to jump") - LONG_INT_PARAM("nelems",&nelems, "Number of elements") - - LONG_PARAM_GROUP("Read or Index") - EXCLUSIVE_PARAM("index",&indexFlag) - EXCLUSIVE_PARAM("read",&readFlag) - - LONG_PARAM_GROUP("Read Type") - EXCLUSIVE_PARAM("uint8",&uint8_t_Flag) - EXCLUSIVE_PARAM("uint16",&uint16_t_Flag) - EXCLUSIVE_PARAM("uint32",&uint32_t_Flag) - EXCLUSIVE_PARAM("uint64",&uint64_t_Flag) - EXCLUSIVE_PARAM("int8",&int8_t_Flag) - EXCLUSIVE_PARAM("int16",&int16_t_Flag) - EXCLUSIVE_PARAM("int32",&int32_t_Flag) - EXCLUSIVE_PARAM("int64",&int64_t_Flag) - EXCLUSIVE_PARAM("char",&char_t_Flag) - EXCLUSIVE_PARAM("float",&float_t_Flag) - EXCLUSIVE_PARAM("double",&double_t_Flag) - - LONG_PARAM_GROUP("Output Options") - LONG_PARAM("force",&forceFlag) - LONG_PARAM("verbose",&verbose) - LONG_STRING_PARAM("out",&outf) - END_LONG_PARAMS(); - - pl.Add(new longParams("Available Options", longParameters)); - pl.Read(argc, argv); - if ( verbose ) pl.Status(); - - // sanity check of input arguments - if ( gzf.empty() ) { - error("--in are required parameters"); - } - if ( ( forceFlag ) && ( readFlag ) ) { - error("--force option is unavailable when --read is on"); - } - - if ( indexFlag ) { - FILE* fp = fopen(gzf.c_str(), "r"); - if ( fp == NULL ) error("Error in reading BGZF file %s",gzf.c_str()); - - std::string idxf = gzf + ".bgi"; - if ( !forceFlag ) { - FILE* ftmp = fopen(idxf.c_str(), "r"); - if ( ftmp != NULL ) error("BGZF Index %s already exists. Use --force option to overwrite",idxf.c_str()); - } - FILE* wp = fopen(idxf.c_str(), "w"); - if ( wp == NULL ) error("Cannot write to %s",idxf.c_str()); - - uint8_t u8; - uint16_t u16; - uint32_t u32; - - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) || ( u8 != 31 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) || ( u8 != 139 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) || ( u8 != 8 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) || ( u8 != 4 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u32, sizeof(uint32_t), 1, fp) != 1 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - if ( ( fread(&u16, sizeof(uint16_t), 1, fp) != 1 ) ) error("Error in reading BGZF file %s",gzf.c_str()); - //if ( u16 > 0 ) fseek(fp, u16, SEEK_CUR); - - uint64_t sz = 0; - for(int i=0;; ++i) { - if ( fwrite(&sz, sizeof(uint64_t), 1, wp) != 1 ) error("Error in writing BGZF Index %s",idxf.c_str()); - - if ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) break; - else if ( u8 != 66 ) error("Error1 in reading BGZF file %s at block %d %u",gzf.c_str(),i,u8); - if ( ( fread(&u8, sizeof(uint8_t), 1, fp) != 1 ) || ( u8 != 67 ) ) error("Error3 in reading BGZF file %s at block %d",gzf.c_str(),i); - if ( ( fread(&u16, sizeof(uint16_t), 1, fp) != 1 ) || ( u16 != 2 ) ) error("Error4 in reading BGZF file %s at block %d",gzf.c_str(),i); - if ( ( fread(&u16, sizeof(uint16_t), 1, fp) != 1 ) ) error("Error5 in reading BGZF file %s at block %d",gzf.c_str(),i); - sz += (u16+1); - //fprintf(stderr,"sz=%lu\n",sz); - if ( fseek(fp, u16-5, SEEK_CUR) != 0 ) break; - } - fclose(wp); - fclose(fp); - } - else { - uint64_t byte = strtoul(sbyte.c_str(),NULL,0); - uint64_t block = (byte >> 16); - uint32_t offset = (byte & 0x0FFFF); - - uint64_t cblock = 0; - if ( block > 0 ) { - std::string idxf = gzf + ".bgi"; - FILE* fp = fopen(idxf.c_str(), "r"); - if ( fp == NULL ) error("Cannot open %s",idxf.c_str()); - fseek(fp, block * sizeof(uint64_t), SEEK_SET); - if ( fread(&cblock, sizeof(uint64_t), 1, fp) != 1 ) - error("Cannot read from %s",idxf.c_str()); - fclose(fp); - } - - int64_t start = (cblock << 16 | offset); - int32_t szelem = ( uint8_t_Flag | int8_t_Flag | char_t_Flag ) ? sizeof(uint8_t) : - ( (uint16_t_Flag | int16_t_Flag ) ? sizeof(uint16_t) : - ( (uint32_t_Flag | int32_t_Flag | float_t_Flag) ? sizeof(uint32_t) : - ( ( uint64_t_Flag | int64_t_Flag | double_t_Flag ) ? sizeof(uint64_t) : -1 ) ) ); - if ( szelem == -1 ) { - uint8_t_Flag = true; - szelem = sizeof(uint8_t); - } - int64_t end = start + nelems * szelem; - - char* buffer = new char[WINDOW_SIZE]; - BGZF* bp = bgzf_open(gzf.c_str(),"r"); - - wFile wf(outf.c_str()); - int c; - - if (bgzf_seek(bp, start, SEEK_SET) < 0) error("Cannot perform bgzf_seek in %s to %ld",gzf.c_str(),start); - while (1) { - if (end < 0) c = bgzf_read(bp, buffer, WINDOW_SIZE); - else c = bgzf_read(bp, buffer, (end - start > WINDOW_SIZE)? WINDOW_SIZE:(end - start)); - if (c == 0) break; - if (c < 0) error("Cannot perform bgzf_seek in %s",gzf.c_str()); - start += c; - for(int i=0; i < c; i += szelem) { - if ( uint8_t_Flag ) { - wf.printf("%u\n",*(const uint8_t*)(buffer+i)); - } - else if ( int8_t_Flag ) { - wf.printf("%d\n",*(const int8_t*)(buffer+i)); - } - else if ( char_t_Flag ) { - wf.printf("%c\n",*(buffer+i)); - } - else if ( uint16_t_Flag ) { - wf.printf("%u\n",*(const uint16_t*)(buffer+i)); - } - else if ( int16_t_Flag ) { - wf.printf("%d\n",*(const int16_t*)(buffer+i)); - } - else if ( uint32_t_Flag ) { - wf.printf("%lu\n",*(const uint16_t*)(buffer+i)); - } - else if ( int32_t_Flag ) { - wf.printf("%ld\n",*(const int16_t*)(buffer+i)); - } - else if ( float_t_Flag ) { - wf.printf("%g\n",*(const float*)(buffer+i)); - } - else if ( uint64_t_Flag ) { - wf.printf("%llu\n",*(const uint64_t*)(buffer+i)); - } - else if ( int32_t_Flag ) { - wf.printf("%lld\n",*(const int64_t*)(buffer+i)); - } - else if ( double_t_Flag ) { - wf.printf("%g\n",*(const double*)(buffer+i)); - } - else { - error("Unrecognized output type"); - } - } - //write(f_dst, buffer, c); - if (end >= 0 && start >= end) break; - } - delete[] buffer; - wf.close(); - } - return 0; -} -*/ - -int main(int argc, char** argv) { - if ( argc < 2 ) { - printf("vcfast -- Fast analytic tools for analyzing and manipulating VCF\n"); - printf("Copyright (c) 2012 Hyun Min Kang\n"); - printf("Usage : %s [gen-hash] [options]\n",argv[0]); - printf("\tType one of the following commands below to get detailed usage\n"); - printf("\t%s summary [options] : summarize vcf\n",argv[0]); - printf("\t%s convert [options] : convert to different format\n",argv[0]); - printf("\t%s index-LD [options] : compute LD with index SNP\n",argv[0]); - printf("\t%s pair-LD [options] : compute pairwise LD\n",argv[0]); - } - else { - std::string cmd(argv[1]); - if ( cmd == "summary" ) { - return runSummary(argc-1,argv+1); - } - else if ( cmd == "convert" ) { - return runConvert(argc-1,argv+1); - } - else if ( cmd == "index-LD" ) { - return runIndexLD(argc-1,argv+1); - } - else if ( cmd == "pair-LD" ) { - return runPairLD(argc-1,argv+1); - } - else if ( cmd == "peak-shift" ) { - return runPeakShift(argc-1,argv+1); - } - else if ( cmd == "bed-enrich" ) { - return runBedEnrich(argc-1,argv+1); - } - //else if ( cmd == "bgzf-index" ) { - // return runBGZIndex(argc-1,argv+1); - //} - else { - error("Unrecognized command %s\n",argv[0]); - } - } - return 0; -} diff --git a/src/wFile.h b/src/wFile.h deleted file mode 100644 index b2e1f4b..0000000 --- a/src/wFile.h +++ /dev/null @@ -1,176 +0,0 @@ -#ifndef __TABIXED_WFILE__H -#define __TABIXED_WFILE__H - -#include -#include -#include -#include -#include - -#include "bgzf.h" -#include "Error.h" - -// class to read tabixed -class wFile { - protected: - FILE *fp; - gzFile gf; - BGZF* bgf; - int type; - static const int MAX_LINE_SIZE = 10000000L; - char* buf; - - public: - ~wFile() { - if ( buf != NULL ) delete [] buf; - close(); // TODO : calling close() generates error. Don't know why - } - - // read specifying one region - wFile(const char* filename, int mode = -1) { - if ( mode == -1 ) { // use bgzf if ends with .gz, otherwise, plain mode - int n = strlen(filename); - if ( strncmp(filename+n-3,".gz",3) == 0 ) { - type = 2; - } - else { - type = 0; - } - } - else { - type = mode; - } - - switch(type) { - case 0: - if ( strcmp(filename,"-") == 0 ) { - fp = stdout; - } - else { - fp = fopen(filename,"wb"); - } - gf = NULL; - bgf = NULL; - if ( fp == NULL ) { - fprintf(stderr,"Cannot open file %s in plain mode\n",filename); - abort(); - } - buf = NULL; - break; - case 1: - fp = NULL; - gf = gzopen(filename,"wb"); - bgf = NULL; - if ( gf == NULL ) { - fprintf(stderr,"Cannot open file %s in gzip mode\n",filename); - abort(); - } - buf = new char[MAX_LINE_SIZE]; - break; - case 2: - fp = NULL; - gf = NULL; - bgf = bgzf_open(filename,"wb"); - if ( bgf == NULL ) { - fprintf(stderr,"Cannot open file %s in bgzip mode\n",filename); - abort(); - } - buf = new char[MAX_LINE_SIZE]; - break; - } - - //fprintf(stderr,"*** type = %d\n",type); - } - - int write(void* ptr, size_t count) { - switch(type) { - case 0: - return (int)fwrite(ptr, 1, count, fp); - case 1: - return gzwrite(gf, ptr, count); - case 2: // bgzipped files - return bgzf_write(bgf, ptr, count); - default: - fprintf(stderr,"Invalid file type %d in wFile::write()\n",type); - abort(); - } - } - - int putc(char c) { - //error("putc(%c)\n",c); - switch(type) { - case 0: - return fputc(c,fp); - case 1: - return gzputc(gf,c); - case 2: - return bgzf_write(bgf, (void*)&c, 1); - default: - fprintf(stderr,"Invalid file type %d in wFile::putc()\n",type); - abort(); - } - } - - int puts(const char* s) { - int n; - - //error("puts(%s)\n",s); - - switch(type) { - case 0: - return fputs(s,fp); - case 1: - return gzputs(gf,s); - case 2: - n = strlen(s); - return bgzf_write(bgf, s, n); - default: - fprintf(stderr,"Invalid file type %d in wFile::puts()\n",type); - abort(); - } - } - - void vprintf(const char* msg, va_list ap) { - //fputs("foo()\n",stderr); - if ( type == 0 ) { - vfprintf(fp, msg, ap); - //::vprintf(msg, ap); - } - else { - int n = vsprintf(buf, msg, ap); - if ( type == 1 ) { - gzwrite(gf, buf, n); - } - else if ( type == 2 ) { - bgzf_write(bgf, buf, n); - } - else { - fprintf(stderr,"Invalid file type %d in wFile::printf()\n",type); - abort(); - } - } - } - - void printf(const char* msg, ...) { - va_list ap; - va_start(ap,msg); - vprintf(msg,ap); - va_end(ap); - } - - void close() { - switch( type ) { - case 0: - if ( fp != NULL ) { fclose(fp); fp = NULL; } - break; - case 1: - if ( gf != NULL ) { gzclose(gf); gf = NULL; } - break; - case 2: - if ( bgf != NULL ) { bgzf_close(bgf); bgf = NULL; } - break; - } - } -}; - -#endif // __TABIXED_WFILE__H