pax_global_header00006660000000000000000000000064121747075540014526gustar00rootroot0000000000000052 comment=7dadb8c5be20b02861eab63b04b78a9f7c49210a Gyoto-0.1.0/000077500000000000000000000000001217470755400126255ustar00rootroot00000000000000Gyoto-0.1.0/.deps/000077500000000000000000000000001217470755400136365ustar00rootroot00000000000000Gyoto-0.1.0/.deps/Astrobj.Po000066400000000000000000000000101217470755400155310ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Error.Po000066400000000000000000000000101217470755400152160ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Factory.Po000066400000000000000000000000101217470755400155340ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Metric.Po000066400000000000000000000000101217470755400153500ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Photon.Po000066400000000000000000000000101217470755400153740ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Register.Po000066400000000000000000000000101217470755400157110ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Scenery.Po000066400000000000000000000000101217470755400155350ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Screen.Po000066400000000000000000000000101217470755400153440ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/SmartPointer.Po000066400000000000000000000000101217470755400165540ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Spectrometer.Po000066400000000000000000000000101217470755400166010ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Spectrum.Po000066400000000000000000000000101217470755400157270ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/ThinDisk.Po000066400000000000000000000000101217470755400156420ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Utils.Po000066400000000000000000000000101217470755400152250ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/Worldline.Po000066400000000000000000000000101217470755400160640ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/WorldlineIntegState.Po000066400000000000000000000000101217470755400200540ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/gyoto.Po000066400000000000000000000000101217470755400152660ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.deps/libgyoto.Po000066400000000000000000000000101217470755400157550ustar00rootroot00000000000000# dummy Gyoto-0.1.0/.gitignore000066400000000000000000000003411217470755400146130ustar00rootroot00000000000000*.fits bin/gyoto *.lo *.o ywrap.c Makefile autom4te.cache .libs config.log config.status doc/html/ doc/latex *.la .deps *.pc *.so *~ libtool config.h include/GyotoConfig.h include/stamp-h2 stamp-h1 yorick/stdplug/polishfit.i Gyoto-0.1.0/AUTHORS000066400000000000000000000011441217470755400136750ustar00rootroot00000000000000Gyoto has been written starting in 2008 primarily by: Frédéric Vincent [1, 2] Thibaut Paumard [1] The development team at Observatoire de Paris also includes: Éric Gourgoulhon [2] Guy Perrin [1] Affiliations: [1] Laboratoire d'études spatiales et d'instrumentation en astrophysique (LESIA), Observatoire de Paris, CNRS, Université Pierre et Maris Curie, Université Paris Diderot 5 place Jules Janssen, F-92190 MEUDON, FRANCE [2] Laboratoire Univers et théories (LUTH), Observatoire de Paris, CNRS, Université Paris Diderot 5 place Jules Janssen, F-92190 MEUDON, FRANCE Gyoto-0.1.0/COPYING000066400000000000000000001045131217470755400136640ustar00rootroot00000000000000 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 . Gyoto-0.1.0/ChangeLog000066400000000000000000000016231217470755400144010ustar00rootroot000000000000000.1.0 2013/07/27 ABI 1 * add units system * add PolishDoughnut astrobj * use pkg-config * gyotoy ported to yorick-gy instead of python * in Worldline, Photon and Scenery: rename tlim to tmin, default value is -DBL_MAX. * add a mutli-wavelength flavour of Astrobj::emission() * install yorick plug-in under ${prefix}, not necessarily in Y_HOME * add plugin attribute to the Metric, Astrobj and Spectrum entities * reform build system to use the autotools * add --plugins command-line option * add virtual destrcuctor to Spectrum::Generic * fix buffer overflow in lib/Factory.C * update paper ref in bin/gyoto.C 0.0.3 2012/05/01 BUG * fix a tiny bug in PatternDisk (initialization of phimin/max) * rearrange flags in Makefiles/local_settings for easier downstream packaging 0.0.2 2012/04/19 PKG * install include files in include/Gyoto * add this ChangeLog 0.0.1 2012/04/16 ABI 0 * release Gyoto-0.1.0/INSTALL000066400000000000000000000507431217470755400136670ustar00rootroot00000000000000INSTALLING GYOTO ================ 0- DISTRIBUTION PACKAGES ======================== Gyoto comes prepackaged for some systems. Of course, the development version may be much more advanced at a given time. On Debian GNU/Linux (and derivatives), try: sudo apt-get install gyoto gyoto-doc yorick-gyoto Developers may be interested in gyoto-dbg and libgyoto0-dev in addition. On an Apple Mac, you can install MacPorts (http://www.macports.org/) and run: sudo port install Gyoto If Gyoto is not packaged for your system or if you prefer to build from source, read on. In un nutshell: ./configure make make check sudo make install I- INSTALL THE DEPENDENCIES =========================== - xercesc-3 (recommended, required for the executable): http://xerces.apache.org/xerces-c/ - cfitsio (required for the executable and some of the Astrobj): http://heasarc.gsfc.nasa.gov/fitsio/ - libudunits2 (recommended, support for unit conversions): http://www.unidata.ucar.edu/software/udunits/ - Yorick (optional, provides an interface to the Yorick interpreted language, allowing to write Gyoto scripts): http://yorick.sourceforge.net/ Yorick users will also need the yorick-yutils add-on (https://github.com/frigaut/yorick-yutils) and may need to install the yorick-dev package (in particulat Debian/Ubuntu users). - LORENE (optional, the libgyoto-lorene plug-in can be built later) http://www.lorene.obspm.fr/ On some systems, LORENE must be built with -fPIC (GYOTO as well, but this is the default). - developers may need the GNU autotools: autoconf, automake, libtool. II- CONFIGURE GYOTO =================== If all the dependencies are installed in standard places (/usr or /usr/local) and if the default prefix (/usr/local) is OK for you, this should do: $ ./configure You may need to pass some options or configuration variables. To list the available options: ./configure --help The standard GNU INSTALL file is appended to this file and documents the most standard and obscure features. Example: assume you want to install in ${HOME}/mysoft, that LORENE is in ${HOME}/mysoft/Lorene (but HOME_LORENE is not set), and Xerces and CFITIO are in /opt/local: $ ./configure --prefix=${HOME}/mysoft \ --with-lorene=${HOME}/mysoft/Lorene \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib III- BUILD ========== $ make IV- TEST ======== Several example files are provided in doc/examples. All the files without "rotstar3_1" should work out of the box. The rotstar3_1 require the lorene plug-in and some work to create lorene data files. You can ray-trace all these sceneries (may take up to a couple of minutes on recent hardware) with: $ make check Don't worry too much for the "severe" warnings. You can now open the resulting FITS files with ds9 (http://hea-www.harvard.edu/RD/ds9/) or spydr (http://www.maumae.net/yorick/doc/spydr_intro.php) or any other FITS-aware image viewer: $ spydr example-*.fits In addition, if Gyoto has been configured to build the Yorick plug-in, this plug-in is also tested. V- INSTALL ========== If installing to a system location (i.e. if you don't have right access to PREFIX), you need to gain root privileges using, for instance, su or sudo: 1- using su: $ su - (type root password) # make install 2- using sudo: $ sudo make install (type your password) Under Linux, if installing to a system location, you may need to also run # ldconfig -v or $ sudo ldconfig -v VII- Setting your environment ============================= If installing in a non-standard place (e.g. under your home directory), you do not need to run ldconfig, but you need to adapt your environment for instance by adding the following lines to ${HOME}/.profile (replace by the actual Gyoto prefix!). One Gyoto file installed in each directory is listed as a comment: export PREFIX= export PATH=${PREFIX}/bin:${PATH} # gyoto export LD_LIBRARY_PATH=${PREFIX}/lib:${LD_LIBRARY_PATH} # libgyoto.so.* export MANPATH=${PREFIX}/share/man:${MANPATH} # gyoto.1 export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig # gyoto.pc Under Mac OS X, LD_LIBRARY_PATH is replaced by DYLD_LIBRARY_PATH. It goes beyond the scope of this manual to teach you how to set environment variables; if in doubt ask the local guru or google... By default, the Yorick plug-in is also installed under ${prefix}. If Yorick itself is un ${prefix}, then the plug-in will be installed directly with the rest of Yorick and hence will be found by Yorick. On the other hand, if Yorick is not under ${prefix}, the plug-in may not be found immediately by Yorick. Assuming you used the default prefix (/usr/local), it should be sufficient to create a file named ${HOME}/Yorick/custom.i containing the three following lines: require, "pathfun.i"; add_y_home,"/usr/local/lib/yorick/"; command_line= process_argv(); Under Debian and Ubuntu GNU/Linux, /usr/local/lib/yorick/ is by default in Yorick search paths. VII- More on GNU ./configure script: ==================================== Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. Gyoto-0.1.0/Makefile.am000066400000000000000000000001351217470755400146600ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS=@mySUBDIRS@ $(SUBDIRS): cd $@ ; $(MAKE) .PHONY: $(SUBDIRS) Gyoto-0.1.0/Makefile.in000066400000000000000000000640331217470755400147000ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 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@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ target_triplet = @target@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure $(top_srcdir)/doc/Makefile.in \ $(top_srcdir)/include/GyotoConfig.h.in \ $(top_srcdir)/yorick/Makefile.in \ $(top_srcdir)/yorick/gyoto.info.in \ $(top_srcdir)/yorick/stdplug/Makefile.in AUTHORS COPYING \ ChangeLog INSTALL NEWS config.guess config.sub depcomp \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h $(top_builddir)/include/GyotoConfig.h CONFIG_CLEAN_FILES = doc/Makefile yorick/Makefile \ yorick/stdplug/Makefile yorick/gyoto.info CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFITSIOCPPFLAGS = @CFITSIOCPPFLAGS@ CFITSIOLDFLAGS = @CFITSIOLDFLAGS@ CFITSIO_CFLAGS = @CFITSIO_CFLAGS@ CFITSIO_LIBS = @CFITSIO_LIBS@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DYLIB_VAR = @DYLIB_VAR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HOME_LORENE = @HOME_LORENE@ 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@ LORENECPPFLAGS = @LORENECPPFLAGS@ LORENELDFLAGS = @LORENELDFLAGS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_S = @MAKE_S@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYS = @SYS@ UDUNITS_CFLAGS = @UDUNITS_CFLAGS@ UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@ UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@ UDUNITS_LIBS = @UDUNITS_LIBS@ VERSINFO = @VERSINFO@ VERSION = @VERSION@ XERCESCPPFLAGS = @XERCESCPPFLAGS@ XERCESLDFLAGS = @XERCESLDFLAGS@ XERCES_CFLAGS = @XERCES_CFLAGS@ XERCES_LIBS = @XERCES_LIBS@ YORICK = @YORICK@ Y_INST_HOME = @Y_INST_HOME@ Y_INST_SITE = @Y_INST_SITE@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mySUBDIRS = @mySUBDIRS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkg_cflags = @pkg_cflags@ pkg_libs = @pkg_libs@ pkg_requires = @pkg_requires@ plugin_sfx = @plugin_sfx@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sovers = @sovers@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = @mySUBDIRS@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(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 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ include/GyotoConfig.h: include/stamp-h2 @if test ! -f $@; then rm -f include/stamp-h2; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) include/stamp-h2; else :; fi include/stamp-h2: $(top_srcdir)/include/GyotoConfig.h.in $(top_builddir)/config.status @rm -f include/stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status include/GyotoConfig.h distclean-hdr: -rm -f config.h stamp-h1 include/GyotoConfig.h include/stamp-h2 doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ yorick/Makefile: $(top_builddir)/config.status $(top_srcdir)/yorick/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ yorick/stdplug/Makefile: $(top_builddir)/config.status $(top_srcdir)/yorick/stdplug/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ yorick/gyoto.info: $(top_builddir)/config.status $(top_srcdir)/yorick/gyoto.info.in cd $(top_builddir) && $(SHELL) ./config.status $@ 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; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @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: $(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) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ 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; }; }'`; \ 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: 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; }; }'`; \ 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) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @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; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__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) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) 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*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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-recursive clean-am: clean-generic clean-libtool 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 dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-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-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 $(SUBDIRS): cd $@ ; $(MAKE) .PHONY: $(SUBDIRS) # 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: Gyoto-0.1.0/Makefile.obs000066400000000000000000000576731217470755400150710ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 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. # 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. am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/gyoto pkgincludedir = $(includedir)/gyoto pkglibdir = $(libdir)/gyoto pkglibexecdir = $(libexecdir)/gyoto 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 subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure $(top_srcdir)/doc/Makefile.in AUTHORS \ COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \ install-sh ltmain.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.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = doc/Makefile CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best 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/thibaut/git/Gyoto/missing --run aclocal-1.11 AMTAR = $${TAR-tar} AR = ar AUTOCONF = ${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf AUTOHEADER = ${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader AUTOMAKE = ${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 CFITSIOCPPFLAGS = CFITSIOLDFLAGS = -lcfitsio CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CXX = g++ CXXCPP = g++ -E CXXDEPMODE = depmode=gcc3 CXXFLAGS = -g -O2 CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DLLTOOL = false DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = FGREP = /bin/grep -F GREP = /bin/grep 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 = -ldl LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo MANIFEST_TOOL = : MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OTOOL = OTOOL64 = PACKAGE = gyoto PACKAGE_BUGREPORT = gyoto@sympa.obspm.fr PACKAGE_NAME = gyoto PACKAGE_STRING = gyoto 0.0.4 PACKAGE_TARNAME = gyoto PACKAGE_URL = PACKAGE_VERSION = 0.0.4 PATH_SEPARATOR = : POW_LIB = RANLIB = ranlib SED = /bin/sed SET_MAKE = SHELL = /bin/bash STRIP = strip VERSION = 0.0.4 XERCESCPPFLAGS = XERCESLDFLAGS = -lxerces-c YORICK = yorick abs_builddir = /home/thibaut/git/Gyoto abs_srcdir = /home/thibaut/git/Gyoto abs_top_builddir = /home/thibaut/git/Gyoto abs_top_srcdir = /home/thibaut/git/Gyoto 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/thibaut/git/Gyoto/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} plugin_sfx = so prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com sovers = 0.0.0 srcdir = . subdirs = yorick sysconfdir = ${prefix}/etc target_alias = top_build_prefix = top_builddir = . top_srcdir = . use_cfitsio = -DGYOTO_USE_CFITSIO use_xerces = -DGYOTO_USE_XERCES ACLOCAL_AMFLAGS = -I m4 SUBDIRS = lib bin all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(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 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ 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; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @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: $(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) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ 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; }; }'`; \ 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: 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; }; }'`; \ 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) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @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; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__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) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) 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*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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-recursive clean-am: clean-generic clean-libtool 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 dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-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-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 # 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: Gyoto-0.1.0/Makefile.old000066400000000000000000000046311217470755400150460ustar00rootroot00000000000000SHELL=/bin/sh DIR=lib bin CLEAN_DIR=$(addprefix clean-,$(DIR)) INSTALL_DIR=$(addprefix install-,$(DIR)) UNINSTALL_DIR=$(addprefix uninstall-,$(DIR)) include local_settings GYOTO_VERSION=$(subst gyoto-,,`basename $(CURDIR)`) all: $(DIR) yorick $(DIR) doc: cd $@; $(MAKE) install: $(INSTALL_DIR) install-yorick $(INSTALL_DIR): cd $(subst install-,,$@) ; $(MAKE) install uninstall: $(UNINSTALL_DIR) uninstall-yorick $(UNINSTALL_DIR): cd $(subst uninstall-,,$@) ; $(MAKE) uninstall clean: $(CLEAN_DIR) clean-doc clean-yorick rm -f example-*.fits $(CLEAN_DIR) clean-doc: cd $(subst clean-,,$@); $(MAKE) clean bin/gyoto: bin/*.C make bin lib/$(LIBGYOTO_FILE): lib/*.C make lib CHECK_CMD:=$(DYLIB_VAR)=lib:$$$(DYLIB_VAR) bin/gyoto check: lib/$(LIBGYOTO_FILE) bin/gyoto check-yorick $(CHECK_CMD) doc/examples/example-thin-disk.xml \ \!example-thin-disk.fits $(CHECK_CMD) doc/examples/example-complex-astrobj.xml \ \!example-complex-astrobj.fits $(CHECK_CMD) doc/examples/example-fixed-star.xml \ \!example-fixed-star.fits $(CHECK_CMD) --resolution=32 doc/examples/example-moving-star.xml \ \!example-moving-star.fits $(CHECK_CMD) doc/examples/example-page-thorne-disk-BL.xml \ \!example-page-thorne-disk-BL.fits $(CHECK_CMD) doc/examples/example-page-thorne-disk-KS.xml \ \!example-page-thorne-disk-KS.fits $(CHECK_CMD) doc/examples/example-torus.xml \ \!example-torus.fits yorick yorick/gyoto.so yorick/gyoto_std.so: yorick/*.C yorick/stdplug/*.C if which $(YORICK); then cd yorick; $(YORICK) -batch make.i; $(MAKE); fi check-yorick: yorick/gyoto.so yorick/gyoto_std.so if which $(YORICK); then \ cd yorick; \ $(DYLIB_VAR)=../lib:$$$(DYLIB_VAR) \ GYOTO_CHECK_NODISPLAY=true \ $(YORICK) -i check.i; \ fi install-yorick uninstall-yorick: yorick/gyoto.so yorick/gyoto_std.so if which $(YORICK); then \ cd yorick; \ $(MAKE) $(subst -yorick,,$@); \ fi clean-yorick distclean-yorick: if which $(YORICK); then \ cd yorick; \ $(YORICK) -batch make.i; \ $(MAKE) $(subst -yorick,,$@); \ fi distclean: clean distclean-yorick tbz: distclean cd ..; \ tar cvf - \ --exclude=.git --exclude=.gitignore --exclude=.pc --exclude=debian \ `basename $(CURDIR)` | \ bzip2 > gyoto_$(GYOTO_VERSION).tbz .PHONY: all $(DIR) clean $(CLEAN_DIR) install $(INSTALL_DIR) uninstall $(UNINSTALL_DIR) distclean check yorick check-yorick clean-yorick install-yorick uninstall-yorick doc clean-doc distclean-yorick tbz Gyoto-0.1.0/NEWS000066400000000000000000000000001217470755400133120ustar00rootroot00000000000000Gyoto-0.1.0/README000066400000000000000000000051371217470755400135130ustar00rootroot00000000000000 *** GYOTO *** General relativitY Orbit Tracer of Observatoire de Paris Gyoto aims at providing a framework for computing orbits and ray-traced images in General relativity. It consists in a library (libgyoto), utility programs, and a plug-in for the Yorick programing language. We request that use of Gyoto in scientific publications be properly acknowledged. Please cite: GYOTO: a new general relativistic ray-tracing code, F. H. Vincent, T. Paumard, E. Gourgoulhon & G. Perrin, Classical and Quantum Gravity 28, 225011 (2011) [arXiv:1109.4769] We also request that Gyoto modifications, extensions or plug-ins leading to a scientific publication be made public as free software reasonably fast (within one year after publication of the scientific paper), for instance by contributing it directly to the Gyoto code base. Contributors will be listed in the relevant source files as well as in the AUTHORS file in the package. Gyoto is Copyright 2011-2012 Thibaut Paumard, Frédéric Vincent (To ease reading on non-UTF8 systems, French accents are omitted in file headers). Gyoto 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. Gyoto 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 Gyoto. If not, see . Refer to the file INSTALL for building and installing Gyoto. Specific instructions for Linux/Ubuntu are in the file INSTALL.ubuntu. Several sample files are provided in doc/examples. You can ray-trace those sceneries with: gyoto FITS files can be read by a variety of free and proprietary software. See http://heasarc.gsfc.nasa.gov/docs/heasarc/fits.html. Custom metrics and astronomical objects can be added fairly easily by implementing them as a Gyoto plug-in. This, of course, requires knowledge of the C++ language. We don't provide yet a complete guide, but look at the standard plug-in lib/StdPlug.C which includes the Kerr metric and the standard objects. The Lorene (numerical) metrics are also implemented as a plug-in, see lib/LorenePlug.C and lib/Makefile.lorene. -- Thibaut Paumard, Tue Aug 30 2011. Gyoto-0.1.0/README.lorene000066400000000000000000000033721217470755400147750ustar00rootroot00000000000000 *** Activating LORENE in Gyoto *** Building the libgyoto-lorene plug-in 3+1 metrics support in Gyoto is implemented in the lorene plug-in, based on the LORENE library. I- BUILDING TOGETHER WITH GYOTO =============================== To enable it at build time, download LORENE from http://www.lorene.obspm.fr/, compile liblorene.a with the -fPIC CFLAG (i.e. check that the CFLAG variable defined in LORENE's local_settings file contains "-fPIC"), and set the HOME_LORENE variable according to the LORENE manual. If HOME_LORENE is defined when compiling Gyoto, the lorene plug-in is automatically built and installed. II- TESTING LIBGYOTO-LORENE ============================ Two example files are provided in doc/examples/: example-*-rotstar3_1.xml. They allow to ray-trace a moving/motionless star orbiting in the space-time of a relativistic rotating star. To run these examples: 1- Run make in $HOME_LORENE/Codes/Nrotstar: $ cd $HOME_LORENE/Codes/Nrotstar $ make 2- Prepare parameter files par_eos.d and par_rot.d, for instance $ cp Parameters/GR/Kepler/*.d ./ 3- Run the executable nrotstar to obtain the result file resu.d $ ./nrotstar 4- Update the file location in example-*-rotstar3_1.xml or copy resu.d to the Gyoto examples directory: $ cd - $ cp $HOME_LORENE/Codes/Nrotstar/resu.d doc/examples/ 5- Run GYOTO with example-*-rotstar3_1.xml. Assuming Gyoto is installed: $ gyoto doc/examples/example-fixedstar_rotstar3_1.xml out1.fits $ gyoto doc/examples/example-movingstar_rotstar3_1.xml out2.fits If gyoto is not installed replace "gyoto" above by: - under Linux: LD_LIBRARY_PATH=lib:$LD_LIBRARY_PATH bin/gyoto - under Mac OS X: DYLD_LIBRARY_PATH=lib:$DYLD_LIBRARY_PATH bin/gyotoGyoto-0.1.0/VERSION000066400000000000000000000000071217470755400136720ustar00rootroot000000000000000.0.3x Gyoto-0.1.0/aclocal.m4000066400000000000000000001046771217470755400145040ustar00rootroot00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 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_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' 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.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])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. # # 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/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 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. # # 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. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _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_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 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 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_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 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. # # 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], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 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. # # 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], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 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_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=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 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_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 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. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. 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. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_append_compile_flags.m4]) m4_include([m4/ax_append_flag.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_pthread.m4]) 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]) m4_include([m4/pkg.m4]) Gyoto-0.1.0/autoscan.log000066400000000000000000000000001217470755400151330ustar00rootroot00000000000000Gyoto-0.1.0/bin/000077500000000000000000000000001217470755400133755ustar00rootroot00000000000000Gyoto-0.1.0/bin/Makefile.am000066400000000000000000000025371217470755400154400ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I@top_builddir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) AM_LDFLAGS = $(XERCESLDFLAGS) $(PTHREAD_LIBS) AM_CXXFLAGS = -rdynamic $(PTHREAD_CFLAGS) CLEANFILES=example-*.fits bin_PROGRAMS = gyoto dist_man_MANS = gyoto.1 gyoto_SOURCES = gyoto.C gyoto_LDADD = @top_builddir@/lib/libgyoto.la gyoto_CPPFLAGS = $(AM_CPPFLAGS) $(CFITSIOCPPFLAGS) gyoto_LDFLAGS = $(AM_LDFLAGS) $(CFITSIOLDFLAGS) -export-dynamic CHECK_CMD = unset GYOTO_PLUGINS && ./gyoto check: gyoto $(CHECK_CMD) ../doc/examples/example-thin-disk.xml \ \!example-thin-disk.fits $(CHECK_CMD) ../doc/examples/example-complex-astrobj.xml \ \!example-complex-astrobj.fits $(CHECK_CMD) ../doc/examples/example-fixed-star.xml \ \!example-fixed-star.fits $(CHECK_CMD) --resolution=32 ../doc/examples/example-moving-star.xml \ \!example-moving-star.fits $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL.xml \ \!example-page-thorne-disk-BL.fits $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-KS.xml \ \!example-page-thorne-disk-KS.fits $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL-with-basis.xml \ \!example-page-thorne-disk-BL-with-basis.fits $(CHECK_CMD) ../doc/examples/example-torus.xml \ \!example-torus.fits $(CHECK_CMD) ../doc/examples/example-polish-doughnut.xml \ \!example-polish-doughnut.fits Gyoto-0.1.0/bin/Makefile.am~000066400000000000000000000010021217470755400156200ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I@top_srcdir@/include $(XERCESCPPFLAGS) AM_LDFLAGS = $(XERCESLDFLAGS) AM_CXXFLAGS = @use_xerces@ @use_cfitsio@ -rdynamic \ -DGYOTO_PLUGIN_SFX=\"@plugin_sfx@\" -DGYOTO_PREFIX=\"@prefix@\" \ -DGYOTO_SOVERS=\"@sovers@\" -fPIC lib_LTLIBRARIES = libgyoto.la libgyoto_la_SOURCES = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ Worldline.C FocalPlane.C Photon.C Scenery.C \ WorldlineIntegState.C Error.C Screen.C Spectrum.C \ Spectrometer.C ThinDisk.C Gyoto-0.1.0/bin/Makefile.in000066400000000000000000000612051217470755400154460ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 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@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ target_triplet = @target@ bin_PROGRAMS = gyoto$(EXEEXT) subdir = bin DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(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)/m4/pkg.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 \ $(top_builddir)/include/GyotoConfig.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_gyoto_OBJECTS = gyoto-gyoto.$(OBJEXT) gyoto_OBJECTS = $(am_gyoto_OBJECTS) gyoto_DEPENDENCIES = @top_builddir@/lib/libgyoto.la gyoto_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(gyoto_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f 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 = $(gyoto_SOURCES) DIST_SOURCES = $(gyoto_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/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) 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@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFITSIOCPPFLAGS = @CFITSIOCPPFLAGS@ CFITSIOLDFLAGS = @CFITSIOLDFLAGS@ CFITSIO_CFLAGS = @CFITSIO_CFLAGS@ CFITSIO_LIBS = @CFITSIO_LIBS@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DYLIB_VAR = @DYLIB_VAR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HOME_LORENE = @HOME_LORENE@ 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@ LORENECPPFLAGS = @LORENECPPFLAGS@ LORENELDFLAGS = @LORENELDFLAGS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_S = @MAKE_S@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYS = @SYS@ UDUNITS_CFLAGS = @UDUNITS_CFLAGS@ UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@ UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@ UDUNITS_LIBS = @UDUNITS_LIBS@ VERSINFO = @VERSINFO@ VERSION = @VERSION@ XERCESCPPFLAGS = @XERCESCPPFLAGS@ XERCESLDFLAGS = @XERCESLDFLAGS@ XERCES_CFLAGS = @XERCES_CFLAGS@ XERCES_LIBS = @XERCES_LIBS@ YORICK = @YORICK@ Y_INST_HOME = @Y_INST_HOME@ Y_INST_SITE = @Y_INST_SITE@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mySUBDIRS = @mySUBDIRS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkg_cflags = @pkg_cflags@ pkg_libs = @pkg_libs@ pkg_requires = @pkg_requires@ plugin_sfx = @plugin_sfx@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sovers = @sovers@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I@top_builddir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) AM_LDFLAGS = $(XERCESLDFLAGS) $(PTHREAD_LIBS) AM_CXXFLAGS = -rdynamic $(PTHREAD_CFLAGS) CLEANFILES = example-*.fits dist_man_MANS = gyoto.1 gyoto_SOURCES = gyoto.C gyoto_LDADD = @top_builddir@/lib/libgyoto.la gyoto_CPPFLAGS = $(AM_CPPFLAGS) $(CFITSIOCPPFLAGS) gyoto_LDFLAGS = $(AM_LDFLAGS) $(CFITSIOLDFLAGS) -export-dynamic CHECK_CMD = unset GYOTO_PLUGINS && ./gyoto all: all-am .SUFFIXES: .SUFFIXES: .C .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) --gnu bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bin/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): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || 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 gyoto$(EXEEXT): $(gyoto_OBJECTS) $(gyoto_DEPENDENCIES) $(EXTRA_gyoto_DEPENDENCIES) @rm -f gyoto$(EXEEXT) $(gyoto_LINK) $(gyoto_OBJECTS) $(gyoto_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gyoto-gyoto.Po@am__quote@ .C.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 $@ $< .C.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) '$<'` .C.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 $@ $< gyoto-gyoto.o: gyoto.C @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gyoto-gyoto.o -MD -MP -MF $(DEPDIR)/gyoto-gyoto.Tpo -c -o gyoto-gyoto.o `test -f 'gyoto.C' || echo '$(srcdir)/'`gyoto.C @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/gyoto-gyoto.Tpo $(DEPDIR)/gyoto-gyoto.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='gyoto.C' object='gyoto-gyoto.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gyoto-gyoto.o `test -f 'gyoto.C' || echo '$(srcdir)/'`gyoto.C gyoto-gyoto.obj: gyoto.C @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gyoto-gyoto.obj -MD -MP -MF $(DEPDIR)/gyoto-gyoto.Tpo -c -o gyoto-gyoto.obj `if test -f 'gyoto.C'; then $(CYGPATH_W) 'gyoto.C'; else $(CYGPATH_W) '$(srcdir)/gyoto.C'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/gyoto-gyoto.Tpo $(DEPDIR)/gyoto-gyoto.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='gyoto.C' object='gyoto-gyoto.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gyoto-gyoto.obj `if test -f 'gyoto.C'; then $(CYGPATH_W) 'gyoto.C'; else $(CYGPATH_W) '$(srcdir)/gyoto.C'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) 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) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @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 $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 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-man 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-man1 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 uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool 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-man1 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 uninstall-man \ uninstall-man1 check: gyoto $(CHECK_CMD) ../doc/examples/example-thin-disk.xml \ \!example-thin-disk.fits $(CHECK_CMD) ../doc/examples/example-complex-astrobj.xml \ \!example-complex-astrobj.fits $(CHECK_CMD) ../doc/examples/example-fixed-star.xml \ \!example-fixed-star.fits $(CHECK_CMD) --resolution=32 ../doc/examples/example-moving-star.xml \ \!example-moving-star.fits $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL.xml \ \!example-page-thorne-disk-BL.fits $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-KS.xml \ \!example-page-thorne-disk-KS.fits $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL-with-basis.xml \ \!example-page-thorne-disk-BL-with-basis.fits $(CHECK_CMD) ../doc/examples/example-torus.xml \ \!example-torus.fits $(CHECK_CMD) ../doc/examples/example-polish-doughnut.xml \ \!example-polish-doughnut.fits # 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: Gyoto-0.1.0/bin/Makefile.old000066400000000000000000000021161217470755400156120ustar00rootroot00000000000000SHELL=/bin/sh include ../local_settings .SUFFIXES : .o .C SRC = gyoto.C OBJ = $(SRC:.C=.o) LIB_SRC = $(shell ls ../lib/*.C) HDRS = $(shell ls ../include/*.h) EXE_ALL = gyoto # the gyoto executable requires XERCES ifeq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) EXE = $(filter-out gyoto,$(EXE_ALL)) else EXE = $(EXE_ALL) endif all: $(EXE) .C.o: $(CXX) -c $(GYOTO_FLAGS) -I../include $(CPPFLAGS) $(CXXFLAGS) $< gyoto: gyoto.o ../lib/$(LIBGYOTO_FILE) $(CXX) -o $@ $< -L../lib -lgyoto -ldl $(LDFLAGS) $(LDLIBS) clean: rm -f $(OBJ) rm -f $(EXE_ALL) rm -fr Doc rm -fr *~ rm -f libgyoto.a rm -fr gyoto.dSYM $(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/bin: install -d $@ ifeq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) install: else install: $(EXE) $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 gyoto.1 install -m 0755 $(EXE) $(DESTDIR)$(PREFIX)/bin install -m 0644 gyoto.1 $(DESTDIR)$(PREFIX)/share/man/man1 endif uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/gyoto rm -f $(DESTDIR)$(PREFIX)/share/man/man1/gyoto.1 .PHONY: clean install uninstallGyoto-0.1.0/bin/gyoto.1000066400000000000000000000206561217470755400146310ustar00rootroot00000000000000.\" Process this file with .\" groff -man -Tascii foo.1 .\" .TH GYOTO 1 "AUGUST 2013" Science "User Manuals" .SH NAME Gyoto \- the General relativitY Orbit Tracer of Observatoire de Paris .SH SYNOPSIS gyoto [\fB\-\-silent\fR|\fB\-\-quiet\fR|\fB\-\-verbose\fR[=\fIN\fR]|\fB\-\-debug\fR] [\fB\-\-imin\fR=\fIi0\fR] [\fB\-\-imax\fR=\fIi1\fR] [\fB\-\-jmin\fR=\fIj0\fR] [\fB\-\-jmax\fR=\fIj1\fR] [\fB\-\-time\fR=\fItobs\fR] [\fB\-\-tmin\fR=\fItmin\fR] [\fB\-\-fov\fR=\fIangle\fR] [\fB\-\-resolution\fR=\fInpix\fR] [\fB\-\-distance\fR=\fIdist\fR] [\fB\-\-paln\fR=\fIOmega\fR] [\fB\-\-inclination\fR=\fIi\fR] [\fB\-\-argument\fR=\fItheta\fR] [\fB\-\-nthreads\fR=\fInth\fR] [\fB\-\-plugins\fR=\fIpluglist\fR] [\fB\-\-impact-coords\fR[=\fIfname.fits\fR]] [\fB\-\-\fR] \fIinput.xml \fIoutput.fits .SH DESCRIPTION Gyoto is a framework for computing geodesics in curved space-times. The \fBgyoto\fR utility program uses this framework to compute images of astronomical objects in the vicinity of compact objects (e.g. black-holes). Such images are distorted by strong gravitational lensing. \fBgyoto\fR takes a scenery description in XML format (\fIinput.xml\fR), computes this scenery using relativistic ray-tracing, and saves the result in FITS format. A companion program, \fBgyotoy\fR(1), can be used to interactively visualize a single geodesic in any Gyoto metric (the trajectory of a single photon or massive particle). Ray-tracing can be very time consuming. It is possible to interrupt the process at any time by hitting ^C, which will save the already-computed part of the image before exiting the program. You can then compute the rest of the image later using the \fB\-\-jmin\fR option. .SH OPTIONS .IP \fB\-\- Ends option processing, in case either \fIinput.xml\fR or \fIoutput.fits\fR starts with "\-". .SS Setting the verbosity level .IP \fB\-\-silent\fR No output. .IP \fB\-\-quiet\fR Minimal output. .IP \fB\-\-verbose\fR[=\fIN\fR] Verbose mode. Verbosity level \fIN\fR may be specified. .IP \fB\-\-debug\fR Insanely verbose. .SS Choosing plug-ins .IP \fB\-\-plugins\fR=\fI[nofail:]plug1[,[nofail:]plug2][...] Comma-separated list of Gyoto plugins to load. Overwrites GYOTO_PLUGINS environment variable below. .SS Selecting a region It's possible to ray-trace only part of the scenery by providing the pixel coordinates of the bottom-left (\fIi0\fR, \fIj0\fR) and top-right (\fIi1\fR, \fIj1\fR) corners of the region. The bottom-left pixel of the complete image has coordinates i=1 and j=1. .IP \fB\-\-imin\fR=\fIi0 Default value: 1. .IP \fB\-\-imax\fR=\fIi1 Default value: \fInpix\fR (see option \fB\-\-resolution\fR below). .IP \fB\-\-jmin\fR=\fIj0 Default value: 1. .IP \fB\-\-jmax\fR=\fIj1 Default value: \fInpix\fR (see option \fB\-\-resolution\fR below). .SS Setting the camera position The following parameters are normally provided in the Screen section of \fIinput.xml\fR but can be overridden on the command line for instance to make a movie (by calling \fBgyoto\fR for each movie frame, changing only the option \fB\-\-time\fR). .IP \fB\-\-time\fR=\fItobs The observing time in geometrical units. .IP \fB\-\-fov\fR=\fIangle\fR The field-of-view of the camera, in radians. .IP \fB\-\-resolution\fR=\fInpix\fR Number of rows and columns in the output image. .IP \fB\-\-distance\fR=\fIdist\fR (Coordinate) distance from the observer to the center of the coordinate system, in geometrical units. .IP \fB\-\-paln\fR=\fIOmega\fR Position angle of the line of nodes, in radians, East of North. The is the angle between the North direction and the line of nodes (see below). .IP \fB\-\-inclination\fR=\fIi\fR Angle between the plane of the sky and the equator of the coordinate system. The intersection of those two planes is the line of nodes. .IP \fB\-\-argument\fR=\fItheta\fR Angle in the equatorial plane between the line of nodes and one of the main axes of the coordinate system. .SS Miscellaneous Unsorted option(s): .IP \fB\-\-nthreads\fR=\fInth\fR Number of parallel threads to use. For instance, on a dual-core machine, \fB\-\-nthreads\fR=2 should yield the fastest computation. This option is silently ignored if Gyoto was compiled without POSIX threads support. Note that the metric and object are replicated for each thread which can lead to a decrease in performance if either is memory-intensive. Setting this option to 0 is equivalent to setting it to 1. .IP \fB\-\-impact\-coords\fR[=\fIimpactcoords.fits\fR] In some circumstances, you may want to perform several computations in which the computed geodesics end up being exactly identical. This is the case for instance if you want to experiment changing the spectrum of a star or when making a movie of a rotating, optically thick disk. This option provides a mechanism to not recompute the geodesics in the most simple case: . .RS .IP \(bu 4 the Screen is always at the same position; .IP \(bu 4 the Metric is always exactly the same; .IP \(bu 4 the Astrobj is optically thick (no radiative transfer processing is necessary); .IP \(bu 4 the location and shape of the Astrobj is always the same. .RE . .IP If \fB\-\-impact\-coords\fR is passed without specifying \fIimpactcoords.fits\fR, the 8-coordinate vectors of the object and photon at impact point are saved for each point of the Screen. Missing data (no impact) are set to DBL_MAX. These data are saved as a supplementary image HDU in the FITS file which is identified by its EXTNAME: "Gyoto Impact Coordinates". The FITS keyword "HIERARCH Gyoto Observing Date" of this HDU holds the observing date (in geometrical unit). .IP If \fIimpactcoords.fits\fR is specified, the above mentioned data are read back from this file. The ray-tracing is not performed, but the Gyoto::Astrobj::Generic::processHitQuantities() method is called directy, yielding the same result if the four conditions above are met. The observing date stored in the FITS keyword "HIERARCH Gyoto Observing Date" is compared to the date specified in the screen or using the \fB\-\-time\fR option and the impact coordinates are shifted in time accordingly. .IP It is also possible to set the two versions of this option at the same time: .IP \fB\-\-impact\-coords\fR=\fIimpactcoords.fits\fR \fB\-\-impact\-coords\fR .IP In this case, the impact coordinates are read from \fIimpactcoords.fits\fR, shifted in time, and saved in \fIoutput.fits\fR. .RE .SH FILES .IP \fIinput.xml A gyoto input file in XML format. Several examples are provided in the source doc/examples directory. Depending on how you installed \fBgyoto\fR, they may be installed on your system in a place such as \fI/usr/share/doc/libgyoto/examples/\fR. It goes beyond the scope of this manpage to document the XML file format supported by Gyoto, please refer to the library documentation which may be distributed by your package manager, can be compiled from the Gyoto source, and can be consulted online at \fIhttp://gyoto.obspm.fr/\fR. .IP \fIoutput.fits The output image in FITS format. \fBgyoto\fR will not overwrite \fIoutput.fits\fR unless it is prefixed with an (escaped) "!": "gyoto in.xml \\!out.fits". This file may actually consist in a stack of images depending on the Gyoto Quantities and on the Spectrometer specified in \fIinput.xml\fR. For further information on the FITS format, see \fIhttp://fits.gsfc.nasa.gov/\fR. .SH ENVIRONMENT .IP GYOTO_PLUGINS Gyoto astronomical objects and metrics are implemented in plug-ins. To use more (or less!) than the standard plug-ins, you may set the environment variable GYOTO_PLUGINS to a comma-separated list of plug-ins. \fBgyoto\fR will exit with an error status if unable to load a specified plug-in, unless it is prefixed with "nofail:" in GYOTO_PLUGINS. This environment variable is overwritten byt he \fB\-\-plugins\fR command-line parameter. Default value: "stdplug,nofail:lorene". Gyoto attempts to find plug-ins first by relying on the system's dynamic linker (so paths in e.g. LD_LIBRARY_PATH and ld.so.conf are searched first). If that fails, it looks in PREFIX/lib/gyoto/ and finally in PREFIX/lib/gyoto/SOVERS/ where PREFIX and SOVERS are two compile-time options. PREFIX usually is /usr/local or /usr. At the time of writing, SOVERS is 0.0.0. .SH EXIT STATUS \fBgyoto\fR returns \fB0\fR upon success, \fB1\fR if unable to parse the command line or to interpret \fIinput.xml\fR, and a CFITSIO error code if an error occurs when trying to open, write to, or close \fIoutput.fits\fR. Refer to the CFITSIO documentation for more details. .SH AUTHOR Thibaut Paumard wrote this manual. .SH "SEE ALSO" .BR gyotoy (1) Gyoto-0.1.0/bin/gyoto.C000066400000000000000000000372531217470755400146540ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // Gyoto #include "GyotoDefs.h" #include "GyotoFactory.h" #include "GyotoUtils.h" #include "GyotoRegister.h" // FITS I/O #include // signal() #include // getpid() #include #include using namespace std; using namespace Gyoto; static char* pixfile = NULL; static fitsfile* fptr = NULL; static int status = 0; static long fpixel[] = {1,1,1}; static long nelements = 0; static double* vect = NULL; static double* impactcoords=NULL; static SmartPointer data = NULL; void usage() { cout << "Usage:" << endl << " rayXML [--imin=i0 --imax=i1 --jmin=j0 --jmax=j1] input.xml output.dat" << endl; } void sigint_handler(int sig) { if (sig!=SIGINT) cerr << "\n********GYOTO: sigint_handler trapping signal " << sig << ", this should not happen !" << endl; cerr << "GYOTO: SIGINT received: saving data to " << pixfile << "... "; signal(SIGINT, SIG_DFL); fits_write_pix(fptr, TDOUBLE, fpixel, nelements, vect, &status); fits_close_file(fptr, &status); fits_report_error(stderr, status); cerr << "Killing self." << endl; kill(getpid(), SIGINT); } static std::string curmsg = ""; static int curretval = 1; void gyotoErrorHandler( const Gyoto::Error e ) { cerr << curmsg << e << endl; if (debug()) abort(); // to keep stack for debugger exit (curretval); } int main(int argc, char** argv) { /* This program aims at computing the null geodesics of photons from an observation screen to an astrophysical object (star orbit, fixed star or disk). The final result is a list of illuminated pixels. */ // For debug output debug(0); // verbose(1); char * parfile=NULL; string ipctfile=""; string param; size_t imin=1, imax=1000000000, jmin=1, jmax=1000000000; // double tobs, tmin, fov, dist, paln, incl, arg; double tobs=0., tmin=0., fov=0., dist=0., paln=0., incl=0., arg=0.; size_t res=0, nthreads=0; // bool xtobs=0, xtmin=0, xfov=0, xres=0, xdist=0, xpaln=0, xincl=0, xarg=0; bool xtobs=0, xtmin=0, xfov=0, xres=0, xdist=0, xpaln=0, xincl=0, xarg=0, xnthreads=0; bool ipct=0; long ipctdims[3]={0, 0, 0}; double ipcttime; string pluglist= getenv("GYOTO_PLUGINS")? getenv("GYOTO_PLUGINS"): GYOTO_DEFAULT_PLUGINS; int stop=0; for (int i=1;i0" << endl; return 1; } } else if (param.substr(0,7)=="--imax=") { imax=atoi(param.substr(7).c_str()); double imaxtest=atof(param.substr(7).c_str()); if (imaxtest<=0){ cerr << "In gyoto.C: screen indices should be >0" << endl; return 1; } } else if (param.substr(0,7)=="--jmin=") { jmin=atoi(param.substr(7).c_str()); double jmintest=atof(param.substr(7).c_str()); if (jmintest<=0){ cerr << "In gyoto.C: screen indices should be >0" << endl; return 1; } } else if (param.substr(0,7)=="--jmax=") { jmax=atoi(param.substr(7).c_str()); double jmaxtest=atof(param.substr(7).c_str()); if (jmaxtest<=0){ cerr << "In gyoto.C: screen indices should be >0" << endl; return 1; } } else if (param.substr(0,15)=="--impact-coords") { if (param.size() > 16 && param.substr(15,1)=="=") ipctfile=param.substr(16); else ipct=1; } else if (param.substr(0,7)=="--time=") { tobs=atof(param.substr(7).c_str()); xtobs=1; } else if (param.substr(0,7)=="--tmin=") { tmin=atof(param.substr(7).c_str()); xtmin=1; } else if (param.substr(0,6)=="--fov=") { fov=atof(param.substr(6).c_str()); xfov=1; } else if (param.substr(0,13)=="--resolution=") { res=atoi(param.substr(13).c_str()); xres=1; } else if (param.substr(0,11)=="--distance=") { dist=atof(param.substr(11).c_str()); xdist=1; } else if (param.substr(0,7)=="--paln=") { paln=atof(param.substr(7).c_str()); xpaln=1; } else if (param.substr(0,14)=="--inclination=") { incl=atof(param.substr(14).c_str()); xincl=1; } else if (param.substr(0,11)=="--argument=") { arg=atof(param.substr(11).c_str()); xarg=1; } else if (param.substr(0,11)=="--nthreads=") { nthreads=atoi(param.substr(11).c_str()); xnthreads=1; } else { usage(); return 1; } } else { if (!parfile) parfile=argv[i]; else if (!pixfile) pixfile=argv[i]; else { usage(); return 1; } } } if (!pixfile) { usage(); return 1; } // State copyright if (verbose() >= GYOTO_QUIET_VERBOSITY) cout << " Copyright (c) 2011 Frederic Vincent & Thibaut Paumard\n" << " GYOTO is distributed under the terms of the GPL v. 3 license.\n" << " We request that use of Gyoto in scientific publications be " << " properly \n acknowledged. Please cite:\n" << " GYOTO: a new general relativistic ray-tracing code,\n" << " F. H. Vincent, T. Paumard, E. Gourgoulhon & G. Perrin 2011,\n" << " Classical and Quantum Gravity 28, 225011 (2011) " << "[arXiv:1109.4769]" << endl << endl; // set-up error reporter Gyoto::Error::setHandler ( &gyotoErrorHandler ); curmsg = "In gyoto.C: Error initializing libgyoto: "; curretval = 1; Gyoto::Register::init(pluglist.c_str()); Factory *factory ; if (verbose() >= GYOTO_QUIET_VERBOSITY) cout << "Reading parameter file: " << parfile << endl; curmsg = "In gyoto.C: Error in Factory creation: "; curretval = 1; factory = new Factory(parfile); curmsg = "In gyoto.C: Error getting Kind: "; const string kind = factory->getKind(); if (!kind.compare("Scenery")) { curmsg = "In gyoto.C: Error initializing ray-tracing: "; curretval = 2; SmartPointer scenery = factory -> getScenery(); SmartPointer screen = scenery->getScreen(); SmartPointer object = scenery->getAstrobj(); if (xtobs) screen -> setTime ( tobs ); else tobs= screen -> getTime(); if (xtmin) scenery -> setTmin ( tmin ); if (xres) screen -> setResolution ( res ); else res = screen -> getResolution(); if (xfov) screen -> setFieldOfView ( fov ); if (xdist) screen -> setDistance ( dist ); if (xincl) screen -> setInclination ( incl ); if (xpaln) screen -> setPALN ( paln ); if (xarg) screen -> setArgument ( arg ); if (xnthreads) scenery -> setNThreads ( nthreads ); if (ipctfile != "") { // if (verbose() >= GYOTO_QUIET_VERBOSITY) size_t ipctnelt=0; cout << "Reading precomputed impact coordinates from " << ipctfile <("Gyoto Impact Coordinates"), 0, &status); fits_read_key(fptr, TDOUBLE, "Gyoto Observing Date", &ipcttime, NULL, &status); fits_get_img_size(fptr, 3, ipctdims, &status); fits_report_error(stderr, status); if (status) return status; if (ipctdims[0]==16 && size_t(ipctdims[1]) == res && size_t(ipctdims[2]) == res) { impactcoords = new double[(ipctnelt=16*res*res)]; } else { cerr<<"ERROR: bad dimensions for precomputed impact coordinates\n"; return 1; } fits_read_subset(fptr, TDOUBLE, fpixel, ipctdims, fpixel, 0, impactcoords, NULL, &status); fits_close_file(fptr, &status); fptr=NULL; fits_report_error(stderr, status); if (status) return status; double dt = tobs * GYOTO_C / scenery -> getMetric() -> unitLength() - ipcttime; for (size_t i=0; i < ipctnelt; i+=8) if (impactcoords[i] != DBL_MAX) impactcoords[i] += dt; ipcttime = tobs * GYOTO_C / scenery -> getMetric() -> unitLength(); } Quantity_t quantities = scenery -> getRequestedQuantities(); if (debug()) cerr << "DEBUG: Gyoto.C: Requested Quantities: " << quantities < spr = screen -> getSpectrometer(); if (!spr) throwError("Spectral quantity requested but " "no spectrometer specified!"); nbnuobs = spr -> getNSamples(); } //nb of frames that will be used for spectral cube size_t nbdata= scenery->getScalarQuantitiesCount(); //nb of frames used for diverse interesting outputs //(obs flux, impact time, redshift..) size_t nelt=res*res*(nbdata+nbnuobs); vect = new double[nelt]; // First check whether we can open file int naxis=3; long naxes[] = {long(res), long(res), long(nbdata+nbnuobs)}; nelements=nelt; fits_create_file(&fptr, pixfile, &status); fits_create_img(fptr, DOUBLE_IMG, naxis, naxes, &status); fits_report_error(stderr, status); if (status) return status; // Allocate space for the output data data = new Astrobj::Properties(); size_t curquant=0; size_t offset=res*res; if (debug()) { cerr << "DEBUG: gyoto.C: flag_radtransf = "; cerr << scenery -> getAstrobj() -> getFlag_radtransf() << endl; cerr << "DEBUG: gyoto.C: Requested quantities: "; cerr << scenery -> getRequestedQuantitiesString() << endl; } char keyname[FLEN_KEYWORD]; char const * fmt="QUANT_%lu"; char * CNULL=NULL; if (quantities & GYOTO_QUANTITY_INTENSITY) { data->intensity=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("Intensity"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_EMISSIONTIME) { data->time=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("EmissionTime"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_MIN_DISTANCE) { data->distance=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("MinDistance"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_FIRST_DMIN) { data->first_dmin=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("FirstDistMin"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_REDSHIFT) { if (debug()) cerr << "DEBUG: gyoto.C: REDSHIFT requested\n"; data->redshift=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("Redshift"), CNULL, &status); } if ((quantities & GYOTO_QUANTITY_IMPACTCOORDS || ipct) && !ipctdims[0] ) { // Allocate if requested AND not provided cerr << "gyoto.C: allocating data->impactcoords" << endl; data->impactcoords = impactcoords = new double [res*res*16]; ipcttime = tobs * GYOTO_C / scenery -> getMetric() -> unitLength(); } if (quantities & GYOTO_QUANTITY_USER1) { data->user1=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("User1"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_USER2) { data->user2=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("User2"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_USER3) { data->user3=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("User3"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_USER4) { data->user4=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("User4"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_USER5) { data->user5=vect+offset*(curquant++); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("User5"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_SPECTRUM) { data->spectrum=vect+offset*(curquant++); data->offset=int(offset); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("Spectrum"), CNULL, &status); } if (quantities & GYOTO_QUANTITY_BINSPECTRUM) { data->binspectrum=vect+offset*(curquant++); data->offset=int(offset); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("BinSpectrum"), CNULL, &status); } signal(SIGINT, sigint_handler); curmsg = "In gyoto.C: Error during ray-tracing: "; scenery -> rayTrace(imin, imax, jmin, jmax, data, ipctdims[0]?impactcoords:NULL); curmsg = "In gyoto.C: Error while saving: "; if (verbose() >= GYOTO_QUIET_VERBOSITY) cout << "\nSaving to file: " << pixfile << endl; signal(SIGINT, SIG_DFL); // Save to fits file fits_write_pix(fptr, TDOUBLE, fpixel, nelements, vect, &status); if (quantities & GYOTO_QUANTITY_IMPACTCOORDS || ipct) { // Save if requested, copying if provided cout << "Saving precomputed impact coordinates" << endl; long naxes_ipct[] = {16, long(res), long(res)}; fits_create_img(fptr, DOUBLE_IMG, naxis, naxes_ipct, &status); fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("Gyoto Impact Coordinates"), CNULL, &status); fits_write_key(fptr, TDOUBLE, const_cast("Gyoto Observing Date"), &ipcttime, "Geometrical units", &status); fits_write_pix(fptr, TDOUBLE, fpixel, res*res*16, impactcoords, &status); fits_report_error(stderr, status); if (status) return status; } fits_close_file(fptr, &status); fits_report_error(stderr, status); if (debug()) cerr << "DEBUG: gyoto.C: FITS file closed, cleaning" << endl; curmsg = "In gyoto.C: Error while cleaning (file saved already): "; if (debug()) cerr << "DEBUG: gyoto.C: delete [] vect" << endl; delete [] vect; if (impactcoords) { if (debug()) cerr << "gyoto.C: delete [] data->impact" << endl; delete [] impactcoords; } if (debug()) cerr << "DEBUG: gyoto.C: scenery==NULL" << endl; scenery = NULL; if (status) return status; } else { cerr << "Unknown kind for root element in XML file" << endl; return 1; } delete factory; return 0; } Gyoto-0.1.0/config.guess000077500000000000000000001274321217470755400151560ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Gyoto-0.1.0/config.h.in000066400000000000000000000051351217470755400146540ustar00rootroot00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Enable debugging information gathering code for putative speed gain */ #undef GYOTO_DEBUG_ENABLED /* Suffix for Gyoto plug-ins */ #undef GYOTO_PLUGIN_SFX /* Gyoto ABI version */ #undef GYOTO_SOVERS /* Define to 1 if you have cfitsio */ #undef GYOTO_USE_CFITSIO /* Define to 1 if you have Lorene */ #undef GYOTO_USE_LORENE /* Define to 1 if you have Xerces */ #undef GYOTO_USE_XERCES /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the `sincos' function. */ #undef HAVE_SINCOS /* 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 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 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 libudunits2 */ #undef HAVE_UDUNITS /* 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 /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to `unsigned int' if does not define. */ #undef size_t Gyoto-0.1.0/config.sub000077500000000000000000001053271217470755400146200ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Gyoto-0.1.0/configure000077500000000000000000023074231217470755400145470ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Gyoto 0.1.0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -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" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: gyoto@sympa.obspm.fr about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Gyoto' PACKAGE_TARNAME='gyoto' PACKAGE_VERSION='0.1.0' PACKAGE_STRING='Gyoto 0.1.0' PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' PACKAGE_URL='' ac_unique_file="include/GyotoKerrKS.h" # 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 mySUBDIRS pkg_libs pkg_cflags pkg_requires LORENELDFLAGS LORENECPPFLAGS HAVE_LORENE_FALSE HAVE_LORENE_TRUE HOME_LORENE MAKE_S CFITSIOCPPFLAGS CFITSIOLDFLAGS HAVE_CFITSIO_FALSE HAVE_CFITSIO_TRUE CFITSIO_LIBS CFITSIO_CFLAGS XERCESCPPFLAGS XERCESLDFLAGS XERCES_LIBS XERCES_CFLAGS UDUNITS_CPPFLAGS UDUNITS_LDFLAGS UDUNITS_LIBS UDUNITS_CFLAGS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config POW_LIB LIBOBJS Y_INST_SITE Y_INST_HOME YORICK plugin_sfx SYS DYLIB_VAR DOXYGEN PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG sovers VERSINFO CXXCPP CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX 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 LIBTOOL am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_static enable_shared with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_native enable_hardening with_yorick with_yorick_home with_yorick_site enable_debugging enable_pthreads with_udunits with_udunits_inc with_udunits_lib with_xerces with_xerces_headers with_xerces_libs with_cfitsio with_cfitsio_headers with_cfitsio_libs with_lorene enable_doc ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR UDUNITS_CFLAGS UDUNITS_LIBS XERCES_CFLAGS XERCES_LIBS CFITSIO_CFLAGS CFITSIO_LIBS MAKE_S HOME_LORENE' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Gyoto 0.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/gyoto] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Gyoto 0.1.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared 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) --enable-native append "-march=native" to CXXFLAGS if supported --enable-hardening add warnings and hardening flags if supported --disable-debugging remove debugging code for hypothetical speed gain --disable-pthreads disable POSIX threads parallelization --disable-doc disable building documentation 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). --with-yorick[=yorick-executable] force using yorick and optionnally specify which one [default=yorick, only if found] --with-yorick-home=DIR architecture-dependent Yorick files [default: the yorick directory if it is under ${exec_prefix}, else ${exec_prefix}/lib/yorick] --with-yorick-site=DIR architecture-independent Yorick files [default: the yorick directory if it is under ${prefix}, else ${prefix}/lib/yorick] --with-udunits[=DIR] Force using udunits2 installed in a given prefix or force disable it. --with-udunits-inc=DIR path to base directory with UDUNITS headers --with-udunits-lib=LDFLAGS linker flags for udunits --with-xerces[=xerces-prefix] Force using xerces installed in a given prefix or force disable it. --with-xerces-headers=path location of xercesc include files (without trailing "/xercesc") --with-xerces-libs=path location of xercesc library files --with-cfitsio[=cfitsio-prefix] Force using cfitsio installed in a given prefix or force disable it. --with-cfitsio-headers=path location of cfitsio include files --with-cfitsio-libs=path location of cfitsio library files --with-lorene[=${HOME_LORENE}] force using the optional LORENE library, possibly specifying HOME_LORENE [default=${HOME_LORENE}] 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 CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path UDUNITS_CFLAGS C compiler flags for UDUNITS, overriding pkg-config UDUNITS_LIBS linker flags for UDUNITS, overriding pkg-config XERCES_CFLAGS C compiler flags for XERCES, overriding pkg-config XERCES_LIBS linker flags for XERCES, overriding pkg-config CFITSIO_CFLAGS C compiler flags for CFITSIO, overriding pkg-config CFITSIO_LIBS linker flags for CFITSIO, overriding pkg-config MAKE_S make command which does not print directories [[make -w]] HOME_LORENE path to Lorene build directory (see also --with-lorene) Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Gyoto configure 0.1.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_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_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_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_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 || 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_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_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_cxx_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_cxx_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_cxx_check_type # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_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_cxx_try_run # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_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_cxx_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_cxx_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Gyoto $as_me 0.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu gyoto_test_CXXFLAGS=${CXXFLAGS+set} gyoto_test_CPPFLAGS=${CPPFLAGS+set} ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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 { $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 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 : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # 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=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( 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 test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='gyoto' VERSION='0.1.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # 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_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 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' ltmain="$ac_aux_dir/ltmain.sh" # 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' 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done 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 struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=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 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" as_fn_executable_p "$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" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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" as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 ;; 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 | 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 as_fn_executable_p "$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 as_fn_executable_p "$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 ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $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=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 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 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 as_fn_executable_p "$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 as_fn_executable_p "$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_cxx_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi 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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 as_fn_executable_p "$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 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 # Set options enable_dlopen=yes # 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 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 --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 | 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 ;; 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 | 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=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 CC="$lt_save_CC" 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=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 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 ;; 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 | 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 | 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 ;; 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 | 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=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 ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_config_headers="$ac_config_headers config.h include/GyotoConfig.h" VERSINFO=1:0:0 sovers=`echo $VERSINFO | tr : .` cat >>confdefs.h <<_ACEOF #define GYOTO_SOVERS "${sovers}" _ACEOF # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $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=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 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 { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi DOXYGEN= for ac_prog in doxygen 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_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DOXYGEN="$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 DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DOXYGEN" && break done # Provide additional defaults for user variables { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts " >&5 $as_echo_n "checking whether C++ compiler accepts ... " >&6; } if ${ax_cv_check_cxxflags__+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags__=yes else ax_cv_check_cxxflags__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags__" >&5 $as_echo "$ax_cv_check_cxxflags__" >&6; } if test x"$ax_cv_check_cxxflags__" = xyes; then : : else : fi if ${CXXFLAGS+:} false; then : case " $CXXFLAGS " in *" "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains "; } >&5 (: CXXFLAGS already contains ) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \""; } >&5 (: CXXFLAGS="$CXXFLAGS ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CXXFLAGS="$CXXFLAGS " ;; esac else CXXFLAGS="" fi # Check whether --enable-native was given. if test "${enable_native+set}" = set; then : enableval=$enable_native; if test "x$enable_native" = "xyes"; then : for flag in -march=native; do as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 $as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CXXFLAGS+:} false; then : case " $CXXFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 (: CXXFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \$flag\""; } >&5 (: CXXFLAGS="$CXXFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CXXFLAGS="$CXXFLAGS $flag" ;; esac else CXXFLAGS="$flag" fi else : fi done fi fi # Check whether --enable-hardening was given. if test "${enable_hardening+set}" = set; then : enableval=$enable_hardening; if test "x$enable_hardening" = "xyes"; then : for flag in -pedantic -Wall -W -Wundef -Wshadow -Wcast-qual \ -Wcast-align -Wconversion -Winline -Wabi -Woverloaded-virtual \ -Wno-long-long -Wformat -Wformat-security -Werror=format-security \ -fstack-protector "--param ssp-buffer-size=4"; do as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 $as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CXXFLAGS+:} false; then : case " $CXXFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 (: CXXFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \$flag\""; } >&5 (: CXXFLAGS="$CXXFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CXXFLAGS="$CXXFLAGS $flag" ;; esac else CXXFLAGS="$flag" fi else : fi done for flag in -D_FORTIFY_SOURCE=2; do as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 $as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CPPFLAGS+:} false; then : case " $CPPFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains \$flag"; } >&5 (: CPPFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS \$flag\""; } >&5 (: CPPFLAGS="$CPPFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CPPFLAGS="$CPPFLAGS $flag" ;; esac else CPPFLAGS="$flag" fi else : fi done fi fi # Guess *LD_LIBRARY_PATH variable for make check SYS=other DYLIB_VAR=LD_LIBRARY_PATH case "x$target_os" in xdarwin*|xmacos) DYLIB_VAR=DYLD_LIBRARY_PATH SYS=Darwin ;; *) ;; esac plugin_sfx=so cat >>confdefs.h <<_ACEOF #define GYOTO_PLUGIN_SFX "${plugin_sfx}" _ACEOF # Used in yorick/stdplug/Makefile # Check for Yorick yorick_exe=yorick YORICK= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use yorick" >&5 $as_echo_n "checking whether to use yorick... " >&6; } # Check whether --with-yorick was given. if test "${with_yorick+set}" = set; then : withval=$with_yorick; if test "x$with_yorick" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if test "x$with_yorick" != "xyes"; then : YORICK=$with_yorick else YORICK=$yorick_exe fi if $YORICK -batch; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YORICK" >&5 $as_echo "$YORICK" >&6; } else as_fn_error $? "$YORICK does not work" "$LINENO" 5 fi fi else for ac_prog in $yorick_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_YORICK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YORICK"; then ac_cv_prog_YORICK="$YORICK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YORICK="$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 YORICK=$ac_cv_prog_YORICK if test -n "$YORICK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YORICK" >&5 $as_echo "$YORICK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YORICK" && break done fi # Only if YORICK available, check for install directories if test "x$YORICK" != "x"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking install path for Yorick platform-dependent files" >&5 $as_echo_n "checking install path for Yorick platform-dependent files... " >&6; } Y_EXE_HOME=`echo write,format=\"%s\",Y_HOME\; quit | ${YORICK}| tail -1` Y_EXE_SITE=`echo write,format=\"%s\",Y_SITE\; quit | ${YORICK}| tail -1` Y_INST_HOME= Y_INST_SITE= # Check whether --with-yorick-home was given. if test "${with_yorick_home+set}" = set; then : withval=$with_yorick_home; Y_INST_HOME=${with_yorick_home} Y_INST_SITE=${with_yorick_home} else if echo ${Y_EXE_HOME} | grep ${exec_prefix}; then : Y_INST_HOME=Y_EXE_HOME Y_INST_SITE=Y_EXE_SITE else Y_INST_HOME='${exec_prefix}/lib/yorick' Y_INST_SITE='${prefix}/lib/yorick' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Y_INST_HOME" >&5 $as_echo "$Y_INST_HOME" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking install path for Yorick platform-independent files" >&5 $as_echo_n "checking install path for Yorick platform-independent files... " >&6; } # Check whether --with-yorick-site was given. if test "${with_yorick_site+set}" = set; then : withval=$with_yorick_site; Y_INST_SITE=${with_yorick_site} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Y_INST_SITE" >&5 $as_echo "$Y_INST_SITE" >&6; } fi # Checks for libraries. { $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_cxx_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 : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi # Checks for header files. # We are not using those tests to far # AC_CHECK_HEADERS([float.h stddef.h string.h unistd.h]) # 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_cxx_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_cxx_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 ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # Checks for library functions. { $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_cxx_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 { $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_cxx_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_cxx_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_cxx_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 # other functions we may need to check for according to autoscan: # floor getcwd pow sqrt strdup for ac_func in sincos do : ac_fn_cxx_check_func "$LINENO" "sincos" "ac_cv_func_sincos" if test "x$ac_cv_func_sincos" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SINCOS 1 _ACEOF fi done pkg_requires= pkg_cflags= pkg_libs= # Enable debugging by default GYOTO_DEBUG_ENABLED=yes # Check whether --enable-debugging was given. if test "${enable_debugging+set}" = set; then : enableval=$enable_debugging; if test "x$enable_debugging" == "xno"; then : GYOTO_DEBUG_ENABLED=0 fi fi if test "x$GYOTO_DEBUG_ENABLED" == xyes; then : $as_echo "#define GYOTO_DEBUG_ENABLED 1" >>confdefs.h fi # Check for pthreads use_pthreads=yes # Check whether --enable-pthreads was given. if test "${enable_pthreads+set}" = set; then : enableval=$enable_pthreads; if test "x$enable_pthreads" = "xno"; then : use_pthreads=no fi fi if test "x$use_pthreads" = "xyes"; then : 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } 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 pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case ${host_os} in solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="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 test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case ${host_os} in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; osf* | hpux*) flag="-D_REENTRANT";; solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=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: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 fi # Check for UDUNITS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libudunits2 should be used" >&5 $as_echo_n "checking whether libudunits2 should be used... " >&6; } udunits_cppflags= udunits_ldflags= UDUNITS_CPPFLAGS= UDUNITS_LDFLAGS= # Check whether --with-udunits was given. if test "${with_udunits+set}" = set; then : withval=$with_udunits; if test "x$withval" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } elif test "x$withval" != "xyes"; then : udunits_cppflags=-I$withval/include udunits_ldflags="-L$withval/lib -ludunits2" with_udunits=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else with_udunits=check { $as_echo "$as_me:${as_lineno-$LINENO}: result: probe" >&5 $as_echo "probe" >&6; } fi have_udunits=no if test "x$with_udunits" != "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether udunits2 include path is provided" >&5 $as_echo_n "checking whether udunits2 include path is provided... " >&6; } # Check whether --with-udunits-inc was given. if test "${with_udunits_inc+set}" = set; then : withval=$with_udunits_inc; with_udunits=yes udunits_cppflags=-I${withval} { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${withval}" >&5 $as_echo "${withval}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether udunits linker flags are provided" >&5 $as_echo_n "checking whether udunits linker flags are provided... " >&6; } # Check whether --with-udunits-lib was given. if test "${with_udunits_lib+set}" = set; then : withval=$with_udunits_lib; with_udunits=yes udunits_ldflags="${withval}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 $as_echo "$withval" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Now check whether or not to use pkg-config for udunits if test "x$udunits_cppflags" == "x" \ && test "x$udunits_ldflags" == "x" \ && test "x$PKG_CONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDUNITS" >&5 $as_echo_n "checking for UDUNITS... " >&6; } if test -n "$UDUNITS_CFLAGS"; then pkg_cv_UDUNITS_CFLAGS="$UDUNITS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udunits\""; } >&5 ($PKG_CONFIG --exists --print-errors "udunits") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UDUNITS_CFLAGS=`$PKG_CONFIG --cflags "udunits" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UDUNITS_LIBS"; then pkg_cv_UDUNITS_LIBS="$UDUNITS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udunits\""; } >&5 ($PKG_CONFIG --exists --print-errors "udunits") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UDUNITS_LIBS=`$PKG_CONFIG --libs "udunits" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UDUNITS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udunits" 2>&1` else UDUNITS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udunits" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UDUNITS_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: udunits.pc not found" >&5 $as_echo "$as_me: udunits.pc not found" >&6;} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: udunits.pc not found" >&5 $as_echo "$as_me: udunits.pc not found" >&6;} else UDUNITS_CFLAGS=$pkg_cv_UDUNITS_CFLAGS UDUNITS_LIBS=$pkg_cv_UDUNITS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } pkg_requires="${pkg_requires} udunits" have_udunits=yes UDUNITS_CPPFLAGS=${UDUNITS_CFLAGS} UDUNITS_LDFLAGS=${UDUNITS_LIBS} fi fi # Failing that, check without pkg-config if test "x$have_udunits" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udunits (without pkg-config)" >&5 $as_echo_n "checking for udunits (without pkg-config)... " >&6; } TMPCPPFLAGS=$CPPFLAGS TMPCFLAGS=$CFLAGS TMPLDFLAGS=$LDFLAGS TMPLIBS=$LIBS CPPFLAGS="$TMPCPPFLAGS $udunits_cppflags" LDFLAGS="$TMPLDFLAGS $udunits_ldflags" LIBS=-ludunits2 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ut_set_error_message_handler(ut_ignore); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : have_udunits=yes { $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 rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$TMPCPPFLAGS LDFLAGS=$TMPLDFLAGS LIBS=$TMPLIBS UDUNITS_LDFLAGS="$udunits_ldflags -ludunits2" UDUNITS_CPPFLAGS="$udunits_cppflags" pkg_cflags="${pkg_cflags} ${UDUNITS_CPPFLAGS}" pkg_libs="${pkg_libs} ${UDUNITS_LDFLAGS}" fi fi if test "x$have_udunits" == "xno"; then : if test "x$with_udunits" == "xyes"; then : as_fn_error $? " **************************************** *** UDUNITS requested but not found! *** ****************************************" "$LINENO" 5 fi else use_udunits=yes $as_echo "#define HAVE_UDUNITS 1" >>confdefs.h fi # Check for Xerces-c { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libxerces should be used" >&5 $as_echo_n "checking whether libxerces should be used... " >&6; } xerces_headers= xerces_lib= XERCESCPPFLAGS= XERCESLDFLAGS= # Check whether --with-xerces was given. if test "${with_xerces+set}" = set; then : withval=$with_xerces; if test "x$with_xerces" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } elif test "x$with_xerces" != "xyes"; then : xerces_headers=-I$with_xerces/include xerces_lib=-L$with_xerces/lib with_xerces=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else with_xerces=check { $as_echo "$as_me:${as_lineno-$LINENO}: result: probe" >&5 $as_echo "probe" >&6; } fi have_xerces=no if test "x$with_xerces" != "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xerces include path is provided" >&5 $as_echo_n "checking whether xerces include path is provided... " >&6; } # Check whether --with-xerces-headers was given. if test "${with_xerces_headers+set}" = set; then : withval=$with_xerces_headers; with_xerces=yes xerces_headers=-I${with_xerces_headers} { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_xerces_headers}" >&5 $as_echo "${with_xerces_headers}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xerces library path is provided" >&5 $as_echo_n "checking whether xerces library path is provided... " >&6; } # Check whether --with-xerces-libs was given. if test "${with_xerces_libs+set}" = set; then : withval=$with_xerces_libs; with_xerces=yes xerces_lib=-L$with_xerces_libs { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xerces_libs" >&5 $as_echo "$with_xerces_libs" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Now check whether or not to use pkg-config for xerces if test "x$xerces_headers" == "x" \ && test "x$xerces_lib" == "x" \ && test "x$PKG_CONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XERCES" >&5 $as_echo_n "checking for XERCES... " >&6; } if test -n "$XERCES_CFLAGS"; then pkg_cv_XERCES_CFLAGS="$XERCES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xerces-c\""; } >&5 ($PKG_CONFIG --exists --print-errors "xerces-c") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XERCES_CFLAGS=`$PKG_CONFIG --cflags "xerces-c" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XERCES_LIBS"; then pkg_cv_XERCES_LIBS="$XERCES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xerces-c\""; } >&5 ($PKG_CONFIG --exists --print-errors "xerces-c") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XERCES_LIBS=`$PKG_CONFIG --libs "xerces-c" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XERCES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xerces-c" 2>&1` else XERCES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xerces-c" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XERCES_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: xerces-c.pc not found" >&5 $as_echo "$as_me: xerces-c.pc not found" >&6;} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: xerces-c.pc not found" >&5 $as_echo "$as_me: xerces-c.pc not found" >&6;} else XERCES_CFLAGS=$pkg_cv_XERCES_CFLAGS XERCES_LIBS=$pkg_cv_XERCES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } pkg_requires="${pkg_requires} xerces-c" have_xerces=yes XERCESCPPFLAGS=${XERCES_CFLAGS} XERCESLDFLAGS=${XERCES_LIBS} fi fi # Failing that, check without pkg-config if test "x$have_xerces" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xerces-c (without pkg-config)" >&5 $as_echo_n "checking for xerces-c (without pkg-config)... " >&6; } TMPCPPFLAGS=$CPPFLAGS TMPCFLAGS=$CFLAGS TMPLDFLAGS=$LDFLAGS TMPLIBS=$LIBS CPPFLAGS="$TMPCPPFLAGS $xerces_headers" LDFLAGS="$TMPLDFLAGS $xerces_lib" LIBS=-lxerces-c cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { xercesc::XMLPlatformUtils::Initialize(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : have_xerces=yes { $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 rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$TMPCPPFLAGS LDFLAGS=$TMPLDFLAGS LIBS=$TMPLIBS XERCESLDFLAGS="$xerces_lib -lxerces-c" XERCESCPPFLAGS="$xerces_headers" pkg_cflags="${pkg_cflags} ${XERCESCPPFLAGS}" pkg_libs="${pkg_libs} ${XERCESLDFLAGS}" fi fi if test "x$have_xerces" == "xno"; then : if test "x$with_xerces" == "xyes"; then : as_fn_error $? "xerces requested but not found" "$LINENO" 5 fi else use_xerces=yes $as_echo "#define GYOTO_USE_XERCES 1" >>confdefs.h fi # Check for CFITSIO { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcfitsio should be used" >&5 $as_echo_n "checking whether libcfitsio should be used... " >&6; } cfitsio_headers= cfitsio_lib= # Check whether --with-cfitsio was given. if test "${with_cfitsio+set}" = set; then : withval=$with_cfitsio; if test "x$with_cfitsio" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } elif test "x$with_cfitsio" != "xyes"; then : cfitsio_headers=-I$with_cfitsio/include cfitsio_lib=-L$with_cfitsio/lib with_cfitsio=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else with_cfitsio=check { $as_echo "$as_me:${as_lineno-$LINENO}: result: probe" >&5 $as_echo "probe" >&6; } fi have_cfitsio=no if test "x$with_cfitsio" != "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio include path is provided" >&5 $as_echo_n "checking whether cfitsio include path is provided... " >&6; } # Check whether --with-cfitsio-headers was given. if test "${with_cfitsio_headers+set}" = set; then : withval=$with_cfitsio_headers; with_cfitsio=yes cfitsio_headers=-I${with_cfitsio_headers} { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_cfitsio_headers}" >&5 $as_echo "${with_cfitsio_headers}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio library path is provided" >&5 $as_echo_n "checking whether cfitsio library path is provided... " >&6; } # Check whether --with-cfitsio-libs was given. if test "${with_cfitsio_libs+set}" = set; then : withval=$with_cfitsio_libs; with_cfitsio=yes cfitsio_lib=-L$with_cfitsio_libs { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cfitsio_libs" >&5 $as_echo "$with_cfitsio_libs" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Now check whether or not to use pkg-config for cfitsio if test "x$cfitsio_headers" == "x" \ && test "x$cfitsio_lib" == "x" \ && test "x$PKG_CONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFITSIO" >&5 $as_echo_n "checking for CFITSIO... " >&6; } if test -n "$CFITSIO_CFLAGS"; then pkg_cv_CFITSIO_CFLAGS="$CFITSIO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cfitsio\""; } >&5 ($PKG_CONFIG --exists --print-errors "cfitsio") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CFITSIO_CFLAGS=`$PKG_CONFIG --cflags "cfitsio" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CFITSIO_LIBS"; then pkg_cv_CFITSIO_LIBS="$CFITSIO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cfitsio\""; } >&5 ($PKG_CONFIG --exists --print-errors "cfitsio") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CFITSIO_LIBS=`$PKG_CONFIG --libs "cfitsio" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CFITSIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cfitsio" 2>&1` else CFITSIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cfitsio" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CFITSIO_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: cfitsio.pc not found" >&5 $as_echo "$as_me: cfitsio.pc not found" >&6;} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: cfitsio.pc not found" >&5 $as_echo "$as_me: cfitsio.pc not found" >&6;} else CFITSIO_CFLAGS=$pkg_cv_CFITSIO_CFLAGS CFITSIO_LIBS=$pkg_cv_CFITSIO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } pkg_requires="${pkg_requires} cfitsio" have_cfitsio=yes CFITSIOCPPFLAGS=${CFITSIO_CFLAGS} CFITSIOLDFLAGS=${CFITSIO_LIBS} fi fi # Failing that, check without pkg-config if test "x$have_cfitsio" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfitsio (without pkg-config)" >&5 $as_echo_n "checking for cfitsio (without pkg-config)... " >&6; } TMPCPPFLAGS=$CPPFLAGS CPPFLAGS="$TMPCPPFLAGS $cfitsio_headers" TMPLDFLAGS=$LDFLAGS LDFLAGS="$TMPLDFLAGS $cfitsio_lib" TMPLIBS=$LIBS LIBS=-lcfitsio cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { fitsfile* fptr=NULL; std::string file=""; int status=0; fits_open_file(&fptr, file.c_str(), 0, &status); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : have_cfitsio=yes { $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 rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$TMPCPPFLAGS LDFLAGS=$TMPLDFLAGS LIBS=$TMPLIBS CFITSIOLDFLAGS="$cfitsio_lib -lcfitsio" CFITSIOCPPFLAGS="$cfitsio_headers" pkg_cflags="${pkg_cflags} ${CFITSIOCPPFLAGS}" pkg_libs="${pkg_libs} ${CFITSIOLDFLAGS}" fi fi if test "x$have_cfitsio" == "xno"; then : if test "x$with_cfitsio" == "xyes"; then : as_fn_error $? "cfitsio requested but not found" "$LINENO" 5 fi else use_cfitsio=yes $as_echo "#define GYOTO_USE_CFITSIO 1" >>confdefs.h fi if test "x$have_cfitsio" == "xyes"; then HAVE_CFITSIO_TRUE= HAVE_CFITSIO_FALSE='#' else HAVE_CFITSIO_TRUE='#' HAVE_CFITSIO_FALSE= fi # Check for LORENE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LORENE" >&5 $as_echo_n "checking for LORENE... " >&6; } if test "x$MAKE_S" = "x"; then : MAKE_S="make -s" fi # first check whether LORENE is required and get HOME_LORENE require_lorene=no # Check whether --with-lorene was given. if test "${with_lorene+set}" = set; then : withval=$with_lorene; if test "x$with_lorene" == "xno"; then : HOME_LORENE="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } elif test "x$with_lorene" == "xyes"; then : require_lorene=yes if test "x$HOME_LORENE" != "x"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOME_LORENE" >&5 $as_echo "$HOME_LORENE" >&6; } else as_fn_error $? "--with-lorene passed with no path: please specify LORENE path either using the HOME_LORENE environment variable or --with-lorene=." "$LINENO" 5 fi else require_lorene=yes HOME_LORENE="$with_lorene" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOME_LORENE" >&5 $as_echo "$HOME_LORENE" >&6; } fi else if test "x$HOME_LORENE" != "x"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOME_LORENE" >&5 $as_echo "$HOME_LORENE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # then check whether LORENE is actually installed in HOME_LORENE # finally output HOME_LORENE if test "x$HOME_LORENE" != "x"; then HAVE_LORENE_TRUE= HAVE_LORENE_FALSE='#' else HAVE_LORENE_TRUE='#' HAVE_LORENE_FALSE= fi if test "x$HOME_LORENE" != "x"; then : if test ! -r ${HOME_LORENE}/local_settings; then : as_fn_error $? "${HOME_LORENE}/local_settings not found" "$LINENO" 5 fi cat >conftest.make <<_ACEOF include \$(HOME_LORENE)/local_settings conftest.make: touch conftest.make %: conftest.make @echo \$(\$@) _ACEOF LORENELDFLAGS="-L$HOME_LORENE/Lib -llorene -llorenef77" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LAPACK | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_GSL | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_PGPLOT | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LORENE | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_CXX | tr -d '\n\r'`" LORENECPPFLAGS=`$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make INC | tr -d '\n\r'` LORENECPPFLAGS="$LORENECPPFLAGS" $as_echo "#define GYOTO_USE_LORENE 1" >>confdefs.h rm conftest.make pkg_cflags="${pkg_cflags} ${LORENECPPFLAGS}" pkg_libss="${pkg_libss} ${LORENELDFLAGS}" fi # disable doc # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : enableval=$enable_doc; if test "x$enable_doc" == "xyes"; then : mkdoc=yes elif test "x$enable_doc" == "xno"; then : mkdoc=no else as_fn_error $? "Please set --disable-doc or --enable-doc only to \`\`yes'' or \`\`no''" "$LINENO" 5 fi else mkdoc=yes fi # Finalization: select output files, subdirs etc. mySUBDIRS="lib" if test "x$use_xerces" != "x" && test "x$use_cfitsio" != "x"; then : mySUBDIRS="$mySUBDIRS bin" fi ac_config_files="$ac_config_files Makefile bin/Makefile doc/Makefile lib/Makefile lib/gyoto.pc lib/gyoto-uninstalled.pc" if test "x$YORICK" != "x"; then : mySUBDIRS="$mySUBDIRS yorick" ac_config_files="$ac_config_files yorick/Makefile" ac_config_files="$ac_config_files yorick/stdplug/Makefile" ac_config_files="$ac_config_files yorick/gyoto.info" fi if test "x$DOXYGEN" != "x" && test "x$mkdoc" == "xyes"; then : mySUBDIRS="$mySUBDIRS doc" fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__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__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 "${HAVE_CFITSIO_TRUE}" && test -z "${HAVE_CFITSIO_FALSE}"; then as_fn_error $? "conditional \"HAVE_CFITSIO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LORENE_TRUE}" && test -z "${HAVE_LORENE_FALSE}"; then as_fn_error $? "conditional \"HAVE_LORENE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Gyoto $as_me 0.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Gyoto config.status 0.1.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $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' YORICK=$YORICK YORICK=$YORICK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "include/GyotoConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/GyotoConfig.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/gyoto.pc") CONFIG_FILES="$CONFIG_FILES lib/gyoto.pc" ;; "lib/gyoto-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES lib/gyoto-uninstalled.pc" ;; "yorick/Makefile") CONFIG_FILES="$CONFIG_FILES yorick/Makefile" ;; "yorick/stdplug/Makefile") CONFIG_FILES="$CONFIG_FILES yorick/stdplug/Makefile" ;; "yorick/gyoto.info") CONFIG_FILES="$CONFIG_FILES yorick/gyoto.info" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # 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 static libraries. build_old_libs=$enable_static # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # 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 ;; "yorick/Makefile":F) oldpwd=`pwd` cd yorick $YORICK -batch make.i cd $oldpwd ;; "yorick/stdplug/Makefile":F) oldpwd=`pwd` cd yorick/stdplug $YORICK -batch make.i cd $oldpwd ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test "x$have_xerces" == "xno" || test "x$have_cfitsio" == "xno" ; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building without xerces-c and/or cfitsio. *** The gyoto executable will not be built! *** Gyoto can still be used as a C++ library and through the Yorick plug-in (although without XML support and/or without certain object types). " >&5 $as_echo "$as_me: WARNING: Building without xerces-c and/or cfitsio. *** The gyoto executable will not be built! *** Gyoto can still be used as a C++ library and through the Yorick plug-in (although without XML support and/or without certain object types). " >&2;} fi if test "x$have_udunits" == "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building without udunits *** Unit conversions disabled *** " >&5 $as_echo "$as_me: WARNING: Building without udunits *** Unit conversions disabled *** " >&2;} fi Gyoto-0.1.0/configure.ac000066400000000000000000000446211217470755400151220ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([Gyoto], [0.1.0], [gyoto@sympa.obspm.fr]) gyoto_test_CXXFLAGS=${CXXFLAGS+set} gyoto_test_CPPFLAGS=${CPPFLAGS+set} AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([include/GyotoKerrKS.h]) AC_CONFIG_MACRO_DIR([m4]) AC_LANG(C++) LT_INIT([dlopen disable-static]) AC_CONFIG_HEADERS([config.h include/GyotoConfig.h]) VERSINFO=1:0:0 sovers=`echo $VERSINFO | tr : .` AC_SUBST([VERSINFO]) AC_SUBST([sovers]) AC_DEFINE_UNQUOTED([GYOTO_SOVERS], ["${sovers}"], [Gyoto ABI version]) # Checks for programs. AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG([]) DOXYGEN= AC_CHECK_PROGS([DOXYGEN], [doxygen]) # Provide additional defaults for user variables AC_ARG_ENABLE([native], [AC_HELP_STRING([--enable-native], [append "-march=native" to CXXFLAGS if supported])], [AS_IF([test "x$enable_native" = "xyes"], [AX_APPEND_COMPILE_FLAGS([[-march=native]])])]) AC_ARG_ENABLE([hardening], [AS_HELP_STRING([--enable-hardening], [add warnings and hardening flags if supported])], [AS_IF([test "x$enable_hardening" = "xyes"], [AX_APPEND_COMPILE_FLAGS([-pedantic -Wall -W -Wundef -Wshadow -Wcast-qual \ -Wcast-align -Wconversion -Winline -Wabi -Woverloaded-virtual \ -Wno-long-long -Wformat -Wformat-security -Werror=format-security \ -fstack-protector "--param ssp-buffer-size=4"]) AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2], [CPPFLAGS]) ]) ] ) # Guess *LD_LIBRARY_PATH variable for make check AC_SUBST([target_os]) SYS=other DYLIB_VAR=LD_LIBRARY_PATH case "x$target_os" in xdarwin*|xmacos) DYLIB_VAR=DYLD_LIBRARY_PATH SYS=Darwin ;; *) ;; esac plugin_sfx=so AC_DEFINE_UNQUOTED([GYOTO_PLUGIN_SFX],["${plugin_sfx}"], [Suffix for Gyoto plug-ins]) AC_SUBST([DYLIB_VAR]) # Used in yorick/stdplug/Makefile AC_SUBST([SYS]) AC_SUBST([plugin_sfx]) # Check for Yorick yorick_exe=yorick YORICK= AC_MSG_CHECKING([whether to use yorick]) AC_ARG_WITH([yorick], [AC_HELP_STRING([--with-yorick[[=yorick-executable]]], [force using yorick and optionnally specify which one [default=yorick, only if found]])], [AS_IF([test "x$with_yorick" == "xno"], [AC_MSG_RESULT([no])], [AS_IF([test "x$with_yorick" != "xyes"], [YORICK=$with_yorick], [YORICK=$yorick_exe]) AS_IF([$YORICK -batch], [AC_MSG_RESULT([$YORICK])], [AC_MSG_ERROR([$YORICK does not work])]) ]) AC_SUBST([YORICK]) ], [AC_CHECK_PROGS([YORICK],$yorick_exe)] ) # Only if YORICK available, check for install directories AS_IF([test "x$YORICK" != "x"], [AC_MSG_CHECKING([install path for Yorick platform-dependent files]) Y_EXE_HOME=`echo write,format=\"%s\",Y_HOME\; quit | ${YORICK}| tail -1` Y_EXE_SITE=`echo write,format=\"%s\",Y_SITE\; quit | ${YORICK}| tail -1` Y_INST_HOME= Y_INST_SITE= AC_ARG_WITH([yorick-home], [AC_HELP_STRING([--with-yorick-home=DIR], [architecture-dependent Yorick files [default: the yorick directory if it is under ${exec_prefix}, else ${exec_prefix}/lib/yorick]])], [Y_INST_HOME=${with_yorick_home} Y_INST_SITE=${with_yorick_home} ], [AS_IF([echo ${Y_EXE_HOME} | grep ${exec_prefix}], [Y_INST_HOME=Y_EXE_HOME Y_INST_SITE=Y_EXE_SITE], [Y_INST_HOME='${exec_prefix}/lib/yorick' Y_INST_SITE='${prefix}/lib/yorick'] )]) AC_MSG_RESULT([$Y_INST_HOME]) AC_SUBST([Y_INST_HOME]) AC_MSG_CHECKING([install path for Yorick platform-independent files]) AC_ARG_WITH([yorick-site], [AC_HELP_STRING([--with-yorick-site=DIR], [architecture-independent Yorick files [default: the yorick directory if it is under ${prefix}, else ${prefix}/lib/yorick]]) ], [Y_INST_SITE=${with_yorick_site}]) AC_MSG_RESULT([$Y_INST_SITE]) AC_SUBST([Y_INST_SITE]) ] ) # Checks for libraries. AC_CHECK_LIB([dl], [dlopen]) # Checks for header files. # We are not using those tests to far # AC_CHECK_HEADERS([float.h stddef.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_HEADER_STDBOOL AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_FUNC_STRTOD # other functions we may need to check for according to autoscan: # floor getcwd pow sqrt strdup AC_CHECK_FUNCS([sincos]) pkg_requires= pkg_cflags= pkg_libs= # Enable debugging by default GYOTO_DEBUG_ENABLED=yes AC_ARG_ENABLE([debugging], [AS_HELP_STRING([--disable-debugging], [remove debugging code for hypothetical speed gain])], [AS_IF([test "x$enable_debugging" == "xno"], [GYOTO_DEBUG_ENABLED=0]) ]) AS_IF([test "x$GYOTO_DEBUG_ENABLED" == xyes], [AC_DEFINE([GYOTO_DEBUG_ENABLED], [1], [Enable debugging information gathering code for putative speed gain]) ] ) # Check for pthreads use_pthreads=yes AC_ARG_ENABLE([pthreads], [AS_HELP_STRING([--disable-pthreads], [disable POSIX threads parallelization])], [AS_IF([test "x$enable_pthreads" = "xno"], [use_pthreads=no])]) AS_IF([test "x$use_pthreads" = "xyes"], [AX_PTHREAD]) # Check for UDUNITS AC_MSG_CHECKING([whether libudunits2 should be used]) udunits_cppflags= udunits_ldflags= UDUNITS_CPPFLAGS= UDUNITS_LDFLAGS= AC_ARG_WITH( [udunits], [AS_HELP_STRING( [--with-udunits[[=DIR]]], [Force using udunits2 installed in a given prefix or force disable it.])], [ AS_IF([test "x$withval" == "xno"], [AC_MSG_RESULT(no)], [test "x$withval" != "xyes"], [udunits_cppflags=-I$withval/include udunits_ldflags="-L$withval/lib -ludunits2" with_udunits=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)]) ], [with_udunits=check AC_MSG_RESULT(probe) ] ) have_udunits=no AS_IF([test "x$with_udunits" != "xno"], [ AC_MSG_CHECKING(whether udunits2 include path is provided) AC_ARG_WITH([udunits-inc], [AS_HELP_STRING([--with-udunits-inc=DIR], [path to base directory with UDUNITS headers])], [with_udunits=yes udunits_cppflags=-I${withval} AC_MSG_RESULT([${withval}])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING(whether udunits linker flags are provided) AC_ARG_WITH([udunits-lib], [AS_HELP_STRING([--with-udunits-lib=LDFLAGS], [linker flags for udunits])], [with_udunits=yes udunits_ldflags="${withval}" AC_MSG_RESULT([$withval])], [AC_MSG_RESULT([no])]) # Now check whether or not to use pkg-config for udunits AS_IF([test "x$udunits_cppflags" == "x" \ && test "x$udunits_ldflags" == "x" \ && test "x$PKG_CONFIG" != "x"], [PKG_CHECK_MODULES([UDUNITS], [udunits], [pkg_requires="${pkg_requires} udunits" have_udunits=yes UDUNITS_CPPFLAGS=${UDUNITS_CFLAGS} UDUNITS_LDFLAGS=${UDUNITS_LIBS} ], [AC_MSG_NOTICE([udunits.pc not found]) ] ) ], []) # Failing that, check without pkg-config AS_IF([test "x$have_udunits" == "xno"], [AC_MSG_CHECKING([for udunits (without pkg-config)]) TMPCPPFLAGS=$CPPFLAGS TMPCFLAGS=$CFLAGS TMPLDFLAGS=$LDFLAGS TMPLIBS=$LIBS CPPFLAGS="$TMPCPPFLAGS $udunits_cppflags" LDFLAGS="$TMPLDFLAGS $udunits_ldflags" LIBS=-ludunits2 AC_TRY_LINK( [#include ], [ut_set_error_message_handler(ut_ignore);], [have_udunits=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CPPFLAGS=$TMPCPPFLAGS LDFLAGS=$TMPLDFLAGS LIBS=$TMPLIBS UDUNITS_LDFLAGS="$udunits_ldflags -ludunits2" UDUNITS_CPPFLAGS="$udunits_cppflags" pkg_cflags="${pkg_cflags} ${UDUNITS_CPPFLAGS}" pkg_libs="${pkg_libs} ${UDUNITS_LDFLAGS}" ]) ], [] ) AS_IF([test "x$have_udunits" == "xno"], [ AS_IF([test "x$with_udunits" == "xyes"], [AC_MSG_ERROR([ **************************************** *** UDUNITS requested but not found! *** ****************************************]) ] ) ], [use_udunits=yes AC_DEFINE([HAVE_UDUNITS], [1], [Define to 1 if you have libudunits2])] ) AC_SUBST([UDUNITS_LDFLAGS]) AC_SUBST([UDUNITS_CPPFLAGS]) # Check for Xerces-c AC_MSG_CHECKING([whether libxerces should be used]) xerces_headers= xerces_lib= XERCESCPPFLAGS= XERCESLDFLAGS= AC_ARG_WITH( [xerces], [AS_HELP_STRING( [--with-xerces[[=xerces-prefix]]], [Force using xerces installed in a given prefix or force disable it.])], [ AS_IF([test "x$with_xerces" == "xno"], [AC_MSG_RESULT(no)], [test "x$with_xerces" != "xyes"], [xerces_headers=-I$with_xerces/include xerces_lib=-L$with_xerces/lib with_xerces=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)]) ], [with_xerces=check AC_MSG_RESULT(probe) ] ) have_xerces=no AS_IF([test "x$with_xerces" != "xno"], [ AC_MSG_CHECKING(whether xerces include path is provided) AC_ARG_WITH([xerces-headers], [AS_HELP_STRING([--with-xerces-headers=path], [location of xercesc include files (without trailing "/xercesc")])], [with_xerces=yes xerces_headers=-I${with_xerces_headers} AC_MSG_RESULT([${with_xerces_headers}])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING(whether xerces library path is provided) AC_ARG_WITH([xerces-libs], [AS_HELP_STRING([--with-xerces-libs=path], [location of xercesc library files])], [with_xerces=yes xerces_lib=-L$with_xerces_libs AC_MSG_RESULT([$with_xerces_libs])], [AC_MSG_RESULT([no])]) # Now check whether or not to use pkg-config for xerces AS_IF([test "x$xerces_headers" == "x" \ && test "x$xerces_lib" == "x" \ && test "x$PKG_CONFIG" != "x"], [PKG_CHECK_MODULES([XERCES], [xerces-c], [pkg_requires="${pkg_requires} xerces-c" have_xerces=yes XERCESCPPFLAGS=${XERCES_CFLAGS} XERCESLDFLAGS=${XERCES_LIBS} ], [AC_MSG_NOTICE([xerces-c.pc not found]) ] ) ], []) # Failing that, check without pkg-config AS_IF([test "x$have_xerces" == "xno"], [AC_MSG_CHECKING([for xerces-c (without pkg-config)]) TMPCPPFLAGS=$CPPFLAGS TMPCFLAGS=$CFLAGS TMPLDFLAGS=$LDFLAGS TMPLIBS=$LIBS CPPFLAGS="$TMPCPPFLAGS $xerces_headers" LDFLAGS="$TMPLDFLAGS $xerces_lib" LIBS=-lxerces-c AC_TRY_LINK( [#include ], [xercesc::XMLPlatformUtils::Initialize();], [have_xerces=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CPPFLAGS=$TMPCPPFLAGS LDFLAGS=$TMPLDFLAGS LIBS=$TMPLIBS XERCESLDFLAGS="$xerces_lib -lxerces-c" XERCESCPPFLAGS="$xerces_headers" pkg_cflags="${pkg_cflags} ${XERCESCPPFLAGS}" pkg_libs="${pkg_libs} ${XERCESLDFLAGS}" ]) ], [] ) AS_IF([test "x$have_xerces" == "xno"], [ AS_IF([test "x$with_xerces" == "xyes"], [AC_MSG_ERROR([xerces requested but not found]) ] ) ], [use_xerces=yes AC_DEFINE([GYOTO_USE_XERCES], [1], [Define to 1 if you have Xerces])] ) AC_SUBST([XERCESLDFLAGS]) AC_SUBST([XERCESCPPFLAGS]) # Check for CFITSIO AC_MSG_CHECKING(whether libcfitsio should be used) cfitsio_headers= cfitsio_lib= AC_ARG_WITH( [cfitsio], [AS_HELP_STRING( [--with-cfitsio[[=cfitsio-prefix]]], [Force using cfitsio installed in a given prefix or force disable it.])], [ AS_IF([test "x$with_cfitsio" == "xno"], [AC_MSG_RESULT(no)], [test "x$with_cfitsio" != "xyes"], [cfitsio_headers=-I$with_cfitsio/include cfitsio_lib=-L$with_cfitsio/lib with_cfitsio=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)]) ], [with_cfitsio=check AC_MSG_RESULT(probe) ] ) have_cfitsio=no AS_IF([test "x$with_cfitsio" != "xno"], [ AC_MSG_CHECKING(whether cfitsio include path is provided) AC_ARG_WITH([cfitsio-headers], [AS_HELP_STRING([--with-cfitsio-headers=path], [location of cfitsio include files])], [with_cfitsio=yes cfitsio_headers=-I${with_cfitsio_headers} AC_MSG_RESULT([${with_cfitsio_headers}])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING(whether cfitsio library path is provided) AC_ARG_WITH([cfitsio-libs], [AS_HELP_STRING([--with-cfitsio-libs=path], [location of cfitsio library files])], [with_cfitsio=yes cfitsio_lib=-L$with_cfitsio_libs AC_MSG_RESULT([$with_cfitsio_libs])], [AC_MSG_RESULT([no])]) # Now check whether or not to use pkg-config for cfitsio AS_IF([test "x$cfitsio_headers" == "x" \ && test "x$cfitsio_lib" == "x" \ && test "x$PKG_CONFIG" != "x"], [PKG_CHECK_MODULES([CFITSIO], [cfitsio], [pkg_requires="${pkg_requires} cfitsio" have_cfitsio=yes CFITSIOCPPFLAGS=${CFITSIO_CFLAGS} CFITSIOLDFLAGS=${CFITSIO_LIBS} ], [AC_MSG_NOTICE([cfitsio.pc not found]) ] ) ], []) # Failing that, check without pkg-config AS_IF([test "x$have_cfitsio" == "xno"], [AC_MSG_CHECKING([for cfitsio (without pkg-config)]) TMPCPPFLAGS=$CPPFLAGS CPPFLAGS="$TMPCPPFLAGS $cfitsio_headers" TMPLDFLAGS=$LDFLAGS LDFLAGS="$TMPLDFLAGS $cfitsio_lib" TMPLIBS=$LIBS LIBS=-lcfitsio AC_TRY_LINK( [#include #include ], [fitsfile* fptr=NULL; std::string file=""; int status=0; fits_open_file(&fptr, file.c_str(), 0, &status);], [have_cfitsio=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CPPFLAGS=$TMPCPPFLAGS LDFLAGS=$TMPLDFLAGS LIBS=$TMPLIBS CFITSIOLDFLAGS="$cfitsio_lib -lcfitsio" CFITSIOCPPFLAGS="$cfitsio_headers" pkg_cflags="${pkg_cflags} ${CFITSIOCPPFLAGS}" pkg_libs="${pkg_libs} ${CFITSIOLDFLAGS}" ] ) ], [] ) AS_IF([test "x$have_cfitsio" == "xno"], [AS_IF([test "x$with_cfitsio" == "xyes"], [AC_MSG_ERROR([cfitsio requested but not found]) ] ) ], [use_cfitsio=yes AC_DEFINE([GYOTO_USE_CFITSIO], [1], [Define to 1 if you have cfitsio]) ] ) AM_CONDITIONAL([HAVE_CFITSIO], [test "x$have_cfitsio" == "xyes"]) AC_SUBST([CFITSIOLDFLAGS]) AC_SUBST([CFITSIOCPPFLAGS]) # Check for LORENE AC_MSG_CHECKING([for LORENE]) AC_ARG_VAR([MAKE_S], [make command which does not print directories [[make -w]]]) AS_IF([test "x$MAKE_S" = "x"], [MAKE_S="make -s"]) AC_ARG_VAR([HOME_LORENE], [path to Lorene build directory (see also --with-lorene)]) # first check whether LORENE is required and get HOME_LORENE require_lorene=no AC_ARG_WITH([lorene], [AS_HELP_STRING([--with-lorene[[=${HOME_LORENE}]]], [force using the optional LORENE library, possibly specifying HOME_LORENE [default=${HOME_LORENE}]])], [AS_IF([test "x$with_lorene" == "xno"], [HOME_LORENE="" AC_MSG_RESULT([no]) ], [test "x$with_lorene" == "xyes"], [require_lorene=yes AS_IF([test "x$HOME_LORENE" != "x"], [AC_MSG_RESULT($HOME_LORENE)], [AC_MSG_ERROR([--with-lorene passed with no path: please specify LORENE path either using the HOME_LORENE environment variable or --with-lorene=.])]) ], [require_lorene=yes HOME_LORENE="$with_lorene" AC_MSG_RESULT($HOME_LORENE) ]) ], [AS_IF([test "x$HOME_LORENE" != "x"], [AC_MSG_RESULT($HOME_LORENE)], [AC_MSG_RESULT([no])]) ] ) # then check whether LORENE is actually installed in HOME_LORENE # finally output HOME_LORENE AC_SUBST([HOME_LORENE]) AM_CONDITIONAL([HAVE_LORENE], [test "x$HOME_LORENE" != "x"]) AS_IF([test "x$HOME_LORENE" != "x"], [ AS_IF([test ! -r ${HOME_LORENE}/local_settings], [AC_MSG_ERROR([${HOME_LORENE}/local_settings not found])]) cat >conftest.make <<_ACEOF include \$(HOME_LORENE)/local_settings conftest.make: touch conftest.make %: conftest.make @echo \$(\$@) _ACEOF LORENELDFLAGS="-L$HOME_LORENE/Lib -llorene -llorenef77" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LAPACK | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_GSL | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_PGPLOT | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LORENE | tr -d '\n\r'`" LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_CXX | tr -d '\n\r'`" LORENECPPFLAGS=`$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make INC | tr -d '\n\r'` LORENECPPFLAGS="$LORENECPPFLAGS" AC_DEFINE([GYOTO_USE_LORENE], [1], [Define to 1 if you have Lorene]) rm conftest.make AC_SUBST([LORENECPPFLAGS]) AC_SUBST([LORENELDFLAGS]) pkg_cflags="${pkg_cflags} ${LORENECPPFLAGS}" pkg_libss="${pkg_libss} ${LORENELDFLAGS}" ] ) # disable doc AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc], [disable building documentation])], [AS_IF([test "x$enable_doc" == "xyes"], [mkdoc=yes], [test "x$enable_doc" == "xno"], [mkdoc=no], [AC_MSG_ERROR([Please set --disable-doc or --enable-doc only to ``yes'' or ``no''])]) ], [mkdoc=yes]) # Finalization: select output files, subdirs etc. AC_SUBST([pkg_requires]) AC_SUBST([pkg_cflags]) AC_SUBST([pkg_libs]) mySUBDIRS="lib" AS_IF([test "x$use_xerces" != "x" && test "x$use_cfitsio" != "x"], [mySUBDIRS="$mySUBDIRS bin"]) AC_CONFIG_FILES([Makefile bin/Makefile doc/Makefile lib/Makefile lib/gyoto.pc lib/gyoto-uninstalled.pc ]) AS_IF([test "x$YORICK" != "x"], [mySUBDIRS="$mySUBDIRS yorick" AC_CONFIG_FILES([yorick/Makefile], [oldpwd=`pwd` cd yorick $YORICK -batch make.i cd $oldpwd], YORICK=$YORICK) AC_CONFIG_FILES([yorick/stdplug/Makefile], [oldpwd=`pwd` cd yorick/stdplug $YORICK -batch make.i cd $oldpwd], YORICK=$YORICK) AC_CONFIG_FILES([yorick/gyoto.info]) ] ) AS_IF([test "x$DOXYGEN" != "x" && test "x$mkdoc" == "xyes"], [mySUBDIRS="$mySUBDIRS doc"]) AC_SUBST([mySUBDIRS]) AC_OUTPUT AS_IF([test "x$have_xerces" == "xno" || test "x$have_cfitsio" == "xno" ], [ AC_MSG_WARN( [ Building without xerces-c and/or cfitsio. *** The gyoto executable will not be built! *** Gyoto can still be used as a C++ library and through the Yorick plug-in (although without XML support and/or without certain object types). ]) ]) AS_IF([test "x$have_udunits" == "xno"], [ AC_MSG_WARN( [ Building without udunits *** Unit conversions disabled *** ]) ]) Gyoto-0.1.0/depcomp000077500000000000000000000506431217470755400142120ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: Gyoto-0.1.0/doc/000077500000000000000000000000001217470755400133725ustar00rootroot00000000000000Gyoto-0.1.0/doc/Makefile.in000066400000000000000000000001651217470755400154410ustar00rootroot00000000000000SHELL=/bin/sh all: doc doc: ../include/*.h doxygen doxyfile distclean clean: rm -fr html latex rm -fr *~ %: ; Gyoto-0.1.0/doc/Makefile.old000066400000000000000000000001331217470755400156040ustar00rootroot00000000000000SHELL=/bin/sh doc: ../include/*.h doxygen doxyfile clean: rm -fr html latex rm -fr *~ Gyoto-0.1.0/doc/doxyfile000066400000000000000000001737541217470755400151610ustar00rootroot00000000000000# Doxyfile 1.5.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = Gyoto # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, # Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = YES # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C EXTENSION_MAPPING = h=C++ C=C++ # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = images # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which # disables this behavior completely. For backwards compatibility with previous # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE # respectively. GENERATE_TREEVIEW = NONE # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = DOXYGEN_RUN GYOTO_USE_XERCES # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Options related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO Gyoto-0.1.0/doc/examples/000077500000000000000000000000001217470755400152105ustar00rootroot00000000000000Gyoto-0.1.0/doc/examples/example-complex-astrobj.xml000066400000000000000000000056161217470755400225040ustar00rootroot00000000000000 0. 1000. 100. 1.22 0. 0.314159265358979323846264338327950288419716 32 2.0e-6 2.4e-6 2. 0. 0. 0.037037 600. 9. 1.5707999999999999741 0 0 0.001 0 0.01 2. 0. 0. 0.037037 650. 9. 1.5707999999999999741 0 0 0 0 1 1. 0. 0. 0.037037 550. 9. 1.5707999999999999741 0 0 1e-4 0 1 2. 0. 0. 0.037037 550. 9. 1.5707999999999999741 0 0 1e-3 0 0.1 9 1. 0. 1e-2 0. 1e-3 12 0 0 0 0 0.001 0 0.01 10000. Spectrum 0. Gyoto-0.1.0/doc/examples/example-fixed-star.xml000066400000000000000000000022421217470755400214310ustar00rootroot00000000000000 0. 4e6 8 150 90 0 0 32 12 0 0 0 0 0.001 0 0.01 1e0 0. Intensity One can also specify a unit (if Gyoto was compiled with --with-udunits): Intensity[mJy/pix²] Intensity[mJy/µas²] Intensity[J.m-2.s-1.sr-1.Hz-1] Intensity[erg.cm-2.s-1.sr-1.Hz-1] Intensity[mJy.sr-1] Intensity[Jy.sr-1] Gyoto-0.1.0/doc/examples/example-fixedstar-rotstar3_1.xml000066400000000000000000000011741217470755400233560ustar00rootroot00000000000000 resu.d 1 1000. 25. 1.57 0. 1. 32 1. 15. 1.5707999999999999741 3.1415926535897932384 Gyoto-0.1.0/doc/examples/example-moving-star.xml000066400000000000000000000016711217470755400216360ustar00rootroot00000000000000 0. 1000. 100. 0.78 0. 0.314159265358979323846264338327950288419716 128 2.0e-6 2.4e-6 2. 0. 0. 0.037037 600. 9. 1.5707999999999999741 0 6000 0 0.1 50. Spectrum 2 0. Gyoto-0.1.0/doc/examples/example-movingstar-rotstar3_1.xml000066400000000000000000000013171217470755400235550ustar00rootroot00000000000000 resu.d 1 1000. 21. 1.22 0. 0.78 32 1.5 0. 0. 0.03 0. 6. 1.5707999999999999741 0 0. Gyoto-0.1.0/doc/examples/example-page-thorne-disk-BL-with-basis.xml000066400000000000000000000027621217470755400250760ustar00rootroot00000000000000 0. 1000. 100. 0.785 0. 1.010152544552210596151553545496426522731781005859375 0. 0. 0. 0. 0. 0. -0.0141477698691514323925400020698361913673579692840576171875 0. 0. -0.01000000000000000020816681711721685132943093776702880859375 0. 0. -0.98994949366116646860547234609839506447315216064453125 0. 0. 1.570796327 0. 101 -1000. Bolometric emission, this is the default (and only intensity) for PageThorneDisk. Gyoto-0.1.0/doc/examples/example-page-thorne-disk-BL.xml000066400000000000000000000011741217470755400230220ustar00rootroot00000000000000 0. 1000. 100. 1.22 0. 0.314159265358979323846264338327950288419716 32 -1000. Bolometric emission, this is the default (and only intensity) for PageThorneDisk. Gyoto-0.1.0/doc/examples/example-page-thorne-disk-KS.xml000066400000000000000000000012441217470755400230400ustar00rootroot00000000000000 0. 1000. 93.909936 0. 34.364575 0.314159265358979323846264338327950288419716 32 -1000. Bolometric emission, this is the default (and only intensity) for PageThorneDisk. Gyoto-0.1.0/doc/examples/example-polish-doughnut.xml000066400000000000000000000051541217470755400225210ustar00rootroot00000000000000 4.31e6 This is the mass of SgrA*, in solar mass. 0. 8 The distance to SgrA*. "dmax" is a tuning parameter and is always expressed in geometrical units. 150 A reasonable field-of-view, about 15 Schwarzschild radii. 90 90° is edge-on 180 Put top on top... 0 32 0.9 1.1 2.1 2.3 2.9 3.1 This is what a real-life detector measures. Spectrum[mJy/pix²] This unit can easily be confronted to observations. We can specify the plug-in in which this Astrobj is implemented. 0.3 0.1 1e-17 g/cm³ is actually the same as kg/L, the default. 0.02 0.1 25. Set UseSpecificImpact to use the specific implementation of the Impact() method instead of Standard::Impact(). 0. Increase SafetyValue if you have trouble resolving the surface of the doughnut. Increasing SafetyValue also increases computation time. The default value is slightly more conservative. Number of subsamples to use when computing BinSpectrum. More subsamples is more accurate but slower. Those two are numerical tuning parameters: 1e0 Default (initial) step for geodesic integration 0. No light-ray will be integrated further in the past. Do we want to use multi-threading? 2 Gyoto-0.1.0/doc/examples/example-thin-disk.xml000066400000000000000000000007701217470755400212610ustar00rootroot00000000000000 0. 1000. 100. 1.22 0. 0.314159265358979323846264338327950288419716 32 3. 0. Gyoto-0.1.0/doc/examples/example-torus.xml000066400000000000000000000014741217470755400205450ustar00rootroot00000000000000 0.52 1000. 100. 0.78 0. 0.15 32 2.0e-6 2.4e-6 3.5 0.5 0. 1. 0. 1e-10 20. BinSpectrum Gyoto-0.1.0/doc/images/000077500000000000000000000000001217470755400146375ustar00rootroot00000000000000Gyoto-0.1.0/doc/images/gyotoy_screenshot.png000066400000000000000000002256211217470755400211440ustar00rootroot00000000000000PNG  IHDRt?bKGD pHYs99ٓFtIME=TtEXtCommentCreated with GIMPW IDATxwxnI6 )$P 4i"Ղ@Hõ ڻW,QZ WS& 7C*-f?5K6ɦ<@fΜ9svfwޝf8z,SԭbRmok\nUW=oS+;b  g^`0纛Sj-q\Ѿ5Nf[o:NCmn`/R2mST=Aqxk(x}urR~*g^B_#]3ԙzk*RUcK\u >mٟ+}4(""""""5jPHyvHv(ԨeKEC!X+}oWH:Z=`TWH]c?oˣv'N`/] M1EDDDDDb-qpQAzY+ "(9)lZZǏKPPMHa57'Pb7ip5@t9^ SSSY'=Zl\hHƍd2UB[{ѻ."""""R_*5úq吮nWaU?8>%%@۶mi4[$?NAjVV'NP︈H}f/|e?f`0p٥iѣG1<ٴy3)))4 nJ iB~}8p ۷ ##O7eѣZtGDDDDDD9 0تfFS۷oW,4k ?~۳ HfcuX,Z j:w5xxx`HIIa׮݌{5M6СCgd`Zٳg/m#hղ[uj ?u`0B wHw?Y[l%!1w׮]С=deecCX,lugn͔SGYjĐh6ש9r-[퍯o>>t:}zʕ?aZiҤ mڴ 88Q6)1NRR2AAAé婣H,5ڬX+0zzDs!|`lܴ`rs]ի;v$;;.]:;N' e$&%۪I=z RSO=޽Cgff&_|1///V:j@X5sa FØ~ \&\ݵZ;{#++,ԑ˨о|PZw<9N3?ľ}ٱc'pѵkG.]p$!#=v qʲun$$&bjR`QXhЎhh0d ?__:*u~~~1[4燷-[$))֭[;{zFbg7L&F~wp=""""""RaӃmZSPP@AAVSanc00xxzb20yz#NׄmϞ:|qݾ}+!ꈲ(O{DDDDDD*zԋdd2zzou8r;vjFFu="""""" a9as Omi-)jhNiGDDDDD!<;Ԇg;:lԨ""""""R(ªª(gdp$!\ӤT-uEVĤ$v;)''7,wוԣG9z:LDDDDsV׮_Ϣ%K]af-%}v[qfJ-E宻&UЋ/f]Yͷ|'X,VXW8x'=MJJ*<$ ̞7e?|_+^^ܳDa5!1_~[0}G `𠋪YwevfϝGRr2 .TZZ3?/&gW'sA@`z .Pki.+"""""R a>mվ=]xA4 /+kHLJqcٽg/:F9$l6 lv ?Ϲz^p>]p u]^WDDDDDjIb nJ^yacؑfϝǦ-[Ϸ<#bbfXiknBBB+lRNHLsؼe+qIQ~&nt={rQL*[EK"ftdFڷ$9%eyƺMrrӸ.:r0ȐA#,ݻѪeӁڷcɲR323Yf-)呓#DFD`ٱc'T:FEѲe [m㚱cA{n7o^k""""""VEuyZYF_<|Ff&eqĭXQπ&N)Jdz}NFo޶M[~W;FJͣq L}n:1 <  *6M+>F_gdO"7:MjrYDDDDDª;|f iiiU^8lI'YހZq?76/cթ~|>>t?Vce1n9]p+-)߷/KNҏvĤ$wsWΝ:˪ߝ?p# 5>T=F"#"ذiT$$֩uJDDDDDj tD<ȋHBEIػo/*cZIII%v |M/ۚu8q$c\ߴiX:ӏȈƑH~~>+/\r^d,_ӞN`#5>TX6n_';;$^1:NH  pLypWLCsc*Ux'yo4v@n?ڗmɲe`u͒e?ҳG:ӏOO7 @hHw/Suy˓?3l[nfW_UCezСݷΞìO>h42S딈a9a nSm3byX3nNBb"֬MG8m۶Nw-ba|h&rs{HIMyXA.n)tEgMuՒ Zj(ĪGD҃ʆ пF\~}rrr:dp|J qk<Rʴc4h'{&}{u(J凯w>2231ԩ#~QXS17""""""IwU; 8$$D""""5q#""""""Rx%(;`04e] =#r="ӈ(#kׯgђ};lÛW|RRS9~t4|,[4mH}ӀEDDDKHLVQXXl&+;|ˍM_~,\Ǟ|v tQ-Itd8s N_""Mfڶiɴ4n.ޛ!C.T FX-{M̧둊yvٳ.Wm*nϥw< ].""5.8(XIK/mvN4qf1w?,dM2ޝ!{ѣ %v rssy $v V;9شe 5cDL ׌x6oيjCv:i=w+qoe.=y)?JPi>)LyQN8|0}?ƌtD5Z; hLUHw~%?/\sFe[*L+ԆL ݷ 0x>?wW$&'q&hFA@&ա=i9ϩmu:j U3+5\3TZ=u9(FQw(???֬W3t1C8ۗ6[i"0 ^dμy49uUbDx2&._NAA/Q.7/#1F0p@32xhpDj%6J /-u䳏^*{$ӻseMA5z(e|WEuS_~4s{rdGNN8UȐAjaf.3HP-fc &99i\N[Bm1h1k׮aGhhS٢A`xP{eRSS k֬Z'RZt'a@{fS> Nuu";UuVLMֿem[U#""R럄k&ysZhn>7aat @~~S=M0>zX^YXVݞʲ8VpC^jߞn]pR8mC[4,4uGs}"%VQǚ<ճ*XUIMW{ޘUEOzDDDjyr l9:|eq!pf3417Ҫpeksq~XaaǩLNNBǩYUkDJRY=;`}U4T򶿡윟Y^K?@K+@޶YHM$&%ѽ]k׮PzL&V2Duh8NG.:ܜv xMb~Wƌ ټeӰu6k6ӢEx'RjI!;5nuW/>ժgw~)m{9Ǥ֣DDDFD,6DY|rӶM,V+~=;w*7038b|pQu2i{ㅗ_x,V+))ĮXpL&F6#/)6'>%//+Xt)W_yfJiHET5g6Y-:mIVpcvuru֟]ΰ~_êz/DDD꣇ᅬ?ěO]ƒgݿ /`̨|\2iڔ-V#,}=d0_:e㙧余rÃqJ1cל?`!M?c{|qAqÄU> ؇]2 eKv.wJ˺oI;pitMvsG,- ,{] )Reme7*eɻ(슈;ǏWgHZIHm۶NhV[a!X,V5#00iv; dggHXXbן⾇Y׫?#bÑiVc[ٴR7XHNKcg5U{Qћ]TE?WUKL&"#kl~F#qa0hݪUfsѦuk9Բ~tرF'Rj}jCIQWڥ0~z!""R X|^xiQgX-YQLGDDD!t( DǨ(,sɰaۣ:KnXGZgEDD!٣{eڷ}Hu9ZDDDDDDVEDDDDDDVEDDDDDDaUDDDDDDJRcn-""""0K-5."""Rjs6RO$sD*MkNL^  Cpp0:vdСt@Jj*Ǐ]aDۀ{֮_Ϣ%K}i"117w ߂[7W%6R}tY)ǒX[Nf 49=g~7d cI Xf-ﺛvҿoƌIdD~er /'RiUb6f7rm_mF@DDDꢣǓYyttT+|p^3 fU }Bigs oޜyoooqiii: tjddk8[nm6LK;⽙2AU)(ezzt͂YJtLnBA!ޗ+-qf 9<=M?wWu$&'q&hFA@&zB6ϯrF2Oj(Aff&釙|L{#sQjo6-[ӧwoG|'Ա#wyy̞;{x>xn#L_t2`QXӔiq IDATr2i[ n7a۳ `0'dpR%o㉧bK=<v܌S(EFy q>fbqݿo_ڴnSq!"#"rrsy{/6뇇Gf/C -???֬W8S  /`._}:xeLXލI '3}yڣ*"""Rؤ);`Pߖ:Q@NԽ!Or7aat 4dҵ<<< v]@OBCB5޼ga4:?ɓdegchZlڰf͈OH( 坾(Hg0 eBC,hm&?'R2mNe7 #8=ZX UURΝ{?#>L%_ЯyLzcءÇYW:ۀQ,ĜP@q72>e833ظ ^NsVEDD "++t_>Hf&FF:hb_q.dee+3N\{ydj8$&%ѽ[7koPV6K@!mmp^ٶ};tj)*`u*HC,$Lmׄ OR}>ie 83>]5:pn&dftɜرsii$$&?oh.v9mۦ ovo ,#!1|V3_|@[@NnX+'7K@5fXvŬ?!--dwUrL/%i"""Rl6"[Gq ~?\څ{l/S!9Mx/lr8W/,9>w 3ۇ /`̨|\2iڔ3[ eϩsxh6&.efep ~j0z%LKcμ|2ѩc\IۈK ͱf- 76VS]*"u3 yxxPhr4syyddAf-1<^AO Z/gZ9}maI{UI@ݐ#xxx3s$n"fSY:fADL?X,2LDX,WBHӦ4mZiM&"#Չ4J ª< qlq:cD hUg۱uMm" .,UUQXQXUi\ :ADDDDVEDDDD[zFG"u*9H]vz-Yyooo麟(W)?~svq{._oUPE]{8a6+ӻw /_<7Ei"8̖uogi EDv1_~Tf:=u6&!1gaXV:oǭ&ѣ{7b 77}yIa!7nI7ٳg/[n&v V;u$!si-4kƈ7e:3IfoWq٘юrŗ ض};' a`~L8\>WmHy&%4$o`il,_|itڅUL_ֲ?q>[IP` ;uwZVQX:"imUУ{7Z8n0%b9@+$![ɷb6,6o]t[׮DuhOZz:Gs*$&'q&hFA@&$u60y h֬ eJLNfƍ޳ƍ_㍷LJ1ݷ 0x>?wW+C5FE6y_{ k֮k?͋ൗ^~wg_"--[nЦ!;qu6`XVVE.y]u#""Yv:gdf:=}4lz}^&?91vl'cbՑRYxzz2w~n-Sn^wycF`gd9DH! ☦߾iݚ'NCN7*cw0eի'㮟K`FPPP;ӗlk;l.[}hO~}YnS9ƺMrrӸ.:r[3 42V 6sEj c܋/Jp223Yf-)呓#NA6[}8 "0 >vU=FPPPӻZVOOOZ`69#*"(\[<,s{dɏ?w~D2YVb/,{%j~:TS =">XVjsyhtWwf>U坾e}){Z[i""ØﷰZLyȩ g Π3|f iiiGNNB<̬LOZЯyLz̡ÇYvSGEU;}Iա:iiil޲K/0{^omD]#RKa>2=GDD]DMӧLJQXjlg2Z,n7Q51/W ټeӰu6k6ӢE8vĤ$wTf llgzw1dżtLlOm@ "Rm]?z*'Hk/Ȕ--&w>^xUbJ,Gm`ZٹkWwu&rA^|uGX,8x.*sZOOOy}vK^^WxR L& ,#!1|V3_|\]ww/'xڳ<, Kb16FDz&'z4TSOiAA8~A^Q#dfeҴ) >[y]0p S{>?9ˢ Kǔ:m^u>.r<3[ eϹƪ&Ka` |90i]x6ƴ_<KFl NQ;"5H]mcgj]? [ֵսU:pqunHvv65+vb+,$>>JfZYo$$HbeV+Gh۶5:j+;}zz:Gb2h6.n"fSY+u~GnժFa4:=<|}ܱcM&S身*ꨩ~􁁁eX ªH ; 8""""*Rhc?EUG]ED>d0C!*8mc \ވTB9z( VY7YiҌ6((*""O|B<&]P9{v$^aUCͬӅEDԣDn7#"RaFQ} " )*:PUרּH lF,:CDl6(U^""uZ"j%_ "5@Tk/6GhU#=ªB ECkc ""3j4WD\𥉉pMUF^kZW"'">JH "\G*\]W,V+/J嚇q\쌖V׬[=wwNPPPL;0= iJ= GKkoU`5kD>AY;9"?$tz^;v: +dcI$~7sr222yX\ueYOe_g燗;v0xblR۬^zUu6Y/biZ8_"Ӧi^ON ןak),,dZ?/N[]ddWwJ6mxlvEΝ]YD*ߥ* !MD$7nb`SB?)LyQa!7nb烙 qU\6ft |<{lbҡ};n4ݻկI7N.SRx_SZ[7of+W[&3?dϞ\:zoqgQPPju׽9;~©gwªԙԢU끈ӵ vfeL81<33_}ń 19 7{ 77~Dp$![ɷb6,6o]twߕ|N9[y///{M;<]?H֭w`6dُ۫wm53bHڴnv`UXQP* gW"̰h/]q)((`%8qw0fHOzFϞC!x|0#xxL\x@A̛KӟG_}d^ip0&~~N  g >(#=@̐!qgؔfqIBBBxȪHl6oX`G^qldX \n':*R !UDJ+׺Hͺ1h1k׮aGhhS٘C3^|Tš5c &99٩\N[}o"#"ػo^MСNNod>\_bWphw:םq#G '88v8cywxg ,yiڷ@jj wkȷXs^_oX?7c0\"""KvU*q7^4\QӭkW.Y8xwvS9|||5Q|||X,#n 2ӝϿ'}Y+;3PA’e?,6<\{6 Ɲ=d 2as}=SaUleulٺĤM`0p^ѫmDGVET3UGE+._{cǎ%4 >Nerrr:N (0 {띮)}N<;IMW_7OG/&NopYOnn|KgIJR@&4 cǮ]: Xą{9jѽ[۾ªH%TGp-Zk;j/Ļ _xuŞZXX-[۰_-2ՁUv>ז56g_7 a21_~[ث,_j;{|fVG휮%iO&$&%"%]:w-s(,,Ďn$xU ^&#G gW_著 gcѶMk~];.嚱c7Se$L{^~I'ТE8'Od_H;?^]>}t͙׳Sdu𠋸2i^y &\w-I;ƶIOK+.wk%;3l?9r$;v8ɢ%KX,\>fL#7ldNr޹AHөcg:u\}UUUDƌaW_s4mZl|^u>ӧt7L(3?yIޛ!7M1<((Ǐwߥe*Dl6?=H`3t`~0;ש_&\{S=TwdD3^z^=zPPPTY>m[Mm ">7ϛcv(- 7+40ZtYO躡uIjk>~x[?}?«/X+d2Ennn}|| ??<==1L$&%9YPl6:S///<==)6ƝiAaa!VVj3 ׼ٺm+Ǔ)MudU(K]Qu*g٘=wmZoJ-KZjUW){b`X\;;YVV+Min/V&??|6vTl2U|K ZEjϋkgE>l6[߄H75l6}UUiqc\Kmt( DǨ(,sɰaۣGwYƻ* F"5gei."wѠ*".tª4Z׺j[瑈; "Fz: F`%"CVL^ "6׿2,"!(0c':笫]wON{gyѿ]{G LJ3j9K^RVrEQ, 鄅tªH}ݘEj2EGHeon'95gŠR~X;K"Wݩ*t/K 骜zr+k0OOGAqu_[8- ;wy}D-rpUiAU;" :*"QPP@VYMqCg\>XaU]UP*"BGW4 iFmVEVAUjUۘOVva!aSE}4GPXUZۏ)h*mZ!88Ѩ)'L```fÜf&xª4PfgWm"WMb6u)Hc6v;vKQX_zfUwi|}}TE*O[OM`0`2\KaUa\nG-ZowVޭȺH Ua;sT|?!Y0\_Ǯ*6ЊH ڡڐAff&[RgT㎯mUw)zq)j,>LnntؑaC1C~">%KV[ѥ<&//>XjWvM4 .ރ3{\vލtD|Ϻ1;??mpK' IDATu'۵+qY*WNz"/>U372=vvł*@PPNg}S(V4ݳl6L&-w3>yyy2p@? qjmVʕ+4Z׺sym<4|Y>>tҙG7w*wQ#8?|<{Cat~Nn.S  /`._QjXuw1C3tc}Ҧuk:ԖN)oS#ЫWO]?0ӏj-w#--(u6ɴ,6<88BKN6 &1)Ĥ$l6c Ac6mv.Y…ȫ/gڬr+'ſG:wp}Z]4UQPF\Kb#}{wfϝ<̐ uE s/Ljj*-]d2qF#EVݙgFf&׬%%5e> s^oGPh @cUVK mxxQ7[:o?Ǟ|=5G^^3?/^^^RXXXrz`}n3ɜ~`UW*WrҸ+JgSfF aİv_`ƛo1?̧KBCBO%U?b*zyycqzNwn>7aat @~~ӴM\Y:|],!U3"[lWb2b6>{x?__2:uLgʟn߯gã7n l l(*"E+ `"TTPDPD""MPDj$HH}@-33۲<>39̙sP(m;oggGg4^)Y%Qrҁ$[6 YޓE^ GaQ.BlZ>sI J^9wp])v¢"]yY.SN RRtsJ[@W\+.FfF=;? f>LQqE9)JFZ}V&$_%j~sn$nyKf tdc/UhWHCNgرs9 FݽW/MeWONRn-;ϴώX+0b4X%*!• Xc8xU()-W+WahE6Im>^u6oABVB67k׭GIi) 6>b8=poW2x04 =tŨs/ں:>nwD9q=~o=LW\e+‘b3qYKqAV} : ]q1o܈qG\ w1TviuB=a$-E*!$܄؇7WeaOaJ]ƍu?SR00vD|{\{;hcLj4Ąqc DRڬZ٬mSScY4e*n6IM ӧ}v355Z̴ λpvn>c_K /͂r~v#яUv*!Dxuݲrk[ ,DBA!PHJGvꬳ >AK/4 !$uBBPzJMmQfطJzV =bPGpu%$Z}B** AK!*^]֙$Q*Z,B $<2B!I WɤiҐ4.ජoBﶔgbzchGs!+Yfj \-?\| 8ڱX,0nBBb+ GV+Ɋ0 ,B 11M3"U*iIJ! #^5 t%:9,FBtufTUWŠX%t!$<+eҐ,GNCT@ZF, ԕjWS U:C~IC`Zg0 PQf 6* P%B#III᳇ Uz iq K!BN 4=BB!A~*{V ώƞUP*P)VI'*!B9PJbA8GBHc.|[(*HLLt:^Ey/,zAv5+Wm;v.]0!Nz=>36L&\Ro42ӣҎu*H%+a󖟠T*qmۻkŖ?j!CX`ΨcExͷ`0-tfÓ&caHRص{7-xIIQeG;s.`) UB!_o[fX~F\q, h=V/2:ĭ6vFawb+QZZ˾:;BbX%Aip!hf@o8Q~~;wLM x}a/2?o Y>*/:GƠۆc̗vގ/p]u}rTVVg56oFA=ay\t 6}uv?G '*P%^ݺk֮5WwE7@~L )Sf|GS0zĩT03'~!\ϑo־p=oc0LQeG UBIXπ}vz{ݨ;1}3o7+Ӫ~v B ٌ}Eow"Ef̗gύ7W SպՊ355HO;Bpo _?GR\ҡX%B>^C~AUWb]էOc8Q^^Z@\!ys||j5\wڼ?B// 0řϷZPPZ̖#$tlďƅBB9O,t kGѧPT;wggسJ|"Bf@>0Lv~W]Mb+,*u+ k缊J^[L{~q&rRRtrJ?ں:8k6^5~Xn=y\}5Z@W\ꊋd;B]o]#UJKCCJ!Kзjml6JpIǎN;v"oZZz]/?e"/OwߘKLH@]qq^"E:|^;w]abGHaY%BHHLL+/Ĥ'ئjssvz`0`?/9U7|]:rzF~F ۵z>͛;x~t ~cZiE!:u !(Y,lٺepԦY%<BHFFx0JmbƎX!B,Q UB!pA i.ć}B!BVž((R !l#H@9%{V ގ֞U1(V)T ! lHC U)pp VB өTj !n$Ļ͞B 5i4G ;Dv;f9u88n's= _h C_Ή{k9x:Sy~#F\`0@ׇ|9,XP%B -ͳQZV;l6G$&F`l\R \v͏XP)T !BܩFqIIu^CQ~$NWʇ`@BB!Ǝ]0QQQ!ܕ?zr?pЫ;/2sYBJ(T !aPS[+ܼ\\:߫Y'.V`HsVDPr_B!2uu6`v,B(VI_B!pVc=1wpadff[m؈7W+Wa݆Ä'h46';(,/a8UY&*qj%`o`0YVSw1n?pχ*NΝ.?ٲm߁Ҳ2lFt˗V7_էO#M\'&Z ?2e]̴鸲KnTVUչڵkkO t~g|UH4_W`_`4)V j4O UB!Duuԓ~M7@bXa]9rAvjѷwoqzw+DNVx)8VXmn|`yHII9z>&5sfxtĨ1˾C^l3r4֭1vNb d~f3}o~ X1QK!㚫V*h'ض}NCףOEbbd2=A79Uw}n ?hղ%.*ۇ; UcG4or t~ݼ9Xj].ƍQ0*!BHX mMHHh;~܋O>_"OF^09SSɄ͛{X,hڤ۱MqRuWUW`0iL%i'!%%3f[1 =:?9=B!1UWtsS vzY$P(tp5>}XUudJ%ӧE{x@m1ΫįoŴ_g.$Ng5D*9FB!RKϫfCiY.)|Ǯ_dvm`Z65Bn9ۿ_t4UJ%e8(.)|_Gx琐·PFPlB!iɄrZb()-`~_,)ǎa(.)hğǎa6wa QYYK/`0o _ŧ/EMM JJ0slT*'oλ8tz=F#nFڋ,EbJ!Bӣ4p}ϜAfF}Gasc}dfb¸xv i^ۭ&=8zo6lz2xq?.Oo';>7܀XpJ%6ĩR>̯JŽ]˯kkԨF=wCKܵO?Qk0잳S 5uVX,Çn]¨{G a`vّ(u**!BHhQ TTT`Cl6<9i28$K\]wcт$vJxںZly `OCI&r`/c=xyJi]C7><> bBB!<->islWx7ڽ3gL \ӭLl IDAT}.)aww*lynt=CRίހ&5ЭkWCX6䖠vّh 0!BHߪxvs1<$ N,pa &5۵E\\Gnh4ճ=,OΝ:aæ[7mudu^\uEi4K:^͚a݆A3/|~XX%B "Ǐc=xzTtB{!t)Ī}U빠};+,d?ā1N>בxZiÀ !"Y8p*Kਭq7:+,b]6uQڗR:rZtXV_CR9Wm}0vZZVҲ2X,@vR~}Iq=:vbPӛkK=BH bټHP*գSbi3葘9cUc'+T*`ldš֡5ݐtlw)/gp6VkPL;HN\4]XX9%BHIMm#WpO$''A ߷}ľOU)UG'99unᵵdIqVTUUA{]3<.#'"9) Cn†MߣQFA39Qk{է| 7Qr^B!XT)[q4i2P*P*>n]q[HNNFFz:ztV0/`6wU{h\|E3%[HRr!B"tTWWBZ&m: zt:t0^;w]%Q~$܉A@Ry#i@vّ&0X1FqK!m<>}Egu6kkb?`?ȑ+nݶ {n7d`h4L{芋QQQ^| uu1|ĉr\zV} V+ Uloj ́[i;bNB!$$Ψ≉X$]4'6GN!B!!QݳZ/Y%Bi`gTUBYEkϪL!Ĩ4ԳG*j㺯*UB!! =JVAq`4 !>!zŪF 2!BHÒIC|t+F#b+a|\)2vBwL_bx [\{5F# -8qO z}HБCBYѱB!$|nҲRl߹f9"IXDa6hW!x).C/ﭼ]*)d'O ݗ-6T lmev=8]Š`)?/i4n\)V !BH1hղZ[( 8VX,0nB!$XV)8'a0X @bb"f6ENUB!zt%:9,FBtufTUWŠX B!"it(J!2Qh4QbRr@!e;-!BY3222V#j:ҳlX%B! CRR*!>P(B*=Bx8B!BH qY%B!A~*{V ]Ec*(}BH:=h4#OH@mcrzǗbUPB!1hضc'^5& M4 ӧ"urE1~8t0 xry`"d<ԓ|98 Gl<᧟d2Nb}S| ђ%8t0ЭUu$ ,\s-J67#߅ ڷ_W|TUU#51.B=N4oϟǎa?`pD+ĝCoGbbt}R1!Y%B eǏc/>XKX9♩a2b] .aDqIչիѲE6̌ Cd2N7+y7zoO }De*!$&`)B7XIj5PTHNJc>ݏ }T],Toi Oe+o);>N\?o-nmq vލ3{ K}G; އR{oMj*[׮5m-J̘ztO*:L!ϩ疛ccЃ߿rsN55l WV^Ē&̞UBHT9Bb_H! qqZFfͰmEIMj*ڷk8{)'FN}[7mud۴y34 zasNذ{w/ 4{%/FfͰnF{5ߢ>0T*hۦ T*F=% %ݻ?}/[.D*Q*utzl輲7h4 q;:'E:Ï>^GFnW_{?ā=~$۹/uAvb L&Kbp~_vAn0xy8~8Zdg[nFV+zf-Ч#4Wt^_À !QHbP eܾ4>!$rf×+~tIEaXЮmw̽ף=R4 Սo~^ݯfԣ_CRaN霪<<-tXVqZh[|ma`6" eeX,'`20z?qYNn[~W+WbάqW8,5ns^EK.-Z[j)))P*h׶-1b9IE/Z*T]F{pXO[QUU rK#99unᵵi1O'fLy/\GODrRr3.h_ ?%90[q4NIMEM49ov'1ofΘlƤ)S}xcknM7P}#q5hzsS>سJZq*4Ş륈%$rCN(ҹM-,*]s+@& UQWJJ2ÀPTh4cꯑݯu;:'bp]q1232|NIl6{55_t>uk_g'#IƜyQ[WÇˎHö;NP7Rc=۸ӥya ?‹fc3<oڄ 6;Qb"`о};o))()-ŒO?'4l=nr 9Ze{߈ҳlb|QЈV WBƒt|n:f<c٧c_\FRaƔxaY!L`Z3^z켷_g8jEffݮ /4 򴹘lo֭\7t6ٳ0iT>l8@O)>7y555{ݯOo6QV^9D?AŶ>֯]achz֤m9Cq{*bD."H(RQQenZQv8մiL>wG]_,_.ːWWWQ[[̌ q}_ a2gQ]q1jЪEK6h+.hٲ%4s1(++Cm]6E E;NrMY,lٺepԦY%L ID*{#*t/XaP*h٢ElobQQPZm WTT=Bj ĄY*@_o0lRC**!$ "U$R)/Z BBv:X.B?BJ HKὡ+ UVB!IJ HJ/ZuO%JzV ?=bPBdTW#r,!m!PRB*R==F^_gHJ%V+ h@B|jyB(RmWC^: {h}$K& Gn+nv+;[ޗsLtBǽz]h`_ `^I:rYYY(+:FB%&TDpFN%6,XFJJ!nҲRl߹f9FOmg Bq)R@]^[yGhꊷ8켭ϙ[~m}'~+(ڄzqs繅Sz~^4ihSB< O)ELIQBl6UVjA_b=MXƱbht X%$"0'e%T VLՊ#Gp$  HLLD̦iCJH(hz_Wk2חIt VB/Jt8SsYY!TWW#5553ͨAJH Ez z^]JMۜkd z-u!,GNCT@ZF, ԕjWS'a+>֧)'mtĨ?A(XIxsBBbFFFj5j:ҳlX%a.~= _X'AK7,+!_(T o  ӢX%1-P=1 Ezh])^SRB!$(~ JJbN6_DV8-izq!G5^o"Ӟ-X)^ !RʞUB|g y$&C9gцP<U\n0.eStOeEHhk0!ĦMJŪT(VIԊTGq&g[O1]rȰ,&=WlsXOÇ)r"Or*!DV[a^? ? & uctJ=viGbHsV.H!*c&zOl Z_zUkNdSB l6<9i28$K\]wcт䱮r."ӎC7>}Q6ch4ճ=,OΝ:aæE9.2-'*hA&*^c?`RE'a8kZ ZBȄЕ`=tX)Z1~ o־Zp=oc0L>H;viGbӿwÀID6rczUM F݇U1roAr*!y9/o֮E\\xWm\ۭXa!>Xڶ{G@>pZtXV]tG깴L;Ky9ztĠ7d'{VIĽbCł+\CY.PX~"Xh4Fj(g߉{]RX,L63ᯊ \:*s!+T*wb)\E-n){VI4lDB=VFBT>HN﫧!\Q8t“e{JQ]}V͚5s;Mj*GDrr}`Kpې[s}Q[[^[[ HII}^Kȴ#k{է|CJe&áp>BxzĆ {HZpiAR9NUBjjx& UQW&JJҭj]q[HNNS깴L;Ӆ5RET{e,X.y" %Ir-ĩgq;-6CG$''U˖رs۱h4.~ iio깺U(Pz=v܅nWwsiv$q13g5VW/FD*Jvi_l]P(lUŶ>֯]a;x%/ZӍګ(:%45SbV} a=vQ{\QQe'bh<G6m0Ӫ=, /fE^n.5qq5[K.HHHp;4e*JTLzIC]'`CeKȵ#9uCJr(ӳX,غm+*-6zڐ 24`/b9ty3F{I*jђOVm IDATb мy|/*VjjX,\˗!11Qֹl;bu-(+u1{"ވKbB"ux97BH0IR1+TsDTM^"<87*\E Uh\LU8*E|1*u%`Vq^VB ]﫟 ,DBA!ƌXuh)(P+E(cLVBYoB"tCl!Mg4IwQ/eXGh.׿(*B"V-[U˖݆)Y%~`AJLp75xBe"Q%BWj|!V?B(VcBawobCVeeKg!D.JVAq`4 !>!ĪP7e(q*4Wȓ28)&֗mdG{HIӤ!h>:\ApEXnb)yW\NB#|9'4EF vk=m4a0ׁ z}HБCBYѱr^b9= gXj0V _ԛx(P<eؾs;fsķr8eoS\K'eh'm2!<OSVP6 (ts +=~i"~s kHË ~5}< @=PkϬ3M-Jw fZ6W_Y HHW \9ki۳iSC4RBUoqM{)oXV)8'a0X @bb"f6ENUB+5D!:Ն,)TSsgBqDWÙ3̲a$HQlFUuP UBJGZ ! ]{Dl g~pbO W {Bd9rZ ==JBLj54MԥgXTb^p8 &AzONG)I !fPE KfNub5TN7ˇ=-,g(L}~TI](U0Bb$O Uz iQѣ` 1*>RV-#m tބc+!B<*!$`"45$TmTcrVKv!$\)Z ~#6!Iس J36L&\Ro42ӽ+\E!!Y%4[V v޻*Ux{ic$X|rV2Q͆''Mp]ÐVc˱kn,Z}Egu6k7d`h4L{芋QQQ^| uu1|ĉr\z.2k *~֧@k0작 Xv)qkϟkYyz -_χ׸=xR(SuP0۲hUEEETbk[~3ge.A~A.^͊\?j$s@]vl1iT4ԓ}C/M~QuH<1q1Tֹ\;rSN!=$2=ł۶8jSUՐ\;w*r @g k  %?_Tjﱙպ}|>X+/Cbbsiv$6ꖭ[PQV$V ; .yrӾ}!R8Bh+WN@Pm|Q\ȍ0jNV*h'zyMJ9vmGb~YbDGKEz*oO+0_/D'1/ȹ/g mϼ!%\Q!q*GR޲H09_?n>1q PEj$ĬhizS%R)Xz*pr?$blpmo(X)D !DLJLJT2w7iy+w_MUԃN~VorD!aV*7mXtڳ** kJ>/cI X])5 DxZtY+T== QO(P 6B JB.< t `xd$|lD]HӤ!h>:\ApEX\)uع<4B9JmK|Ch`x~ v^=tPVtbS)gpw.m!z'džީH)q-˓#!FsC@JHnҲRl߹f9"쩞>B<+Ldefه0BS]]ԨKl6 (* oRIB՛hG܉ /;՗Ŋ-PI ; u.ԅ8bI4 'ˑ"P*!!rQh4QbRrUU SB՛h `u.fK~|L-_BHp1[ȀZT)B|`0@VG]z6 6p$KoTm0t)=^KYϗNU`+U3,! CRR*!~|BB@||`Z$Ii0EkmO * V+CQ!z %g/2$BB& 4K$"LOB65Z) V3@4y=EjhpPQ?O=Fc*()VI؋&){SƂPK-C!*g^hp9{ yОQLxSl'P(дImUB(VBJɔ+@-ZUh+I0 -T-'>m^B]>?/2 xqtM&8k6v'ڷk')娨w(z|gm0Lӥshd{W깴L;CBJ(Z%;Rhux]JzWbbZ0zu` C)uWKJqJ]~ކ'&N|o૕zŗ l6<9i28$K\]wcтr."ӎC7><^vZB4*hK¢uHJ)ΗaÁ,*u!Dz*!$mː(6vq=t{F߇˾F)\E%%.ID *!Q阔sbU yoµV"ȴ@'7盐@m|xضcVƳӟßǎ'awb ǭV+nۆtW+Wa݆Ä'„'´__T~ߴy34 zasNذ{msivEW?Ol%9RkZ*E(bg˟=S]E/Pq=W$B.BHp 6iiA7չHs+=~SÅbsN9xUUv*%ގ:]6M"wH~ڷkk_- ڷñBL&8Kȴ#8 82 νԳUld) +$| 3GCã>'đE/A-0Ps[cѮ]['ں:x[<[ކ ڷGffx/hyZ-~;aިpwZtXV]tG깴L;xE^?GR\a**SlXp!=RIY B ŕ;ZBl~3^aHa}ճ]P%;yfR^=zƳeϸk|79 J)Xv`1[Dz."ӎX,"gDrlV+D[4ڻ*oj(z/4: BPU] M2ݎ5KMmxp]q1t!rdZ&''-,ZWK=viG>=֠͝OKbČ3*؜EGMG+&XUPDgC@RnN>Md-[Fli>(J(JwuNtnbdfd 99Y4N.2{[q0h&,6 THغRΉ k4u+#9?yxSߤik P"*r ("\}Y[[bF?iN4Mr:uO/q8.iǟl]#gV.x}nވC:1_z{\sIl"f36uYׄ{ +^bO\WYF9(((싥Xn= r9 xӧ>]l݆u+7XK]bJbh"ٻW"&:W|vYthΜ=I '7Чw/M?S0~X 4СAaa!ܸJ;p?FumbftڊXwU[SԖ#)G:DJ )7ƿts)笊U0 =6T* UkaW˰aj8vҶ#!Vߋ3)^m9b@]IuQZ}䲮VFvf1a}! 22)1پmoz} \.G$322g,[ g&bqpňHGX{{"QڈP_]uYg!£sl?6~XVBA'Հ]sd'ś=1)b&+$֦,Un !>t1N##s]Umū3SWNQGaBH?ڍwGVAZN2c#GF]MzjkZ3 u_9B\BJJtTY9.YÞ`GQZK\S/YxrA@Q#8(bo +F_l9 ڕ/Go."H3JpE_bxͅk_Or&#ybFZ5DV-囚Xf\*T!)W1uҕ">B.EӺ,OBƍ#'7N|l1FVJ@׺ \y>B>~kd:#`x>Umeu[pY[\F:f}=EXLD\8^##ձ:5;RUumZt,?e檶[t:4oU3lz"<*!]"5ֵyfl5-JqŽ`0 B\ZfB!!!h MOC&;\1jk:ߎ|/"(ċT[S!Efv&]ElLi #!D<%%%t:K,X%ė'H+(ˢ[ԍHBC|$% ** rB( (JOCQ@~A>*!bG]ňTkBĈ#)dH^h( ~Jj( h4#ΣX%Dj7訫3"՚88P3P~ Ԣotd2X%D!+e[쨫#"Z:RR΋ԚuIh/!C.XCE|^zKηQW[ݿW&8j-V'ݥH%DT}JL_YL;vU9ҽph;:}P'NO.D+W Р~}pF?͛jQ!kyHѦDŪX(V ǟp1B+ b?m1/4NJEpH0fNf ;xfΞV AiSشE|VErs/Fˣq #GxcL >15l ?xݺt ?a˶1vDL}= mɎݻT*ѫGwSX*۶Ŷ;mCbNvI'և*!.ξY& W!1X;W[SΖ%m Y!A:h!T> SkeRs>U9Χͩp|ddfl4 rrs"~ӄ\4O3%%&*&֭Z!y3~~޽%QHKɖ Pl.AZMSl\IӎWiNQPu=Zi؞dO,qޭM?-˕Φ o͗ƲoC|\f3 םlUӦ=u$'7Wh4bͺe&% 3oh٢bbbDѲE2T*jOWS~X+RY{=%Lxx8PZZjq@$47ƴKq#Ir("!-ڊ ʲBLt4¬)6.iG,YoߺFo!֞ ,bE1{El55ӲX蹢sqBJ Cc'N#+;,[׮8v$4A]LaHAAAj4sچNDFf#GѹSGiK;i?S"B X[~)\Vb*ҷsŲ!GɓXJ!;'3A@@`/cs"9wu (**t&VɣiB4Z-)_5Rヌ̬,P^Q' 1StNv52 2Ve+c[7oL؊uﳭo~H|S]O=m7oԧnk.kH캯dzˀ)}\\_"kkSRK!T&Z=%||M_BӡI|Un>}^FcNJAhCF깗bDa0v! W @V@!4i& v X*$(Z֜mRb+G] !R 3;Wˮ"6&4"DDD\~:%@(VQPuTTpoV׈S[efF%9JW(r!P(T*}.?^ESZB/Cp:V, !E!:: / qZ BsFaDyxJ.0b^9qz, BP UBjGqW~2 AAAyQώIpըNbFVc5!B7-۶cO1 ;vRDMaIDovh\eDZ$7G``٧-5?o܄2K~֬EQQ19B^'-?KoD UW Z P"X*Χͩp|ddf~4^;8~V\6Onޞ `nJ KLbUL>[Brf ={{}_,,/ErsQǖ-q%hZi&ǎ@bӦtpc>Z]Xvϗ~_\;_:V~B[5G$"˾qq4\wUMbבd/į7#00ϏzDC<|];E Zhl$ 'OF>}$! ¢B$TQQQ0 ZVfugYN^~Z-zڶEƍ{>߰sg;oNF#f?j)z}ŎX^_8WTZW-XCYˇ#,b *!D:sz0 Huk4jFAJn( tzݽzB.3fwuP>R퓅0 tIF:4kWN 8>>&}̙;֬?\_y~bWp9Z FP6DZ@VAc`0 2"%̬,dfeGb r@xxU6q^>Mx}Xk~.LO>~2pUt:\z}bGc^yͣ[Sa-UBJ*7Z+--Exx8@g ee -׸1T*"rro̬,̬,DG#™'6m?pMfn^j5d2K튊Q^Q`9fyVl޲ ~.:^_#_xk~4`BJp ˡJLı'򑕝c;,, MqQ4N9F[n*bj5ϝ:މL*++qQtfk-=8j~| Br$>_;E qKV]?Sx差ē ~t <?DYYsr1cX؝=KZ"">.(**t&VɧiB4Z-)_髫JS}YY(((;3gObG=%;wa]HKK?xw©ӧMv8̜=SSQXXcێxP/$v7Y_?w JC+v52 2Ve+c[7oL7eMqݳ_]ދwKAA$^|RYr<  L._~͍-87k)o&MnڌKڕߛ-$6^.žPz*bzw^[~gϟElqs4y rrsʈL8}z2٤_?5 ǍAѩ{O[W̛3 L<ڢ?ƘjҽO_ Sz%;rBDqdw~ڔbLIvAjEEEGXDFFZ+-7/Q#Eޜ2 axcG*K9gU`0RYحZKZ kW[Cj/3dfePFDN bWս 7LKBo"\aHQ1T@tTd2XUh߶ ڷk[|$g\.G$322g,ΐ$@ z}ŎO/f5`:*u%ȣ]-ZY"{H+>eU5ߠs>؈zI>Ö%G.`0 !5jXXTm*op3BKJ>8O2տZ P"fF_=Ϫ;Qi ꐚZB@Vیʙjn)ԴT"7UP%wW=8FFCGAI&L0ZȨ)+t+SS,ISN(W^3|i'Tmemq=]xa0oK2q{pt(T !}G] NC&P%8-˘h,}z0!xᨫs7!1rB)(_ұ#p)^پY޻e!Bu/6ū ֪UBEd!:%%< +nBBOԨ+\>zld;TƍзO4jХymX \GA?n˓w#g UBxQWB|\޻ Wʰzz ,vҼѳ]ur?|˭ynYBBGl##ԎgG@ӄ@aQF">|1z<wuDP UBc ;"#;-(..Rď?O`O#--ώ8s,;# 0۶ó##qcS[m;{²sr易jѼYyi9eegC֠alۧ47-۶cO(֛y9ת}vp,3 x!YI*JGB5+SBjOii)d2BBB9/Hwߍ7d&-Z`+/R[nj}(<:sL1h} E(6oيq~V7 p)#/ 2O  ;' кU+$7ob<*ڊz <ŞkN|ߏ=akv+ X%/TTBk+G] qZ]{hצ իg:V^Q1wme_Cg!8(xzsaܳy} (#"09xݺtƋ7˗c;ӯ-A`` >_ciJed$T8y4c9 L8ݺttΧ`˶bUjPB ך}]B h߶-&6F.WwoXZ-Μ=mZ'8rs7._lv-uSN|PuG5((]:u4fI*\c!Rv (h)T !("11 UQÆfoVq<ZV^[6hL+{Bbغ}{#}VF=0曅@SX C(V *!BCvՀ0|^ק Z+.)1''Z3TL&CQQQs%[>BB\BS^=$6Mcp9rVHn}B}!!!Hn 2MQ"((ZNΕUBJ!2!䱁q>%K EEȽ|zjlߎkי?$x3fAVv64 x~d4!܀TJ:WBN&u |sO!l Mw Xr 2RZHs;171LᑑJ { ];wƤ KmNs|wO\[aٷߡUDGc\vxEr7{1x0vh.t֞B.;# x䨬DFfJl_~ ~W_YhDvNʠP"6F7 F T*\ nյ)GV *!]&8AzN OME|\$>nr9Tu~x+f!"m !ɓA8u4||0 '*P%m)X DL~ $7oh!BBe dfgJj攴!$$ b I*q3p!.BP%DٙZv18JII """|.?Nb kt!xKĶx3W(o !Q(Z[P)_O*8(h)T !2!Π B qZ BsFaDy!RL e%m;w'$` UBaL!xO#!]&ΩN#8*ec!]&m/*!bX%V+'% !BTqQqPE( IDAT7B>}ШQC ߶nþлGjz_3** c^~XQQ>Z~A6ﯿnWhp9OMEz5jL7YN  i̮߮VEm0jpDGE=qi'M;Bf8 !"/)T=NvN.vBeeXn=z;w15سo?镕ǟ~ƞ}j8j޻999b)Wp ܽj x=v{DGnew8~ЄIoa5qW7q!0WT<qi'M;\[|,dSq8AJ!{*CgG@ӄ@aQF">|1zn9u rrsؠXf-HKGNФ .]tAD(uHJR/"Ic~ݴeeeXs41!Xn=n>{^=~3OC#]:w#r|zsvҴ#@sdPBe$Qx(..6i7jQßFd7oU>#KmV (#""9M/mJJJ8SXhh(Ƣcn(JJDmmN"6.iǟ~/G~XX%t!2U($$PV^{o>zaێh4NVڹvyt z^~vS_4HKMWѲE2.^Vk5qi'M;}:Dv8ZƮ={qakص j޾X?^[lgO5b8F%lW za VlEk͑y3=C|r#//cFG;Fhjn;nQQ]=kصg/~XڷCfͮ/ F:<ƥ4툗FU!9fA˷¶811 UQÆktRF&ΝOA}wSxӄصg7ԯt# {jZWbty|3{wL_jpmz3b3WKaaa(/_~}50ظ_Tg+y4y >t<8J B;lALdo]wlڲ-[ǝλQx~Xvt$rfNiR /Zhi5  ̄uV_m`t,_ iB2,gfe!&:aaaV]l\INJ};ums45{.DJ!GeE㷭pW׮رyůw`u1[ }߭^u=<, nkos\G`` :މLddfl*++qQtfbNv;0 XCD!2q?n 998uYcDZk^'A_=Ϫ;QBŴ5gTG@VیJmVQYYMMKEll,r3.RP=-h\B3!q#$<[BFh7)+t+SS,I hFbՙ|"¶o%44BZ=|~ܕL&CPP`^pS!mv5be$Bٷ }3GgBQ" Uߩrd!_YL;@_ib6A{P%mh*KJPZZ&{<3DŪX$/V}MQBe=_6n+/111.OϿ`Uz]M^~> -ny^,YٮFs8 PkԘ0n,"##xw©gp+A;c $$̶߮VEm0jpDGE=Oqi'M;B~ͪ<B*q 9ؽwt՚$%&g,݈~ָ5_:#5)p_pdde.]E|RlٶK?&_j¤py<`*Xf-?eK#,49K;iՅ~iK[U+ ;E/!BP%n]qW~$r)TXn=/X0 ύ-Z!۶a]wo_={qq̘> {tCk0aVQl\Iӎxs!,B8"}x{;Io?ň^On{Ơ'ŨUkZM{˶u)#0Oa%_d~Oزm;***0vD?S}O0_8s,^3Q<2qL{o&rrs. 2 N&Ahz+ºw5ؽJzt7%Ѿm[l۱S0mGNvϚ׋Uh3D!f\'N`hצ ^*7K p 3Wq.%O7'N݋VӾSg8W xr<x~ؼu+ޘ%/ >?o~HK$6mj KKMWѲE2.^Vk5=qi'M;"=]ӀVHJ!)R0O| L8ݺttΧ`˶-Y@|pïǼNӻe;Ф x{2.^Ub"ZHFJNo>6bPFD`Y 5~X/>C纇̾h9jr$TճɾI*E( \-+ظ/S J4>r(?kU UBavٯ BNMr4KRr^@؉σTuW%8x0QYYr@FfTj8s>I@xiOt\BhZLz{ ),~.Ao@@Q7No5]qi'M;0~(Vk!3BB-TنK0!\"{ Z5cx{;h-WJZV^[mŪjkDGa)8} ͒̎"~ 0iK;iW^h~|yȪ-[!i U*d(**rK~ ? wLl [:^=@iiűqO !k5 Xc8r80¦iB2,gfe!&:aaaVvҴ>۷+rA !" U y3?xN2ŭ[>z6((ZfzCb9f gΝ-7,gNo0)Sq!|4}־]w"#3J>rMyM\Iӎx7Fyt!/7ԓE̘=Yh4ElEUb"6oيjص ?Zma4!܀T\/48SR˯PTT˗V1h#ؾs܅t}.:}d7kضc'wKJLq܅tCCTb!3+ xg,WT!CLvyyԽ'>]Ḵ޻uL&L`U.D!D*W%ڹ3&Mx,^m;vݽz?ti^ . ~L ƾ2oOnf׽[WNCqI1Ubݩ+!DJB[a{I8#!.QQQ,BDP@T\~z" )V8Jg"mCBC!:: ߬j 30ˆ(VJcm5:jO UGwWK}BCC)T E?]d2 EJv(\ !Rh'k',!"bULtaBgK6KS*!8 rwĥ•N!E?qYv_UB(VBJTҁ#ԦԊTqQqPE(7B>}ШQCS`mX{gj4 Μ=HOF "22}.:}Wt<6pBBBl+++AhZkF GtTvҴ#^ oVkMJJ#T 49ؽwaaaZV ѫGw#Ψ#5)p_]]mŋزm;~ MDŽIoxU(rZ=~˖,FXhMFL\INjϐ7y/qIOQWBΊmF9MEE‹u*)Io\$U"V[>{QU+Tۻ}۶=#l߹ ؽg/?ӧw.;cXz F>=깈K;ioh #3p5i~:Um!LTd$:y7͎edfb7񟁏bs/_7?FB0ْ/PQQafW?xù2l8|d 3fe0'b 8}2Ohz+ºw5ؽJzt7%Ѿm[l۱湈K;i_>ݑ(VH{ WWBK"JKK!̾T՘4y*ڵiƼ͒0w;qd~ 8&O6o݊7&O1K8w>#ûS&c'F _ENe38~MΧzs.HK$6mj KKMWѲE2.^Vk5=qi'M;~֕ jŁCѮMԫWt&N@.ݻuŹ)زm;n6@޽Чw/Sw܁&Mۓq%p9>Unm (#"09 t/:,_L‡gȪ-1ORW&¢B$T񣢢`0p;bNvR/ J4>r(?kPIf WB|Or_"F<`0M̝ t\.G$.ٕGee%YP%&"005ªP(&S|^#G>wfiܲ%!SF[!DrVIoO?ӏx5 TX5魦+6.iG}0R\H/cb@ r?0!>rޞƢed(35d7I'>c5{ύmaNäSp,%% CyyEaVvҴW^h~|ypdht Vsxڷ3\~ޙ2v)#l5Kn ~"~޴ S}sf<zjHpiԫW-c߁_,:aap[{ 9e*:fڷNddf"#3VYYGs۵K;i/i#PuoCJw:3JL-[ZvU 9RPYY FMmFEO? ެٸ V|lپ׮2pd pS IDAT;wa]HKK?xw©ӧMv|m;v~g]HKO7=Կ?J%2PPPwfByE2dN{KK;ikd2dV.x}nވC|:Qק:S緮xyQȲnx| bi.[núߛO1 .SR1wqcb/i1iۧFիbSOv݇O>_|SXdÞx<+˳ϢC^G=խ+͙ xlS8-u9L<9eD&M`Bs?S0~X 4С(,,DW/vg~z9٨M)VT EGSb^ -Ϻs|(VVl@ӦM V\\+WƍZAYYJ6X[8r!ZW I*ZKZ kW[Ūg{Qc&VtijX UB RٵS*P*v&h~ϵ-|9`/.mGvnpLq,!0;#`x>Umeu[pY[\F:f}=EXLD\8^#bW?u:&:M@wnl3 X zh4pU/~x|]Ȱ+He%8`@څ4\)Z!BBB $PJI/o]T*#!23q*bcbMS !)))ADDP\R db)fo,W(r!P(T*}.?^Exp%Xt;:DGGCP-! j5 g4ayQBJsBBjKhh(*!ݽ;d ̋b GoBu{B!o}NJ gnCǗbUPָ!tx<+ʙ>Pe%ѣe&S Add$7CNff_b*lqQPniu3 zbcl|HKKVEӄ ~tڴnm7J|{;pZڶo(?ٽKrBI(D^EzWHؕ>*" #UETH54H ^lJ|߯)ٝ|vfgMExXX GވYФRz]B :Wsnѳz=8éӧƍ`LOCwx}M7MQfoIKOǴG!4s7jǟo:uYܗp)Lx`t:^ĊO?>(V#_P wO?9~̪YVk.5҆#5Qߘ1}KaGˡh0bPz^=)teL&cP{Fc=՝xN@1q4^ӧLn7[P7yr< 5 a0{ C euv$m߁}>r9 JLsgb$lݶf{両ҋ֬'޵ L谖?m0cT,h9Μ9w$>AsZz:f9ՆF 1x?v=LzFj%9 ǡy<4e ڶz5pݳ_R11}AAAh=;;v`@;{%ǡmaێ)"Ax-߬Kl}nCM )*D&ˈ}2QQ*4?rrs|<jf&?n`=ǯ-}s?fi\ݝC<BZ^8PYQ%R^JQQX~t::vhА_P=EfV, )ifURGYEx\̴k;p01QuDիWNLDҎ5&(%77_?HRq/Zwk֢cѼY3 @ҞLjE8 HجVWaNKԮ{! &\vxi.C,XJĸc+1xxyB4Dbib6Xw:Vk`L8QQQekowq㮁ƨ Ӻp֬Mf`Sףtҗz0 /}J̳5޻Kߪz۳Z=ur5T60S+;Mo? [ߢys,{-شy3/z o.Yf]rt _gv9%[&1H0uF0S&M|e,:=9mڠADDcFݱrշ(2.46iiNLMKCDx}@G>K³u@}Hɟ wtSCwiF!Qٺm; <50F#]j GP<ٜUƕ+ {NF͛=@EaZ-Zh&L ܇t:-]sڞRiݺvAJj*RRS, ۏeQz8 p:kV21z7-\̀7d^ jG=ݻܗ7q[[䣏}>X1Μ;͆Ϳmơe{l܈g`qqز5 ZnJ$\t xilx6nf)H>.q۱v .^ĻGfVn` غm;j 33 zG|j;`00kHMKCvv6.yEf3&_kя~u穮Wsj\fZWfΥ4}{!#Ae*Тy3߷(X?u`ߦj1eD @̽# ŊAAa!"ñogE4!@~ijfٽ;>/|ɧضw{߷k{.ҋO0uMn40y„hM ,V+z V}@DÇ3+4 ""  o^qP|˃ sf='Yj4pHI[~Ÿq#zKvuQhjvvvҝkנRFU<㐖hڴ)l TlE6`p #I32`2`5 2[C/N>;BVoِq 8Ghf| l\)EQ[6@GAX5.uT ]B 5޳*ׄAԃ@ua/hX5AVJBB|Z,썻Bƍk$ZVg ݞUw()}50#j덆5uAF $jղ $ Axc*Z^Z_5DDmeYHAVj:0*ADMJ=A6#/$M6^/S_K^z҅¹w4w QWj7r)6 Vc|9WHZX,ՒgΝAdd$\ ,wе@.wk ӵKDGE#JxnWDO$H]p{s9 t(9)O\&~se$tz*] JBIXu^;s8]i[ wHOh0"&:GmuV}NQ@uto&<& >.Fp@l64 zxv W_*=oL ǰdV f^kbyQDu0` zL=W KZvN(FIH#-=2 j2A9Yk IDfxe"dgg73+ 'ONM?cOхP@Y%4n+꫹+(ׇ g\]a**9_~/T+ӝք8}]5\DY%s5m~EkK ^=qGAf y-kyӼwZjH=[S ڄaXr9s}H=|?a0͘ !_z/ZGqh,MvuHk{opU4ƴ#GR0cT=ӧ<>%0c4\NIwkɓEtS&MNPmۑ}B'N˕\r2Jv;fLh2i_1_0G ȟxq69 ""iѽ6o݊֬Cn^ڶiggDxXyUTr\35 | >r0 hft8W*Aa%sAKA=Aq*:.aAk0{7~o)bЩCm-7Cn^-Y-6ixYhҸ1t lٚ9/K?i pq[ݻvɓ><ϣENzΝOƠ1l`ϟ`fT|z5N=w|_&ob{|o\kӹ.Xy>u2Glw6*U 6(Pg ,AOf}yлWOhN4SW\4}!,^Rlt[%bر43U 2mA+1`N)&  Z\}99^FkGѥSG,|e}lٚTiN堨(BQk4}>ȟ\ݝkͱGb͘5d1:w@3uV  YQTl6mZ-[4@ESED /!\;$IBƕ+ {JkyZ-b& O-[˖w(#8 Q>S-^3b4ѷϝPU8zUV2AAuqq#N9.OorJ*l,lݾkoǟ$pĶcނ s{V-[Պ֬Zky3N_|<\z^/V+Ǝ%[)J,#= ł۶͛1ޑPT>SU-^3Ⱦq,gΝbf߶fвd]DAÀ 6h,ADw1l(V| ~]`K/Ï?L0w oVa+ӧauh^ixv3xe"LADf?4^~uWZ3|bo5v/HlB ƘQ9oHNɑ?U25۴Z-L޽zQe pիVJ/PW8AKTiΦ̨GH L&B l4Oyl6ƌ{F njӼJ8M:|ZY, RRӠP( B|ϰ5i6LEEHKO`@H?G23~^^]JBtT4 U$i(Mg 2AD?4nޘr8n]eYf,#_>^RP\hZY{Rݡ B-znȟʖ  | 2ATC2A'8ü BCBq#'jz-5 "2AQ֠RO+A }P~Z#:- =d@o׎. JDMҿɰA/DQDjz*e_j>"Y qءQ tF $*AAQTȈH!‘|ֹxG^~2A &.u- 1 iW t:ITu't:degY%zApt:I NWғ$ $d^$JDf`ɬADF * 0Z+=aR\Ef j3d  WէdV 6JA_JSU=2c'JAAT[×*AY2AA~&3+ 7pKf.⇍q69yy AV0aj!bpm k8WԔ WseNG0WH+M{ IDAT AQ= ήƟiúz[Gn=ǍyfƖI|r6ilo>3_8y&<0A:V[Z~}P_¹P+@ 77F1[S<Պ#Ǐ +5e)AAbUgȨ`{s]o vp~5\ϻ_ٗSMDf  m-7J1|` ׯU/'jy+V~ 8}h٢0Ė-pepp)-ʜ LAG[@B|<=A8[j>scɂWxkԳi}~K8qd$K!!X[[srs?,, (dBxX\QSZ(\͕y^m59~Motg  h;cOs;bPL o,o+W¹ZK&_¹P+s.U  b`~H>4F=־w{xr,.q(*2;/**0\QSZ(\͕ymy3gk4wU)!JAAaWfahӦ5N:m46iiNS^p)-q-zѯaVիVJ $m&//  ή)Y>ܵo+. FS'ĩؾ#j-gXr6_ FSZ(\#Zfu_}%KAA_L+qq^eY4KHp)))xᇜjMhpɜȬAA-ssfSmBz&`    5P   |ng ՞Uw0`  ZAYY  aY(RFfZجAA F$_HFVm\ά[_$ɡtmtS8W.f+QOq˓!n(>G>t4L V:Υ'I$HȼI\˩ Q̪(H\S^@NWIV~k&y'S#}υY7Ȩaj͏JaT**:BmTψ:eVI/zZ9f_G.B>i }աV#}5<͆OԐO "Yل΃a6CHH֚L8}2(mZV̯) x/Jm] R{>>?P憸H#}̜ P864bJN2RQP/j!4R-3;o<$_8u*,wA8q(:uJ̪ ^}Shȼ^;B '$}nT]\#}5/;?(mY3NeVhؠ w/W׮_ÙsЪe2ToU`>!nd{ [PX?wwBPEEh kׯYlZPTP4{*U7Y7AZ&F>I` ۍ n@9w V(ug+p.0> B-"]_o4<̈́a~h:M@hDCfY VB.+UE.`=W?kX,a{qn6aaכ6 Oĩ3g|Vϙ Xi-U\oLO+ih4hI x4ðhejTjg=+[<ձܹ# = Tp%4isZH˸6a hVyߌR ?UCl<gJi)3!}uUwyK]I(`A͹OB]ީJзVo Ď\V&דa.0J Nn)cr-4 h8tCބiHߊx'}.9D΂Ot7F.S2 z-yg@7+Uf ?/^ƞ8u 6Դ4p0wQA$wztSau>ecz7!!_9vxth7 l6+Xjuy|3nT3ґP/&e WlEF!"RS~%FC Z]#zmV'XrnX8Ao5jl imA`B HX"JPŜ&P*Y&$ V0]F^wpMt&$0셶=^3> zS{L'}mE$BRCd!H:0 \&D6HA>&G>ڬ,l6ѳCu͎;a0} qhmضw<4ucz Ch]jF|KkLT(e!=<2(J .9 oXe]8& ,oӽ !,܍WLp$\^ 㝳 ;nMA lE[X-[bPxvԾ=z]Tv.;q}E~AZ%&3yknٌϽPl ҋ |J>r6Cf xh? ”IqEo(tt:'S]5Sض7QρRBjz*bİP*q5C]deX, `**/h4 V#GF5D6F>!!!: GR2,lіEH:$VMpP)-8tˇs15,YgaK? ] HP F/Hm& #}WXAjs֥ ;_;y/CAɸn !>i{XXDQDv 񪢹{=ǯ-}X,ƴJJ”HNK!moiݻ᫯Wa@߾> ?\x rs0}d4طl6ڶi͛!7/Ç`8gfIxlC邰eko,}Цu+@ի8p Ξ;c?wˠj1h@ uxkV@ST*z)$8)(,@Ҷ-;~#':T*5RRu[~70sZn{Ϝ޽{0p`˲fU avu:t طBCj`t:, GRHW80'UK9xQ }Ƌ\DQr2(`4en\ s870,xJrNd+U&]\-X9<ȶ\;[A Y [n AӡP-ן*`iʯq|P;^{7-Xk }jTu8(nwU[ɝn]aPf$ٿ[V}P>=,~qXҳZ6$I0-ӦǟƟQzix?q5o/`@B|<=A/3BC[o_O̜Va7b=Æw늼||J(zS9VSUA$a;*Az\FJ6ma4$8!#Q:YͪZb(Na aaHOO{Ѥq4Ahh_YVͪ'RVk]*?AGUd4|&}Q-6]%=P_% (8NVTG(JJc;f"gq(qf{LIeÕ柯Z\4+Jm8wek_BKP*=ˡhMSAѾϡ_ üFFk>O,~Çqx ZЬoz`sUxUIW30go޻Kߪ{Vf`@- OIV[e03,k^%c@Xw>tU(Y:;GhHW&b8?^갯ub"vp3__ _GVV*zu)! aaሎAaa!!r0 G\xwbb߻\vCh1[n !(">oB>z뵙fVyFUTA*kVQ, |(loQ"}uX/HUKv}F 3 `4xpYM7L {.M W6|iz Ew/@>EGwtKn\ LD k{}(,,D 6Ge,:5"5-i{jZ"á2q= YxU\QޟT/7[,%߃4yyCtt niP{q'lȞg'O;Ěu1t i.C,XlJĸcѧVAl-[}jDˬkU)@ST*~)"Ix_ҳ!C㧟D;"&:iѸqSL<~1Ǝ]:w{o[7yYMDPւeX\tk&Mb^:0Zzf5Hl${'R$. U} @:|U@ߨ$ B)0n8\fq8S>6h qŬrqKIL*^[aZԏPt}q/.L7K `POk>znj׺+((pWPPhQj"n]`"%5MccݷQkUVxr[W|x3l6 r$1 B^aPP 2= ,s*DE5ˆaCvͫ8-7DzBnn.9M7cngՕ'ǔI+L(:T\PX\/Kglo-թYτ:j߃~\}!&:.G\\3< ,C { #}'ͪqMbM&<[Zǡo]w`0`אl,\:fL?.33 zG|s\8w.מ=8z6\]y* >~-D JP(^h(a$QlKCu % |?Fs'h!j;x(\#VբefE8dw t:DGGyמթWoVy_n0cF3[~CjZ HN><:q|j%_bzUjuxk}ޅF܋ΝBj180j8Yz{DI(א+{%dWܓ'$ß:;YP %h`:<TAoI}sp*bincD,$Hl=i E8|Hכp-slQws3ɴ吲1߀>H @ɼ"WI 7o> IDATK7z43~!, =;W!4:-[&d(9(xŗ}WO>pu9tΗ9 @Jt:N)[OTIC*9;^|* }[G\l,Xmaqkil,l܈6[ARyL2s罂^S&MDttrn}cn/Re~?M͸U*t?p/2ܿ0?ʑTg/@l1vU0` bbbpI$l' .}ӧpˉb˲P)և@[~EVV& TyK !(XX VBT_ gBK^V_$o>91r!Mey(U9qF!+[?|LQ&"=|!*Hכp^*Lg!)y{0,H0@+= 6x0rrrrշv{c~sزFo?[K/8$;MNq4{v87qJ%۫xY[w#ZTTTVc2b`N%VPd2A:77|Cˢ`ػ}}VŔIѻWp޽zbİX7((,DDx8~ w/?Sg=]x^D8~(ni~ۺ7R߻1tp 8HKO`@Htt;Z-/N1x7剈hIė_}#&1NAf@H_m [F'UC*&9}C6mO]={ħ}"tc_}6xpRY PkҸWaAAhղ_tQoN=vCBqa\˾N,4lA/EAA!z?#Ė8x7nׯh4BTj5kdWU6jD5* J:nR1gY$^uf h_*ճ[πoCBBah4s5lV ƧaJ|#'8.,I'A6`}ˬONm%}J*˲L8A6+*fr-۸!ۺSψ:bVU */j6^Zf@G+7W%>̍qG> AJߐk4|!mZ z<'Uar,_K˝(C0 l6Vq|][ϞFdiIMkk$IᥥJ]t%I׳azp̹3TY*g@hpF> 髼[rj#}Nc!j5,B4O+g?NQA[Qj^m c{jzs(>UhFKœz'b\OUVGix %$T`DLtLI|-_Wuzvӱ}3n[zVR=#Z퍕p :qߠ o|3̍@xW d'6G> +RV>߃<4nK ڈDrrzVΑx( _2AYYu> y  6VQˠzKbV{4ӢObs…y AAЛz @g   "p!(G   ,     %$mr   IENDB`Gyoto-0.1.0/include/000077500000000000000000000000001217470755400142505ustar00rootroot00000000000000Gyoto-0.1.0/include/Gyoto.h000066400000000000000000000242741217470755400155330ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ /** * \file Gyoto.h * \brief All of Gyoto * * Gyoto.h includes all of the other Gyoto C++ header files. Beware * that some symbols are resolved only in the plugins * (libgyoto-stdplug.so, libgyoto-lorene.so). */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /** * \mainpage Gyoto
General relativitY Orbit Tracer of Observatoire de Paris
* * Download | Installation instructions | \ref conditions_sec * * Gyoto aims at providing a framework for computing orbits and * ray-traced images in General relativity. It consists of a library * (libgyoto), utility programs, and a plug-in for the Yorick * programing language. Gyoto is known to run under Linux and Mac OS * X. Please do tell us if you manage to run Gyoto under a different * OS. It should compile and run with moderate effort on most * UNIX-like systems. * * Gyoto can be expanded with plug-ins providing custom Gyoto::Metric::Generic, * Gyoto::Astrobj::Generic and Gyoto::Spectrum::Generic classes, which describe * respectively analytical or numerical metrics, astronomical objects, * and spectral shapes for astronomical objects (see \ref * writing_plugins_page). * * A graphical user interface for tracing stellar orbits is provided * with the Yorick plug-in (see \ref yorick_plugin_page). * * \image html gyotoy_screenshot.png * * \section conditions_sec Conditions for use * * We request that use of Gyoto in scientific publications be properly * acknowledged. Please cite: * * F. H. Vincent, T. Paumard, E. Gourgoulhon & G. Perrin: * GYOTO: a new general relativistic ray-tracing code, * Classical and Quantum Gravity 28, 225011 (2011) * [published version] * [preprint: arXiv:1109.4769] * * We also request that Gyoto modifications, extensions or plug-ins * leading to a scientific publication be made public as free software * reasonably fast (within one year after publication of the scientific * paper), for instance by contributing it directly to the Gyoto * code base. Contributors will be listed in the relevant source files as * well as in the AUTHORS file in the package. * * Gyoto is Copyright 2011 Thibaut Paumard, Frédéric Vincent. * * Gyoto 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. * */ /** \page yorick_plugin_page Gyoto for Yorick \section yoprerec_sec Prerequisites \subsection yo_sec Yorick For direct access to Gyoto, only Yorick (>=2.2) is required. Yorick comes precompiled with many distributions of Linux and is present in the Macports. You can also find source code at https://github.com/dhmunro/yorick For the graphical user interface Gyotoy, you'll need a few additional pieces. First of all, I seriously doubt it will run under MS Windows, but please report any news on that front. \subsection yutils_sec Yutils A collection of utilities for Yorick, distributed as yorick-yutils in many Linux distributions. Actually, only pyk.i is used in Gyotoy (so far), and as of writing, the CVS version is required. Either get yutils > 1.4.0 from e.g. http://www.maumae.net/yorick/packages/src/ or fetch pyk.i from the CVS browser at http://yorick.cvs.sourceforge.net/viewvc/yorick/yorick-yutils/pyk.i?view=markup \subsection pygtk_sec PyGObject The graphical interface gyotoy needs yorick-gy and the Gtk 3 GObject Introspection files. Get yorick-gy from: https://github.com/paumard/yorick-gy Under Mac OS X (using macports), install the gtk3 package. Under a Debian derivative GNU/Linux system, install gir1.2-gtk-3.0. Check yorick/README.gyotoy in the source distribution for more details. \section building_sec Building From the Gyoto source directory (i.e. the directory which contains the yorick/ subdirectory: \code make yorick \endcode You can check the package by running \code make check-yorick \endcode \section installing_sec Installing \code sudo make install-yorick \endcode \section running_sec Running Read gyoto.i and check.i for using Gyoto from within Yorick. The graphical interface, Gyotoy, can be run with \code yorick -i gyotoy.i \endcode or \code gyotoy \endcode */ /** \page writing_plugins_page Writing plug-ins for Gyoto Al the generic Gyoto machinery for computing orbits, reading input files, performing ray-tracing etc. is implemented in libgyoto. On the other hand, all the code specific to a given metric kind or a given astronomical object is available in plug-ins. For instance, the standard plug-in libgyoto-stdplug contains the two flavors of the Kerr metric: Gyoto::KerrBL and Gyoto::KerrKS, as well as basic objects: Gyoto::FixedStar, Gyoto::Star, Gyoto::Torus, Gyoto::ThinInfiniteDiskBL and Gyoto::ThinInfiniteDiskKS. The libgyoto-lorene plug-in contains the code to access numerical metrics (Gyoto::LoreneMetric) as well as an example thereof: Gyoto::RotStar3_1. The two basic spectral shapes Gyoto::Spectrum::PowerLaw and Gyoto::Spectrum::BlackBody are also to be found in the standard plug-in. Gyoto can be used right away to compute stellar orbits in the Kerr metric or to do basic ray-tracing of accretion disks. But Gyoto is not limited to the basic metrics and objects we have thought of. It is fairly easy to add custom metrics and objects (and emission/absorption laws) it Gyoto, and Gyoto itself does not need to be modified or even re-compiled to do so: custom classes can (and should) be implemented as plug-ins. For an example, simply look at the lib/StdPlug.C file in the source distribution, and the source files for the objects and metrics it provides: e.g. lib/FixedStar.C and lib/KerrBL.C. To implement a new plug-in, you first need to implement a derived class of either the Gyoto::Astrobj, Gyoto::Metric, or Gyoto::Spectrum::Generic class. You don't necessarily need to implement everything, the Gyoto::Astrobj page explains what is required for an astronomical object. Assuming you want to be able to actually use your custom class, you need a way to instantiate it. This is normally the job of the Gyoto::Factory. You need to instruct the Gyoto::Factory how to read parameters for your specific class from an XML file by implementing a subcontractor (for a Gyoto::Astrobj, the subcontractor is a static method of the Gyoto::Astrobj::Subcontractor_t type). The subcontractor communicates with the Gyoto::Factory by means of a Gyoto::FactoryMessenger and basically loops calling the Gyoto::FactoryMessenger::getNextParameter() method (see the GyotoRegister.h file, unfortunately undocumented at the moment). You also need to register your subcontractor, so that the Gyoto::Factory knows it must call it when it encounters a tag of the form <Astrobj kind="YourKind"> in an XML description. This is typically done by providing an static Init method in your class: \code void Gyoto::FixedStar::Init() { Gyoto::Astrobj::Register("FixedStar", &Gyoto::FixedStar::Subcontractor); } \endcode You need to make sure this Init() method is called when your plug-in is loaded. Assume you decide to call your plug-in MyPlug, and it contains a single Gyoto::Astrobj named Gyoto::MyObj. You will compile it under the file name libgyoto-MyPlug.so (under Linux) or libgyoto-MyPlug.dylib (under MacOS X). Just put this file somewhere where the dynamic linker can find it (any directory listed in $LD_LIBRARY_PATH or $DYLD_LIBRARY_PATH will be fine; /usr/local/lib/ should also be fine). In addition to the implementation of the Gyoto::MyObj class, you will need to provide a function called __GyotoMyPlugInit() which will be exactly this: \code extern "C" void __GyotostdplugInit() { Gyoto::MyObj::Init(); } \endcode This function is typically provided in a separate source file (such as lib/StdPlug.C in the Gyoto source) and can initialize several custom classes at once. Finally, you need to instruct Gyoto to load your plug-in at run time. This is done by adding the name of your plug-in to the GYOTO_PLUGINS environment variable. The default value for GYOTO_PLUGINS is "stdplug,nofail:lorene", meaning Gyoto should load the standard plug-in stdplug and attempt to load the lorene plug-in, failing only if stdplug is nowhere to be found. If you want to load your plug-in in addition to those, alter this variable in your shell (if you don't know what this means or how to do this, ask the local Unix guru or read the fine manual): \code export GYOTO_PLUGINS="stdplug,nofail:lorene,MyPlug" \endcode but if your lug-in is self-contained and your don't need the objects in the standard plug-ins, this will do it for you: \code export GYOTO_PLUGINS="MyPlug" \endcode This will instruct Gyoto to locate and load the file named libgyoto-MyPlug.(so|dylib) and to run the function named __GyotostdplugInit() from this library file. */ Gyoto-0.1.0/include/GyotoAstrobj.h000066400000000000000000000655131217470755400170610ustar00rootroot00000000000000/** * \file GyotoAstrobj.h * \brief Astronomical objects (light emitters) * * The target of ray-traced Gyoto::Photon */ /* Copyright 2011-2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoAstrobj_H_ #define __GyotoAstrobj_H_ #include "GyotoConfig.h" #include #include #include #include #include #include #include namespace Gyoto{ class Photon; namespace Register { class Entry; } namespace Metric { class Generic; } class FactoryMessenger; namespace Astrobj { class Generic; class Properties; /** * This is a more specific version of the * SmartPointee::Subcontractor_t type. An Astrobj::Subcontrator_t * is called by the Gyoto::Factory to build an instance of the * kind of astronomical object specified in an XML file (see * Register()). The Factory and Subcontractor_t function * communicate through a Gyoto::FactoryMessenger. A template is * provided so that you may not have to code anything. */ typedef SmartPointer Subcontractor_t(Gyoto::FactoryMessenger*); ///< A function to build instances of a specific Astrobj::Generic sub-class /** * Instead of reimplementing the wheel, your subcontractor can simply be * Gyoto::Astrobj::Subcontractor. * * If MyKind accepts any XML parameters, it should re-implement * Astrobj::Generic::setParameter() or, if low-level access to the * FactoryMessenger is needed, Generic::setParameters(). * * \tparam T Gyoto::Astrobj::Generic sub-class */ template SmartPointer Subcontractor (FactoryMessenger* fmp) { SmartPointer ao = new T(); ao -> setParameters(fmp); return ao; } ///< A template for Subcontractor_t functions /** * Query the Astrobj register to get the Astrobj::Subcontractor_t * correspondig to a given kind name. This function is normally * called only from the Factory. * * \param name e.g. "Star" * \param errmode 1 to return NULL in case of failure instead of * throwing an Error. * \return pointer to the corresponding subcontractor. */ Gyoto::Astrobj::Subcontractor_t* getSubcontractor(std::string name, int errmode = 1); ///< Query the Astrobj register #if defined GYOTO_USE_XERCES /** * Use the Astrobj::initRegister() once in your program to * initiliaze it, the Astrobj::Register() function to fill it, and * the Astrobj::getSubcontractor() function to query it. */ extern Gyoto::Register::Entry * Register_; ///< The Astrobj register /** * This must be called once. */ void initRegister(); ///< Empty the Astrobj register /** * Register a new Astrobj::Generic sub-class so that the * Gyoto::Factory knows it. * * \param name The kind name which identifies this object type in * an XML file, as in <Astrobj kind="name"> * * \param scp A pointer to the subcontractor, which will * communicate whith the Gyoto::Factory to build an instance of * the class from its XML description */ void Register(std::string name, Gyoto::Astrobj::Subcontractor_t* scp); ///< Make an Astrobj kind known to the Factory #endif } } /** * \namespace Gyoto::Astrobj * \brief Access to astronomical objects * * Objects which are supposed to be the target of the ray-tracing * code should inherit from the Gyoto::Astrobj::Generic class. * * When implementing a new object, you must: * - make sure the object can be loaded from XML by providing a * Subcontractor_t using the Gyoto::Astrobj::Register(std::string * name, Gyoto::Astrobj::Subcontractor_t* scp) function; * - make sure this subcontractor is registerred in the initialization * routine of your plug-in; * - make sure Generic::Impact() works (see below). * * In addition, you should make sure that your object plays nicely in * the Yorick plug-in, which means: * - implement the copy constructor and the Generic::clone() method; * - implement the fillElement method, used for printing and saving to * XML. * * There are basically two ways of making Generic::Impact() work: * either by making the Astrobj a sub-class of the low-level * Gyoto::Astrobj::Generic class ans providing your own * Generic::Impact() function (which, in principle, should rely on * Generic::processHitQuantities()), or by making the Astrobj a * sub-class of the higher-level Gyoto::Astrobj::Standard class and * implementing two lower level, simpler functions which are * used by the Standard::Impact(): * - Standard::operator()() yields a distance or potential defining * the interior of the object; * - Standard::getVelocity() yields the velocity field of the fluid. * * Generic::processHitQuantities() itself is an intermediate-level * function which you may choose to reimplement. It uses three * low-level, easy to implement functions: * - Generic::emission(); * - Generic::integrateEmission(); * - Generic::transmission(). * Default implementations of these three functions exist, they have * little physical relevance but allow quick 0-th order vizualisation * of your object. * * To be usable, a Astrobj::Generic (or Astrobj::Standard) sub-classe * should register an Astrobj::Subcontractor_t function using the * Astrobj::Register() function. See also \ref writing_plugins_page * . If your clas implements setParameter() and/or, if necessary, * setParameters(), registering it is normally done using the provided * template: * \code * Astrobj::Register("MyKind", &(Astrobj::Subcontractor)); * \endcode */ /** * \class Gyoto::Astrobj::Generic * \brief Base class for astronomical object * * See introduction in the Gyoto::Astrobj namespace. */ class Gyoto::Astrobj::Generic : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; // Data : // ----- protected: /** * \brief The Metric in this end of the Universe */ SmartPointer gg_; /** * Maximum distance from the center of the coordinate system at * which a photon may hit the object. Child classes may choose to * update rmax at all time or to use it to cache the value, for * instance when getRmax() is called. External classes (Photons in * particular) must use getRmax() to access this information. * * rmax_set_==1 means that rmax_ was set using setRmax() or the * constructor. In this case, getRmax() must always return this * value, not recompute it. * * rmax_ is in geometrical units. */ double rmax_; ///< Maximum distance to the center of the coordinate system [geometrical units] /** * rmax_set_==1 means that rmax_ was set using setRmax() or the * constructor. In this case, getRmax() must always return this * value, not recompute it. * * Use unsetRmax() to reset rmax_set_ to 0. * */ int rmax_set_; ///< Never recompute rmax: it was externally set /** * The kind should match the name of the class, e.g. "Star" for a * Gyoto::Star. */ const std::string kind_; ///< Kind of object (e.g. "Star"...) int flag_radtransf_; ///< 1 if radiative transfer inside Astrobj, else 0 // Constructors - Destructor // ------------------------- public: /** * kind_ = "Default", rmax_ = 0., rmax_set_ = 0. */ Generic(); ///< Default constructor. /** * kind_ = "Default", rmax_ = radmax, rmax_set_ = 1. */ Generic(double radmax); ///< Set rmax in constructor. /** * kind_ = kind, rmax_ = 0., rmax_set_ = 0. */ Generic(std::string kind); ///< Set kind in constructor. /** * Make a deep copy of an Astrobj::Generic instance */ Generic(const Generic& ) ; ///< Copy constructor. /** * This method must be implemented by the various Astrobj::Generic * subclasses in order to support cloning: * \code * SmartPointer deep_copy = original->clone(); * \endcode * * Cloning is necessary for multi-threading, recommended for * interaction with the Yorick plug-in etc. * * Implementing it is very straightforward, as long as the copy * constructor Generic(const Generic& ) has been implemented: * \code * MyAstrobj* MyAstrobj::clone() const { return new MyAstrobj(*this); } * \endcode */ virtual Generic* clone() const = 0 ; ///< Cloner virtual ~Generic() ; ///< Destructor: does nothing. // Accessors // --------- public: /** * \brief Get the Metric Generic::gg_ */ virtual SmartPointer getMetric() const; /** * \brief Set the Metric Generic::gg_ */ virtual void setMetric(SmartPointer) ; /** * Get maximal distance from center of coordinate system at which a * Photon may hit the object. * * Child classes may use the rmax_ member to cache this value. * * It can also be set using setRmax(). If setRmax has been used * to set rmax_, getRmax() must not recompute it. * * \return rmax_ in geometrical units */ virtual double getRmax(); ///< Get maximal distance from center of coordinate system /** * Call getRmax() and convert result to unit. * * \param unit string * \return double rmax converted to unit */ virtual double getRmax(std::string unit); ///< Get rmax_ is specified unit const std::string getKind() const; ///< Get the kind of the Astrobj (e.g. "Star") /** * Set maximal distance from center of coordinate system at which a * Photon may hit the object. * * Side effect: set rmax_set_ to 1. * \param val new rmax_ in geometrical units. */ virtual void setRmax(double val); ///< Set maximal distance from center of coordinate system /** * Call Generic::setRmax(double val) after converting val from unit * to geometrical units. * * \param val rmax_ expressed in unit "unit"; * \param unit string... */ virtual void setRmax(double val, std::string unit); ///< Set maximal distance from center of coordinate system /** * getRmax() will then be free to recompute rmax_. Astrobjs * which cache rmax_ may need to update it when unsetRmax() is * called. */ virtual void unsetRmax() ; ///< Set rmax_set_ to 0. /** * Set flag indicating that radiative transfer should be integrated, * i.e. the object is to be considered optically thin. * \param flag: 1 if optically thin, 0 if optically thick. */ void setFlag_radtransf(int flag); ///< Set whether the object is optically thin. /** * See setFlag_radtransf(int flag). */ int getFlag_radtransf() const ; ///< Query whether object is optically thin. /** * Return a Gyoto::Quantity_t suitable as input to * Gyoto::Scenery::setRequestedQuantities() to set de default * quantities to compute for this object. The default of these * defaults GYOTO_QUANTITY_INTENSITY. */ virtual Quantity_t getDefaultQuantities(); ///< Which quantities to compute if know was requested //XML I/O public: /** * \brief Set parameter by name * * Assume MyKind is a subclass of Astrobj::Generic which has two * members (a string StringMember and a double DoubleMember): * \code * int MyKind::setParameter(std::string name, * std::string content, * std::string unit) { * if (name=="StringMember") setStringMember(content); * else if (name=="DoubleMember") setDoubleMember(atof(content.c_str()), * unit); * else return Generic::setParameter(name, content, unit); * return 0; * } * \endcode * If MyKind is not a direct subclass of Generic but is a subclass * of e.g. Standard, UniformSphere of ThinDisk, it should call the * corresponding setParameter() implementation instead of * Generic::setParameter(). * * \param name XML name of the parameter * \param content string representation of the value * \param unit string representation of the unit * \return 0 if this parameter is known, 1 if it is not. */ virtual int setParameter(std::string name, std::string content, std::string unit) ; #ifdef GYOTO_USE_XERCES /** * \brief Fill XML section * * Astrobj implementations should impement fillElement to save their * parameters to XML and call the generic implementation to save * generic parts such as Flag_radtrans: Generic::fillElement(fmp). */ virtual void fillElement(FactoryMessenger *fmp) const ; /** * \brief Main loop in Subcontractor_t function * * The Subcontractor_t function for each Astrobj kind should look * somewhat like this (templated as * Gyoto::Astrobj::Subcontractor): * \code * SmartPointer * Gyoto::Astrobj::MyKind::Subcontractor(FactoryMessenger* fmp) { * SmartPointer ao = new MyKind(); * ao -> setParameters(fmp); * return ao; * } * \endcode * * Each object kind should implement setParameter(string name, * string content, string unit) to interpret the individual XML * elements. setParameters() can be overloaded in case the specific * Astrobj class needs low level access to the FactoryMessenger. See * UniformSphere::setParameters(). */ virtual void setParameters(FactoryMessenger *fmp); #endif // Outputs // ------- public: /** * Impact() checks whether a Photon impacts the object between two * integration steps of the photon's trajectory (those two steps are * photon->getCoord(index, coord1) and photon->getCoord(index+1, * coord2)). Impact returns 1 if the photon impacts the object * between these two steps, else 0. In many cases of geometrically * thick obects, the implementation Astrobj::Standard::Impact() will * be fine. * * Impact will call Generic::processHitQuantities() (which is * virtual and may be re-implemented) to compute observable * properties on demand: if the data pointer is non-NULL, the object * will look in it for pointers to properties which apply to its * kind. If a pointer to a property known to this object is present, * then the property is computed and store at the pointed-to * adress. For instance, all objects know the "intensity" * property. If data->intensity != NULL, the instensity is computed * and stored in *data->intensity. * * If data is non-NULL and only in this case, processHitQuantities() * will also call ph->transmit() to update the transmissions of the * Photon (see Photon::transmit(size_t, double)). This must not be * done if data is NULL (see Astrobj::Complex::Impact() for an * explanation). * * \param ph Gyoto::Photon aimed at the object; * \param index Index of the last photon step; * \param data Pointer to a structure to hold the observables at impact. * * \return 1 if impact, 0 if not. */ virtual int Impact(Gyoto::Photon* ph, size_t index, Astrobj::Properties *data=NULL) = 0 ; ///< Does a photon at these coordinates impact the object? /** * \brief Fills Astrobj::Properties * * processHitQuantities fills the requested data in Impact. To use * it, you need to call it in the Impact() method for your object in * case of hit. It will fill Redshift, Intensity, Spectrum, * BinSpectrum and update the Photon's transmission by calling * Photon::transmit(), only if data==NULL. * * You can overload it for your Astrobj. The generic implementation * calls emission(), integrateEmission() and transmission() below. */ virtual void processHitQuantities(Photon* ph, double* coord_ph_hit, double* coord_obj_hit, double dt, Astrobj::Properties* data) const; /** * \brief Specific intensity Iν * * Called by the default implementation for processHitQuantities(). * * emission() computes the intensity Iν emitted by the * small volume of length dsem, in the emitter's * frame. It should take self-absorption along dsem into * account. * * Reminder : * - intensity = Iν [J m^-2 s^-1 ster^-1 Hz^-1]; * * - invariant intensity = Iν3, which * has the same value in any frame; * * - emission coefficient = jν [J m^-3 s^-1 ster^-1 * Hz^-1] , defined by dIν = jν*ds, * where ds is the distance travelled by the photon inside the * object; * - invariant emission coef = jν2, * which has the same value in any frame. * * The equation used for radiative transfer (without absorption) is: * * d(Iν3)/dλ = (jν2) [*] * * where λ is the integration parameter along the null geodesic. * * NB: Let us consider a particular observer, with ν being the * frequency measured by this observer, and ds being the proper * distance (as measured by the observer) that the photon travels * as it moves from λ to λ+dλ along its * geodesic. Then it can be shown that: * * dλ = ds/ν * * This shows that Eq. [*] is homogeneous. * * The default implementation returns 1. if optically thick and dsem * if optically thin. It allows for a quick implementation of your * object for visualization purposes. * * \param nu_em Frequency at emission [Hz] * \param dsem length over which to integrate inside the object * [geometrical units] * \param coord_ph Photon coordinate * \param coord_obj Emitter coordinate at current photon position */ virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]=NULL) const ; /** * \brief Specific intensity Iν for several values of νem * * Called by the default implementation for processHitQuantities(). * * emission() computes the intensity Iν emitted by the small * volume of length dsem. It should take self-absorption along dsem * into account. * * Same as emission(double nu_em, double dsem, double coord_ph[8], * double coord_obj[8]=NULL) const * looping on several values of nu_em. * * \param Inu[nbnu] Output (must be set to a previously allocated * array of doubles) * \param nu_em[nbnu] Frequencies at emission * \param nbnu Size of Inu[] and nu_em[] * \param dsem Length over which to integrate inside the object * \param coord_ph Photon coordinate * \param coord_obj Emitter coordinate at current photon position * \return Iν or dIν [W m-2 sr-2] */ virtual void emission(double Inu[], double nu_em[], size_t nbnu, double dsem, double coord_ph[8], double coord_obj[8]=NULL) const ; /** * Compute the integral of emission() from ν1 to * ν2. The default implementation is a numerical * integrator which works well enough and is reasonably fast if * emission() is a smooth function (i.e. no emission or absorption * lines). If possible, it is wise to implement an analytical * solution. It is used by processHitQuantities to compute the * "BinSpectrum" quantity which is the most physical: it is the only * quantity that can be actually measured directly by a real-life * instrument. */ virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const; ///< ∫ν1ν2 Iν dν (or jν) /** * Like double integrateEmission(double nu1, double nu2, double * dsem, double c_ph[8], double c_obj[8]) const for each * Spectrometer channel. */ virtual void integrateEmission(double * I, double const * boundaries, size_t const * chaninds, size_t nbnu, double dsem, double *cph, double *co) const; ///< ∫ν1ν2 Iν dν (or jν) /** * transmission() computes the transmission of this fluid element or * 0 if optically thick. The default implementation returns 1. (no * attenuation) if optically thin, 0. if optically thick. * * \param nuem frequency in the fluid's frame * \param coord Photon coordinate * \param dsem geometrical length in geometrical units */ virtual double transmission(double nuem, double dsem, double coord[8]) const ; ///< Transmission: exp( αν * dsem ) }; /** * \class Gyoto::Astrobj::Properties * \brief Observable properties of an Astronomical object * * The sort of properties one wants to measure on a ray-traced * Gyoto::Photon which hits a Gyoto::Astrobj. Not all Astrobj are * able to fill all of these properties. * * An instance of Properties essentially contains a bunch of pointers * to memory areas where the observable quantities (see Quantity_t) * should be stored. * * Astrobj::Generic::processHitQuantities() fills the various arrays * upon request. A quantity is ignored if the corresponding pointer * is NULL. * * Scenery::operator()() increments the Properties between each * Photon using Properties::operator++(). * * The main application (gyoto, the yorick plug-in, or your user * application) is responsible for allocating the various arrays, * filling the various members of Properties, and doing whatever * meaninful with the arrays after they have been filled with values * by the ray-tracing code (e.g. saving them to disk or displaying * them). * * Also see Gyoto::Scenery and Gyoto::Quantity_t. */ class Gyoto::Astrobj::Properties : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; public: double *intensity; ///< GYOTO_QUANTITY_INTENSITY : Intensity double *time; ///< GYOTO_QUANTITY_EMISSIONTIME: EmissionTime /** * Behaves like the square of the closest distance between Photon * and Astrobj (but not exactly that). Initialize it to DBL_MAX from * float.h.; */ double *distance; ///< GYOTO_QUANTITY_MIN_DISTANCE: MinDistance /** * First local minimum in distance from object */ double * first_dmin; ///< GYOTO_QUANTITY_FIRST_DMIN : FirstDmin /** * Properties::first_dmin will be set to the first local minimum and * Properties::first_dmin_found will be set to 1 if a local minimum * in distance is found. Initialize it to 0. */ int first_dmin_found; ///< Whether Properties::first_dmin was found /** * Redshift factor νobsem (necessary * for emission lines computation) */ double *redshift; ///< GYOTO_QUANTITY_REDSHIFT : RedShift /** * Iν (ν) (observed specific intensity) */ double *spectrum; ///< GYOTO_QUANTITY_SPECTRUM : Spectrum /** * Iν1ν2, the * integral of Iν over each spectral channel * (i.e. what a spectrometer would measure) */ double *binspectrum; ///< GYOTO_QUANTITY_BINSPECTRUM : BinSpectrum /** * Spectra elements are separated by offset doubles in memory. In * other words, the ith spectral element is spectrum[i*offset]. */ int offset; ///< How to jump from one spectral element to the next /** * Coordinates of the object and photon at impact */ double * impactcoords; ///< GYOTO_QUANTITY_IMPACTCOORDS: ImpactCoords /** * \brief GYOTO_QUANTITY_USER1 : User1 * Astrobj-specific quantity */ double *user1; /** * \brief GYOTO_QUANTITY_USER2 : User2 * Astrobj-specific quantity */ double *user2; /** * \brief GYOTO_QUANTITY_USER3 : User3 * Astrobj-specific quantity */ double *user3; /** * \brief GYOTO_QUANTITY_USER4 : User4 * Astrobj-specific quantity */ double *user4; /** * \brief GYOTO_QUANTITY_USER5 : User5 * Astrobj-specific quantity */ double *user5; # ifdef HAVE_UDUNITS /** * \brief Converter between SI (J.m -2.s-1.sr-1.Hz-1) and requested Intensity unit */ Gyoto::SmartPointer intensity_converter_ ; /** * \brief Converter between SI (J.m -2.s-1.sr-1.Hz-1) and requested Spectrum unit */ Gyoto::SmartPointer spectrum_converter_ ; /** * \brief Converter between SI (J.m -2.s-1.sr-1) and requested BinSpectrum unit */ Gyoto::SmartPointer binspectrum_converter_ ; # endif public: Properties(); ///< Default constructor (everything is set to NULL); Properties (double*, double*); ///<< Set intensity and time pointers. /** * \brief Initialize observable quantities * * The pointed-to values are initialized as follows (if the * corresponding pointer is not NULL): * * - intensity, firt_dmin_found, redshift, userN: 0 * - time, distance, first_dmin: DBL_MAX * - for spectrum and binspectrum, nbnuobs values separated by offset in memory are initialized to 0 * - for impactcoords, 16 contiguous values are initialized to DBL_MAX */ void init(size_t nbnuobs=0); /** * \brief Increment pointers * * All valid pointers are incremented by 1 (sizeof(double)), excepted * impactcoords which is incremented by 16. */ Properties operator++(); # ifdef HAVE_UDUNITS void setIntensityConverter(Gyoto::SmartPointer); ///< Set Properties::intentity_converter_ void setIntensityConverter(std::string); ///< Set Properties::intentity_converter_ void setSpectrumConverter(Gyoto::SmartPointer); ///< Set Properties::spectrum_converter_ void setSpectrumConverter(std::string); ///< Set Properties::spectrum_converter_ void setBinSpectrumConverter(Gyoto::SmartPointer); ///< Set Properties::binspectrum_converter_ void setBinSpectrumConverter(std::string); ///< Set Properties::binspectrum_converter_ # endif }; #endif Gyoto-0.1.0/include/GyotoBlackBodySpectrum.h000066400000000000000000000043311217470755400210210ustar00rootroot00000000000000/** * \file GyotoBlackBodySpectrum.h * \brief I_nu(nu, T) = cst_*2*h*nu^3/c^2/(exp(h*nu/k*T)-1.); * * h = 6.62606896e-34 J.s; J.s = kg.m^2/s * * k = 1.3806504e-23 J.K-1; h/k : s*K = K/Hz. * */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoBlackBodySpectrum_H_ #define __GyotoBlackBodySpectrum_H_ #include "GyotoSpectrum.h" namespace Gyoto { namespace Spectrum { class BlackBody; } } /** * \class Gyoto::Spectrum::BlackBody * \brief Black Body * * Light emitted by e.g. a Star. * * Example XML entity: * \code * * 6000 * 1. * * \endcode * */ class Gyoto::Spectrum::BlackBody : public Gyoto::Spectrum::Generic { friend class Gyoto::SmartPointer; protected: double T_; ///< Temperature (K) double cst_; ///< Scaling constant double Tm1_; ///< 1./T_; public: BlackBody(); /** * \brief Constructor setting T_ and cst_ */ BlackBody(double T, double scaling=1.); virtual BlackBody * clone() const; ///< Cloner double getTemperature() const; ///< Get constant void setTemperature(double); ///< Set constant double getScaling() const; ///< Get exponent void setScaling(double); ///< Set exponent using Gyoto::Spectrum::Generic::operator(); virtual double operator()(double nu) const; #ifdef GYOTO_USE_XERCES virtual void setParameter(std::string name, std::string content, std::string unit); virtual void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoComplexAstrobj.h000066400000000000000000000122471217470755400204050ustar00rootroot00000000000000/** * \file GyotoComplexAstrobj.h * \brief Combine astronomical objects * * An astrobj made of several astrobjs */ /* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoComplexAstrobj_H_ #define __GyotoComplexAstrobj_H_ #include namespace Gyoto{ namespace Astrobj { class Complex; } } /** * \class Gyoto::Astrobj::Complex * \brief Complex astronomical object * * A Gyoto::Astrobj::Generic whic contain several * Gyoto::Astrobj::Generic instances. It is essentially a * SmartPointer array, which some methods * around. Indeed, the operator[](size_t i) method is implemented to * retrieve the i-th element. * * In an XML description, the <Astrobj> section must be unique, * its kind is "Complex". Each sub-astrobj then appears as a * <SubAstrobj> subsection: * \code * * * * 2. * 0. 0. 0.037037 * 600. 9. 1.5707999999999999741 0 * * 0 * 0.001 * * * 0 * 0.01 * * * * * \endcode * */ class Gyoto::Astrobj::Complex : public Gyoto::Astrobj::Generic { friend class Gyoto::SmartPointer; // Data : // ----- protected: /** * \brief Number of objects */ size_t cardinal_; /** * \brief Array of Astrobj::Generic */ Gyoto::SmartPointer * elements_; /** * Currently not settable, always equal to GYOTO_DEFAULT_DELTA */ double step_max_; ///< Maximum δ step inside the Astrobj public: Complex(); ///< Default constructor. Complex(const Complex& ) ; ///< Copy constructor. virtual Complex* clone() const; ///< "Virtual" copy constructor /** * Frees every SmartPointer before freed the array itself. */ virtual ~Complex() ; ///< Destructor // Mutators // -------- public: /** * If the Astrobj::Complex itself does not have a metric already * assigned, it takes it from the new element. Else, it sets the * metric in the new element to its own. This ensures that all * elements use the same metric (this heuristic is not entirely * fool-proof, it's safer to set the metric directly in the * Astrobj::Complex). */ void append(Gyoto::SmartPointer element); ///< Add element at the end of the array. void remove(size_t i); ///< Remove i-th element from the array. size_t getCardinal() const; ///< Get the number of elements in the array. void setMetric(SmartPointer gg); ///< Set metric in each element. public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; virtual void setParameters(FactoryMessenger *fmp); #endif // Outputs // ------- public: /** * Astrobj::Complex::Impact(Gyoto::Photon* ph, size_t index, * Astrobj::Properties *data) calls the specific implementation of * Astrobj::Generic::Impact() for each of its * elements twice: the first time, data is set to NULL so that * Astrobj::Complex::Impact() only knows whether each object is hit * by the Photon. If no object is hit, return. If a single object is * hit, call Impact() again only for this object, passing data this * time. If several objects are hit, the Photon's trajectory is * refined so that the step is at most step_max_ and the Impact() * methods for each of the hit objects are called again for each * step, passing data. It is therefore important that the * transmission of the Photon is not touched by Impact() when * data==NULL. * */ virtual int Impact(Gyoto::Photon* ph, size_t index, Astrobj::Properties *data=NULL) ; ///< Call Impact() for each of the elements. /** * This should work as expected: * \code * SmartPointer cplx; * SmartPointer objA; * SmartPointer objB; * cplx -> append(objA); * cplx[0] = objB; * \endcode */ Gyoto::SmartPointer operator[](size_t i) ; ///< Retrieve i-th element. Gyoto::SmartPointer const operator[](size_t i) const; ///< Retrieve a const version of the i-th element. }; #endif Gyoto-0.1.0/include/GyotoComplexSpectrometer.h000066400000000000000000000117561217470755400214610ustar00rootroot00000000000000/** * \file GyotoComplexSpectrometer.h * \brief Combine spectrometer objects * * A spectrometer made of several spectrometers */ /* Copyright 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoComplexSpectrometer_H_ #define __GyotoComplexSpectrometer_H_ #include namespace Gyoto{ namespace Spectrometer { class Complex; } } /** * \class Gyoto::Spectrometer::Complex * \brief Complex spectrometer object * * A Gyoto::Spectrometer::Generic whic contain several * Gyoto::Spectrometer::Generic instances. It is essentially a * SmartPointer array, which some methods * arround. Indeed, the operator[](size_t i) method is implemented to * retrieve the i-th element. * * In an XML description, the <Spectrometer> section is unique, * its kind is "Complex". Each sub-spectrometer then appears as a * <SubSpectrometer> subsection. For instance, to compute 10 * channels ovr the K infrared band plus 10 channels in the high * energy domain: * \code * * * 2.0 2.4 * * * 14 22 * * * \endcode * */ class Gyoto::Spectrometer::Complex : public Gyoto::Spectrometer::Generic, public Gyoto::Hook::Listener { friend class Gyoto::SmartPointer; // Data : // ----- protected: /** * \brief Number of subspectrometers * * Size of elements_. */ size_t cardinal_; /** * \brief Actual array of SmartPointer objects */ Gyoto::SmartPointer * elements_; public: Complex(); ///< Default constructor. Complex(const Complex& ) ; ///< Copy constructor. /** * \brief Clone an instance * * Use this to get a deep copy of an instance; * \code * SmartPointer myclone = orig->clone(); * \endcode * * Most implementations will use the copy constructor: * \code * Generic* Uniform::clone() const { return new Uniform(*this); } * \endcode */ virtual Complex* clone() const; /** * Frees every SmartPointer before freed the * array itself. */ virtual ~Complex() ; ///< Destructor // Mutators // -------- public: /** * If the Spectrometer::Complex itself does not have a metric already * assigned, it takes it from the new element. Else, it sets the * metric in the new element to its own. This ensures that all * elements use the same metric (this heuristic is not entirely * fool-proof, it's safer to set the metric directly in the * Spectrometer::Complex). */ void append(Gyoto::SmartPointer element); ///< Add element at the end of the array. void remove(size_t i); ///< Remove i-th element from the array. size_t getCardinal() const; ///< Get the number of elements in the array. virtual void tell(Gyoto::Hook::Teller *msg); public: #ifdef GYOTO_USE_XERCES /** * \brief Fill in the XML entity * * Loops on elements_[i]->fillElement(); */ virtual void fillElement(FactoryMessenger *fmp) const ; /** * \brief Main loop in the (templated) subcontractor * * In the case of Spectrometer::Complex, the setParameter() API is * not sufficient: setParameters() needs acces to the * FactoryMessenger to instanciate childs for the SubSpectrometers. */ virtual void setParameters(FactoryMessenger *fmp); #endif // Outputs // ------- public: /** * This should work as expected: \code SmartPointer cplx; SmartPointer objA; SmartPointer objB; cplx -> append(objA); cplx[0] = objB; \endcode */ Gyoto::SmartPointer operator[](size_t i) ; ///< Retrieve i-th element. Gyoto::SmartPointer const operator[](size_t i) const; ///< Retrieve a const version of the i-th element. /** * \brief "Complex" * * Use this static member attribute to check whether a Spectrometer * object spectro is of kind Complex: * \code * if (spectro->getKind() == Complex::Kind) ... ; * \endcode * */ static kind_t const Kind; protected: }; #endif Gyoto-0.1.0/include/GyotoConfig.h.in000066400000000000000000000154421217470755400172630ustar00rootroot00000000000000/** * \file GyotoConfig.h * \brief Compile-time configuration * * Codes based on Gyoto and Gyoto plug-ins must have access to the * flags used when compiling Gyoto. This files is generated by Gyoto's * configure script and holds influential variables such as * HAVE_SINCOS. * * The values determined by configure when this documentation was * built are documented, replaced by "(undefined)" if the macro was * undefined. */ /* Copyright 2012 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoConfig_H_ #define __GyotoConfig_H_ /** \def GYOTO_DEBUG_ENABLED \brief Whether debugging information gathering code was enabled. */ #undef GYOTO_DEBUG_ENABLED #ifdef DOXYGEN_RUN # ifndef GYOTO_DEBUG_ENABLED # define GYOTO_DEBUG_ENABLED (undefined) # endif #endif /** \def GYOTO_PLUGIN_SFX \brief Suffix for Gyoto plug-ins. */ #undef GYOTO_PLUGIN_SFX #ifdef DOXYGEN_RUN # ifndef GYOTO_PLUGIN_SFX # define GYOTO_PLUGIN_SFX (undefined) # endif #endif /** \def GYOTO_PREFIX \brief Gyoto prefix. */ #undef GYOTO_PREFIX #ifdef DOXYGEN_RUN # ifndef GYOTO_PREFIX # define GYOTO_PREFIX (undefined) # endif #endif /** \def GYOTO_SOVERS \brief Gyoto ABI version. Updated in stable releases, not during dev. cycle. */ #undef GYOTO_SOVERS #ifdef DOXYGEN_RUN # ifndef GYOTO_SOVERS # define GYOTO_SOVERS (undefined) # endif #endif /** \def GYOTO_USE_CFITSIO * \brief Whether cfitsio support is compiled-in. * * Necessary for FITS file format i/o, used in the Gyoto tool and * optional in Gtyoto::PatternDisk. */ #undef GYOTO_USE_CFITSIO #ifdef DOXYGEN_RUN # ifndef GYOTO_USE_CFITSIO # define GYOTO_USE_CFITSIO (undefined) # endif #endif /** \def GYOTO_USE_LORENE \brief Whether Lorene support is compiled-in. Used only in the lorene plug-in. */ #undef GYOTO_USE_LORENE #ifdef DOXYGEN_RUN # ifndef GYOTO_USE_LORENE # define GYOTO_USE_LORENE (undefined) # endif #endif /** \def GYOTO_USE_XERCES \brief Whether Xerces support (XML i/o) is compiled-in. Used only in the Gyoto::Factory but Gyoto build is not often tested without it. */ #undef GYOTO_USE_XERCES #ifdef DOXYGEN_RUN # ifndef GYOTO_USE_XERCES # define GYOTO_USE_XERCES (undefined) # endif #endif /** \def HAVE_DLFCN_H \brief Whether header file was found. */ #undef HAVE_DLFCN_H #ifdef DOXYGEN_RUN # ifndef # define (undefined) # endif #endif /** \def HAVE_INTTYPES_H \brief Whether header file was found. */ #undef HAVE_INTTYPES_H #ifdef DOXYGEN_RUN # ifndef HAVE_INTTYPES_H # define HAVE_INTTYPES_H (undefined) # endif #endif /** \def HAVE_LIBDL \brief Whether the `dl' library (-ldl) was found. Plug-in support. */ #undef HAVE_LIBDL #ifdef DOXYGEN_RUN # ifndef HAVE_LIBDL # define HAVE_LIBDL (undefined) # endif #endif /** \def HAVE_MEMORY_H \brief Whether the header file was found. */ #undef HAVE_MEMORY_H #ifdef DOXYGEN_RUN # ifndef HAVE_MEMORY_H # define HAVE_MEMORY_H (undefined) # endif #endif /** \def HAVE_PTHREAD * \brief Whether POSIX threads support is compiled-in. * * Multi-threading support, see Gyoto::Scenery::nthreads_. */ #undef HAVE_PTHREAD #ifdef DOXYGEN_RUN # ifndef HAVE_PTHREAD # define HAVE_PTHREAD (undefined) # endif #endif /** \def HAVE_PTHREAD_PRIO_INHERIT \brief Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT #ifdef DOXYGEN_RUN # ifndef HAVE_PTHREAD_PRIO_INHERIT # define HAVE_PTHREAD_PRIO_INHERIT (undefined) # endif #endif /** \def HAVE_SINCOS * \brief Whether the `sincos' function is available. * * Else Gyoto provides it as a macro in GyotoDefs.h. */ #undef HAVE_SINCOS #ifdef DOXYGEN_RUN # ifndef HAVE_SINCOS # define HAVE_SINCOS (undefined) # endif #endif /** \def HAVE_STDINT_H \brief Whether the header file was found. */ #undef HAVE_STDINT_H #ifdef DOXYGEN_RUN # ifndef HAVE_STDINT_H # define HAVE_STDINT_H (undefined) # endif #endif /** \def HAVE_STDLIB_H \brief Whether the header file was found. */ #undef HAVE_STDLIB_H #ifdef DOXYGEN_RUN # ifndef HAVE_STDLIB_H # define HAVE_STDLIB_H (undefined) # endif #endif /** \def HAVE_STRINGS_H \brief Whether the header file was found. */ #undef HAVE_STRINGS_H #ifdef DOXYGEN_RUN # ifndef HAVE_STRINGS_H # define HAVE_STRINGS_H (undefined) # endif #endif /** \def HAVE_STRING_H \brief Whether the header file was found. */ #undef HAVE_STRING_H #ifdef DOXYGEN_RUN # ifndef HAVE_STRING_H # define HAVE_STRING_H (undefined) # endif #endif /** \def HAVE_SYS_STAT_H \brief Whether the header file was found. */ #undef HAVE_SYS_STAT_H #ifdef DOXYGEN_RUN # ifndef HAVE_SYS_STAT_H # define HAVE_SYS_STAT_H (undefined) # endif #endif /** \def HAVE_SYS_TYPES_H \brief Whether the header file was found. */ #undef HAVE_SYS_TYPES_H #ifdef DOXYGEN_RUN # ifndef HAVE_SYS_TYPES_H # define HAVE_SYS_TYPES_H (undefined) # endif #endif /** \def HAVE_UDUNITS * \brief Whether libudunits2 support is compiled in. * * Foundation for the Gyoto::Units framework. Gyoto ought to build * and work without it, but with restricted unit conversion * capabilities. */ #undef HAVE_UDUNITS #ifdef DOXYGEN_RUN # ifndef HAVE_UDUNITS # define HAVE_UDUNITS (undefined) # endif #endif /** \def HAVE_UNISTD_H \brief Whether the header file was found. */ #undef HAVE_UNISTD_H #ifdef DOXYGEN_RUN # ifndef HAVE_UNISTD_H # define HAVE_UNISTD_H (undefined) # endif #endif /** \def HAVE__BOOL \brief Whether the system has the type `_Bool'. */ #undef HAVE__BOOL #ifdef DOXYGEN_RUN # ifndef HAVE__BOOL # define HAVE__BOOL (undefined) # endif #endif /** \def PTHREAD_CREATE_JOINABLE \brief Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE #ifdef DOXYGEN_RUN # ifndef PTHREAD_CREATE_JOINABLE # define PTHREAD_CREATE_JOINABLE (undefined) # endif #endif /** \def STDC_HEADERS \brief Whether the ANSI C header files were found. */ #undef STDC_HEADERS #ifdef DOXYGEN_RUN # ifndef STDC_HEADERS # define STDC_HEADERS (undefined) # endif #endif /** \def size_t \brief If not defined in . */ #undef size_t #ifdef DOXYGEN_RUN # ifndef size_t # define size_t (undefined) # endif #endif #endif Gyoto-0.1.0/include/GyotoConverters.h000066400000000000000000000407551217470755400176100ustar00rootroot00000000000000/** * \file GyotoConverters.h * \brief GYOTO converters * * As a (recommended) option, Gyoto can use the libudunits2 library * by UCAR/Unidata * (http://www.unidata.ucar.edu/software/udunits/udunits-2/udunits2.html) * to perform conversions to and from various units. Since udunits * parses units, the following are equivalent for instance: * "mJy.sr-1", "mJy/sr", "1e-3Jy/sr". Gyoto considers every string as * UTF-8: either use UTF-8 or stay with ASCII. This means "µ" can be * used for "micro" and powers can be noted as superscripts: m³, * pix². * * In addition to the stock units known by udunits2, Gyoto registers * the following (which may be used in any context): Jansky (symbol * Jy), symbol "pc" for parsec, "sunradius", "sunmass", symbol "as" * for "arcsec". * * Other units are context-sensitive: "geometrical" allows converting * between geometrical units and other legnth units, but only when a * Metric is defined, and may not be used (yet) in compound * units. Likewise, "geometrical_time" can be used as duration unit * whenever a Metric is defined, but not in a compound unit. * * When a Screen is defined, "pix" can be used as an angle unit (you * need to call Screen::mapPixUnit() and Screen::unmapScreenUnit(), * which is done automatically in certain contexts). * * Units can often be specified using the "unit" XML attribute: * \code * * * 4e6 * * * * * 8 * * * 150 * * * \endcode * * Units for output quantities are specified after the name of the * quantity, in squared brackets, e.g.: * \code * * Spectrum[erg.s-1.cm-2.sr-1.Hz-1] * * \endcode * or * \code * * Spectrum[mJy/pix²] * * \endcode */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoConverters_H_ #define __GyotoConverters_H_ #include #include #ifdef HAVE_UDUNITS #include #endif #include #include namespace Gyoto { namespace Metric { class Generic; } namespace Units { /** * \namespace Gyoto::Units * \brief Units-related classes and functions */ #ifdef HAVE_UDUNITS /** * \class Gyoto::Units::Unit * \brief Wrapper around ut_unit from udunits * * Gyoto::Units::Unit objects usually cast seamlessly to and from * udunits2 ut_unit* and std::string. */ class Unit; /** * \class Gyoto::Units::Converter * \brief Wrapper around ut_converter from udunits * * A Gyoto::Units::Converter object is a functor and can be used * to convert efficiently between the two units specified at * instantiation time: * * \code * Gyoto::Units::Unit from_unit ("erg.s-1.cm-2.sr-1.Hz-1"), * to_unit ("mJy/µas²"); * double data_in[1000], data_out[1000]; * Converter conv(from_unit, to_unit); * for (size_t i=0; i<1000; ++i) data_out[i] = conv(data_in[i]); * \endcode * * Since std::string cast automatically to Gyoto::Units::Unit * object, this is equivalent: * * \code * Converter conv("erg.s-1.cm-2.sr-1.Hz-1", "mJy/µas²"); * for (size_t i=0; i<1000; ++i) data_out[i] = conv(data_in[i]); * \endcode */ class Converter; /** * \brief Retrieve the unit system used in all of Gyoto */ ut_system * getSystem(); #endif /** * \brief Load and initialize all (non-context-sensitive) units * * If udunits is used (preprocessor macro HAVE_UDUNITS), Init() * initializes the ut_system used throughout Gyoto and maps a few * additional units to the unit system. */ void Init(); /** * \brief Convert from arbitrary length unit to meters * * Convert value from unit represented by "unit" to meters. * * If gg is provided (and not NULL), use it to interpret the * string "geometrical" as representing * gg->Gyoto::Metric::Generic::unitLength(). * * ToMeters() will also convert time, frequency and energy units * to meters (as in frequency -> wavelength). * * \param value * (double) the value to convert, expressed according to "unit" * \param unit (std::string) the "unit" from which to convert, * e.g. "km", "sunradius" or "geometrical". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &, * NULL if not specified) optional metric to interpret * "geometrical". * * \return value, expressed in meters. */ double ToMeters(double value, const std::string &unit, const Gyoto::SmartPointer &gg=NULL); /** * \brief Convert to arbitrary length unit from meters * * Convert value to unit represented by "unit" from meters. * * If gg is provided (and not NULL), use it to interpret the * string "geometrical" as representing * gg->Gyoto::Metric::Generic::unitLength(). * * ToMeters() will also convert to time, frequency and energy * units (as in wavelength -> frequency). * * \param value * (double) the value to convert, expressed in meters. * \param unit (std::string) the "unit" to which to convert, * e.g. "km", "sunradius" or "geometrical". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &, * NULL if not specified) optional metric to interpret * "geometrical". * * \return value, expressed in "unit". */ double FromMeters(double value, const std::string &unit, const Gyoto::SmartPointer &gg=NULL); /** * \brief Convert from arbitrary time unit to seconds * * Convert value from unit represented by "unit" to seconds. * * If gg is provided (and not NULL), use it to interpret the * string "geometrical_time" as representing * gg->Gyoto::Metric::Generic::unitLength()/GYOTO_C. * * \param value * (double) the value to convert, expressed according to "unit" * \param unit (std::string) the "unit" from which to convert, * e.g. "s", "yr" or "geometrical_time". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &, * NULL if not specified) optional metric to interpret * "geometrical". * * \return value, expressed in seconds. */ double ToSeconds(double value, const std::string &unit, const Gyoto::SmartPointer &gg=NULL); /** * \brief Convert to arbitrary time unit from seconds * * Convert value to unit represented by "unit" from seconds. * * If gg is provided (and not NULL), use it to interpret the * string "geometrical_time" as representing * gg->Gyoto::Metric::Generic::unitLength()/GYOTO_C. * * \param value * (double) the value to convert, expressed in seconds. * \param unit (std::string) the "unit" to which to convert, * e.g. "s", "yr" or "geometrical_time". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &, * NULL if not specified) optional metric to interpret * "geometrical". * * \return value, expressed in "unit". */ double FromSeconds(double value, const std::string &unit, const Gyoto::SmartPointer &gg=NULL); /** * \brief Convert from arbitrary mass unit to kilograms * * Convert value from unit represented by "unit" to kilograms. * * \param value * (double) the value to convert, expressed according to "unit" * \param unit (std::string) the "unit" from which to convert, * e.g. "g", "kg" or "sunmass". More units are * supported if Gyoto was compiled with udunits support. * * \return value, expressed in kilograms. */ double ToKilograms(double value, const std::string & unit); /** * \brief Convert to arbitrary mass unit from kilograms * * Convert value from unit represented by "unit" from kilograms. * * \param value * (double) the value to convert, expressed inkilograms. * \param unit (std::string) the "unit" to which to convert, * e.g. "g", "kg" or "sunmass". More units are * supported if Gyoto was compiled with udunits support. * * \return value, expressed in "unit". */ double FromKilograms(double value, const std::string & unit); /** * \brief Convert from arbitrary length unit to geometrical units * * Convert value from unit represented by "unit" to geometrical units. * * \param value * (double) the value to convert, expressed according to "unit". * \param unit (std::string) the "unit" from which to convert, * e.g. "km", "sunradius" or "geometrical". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &) * metric to interpret "geometrical". * * \return value, expressed in geometrical units. */ double ToGeometrical(double value, const std::string & unit, const Gyoto::SmartPointer & gg); /** * \brief Convert to arbitrary length unit from geometrical units * * Convert value to unit represented by "unit" from geometrical units. * * \param value * (double) the value to convert, expressed in geometrical units. * \param unit (std::string) the "unit" to which to convert, * e.g. "km", "sunradius" or "geometrical". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &) * metric to interpret "geometrical". * * \return value, expressed in "unit". */ double FromGeometrical(double value, const std::string & unit, const Gyoto::SmartPointer & gg); /** * \brief Convert from arbitrary time unit to geometrical units * * \param value * (double) the value to convert, expressed according to "unit". * \param unit (std::string) the "unit" from which to convert, * e.g. "s", "kyr" or "geometrical_time". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &) * metric to interpret "geometrical_time". * * \return value, expressed in geometrical (time) units. */ double ToGeometricalTime(double value, const std::string & unit, const Gyoto::SmartPointer & gg); /** * \brief Convert to arbitrary time unit from geometrical units * * \param value * (double) the value to convert, expressed in geometrical units. * \param unit (std::string) the "unit" to which to convert, * e.g. "yr", "s" or "geometrical_time". More units are * supported if Gyoto was compiled with udunits support. * \param gg (const Gyoto::SmartPointer &) * metric to interpret "geometrical_time". * * \return value, expressed in "unit". */ double FromGeometricalTime(double value, const std::string & unit, const Gyoto::SmartPointer &gg); /** * \brief Convert from arbitrary frequency unit to Herz * * ToHerz will also convert from length and energy units (such as * "eV"). * * \param value * (double) the value to convert, expressed according to "unit". * \param unit (std::string) the "unit" from which to convert, * e.g. "MHz", "keV" * * \return value, expressed in "Hz". */ double ToHerz(double value, const std::string &unit); /** * \brief Convert to arbitrary frequency unit from Herz * * FromHerz will also convert to length and energy units (such as * "eV"). * * \param value * (double) the value to convert, expressed according in "Hz". * \param unit (std::string) the "unit" from which to convert, * e.g. "MHz", "keV" * * \return value, expressed in "units". */ double FromHerz(double value, const std::string &unit); # ifdef HAVE_UDUNITS /** * \brief Is it possible to convert between unit1 and unit2? * * e.g. areConvertible("m", "kg") == 0; areConvertible("m", "km")==1. * * Warning: angle units are dimensionless, therefore e.g. * areConvertible("Jy", "Jy/microacsec2")==1. Numerically, "Jy" is * the same as "Jy/sr2". * * \param unit1 (Gyoto::Units::Unit) first unit * \param unit2 (Gyoto::Units::Unit) second unit * * \return bool, True if it is possible to convert between the two * units, 0 otherwise. */ bool areConvertible(const Unit &unit1, const Unit &unit2); # endif } } #ifdef HAVE_UDUNITS class Gyoto::Units::Unit : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; friend class Gyoto::Units::Converter; private: ut_unit * unit_; ///< the underlying ut_unit (from udunits) std::string kind_; ///< the string used to instanciate this unit public: /** * \brief Build Unit described by string * * Throws a Gyoto::Error if anything goes wrong. * * \param unit string description of the unit, e.g. "mJy/sr2" or "sunmass". */ Unit(const std::string &unit); /** * \brief Build Unit described by C string * * Throws a Gyoto::Error if anything goes wrong. * * \param unit char const * const description of the unit, * e.g. "mJy/sr2" or "sunmass". */ Unit(char const * const unit); /** * \brief Destructor * * Frees unit_. */ ~Unit(); /** * \brief Convert to Unit * * \param val double to convert * \param from_unit Unit from which to convert * * \return value converted to unit_. */ double To (double val, const Unit &from_unit); /** * \brief Convert from Unit * * \param val double to convert * \param to_unit Unit to which to convert * * \return value converted to "to_unit". */ double From (double val, const Unit &to_unit); /** * \brief Cast to string * * \return kind_ */ operator std::string() const ; /** * \brief Cast to ut_unit* * * \return unit_ */ operator ut_unit*() const ; }; class Gyoto::Units::Converter : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; private: cv_converter * converter_; ///< Underlying ut_converter object from udunits public: Converter(); ///< Construct trivial Converter (Converter()(x)==x) Converter(const Gyoto::Units::Unit& from, const Gyoto::Units::Unit& to); ///< Construct Converter from two Unit ~Converter(); ///< Destruct converter, freeing converter_ void reset(); ///< Reset to trivial Converter (Converter()(x)==x) void reset(const Gyoto::Units::Unit& from, const Gyoto::Units::Unit& to); ///< Reset to converter from "from" to "to" /** * \brief Actually convert data * * The entire Gyoto::Units::Converter class is there just for this * operator, which converts value from unit "from" to unit "to" * where "from" and "to" are the two Units passed to the constructor * Gyoto::Units::Converter::Converter(const Gyoto::Units::Unit& * from, const Gyoto::Units::Unit& to). * * \param value double expressed in Unit from * * \return converted value expressed in Unit to */ double operator()(double value) const ; }; #endif #endif Gyoto-0.1.0/include/GyotoDefs.h000066400000000000000000000340771217470755400163370ustar00rootroot00000000000000/** * \file GyotoDefs.h * \brief Gyoto ubiquitous macros and typedefs */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoDefs_H_ #define __GyotoDefs_H_ #include "GyotoConfig.h" /** * \brief Replacement for GNU extension sincos * * If #HAVE_SINCOS is undefined, Gyoto provides a trivial * implementation. * \param[in] t Angle in radian; * \param[out] s Adress where sin(t) should be stored; * \param[out] c Adress where cos(t) should be stored. */ #if !HAVE_SINCOS #define sincos(t, s, c) *s=sin(t); *c=cos(t) #else # ifdef DOXYGEN_RUN # define sincos(t, s, c) (undefined) # endif #endif /* Typedef for various Gyoto data types */ namespace Gyoto { //\{ /** * \name Observable quantities * * Individual quantities are represented as a variable of this * type. A combination of quantities is an ored list of Quantity_t, * e.g. * * \code * GYOTO_QUANTITY_INTENSITY | GYOTO_QUANTITY_EMISSIONTIME * \endcode * * To check wheter a given quantity is listed in a Quantity_t * variable quant: * \code * if (quant & GYOTOQUANTITY_EMISSION) ... * \endcode * * List of all possible Quantity_t individual values and the * corresponding string (see Gyoto::Scenery) with corresponding XML * name: */ /// Type for observabke quantities typedef unsigned int Quantity_t; /* Generic */ /// Intensity: Iν at Scenery::freq_obs_. #define GYOTO_QUANTITY_INTENSITY 1 /// EmissionTime: Emission date. #define GYOTO_QUANTITY_EMISSIONTIME 2 /// MinDistance: Behaves like minimal distance between Photon and Astrobj. /** * Not always exactly a distance, though. */ #define GYOTO_QUANTITY_MIN_DISTANCE 4 /// FirstDmin: First Photon-Astrobj distance local minimum while integrating back in time. #define GYOTO_QUANTITY_FIRST_DMIN 8 /// Redshift: νobsem. #define GYOTO_QUANTITY_REDSHIFT 16 /// ImpactCoords: Astrobj and Photon 8-coordinates at emission. /** * A 16-element vector. See Gyoto::Quantity_t. */ #define GYOTO_QUANTITY_IMPACTCOORDS 32 /// Spectrum: Iν at each frequency in Scenery::screen_->getMidpoints(). #define GYOTO_QUANTITY_SPECTRUM 512 /// Spectrum: ∫ν1ν2Iν dν in each frequency channel in Scenery::screen_. #define GYOTO_QUANTITY_BINSPECTRUM 1024 /* Astrobj-specific */ /// User1: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER1 32768 /// User2: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER2 16384 /// User3: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER3 8192 /// User4: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER4 4096 /// User5: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER5 2048 //\} /** * \name Gyoto messages * \brief Controling which messages are shown to the user * * The user should be able to choose which messages are shown to * her. In Gyoto, this is determined by a user-settable verbosity * level (see Gyoto::verbose()) and a user-settable debug mode (see * Goyto::debug()). * * The following macros define various debug and verbosity level and * provide short-cuts to display formatted messages only at a given * verbosity level or in debug mode. */ //\{ /// Type for verbosity levels typedef unsigned int Verbosity_t; /// Default debug mode #define GYOTO_DEFAULT_DEBUG_MODE 0 /// Quiet Gyoto::Verbosity_t /** * Only very few messages may be output to stdout at this level. * * Use #GYOTO_QUIET to display messages at this level. */ #define GYOTO_QUIET_VERBOSITY 1 /// Severe warnings /** * Severe warning messages are output to stderr if * Gyoto::verbose()≥GYOTO_SEVERE_VERBOSITY. * * Use #GYOTO_SEVERE to display messages at this level. */ #define GYOTO_SEVERE_VERBOSITY 3 /// Warnings /** * Warning messages are output to stderr if * Gyoto::verbose()≥GYOTO_WARNING_VERBOSITY. * * Use #GYOTO_WARNING to display messages at this level. */ #define GYOTO_WARNING_VERBOSITY GYOTO_SEVERE_VERBOSITY /// Default verbosity level /** * Normal messages are output to stdout if * Gyoto::verbose()≥GYOTO_DEFAULT_VERBOSITY. * * Use #GYOTO_MSG to display messages at this level. */ #define GYOTO_DEFAULT_VERBOSITY 5 /// Informative messages /** * Informative messages are output to stderr if * Gyoto::verbose()≥GYOTO_INFO_VERBOSITY. * * Use #GYOTO_INFO to display messages at this level. */ #define GYOTO_INFO_VERBOSITY 10 /// Maximum verbosity level /** * In debug mode, all messages are displayed in addition to specific * debug information. * * To display debug messages, check #GYOTO_DEBUG_MODE or use * #GYOTO_DEBUG for instance. */ #define GYOTO_DEBUG_VERBOSITY 3000 /// Display a message to stdout even in quiet mode. /** * Only very few messages may be output to stdout at this * level. This should be reserved to messages shown at most once in * a run. * * \code * GYOTO_QUIET << "Important message displayed once" << std::endl; * \endcode */ #define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) std::cout /// Display a severe level message to stderr. /** * \code * GYOTO_SEVERE << "Important warning" << std::endl; * \endcode */ #define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"SEVERE: " /// Display a warning level message to stderr. /** * \code * GYOTO_WARNING << "Warning" << std::endl; * \endcode */ #define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"WARNING: " /// Display normal message to stdout. /** * The message will by default be shown to the user. To be reserved * to messages shown at most once per Gyoto::Screen row. * * \code * GYOTO_MSG << "Message" << std::endl; * \endcode */ #define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) std::cout /// Display informative message to stderr. /** * Message will be shown to the user only if Gyoto::verbose() has * been explicitely raised. * * \code * GYOTO_MSG << "Message" << std::endl; * \endcode */ #define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) std::cerr<<"INFO: " /// Unit ignored because libudunits2 was disabled. /** * Use this warning when a conversion has been dropped due to * #HAVE_UDUNITS being undefined. * * \param from From unit. * \param to To unit. */ #define GYOTO_WARNING_UDUNITS(from, to) \ GYOTO_WARNING << "unit ignored (trying to convert from \"" << from \ << "\" to " \ << to \ << "\"), you may have more chance recompiling Gyoto with --with-udunits\n" /// Output expression value in debug mode /** * Output, only in debug mode both code and value that code * yield. For instance: * \code * int a=1, b=2; * GYOTO_DEBUG_EXPR(a+b); * \endcode * will essentially output, only in debug mode: * \code * DEBUG: : a+b=3 * \endcode */ #define GYOTO_DEBUG_EXPR(a) GYOTO_DEBUG << #a << "=" << a << std::endl /// Output array content in debug mode /** * Output, only in debug, name and content of array. * For instance: * \code * int a[]= {1, 2, 3}; * GYOTO_DEBUG_ARRAY(a,3); * \endcode * will essentially output, only in debug mode: * \code * DEBUG: : a=[1,2,3] * \endcode * * \param a Array * \param n Number of elements to show (array must be at least this * size). */ #define GYOTO_DEBUG_ARRAY(a,n) if (GYOTO_DEBUG_MODE) { \ std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " \ << #a << "=[" << a[0] ; \ for (size_t _gyoto_debug_array_i=1; _gyoto_debug_array_i < n; ++_gyoto_debug_array_i) \ std::cerr << "," << a[_gyoto_debug_array_i] ; \ std::cerr << "]" << std::endl ;} /// Display debug message /** * Message is deiplayed only if #GYOTO_DEBUG_MODE is true and is * prepended with the word "DEBUG:" and the signature of the * function. * * \code * GYOTO_DEBUG << "message" << endl; * \endcode */ #define GYOTO_DEBUG if (GYOTO_DEBUG_MODE) std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " /// Start debug-only block. /** * Code between GYOTO_IF_DEBUG and #GYOTO_ENDIF_DEBUG is only * executed in debug mode. */ #define GYOTO_IF_DEBUG if (GYOTO_DEBUG_MODE) { /// End debug-only block. /** * Code between #GYOTO_IF_DEBUG and GYOTO_ENDIF_DEBUG is only * executed in debug mode. */ #define GYOTO_ENDIF_DEBUG } /// Whether debug mode is activated (run-time). #define GYOTO_DEBUG_MODE Gyoto::debug() //\} //\{ /** * \name Coordinate system kind * GYOTO_COORDKIND_CARTESIAN or GYOTO_COORDKIND_SPHERICAL * * Every Gyoto::Metric has a coordinate system kind. It can be used * by functions which need to express coordinates always in * spherical or always in Cartesian form, with trivial conversion * between the two. */ /** * \brief Type for coordinate system kinds */ typedef unsigned int CoordKind_t; #define GYOTO_COORDKIND_UNSPECIFIED 0 ///< Unspecified coordinate kind #define GYOTO_COORDKIND_CARTESIAN 1 ///< Cartesian-like coordinate system #define GYOTO_COORDKIND_SPHERICAL 2 ///< Spherical-like coordinate system //\} } //{ /** * \name Default values for various things */ #define GYOTO_DEFAULT_X_SIZE 1024 ///< Default size for arrays in a Worldline /** * \brief Default value for the initial step in the integration loop. * * Since the step is (most of the time) adaptive, this default only * has little influence, but sometimes, it matters. Also used in * Scenery. */ #define GYOTO_DEFAULT_DELTA 0.01 /** * \brief Default value for Gyoto::Worldline::maxiter_ */ #define GYOTO_DEFAULT_MAXITER 100000 /** * \brief Precision on the determination of a date * * E.g. in Gyoto::Photon::findMin(), Gyoto::Photon::findValue(). */ #define GYOTO_T_TOL 1e-4 /// \brief Default value for Screen::dmax_ #define GYOTO_SCREEN_DMAX 1e7 //For displays with setw and setprecision /// Precision when outputting double values #define GYOTO_PREC 15 /// \brief Field width when outputting double values #define GYOTO_WIDTH 25 /* Plugins Stuff */ /// \brief Default list of default plug-ins to load... #ifndef GYOTO_DEFAULT_PLUGINS #define GYOTO_DEFAULT_PLUGINS "stdplug,nofail:lorene" #endif #ifndef GYOTO_PLUGIN_SFX #define GYOTO_PLUGIN_SFX "so" #endif //\} //\{ /** *\name Physical constants */ /// \brief Celerity of light (m/s) #define GYOTO_C 299792458. /// \brief Celerity of light (cm/s) #define GYOTO_C_CGS 2.99792458e10 /// \brief Gravitational constant (SI = m^3 * kg^-1 * s-2) #define GYOTO_G 6.67428e-11 /// \brief Gravitational constant (cgs: cm^3 * g^-1 * s-2) #define GYOTO_G_CGS 6.67428e-8 /// \brief G/c^2=6.67428e-11/299792458.^2 #define GYOTO_G_OVER_C_SQUARE 7.426138e-28 /// \brief Planck's constant (h) in SI (J.s=kg.m^2/s) #define GYOTO_PLANCK 6.62606896e-34 /// \brief Planck's constant (h) in c.g.s (g.cm^2/s) #define GYOTO_PLANCK_CGS 6.62606896e-27 /// \brief h/c^2 in SI (kg.s) #define GYOTO_PLANCK_OVER_C_SQUARE 7.372496e-51 /// \brief Boltzmann's constant (k) in SI (J/K) #define GYOTO_BOLTZMANN 1.3806504e-23 /// \brief Boltzmann's constant (k) in cgs (erg/K) #define GYOTO_BOLTZMANN_CGS 1.3806504e-16 /// \brief h/k (K.s = K/Hz) #define GYOTO_PLANCK_OVER_BOLTZMANN 4.7992373e-11 /// \brief ideal gas constant R in SI #define GYOTO_GAS_CST 8.3144621 /// \brief ideal gas constant R in erg/(K mol) #define GYOTO_GAS_CST_CGS 8.3144621e7 /// \brief Avogadro constant #define GYOTO_AVOGADRO 6.0221413e23 /// \brief Thomson cross-section in cgs #define GYOTO_THOMSON_CGS 6.6524e-25 /// \brief Fine structure constant (=1/137) #define GYOTO_ALPHA_F 0.00729927 /// \brief proton mass in cgs #define GYOTO_PROTON_MASS_CGS 1.67262158e-24 /// \brief electron mass in cgs #define GYOTO_ELECTRON_MASS_CGS 9.10938188e-28 /// \brief electron classical radius in cgs #define GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS 2.8179e-13 /// \brief elementary charge in cgs (erg^{1/2} cm^{1/2}) #define GYOTO_ELEMENTARY_CHARGE_CGS 4.80320427e-10 /// \brief Euler-Mascheroni constant #define GYOTO_EULER_MASCHERONI 0.577216 /// \brief atomic mass unit in cgs #define GYOTO_ATOMIC_MASS_UNIT_CGS 1.660537781e-24 /// \brief Factor to convert Iν from c.g.s. to SI #define GYOTO_INU_CGS_TO_SI 0.001 /// \brief Sun mass (kg) #define GYOTO_SUN_MASS 1.98843e30 /// \brief Sun mass (g) #define GYOTO_SUN_MASS_CGS 1.98843e33 /// \brief Sun radius (m) #define GYOTO_SUN_RADIUS 6.955e8 /// \brief Kiloparsec (m) #define GYOTO_KPC 3.08568025e19 /// \brief Astronomical Unit (m) #define GYOTO_ASTRONOMICAL_UNIT 1.49597870700e11 /// \brief Light-year (m) #define GYOTO_LIGHT_YEAR 9.4607304725808e15 /// \brief Convert from radians to degrees #define GYOTO_RADEG 57.2957795130823 /// \brief Convert from degrees to radians #define GYOTO_DEGRAD 0.0174532925199433 /// \brief Convert from arcminutes to radians #define GYOTO_MINRAD 2.908882086657216e-04 /// \brief Convert from arcseconds to radians #define GYOTO_SECRAD 4.848136811095360e-06 /// \brief Convert from milliarcseconds to radians #define GYOTO_MASRAD 4.848136811095360e-09 /// \brief Convert from microarcseconds to radians #define GYOTO_MUASRAD 4.848136811095360e-12 /// \brief Convert from eV to Hz #define GYOTO_eV2Hz 2.417989348e+14 //\} #endif Gyoto-0.1.0/include/GyotoDisk3D.h000066400000000000000000000176511217470755400165360ustar00rootroot00000000000000/** * \file GyotoDisk3D.h * \brief A geometrically thick, optically thin disk * * The target of ray-traced Gyoto::Photon */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoDisk3D_H_ #define __GyotoDisk3D_H_ #include #include #include namespace Gyoto{ namespace Astrobj { class Disk3D; } } /** * \class Gyoto::Astrobj::Disk3D * \brief Geometrically thick disk read from FITS file * * This class is the base class for thick disks. The emitter's * velocity is given in a FITS file, together with emission * related quantity (typically temperature). * This class mainly implements the Impact() function. * Emission() function is here left to its default, and should * be implemented according to specific needs in heir classes. * Here the disk is supposed not to evolve in time. The dynamical * treatment is provided in heir classes. * * The 3D disk is assumed to be described by a regular * (non adaptive) grid of cylindrical geometry. The disk * is a slab from rin_ to rout_ and zmin_ (typically = -zmax_) to zmax_. * */ class Gyoto::Astrobj::Disk3D : public Gyoto::Astrobj::Generic { friend class Gyoto::SmartPointer; private: std::string filename_; ///< Optional FITS file name containing the arrays /** * An array of dimensionality double[nr_][nz_][nphi_][nnu_]. In FITS * format, the first dimension is nu, the second phi, the third * z and last r. It typically contains temperature and is used only by * subclasses. */ double * emissquant_; ///< Physical quantity yielding emission. /** * An array of dimensionality double[nr_][nz_][nphi_][3]. In FITS format, * the second dimension is phi, the third z and last r. The first plane in * the first FITS dimention is dphi/dt, the second dz/dt the last dr/dt. */ double * velocity_; ///< Velocity(r, z, phi) double dnu_; ///< Frequency scale of PatternDisk::emission_ in Hz double nu0_; ///< Lowest frequency provided in PatternDisk::emission_ in Hz size_t nnu_; ///< Number of frequencies provided in PatternDisk::emission_ double dphi_; ///< δφ between two grid columns double phimin_;///< Minimum φ in grid size_t nphi_; ///< Grid size in the φ direction double phimax_; ///< Maximum φ in grid /** * XML elment: <RepeatPhi>. * FITS keyword: HIERARCH GYOTO Disk3D RepeatPhi */ size_t repeat_phi_; ///< Number of times the pattern should be repeated to cover [0, 2Π] //double phi0_==0, phi max is always 2*M_PI double dz_; ///< Altitude step double zmin_; ///< Minimum altitude size_t nz_; ///< Grid size in the altitude direction double zmax_; ///< Maximum altitude double dr_; ///< Radius step double rin_; ///< Inner radius of the grid size_t nr_; ///< Number of rows in the patternGrid size in the r direction double rout_; ///< Outer radius of the grid // Constructors - Destructor // ------------------------- public: Disk3D(); ///< Standard constructor. Disk3D(const Disk3D& ) ;///< Copy constructor. virtual Disk3D* clone () const; ///< Cloner. virtual ~Disk3D() ; ///< Destructor. // Accessors // --------- public: /// Read parameters and arrays from FITS file. virtual void fitsRead(std::string filename_); /// Write parameters and arrays to FITS file. virtual void fitsWrite(std::string filename_); /// Set Disk3D::emissquant_. /** * The pointer is copied directly, not the array content. * * This is a low-level function. Beware that: * - previously allocated array will not be freed automatically; * - array attached when the destructor is called will be freed. */ void setEmissquant(double * pattern); /// Set Disk3D::velocity__. /** * The pointer is copied directly, not the array content. * * This is a low-level function. Beware that: * - previously allocated array will not be freed automatically; * - array attached when the destructor is called will be freed. */ void setVelocity(double * pattern); /// Set Disk3D::emissquant_. /** * Disk3D::emissquant_ is freed if not NULL, reallocated, and * pattern is copied into emission_. * * If Disk3D::velocity_ or has been set previously with mismatching * sizes, it is deallocated too. * * Finally, Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_ and * Disk3D::nr_ are set according to naxes. * * \param pattern Array to copy as emission_. May be NULL in which * case emission_ is simply deallocated and set to NULL. * * \param naxes { nnu_, nphi_, nz_, nr_ }. */ virtual void copyEmissquant(double const * const pattern = NULL, size_t const naxes[4] = NULL); /// Get Disk3D::emissquant_. virtual double const * getEmissquant() const; /// Get { Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_, Disk3D::nr_ }. virtual void getEmissquantNaxes( size_t naxes[4] ) const ; /// Set Disk3D::velocity_. /** * Disk3D::velocity_ is first freed if not NULL and set to NULL. * * If pattern is not NULL, Disk3D::emissquant_ must have been set * previously with matching dimensions. Disk3D::velocity_ is * then reallocated, and pattern is copied into velocity_. * * \param pattern Array to copy as velocity_. May be NULL in which * case velocity_ is simply deallocated and set to NULL. * * \param naxes { nphi_, nz_, nr_ }. */ virtual void copyVelocity(double const * const pattern = NULL, size_t const naxes[3] = NULL); /// Get Disk3D::velocity_. virtual double const * getVelocity() const; /// Set Disk3D::repeat_phi_. virtual void repeatPhi(size_t n); /// Get Disk3D::repeat_phi_. virtual size_t repeatPhi() const; /// Set Disk3D::nu0_. virtual void nu0(double freq); /// Get Disk3D::nu0_. virtual double nu0() const; /// Set Disk3D::dnu_. virtual void dnu(double dfreq); /// Get Disk3D::dnu_. virtual double dnu() const; /// Set Disk3D::rin_. void rin(double rrin); /// Get Disk3D::rin_. double rin() const; /// Set Disk3D::rout_. void rout(double rout); /// Get Disk3D::rout_. double rout() const; /// Set Disk3D::zmin_. void zmin(double zmin); /// Get Disk3D::zmin_. double zmin() const; /// Set Disk3D::zmax_. void zmax(double zmax); /// Get Disk3D::zmax_. double zmax() const; /// Set Disk3D::phimin_. void phimin(double phimin); /// Get Disk3D::phimin_. double phimin() const; /// Set Disk3D::phimax_. void phimax(double phimax); /// Get Disk3D::phimax_. double phimax() const; virtual int setParameter(std::string name, std::string content, std::string unit); protected: void getIndices(size_t i[4], double const co[4], double nu=0.) const ; ///< Get emissquant_ cell corresponding to position co[4]. public: int Impact(Photon *ph, size_t index, Astrobj::Properties *data); /// Get fluid 4-velocity at point. /** * Fill vel with the 4-vector velocity of the fluid at 4-position * pos. * * \param[in] pos 4-position at which to compute velocity; * \param[out] vel 4-velocity at pos. */ virtual void getVelocity(double const pos[4], double vel[4]) ; public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; virtual void setParameters(FactoryMessenger *fmp); #endif }; #endif Gyoto-0.1.0/include/GyotoDisk3D_BB.h000066400000000000000000000077401217470755400170770ustar00rootroot00000000000000/** * \file GyotoDisk3D_BB.h * \brief A geometrically thick, optically thin disk, evolving dynamically, * with black body emission. * * The disk is described by a set of FITS files for a set of different times */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoDisk3D_BB_H_ #define __GyotoDisk3D_BB_H_ #include #include #include #include namespace Gyoto{ namespace Astrobj { class Disk3D_BB; } } #include #include /** * \class Gyoto::Astrobj::Disk3D_BB * \brief Geometrically thick optically thin disk * read from a set of FITS files. * * This class describes a PatternDiskBB that evolves dynamically. * It is described by a set of FITS files for different times. * Its emission is blackbody. * * The disk is assumed to be described by a regular, * constant in time, grid. * * The metric must be Kerr in BL coordinates. * */ class Gyoto::Astrobj::Disk3D_BB : public Astrobj::Disk3D { friend class Gyoto::SmartPointer; protected: SmartPointer spectrumBB_; ///< disk black body ///< emission law private: char* dirname_; ///< FITS files directory double tinit_; ///< Time of the first FITS file double dt_; ///< Time increment between two FITS (assumed constant) int nb_times_; ///< Number of times /** * An array of arrays of dimensionality double[nr_][nz_][nphi_][nnu_]. * In FITS format, the first dimension is nu, the second phi, the third * z, the last r. It contains temperature. */ double ** temperature_array_; /** * An array of arrays of dimensionality double[nr_][nz_][nphi_][3]. * In FITS format, the second dimension is phi, and the third r. * The first plane in the first FITS dimention is dphi/dt, * the second dz/dt, the third dr/dt. */ double ** velocity_array_; ///< velocity(r, z, phi) // Constructors - Destructor // ------------------------- public: Disk3D_BB(); ///< Standard constructor Disk3D_BB(const Disk3D_BB& ) ;///< Copy constructor virtual Disk3D_BB* clone () const; ///< Cloner virtual ~Disk3D_BB() ; ///< Destructor // Accessors // --------- public: void setMetric(SmartPointer gg); virtual int setParameter(std::string name, std::string content, std::string unit); /// Compute emission at one grid date. double emission1date(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; using Disk3D::emission; /// Interpolate emission between grid dates. virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; /// Compute transmission at one grid date. double transmission1date(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; /// Interpolate transmission between grid dates. double transmission(double nu_em, double dsem, double c_obj[8]) const; void getVelocity(double const pos[4], double vel[4]); double const * getVelocity() const; protected: /// Set underlying Disk3D pointers to a specific date slice. /** * \param iq Index of the date slice. */ void copyQuantities(int iq) ; public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoDynamicalDisk.h000066400000000000000000000066461217470755400201730ustar00rootroot00000000000000/** * \file GyotoDynamicalDisk.h * \brief A geometrically thin, optically thick disk, evolving dynamically * * The disk is described by a set of FITS files for a set of different times */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoDynamicalDisk_H_ #define __GyotoDynamicalDisk_H_ #include #include #include #include namespace Gyoto{ namespace Astrobj { class DynamicalDisk; } } //#include #include /** * \class Gyoto::Astrobj::DynamicalDisk * \brief Geometrically thin disk read from a set of FITS files * * This class describes a PatternDiskBB that evolves dynamically. * It is described by a set of FITS files. * */ class Gyoto::Astrobj::DynamicalDisk : public Astrobj::PatternDiskBB { friend class Gyoto::SmartPointer; private: char* dirname_; ///< FITS files directory double tinit_; ///< date of the first FITS file double dt_; ///< Time increment between two FITS (assumed constant) int nb_times_; ///< Number of dates /// Array of PatternDisk::emission_ arrays double ** emission_array_; /// Array of PatternDisk::opacity_ arrays double ** opacity_array_; /// Array of PatternDisk::velocity_ arrays double ** velocity_array_; ///< /// Array of PatternDisk::radius_ arrays double ** radius_array_; ///< radius vector /// Array of PatternDisk::dnu_ values double * dnu_array_; /// Array of PatternDisk::nu0_ values double * nu0_array_; /// Array of PatternDisk::nu1_ values size_t * nnu_array_; /// Array of PatternDisk::dphi_ values double * dphi_array_; /// Array of PatternDisk::nphi_ values size_t * nphi_array_; /// Array of PatternDisk::dr_ values double * dr_array_; /// Array of PatternDisk::nr_ values size_t * nr_array_; // Constructors - Destructor // ------------------------- public: DynamicalDisk(); ///< Standard constructor DynamicalDisk(const DynamicalDisk& ) ;///< Copy constructor virtual DynamicalDisk* clone () const; ///< Cloner virtual ~DynamicalDisk() ; ///< Destructor // Accessors // --------- public: virtual int setParameter(std::string name, std::string content, std::string unit); using PatternDiskBB::emission; virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; void getVelocity(double const pos[4], double vel[4]); double const * getVelocity() const; protected: /// Set underlying PatternDisk pointers to a specific date slice. /** * \param iq Index of the date slice. */ void copyQuantities(int iq) ; public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoError.h000066400000000000000000000120421217470755400165330ustar00rootroot00000000000000/** * \file GyotoError.h * \brief Error handling * * Gyoto dlopens its plug-ins. The throw/catch C++ mechanism cannot * pass the dlopen boundary. The Gyoto::Error mechanism alleviates * this C++ language limitation. * * Every Gyoto method (either in the main Gyoto library or in a Gyoto * plug-in) should check for possible error conditions and throw * adequate Gyoto::Error exceptions through the * Gyoto::Error::throw() function. For instance: * \code * if (error_condition) Gyoto::Error::throw("Useful error message"); * \endcode * * If the main code has set Gyoto::Error::handler_t error handler * using Gyoto::Error::setHandler(), these errors will then be passed * to it. Else, the Error is C++-thrown at the main Gyoto library * level, above the dlopen boundary. * * The main code can then catch these exceptions and act appropriately, * for instance: * \code * try { gyoto_code ; } * catch (Gyoto::Error err) * { * err.Report(); * abort(); * } * \endcode * */ /* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoError_H_ #define __GyotoError_H_ /** * \namespace Gyoto * \brief Namespace for the Gyoto library */ #include namespace Gyoto { class Error; } /** * \class Gyoto::Error * \brief Class for thowing exceptions. * * Gyoto dlopens its plug-ins. The throw/catch C++ mechanism cannot * pass the dlopen boundary. The Gyoto::Error mechanism alleviates * this C++ language limitation. * * Every Gyoto method (either in the main Gyoto library or in a Gyoto * plug-in) should check for possible error conditions and throw * adequate Gyoto::Error exceptions through the * Gyoto::throwError() function. For instance: * \code * if (error_condition) Gyoto::throwError("Useful error message"); * \endcode * * If the main code has set Gyoto::Error::handler_t error handler * using Gyoto::Error::setHandler(), these errors will then be passed * to it. Else, the Error is C++-thrown at the main Gyoto library * level, above the dlopen boundary. * * The main code can then catch these exceptions and act appropriately, * for instance: * \code * try { gyoto_code ; } * catch (Gyoto::Error err) * { * err.Report(); * abort(); * } * \endcode */ class Gyoto::Error { private: /// Error message. const std::string message; /// Error code. /** * Default value is EXIT_FAILURE from cstdlib. Currently not used in * practice. */ const int errcode; public: /// Constructor with an error message. Error( const std::string m ); /// Constructor with an error code. Error( const int errcode ); /// Constructor with both an error message and an error code. Error( const std::string m, const int errcode ); /// Print-out error message on standard error. void Report() const ; /// Retrieve error code. /** * See also operator const char * () const and get_message(). * \return Error code */ int getErrcode() const ; /// Cast to const char *. /** * Retrieve error message as a C string. See also get_message() and * gerErrcode(). */ operator const char * () const; /// Retrieve error message for custom handling of the exception. /** * See also operator const char * () const and getErrCode(). * \return char* message : pointer to the error message */ std::string get_message() const ; /// Error handler type. /** * Instead of catching Gyoto errors directly (for instance if gyoto * itself is dlopened), you can set a Handler_t error handler using * setHandler(). * * A very simple handler could be: * \code * void applicationErrorHandler(const Gyoto::Error e) { * e.Report(); * exit ( e.getErrCode() ); * } * \endcode */ typedef void Handler_t (const Error); /// Set application error handler. /** * Instead of catching Gyoto errors directly (for instance if gyoto * itself is dlopened), you can set an Error::Handler_t error * handler using setHandler(). * * \code * void applicationErrorHandler(const Gyoto::Error e) { * e.Report(); * exit ( e.getErrCode() ); * } * int main() { * Gyoto::Error::setHandler(&applicationErrorHandler); * } * \endcode * \param phandler Function pointer to the handler. */ static void setHandler( Gyoto::Error::Handler_t* phandler); }; namespace Gyoto { /// Throw a Gyoto::Error void throwError( std::string ); } #endif Gyoto-0.1.0/include/GyotoFactory.h000066400000000000000000000273541217470755400170650ustar00rootroot00000000000000#ifdef GYOTO_USE_XERCES /** * \file GyotoFactory.h * \brief XML I/O * * The Factory is a place where objects are built. * */ /* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoFactory_H_ #define __GyotoFactory_H_ #include "GyotoConfig.h" /// Xerces internal. /** * For some reason it sometimes need to be set to 0 instead of being * undefined. */ #ifndef XERCES_INCLUDE_WCHAR_H #define XERCES_INCLUDE_WCHAR_H 0 #endif #include #include #include #include #include #include #include #include namespace Gyoto { class Factory; class FactoryMessenger; namespace Spectrometer { class Generic; class Uniform; } } /** * \class Gyoto::Factory * \brief XML input/output * * The Factory is responsible from building objects from their XML * description, and from saving an XML description of existing * objects. Since the Factory doesn't know how to build the variety of * objects available in Gyoto and in external plug-ins, the Factory * orders Metric, Astrobj and Spectrum objects from registered * subcontractors (see SmartPointee::Subcontractor_t). The factory an the * various subcontractors communicate through a FactoryMessenger. * * To read an XML file, you simply create an instance of the Factory * with a filename, and get whichever object type you are interested * in: * \code * Gyoto::Factory * factory = new Gyoto::Factory("some/input/file.xml"); * const std::string kind = factory->getKind(); * if (kind.compare("Scenery")) Gyoto::throwError("I wan't a Scenery"); * Gyoto::SmartPointer scenery = factory -> getScenery(); * Gyoto::SmartPointer screen = scenery->getScreen(); * Gyoto::SmartPointer object = scenery->getAstrobj(); * Gyoto::SmartPointer metric = scenery->getMetric(); * delete factory; factory=NULL; * \endcode or, for a single object and without checking the kind * (getKind()) first: * \code * Gyoto::SmartPointer scenery = Factory("some/input/file.xml").getScenery(); * \endcode * * * Writing an object to a file is even easier. Assuming "object" below * is a Gyoto::SmartPointer where "class" is one of Scenery, * Metric::Generic, Astrobj::Generic, Spectrum::Generic, Screen, * Photon or Spectrometer: * \code * Gyoto::Factory * factory = new Gyoto::Factory(object); * factory -> write("some/output/file.xml"); * delete factory; factory=NULL; * \endcode * * or, for short: * \code * Gyoto::Factory(object).write("some/output/file.xml"); * \endcode * * You can also directly display the object to stdout: * \code * std::cout << Gyoto::Factory(object).format() << std::endl; * \endcode */ class Gyoto::Factory { friend class Gyoto::FactoryMessenger; protected: // XERCES MACHINERY /// Xerces error handler xercesc::ErrorHandler *reporter_; /// The document being read or written xercesc::DOMDocument *doc_; /// Root element in Factory::doc_ xercesc::DOMElement *root_; /// Xerces parser xercesc::XercesDOMParser *parser_; /// Xerces resolver xercesc::DOMXPathNSResolver* resolver_; /// Xerces implementation xercesc::DOMImplementation* impl_; // Elements which must happen only once in a file // but may happen about anywhere /// XML element representing the Metric xercesc::DOMElement *gg_el_; /// XML element representing the Astrobj xercesc::DOMElement *obj_el_; /// XML element representing the Photon xercesc::DOMElement *ph_el_; // GYOTO elements /// The Scenery read from or written to Factory::doc_ SmartPointer scenery_; /// The Metric read from or written to Factory::doc_ SmartPointer gg_; /// The Screen read from or written to Factory::doc_ SmartPointer screen_; /// The Astrobj read from or written to Factory::doc_ SmartPointer obj_; /// The Photon read from or written to Factory::doc_ SmartPointer photon_; /// The Spectrometer read from or written to Factory::doc_ SmartPointer spectro_; // Factory stuff /// XML file name, if actually reading from or writting to file. std::string filename_; /// Kind of root element (Scenery, Metric etc.) std::string kind_; public: /// Constructor for reading a file Factory(char * filename); /// Constructor for saving (or printing) a Scenery Factory(SmartPointer sc); /// Constructor for saving (or printing) a Metric Factory(SmartPointer gg); /// Constructor for saving (or printing) an Astrobj Factory(SmartPointer ao); /// Constructor for saving (or printing) a Spectrum Factory(SmartPointer sp); /// Constructor for saving (or printing) a Screen Factory(SmartPointer screen); /// Constructor for saving (or printing) a Photon Factory(SmartPointer photon); /// Constructor for saving (or printing) a Spectrometer Factory(SmartPointer Spectrometer); /// Destructor ~Factory(); private: /// Set Xerces reporter void setReporter(xercesc::ErrorHandler*); /// Get Factory::root_ xercesc::DOMElement * getRoot(); /// Get Factory::doc_ xercesc::DOMDocument* getDoc(); public: /// Get Factory::kind_ const std::string getKind(); /// Find Scenery element, instanciate it and get it. /** * Scenery must be the root element. getScenery() will call * getMetric(), getAstrobj() and getScreen(). */ Gyoto::SmartPointer getScenery(); /// Find Metric element, instanciate it and get it. /** * Metric may be either the root element or directly within the root * element. */ Gyoto::SmartPointer getMetric(); /// Find Screen element, instanciate it and get it. /** * Screen may be either the root element or directly within the root * element. */ Gyoto::SmartPointer getScreen(); /// Find Astrobj element, instanciate it and get it. /** * Astrobj may be either the root element or directly within the root * element. */ Gyoto::SmartPointer getAstrobj(); /// Find Photon element, instanciate it and get it. /** * Photon may be either the root element or directly within the root * element. */ Gyoto::SmartPointer getPhoton(); /// Find Photon element, instanciate it and get it. /** * Photon may be either the root element or directly within the root * element. */ Gyoto::SmartPointer getSpectrum(); /// Find Spectrometer element, instanciate it and get it. /** * Spectrometer may be either the root element or directly within the root * element. */ Gyoto::SmartPointer getSpectrometer(); // XML OUTPUT /// Write constructed XML representation to file void write(const char* const fname=0); /// Get constructed XML representation as std::string std::string format(); // Setting elements /// Set Metric for this document. /** * If called several times for the same document, the metric * SmartPointers must point to the same instance or an error will be * thrown using Gyoto::throwError(). */ void setMetric(SmartPointer gg, xercesc::DOMElement *el); /// Set Astrobj for this document. /** * If called several times for the same document, the astrobj * SmartPointers must point to the same instance or an error will be * thrown using Gyoto::throwError(). */ void setAstrobj(SmartPointer ao, xercesc::DOMElement *el); /// Set Screen for this document. /** * If called several times for the same document, the screen * SmartPointers must point to the same instance or an error will be * thrown using Gyoto::throwError(). */ void setScreen(SmartPointer scr, xercesc::DOMElement *el); /// Set text content of XML element void setContent(std::string content, xercesc::DOMElement *el); /// Create new XML element without content /** * E.g. * \code * * \endcode * \param name XML entity name. * \param pel Parent XML element. */ void setParameter(std::string name, xercesc::DOMElement *pel); /// Create new XML element with double value /** * E.g. * \code * 2. * \endcode * \param name XML entity name. * \param value Entity content. * \param pel Parent XML element. */ void setParameter(std::string name, double value, xercesc::DOMElement *pel); /// Create new XML element with integer value /** * E.g. * \code * 7 * \endcode * \param name XML entity name. * \param value Entity content. * \param pel Parent XML element. */ void setParameter(std::string name, int value, xercesc::DOMElement *pel); /// Create new XML element with integer value /** * E.g. * \code * 7 * \endcode * \param name XML entity name. * \param value Entity content. * \param pel Parent XML element. */ void setParameter(std::string name, unsigned int value, xercesc::DOMElement *pel); /// Create new XML element with integer value /** * E.g. * \code * 7 * \endcode * \param name XML entity name. * \param value Entity content. * \param pel Parent XML element. */ void setParameter(std::string name, long value, xercesc::DOMElement *pel); /// Create new XML element with integer value /** * E.g. * \code * 7 * \endcode * \param name XML entity name. * \param value Entity content. * \param pel Parent XML element. */ void setParameter(std::string name, unsigned long value, xercesc::DOMElement *pel); /// Create new XML element with string content /** * E.g. * \code * Text * \endcode * * Any parameter can acually be set this way if total control over * Text formatting is wished for. * \param name XML entity name. * \param value Entity content. * \param pel Parent XML element. */ void setParameter(std::string name, std::string value, xercesc::DOMElement*pel); /// Create new XML element with array content /** * E.g. * \code * 0. 10. 3.14. 0. * \endcode * \param[in] name XML entity name. * \param[in] val Entity content. * \param[in] nelem Number of elements in val to output. * \param[in] pel Parent XML element. * \param[out] child If not NULL, set to a new Gyoto::FactoryMessenger * pointing to the new element. It must be deleted later. */ void setParameter(std::string name, double val[], size_t nelem, xercesc::DOMElement* pel, FactoryMessenger **child = NULL); /// Transform relative path into absolute path. /** * \param relpath Path relative to XML file. * \return Absolute path to same file. */ std::string fullPath(std::string relpath); }; #endif #endif Gyoto-0.1.0/include/GyotoFactoryMessenger.h000066400000000000000000000356711217470755400207370ustar00rootroot00000000000000/** * \file GyotoFactoryMessenger.h * \brief Factory / SmartPointee::Subcontractor_t interface */ #ifdef GYOTO_USE_XERCES /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoFactoryMessenger_H_ #define __GyotoFactoryMessenger_H_ /// Internal to Xerces /** * For obscure reasons, this needs to be set to 0 instead of just * undefined. */ #ifndef XERCES_INCLUDE_WCHAR_H #define XERCES_INCLUDE_WCHAR_H 0 #endif #include #include #include #include namespace Gyoto { class Factory; class FactoryMessenger; namespace Metric { class Generic; } namespace Astrobj { class Generic; } namespace Spectrum { class Generic ; } class Screen; class Photon; } /** * \class Gyoto::FactoryMessenger * \brief Factory / SmartPointee::Subcontractor_t interface * * A FactoryMessenger instance is like an employee passing messages * between its employer (the Factory) and a subcontractor (a function * of the SmartPointee::Subcontractor_t type). * * The FactoryMessenger also communicate with the fillElement method * of some classes (Astrobj::Generic::fillElement(), * Metric::Generic::fillElement(), Spectrum::Generic::fillElement()). * * A subcontractor function typically loops calling getNextParameter() * to read all the parameters provided for it in an XML file. If BASE * is one of Astrobj, Metric or Spectrum, and MyClass is an * implementation of BASE::Generic, the subcontractor static member * function often looks like this: * * \code * SmartPointer MyClass::Subcontractor(Gyoto::FactoryMessenger *messenger) { * SmartPointer deliverable = new MyClass(); * while (messenger->getNextParameter(name, content) { * if (name=="SomeProperty") deliverable -> setSomeProperty(content); * else if (name=="AnotherProperty") deliverable -> setAnotherProperty(content); * } * return deliverable; * } * \endcode * * Other get* methods are provided to cope with more complex syntax * (e.g. when XML attributes are used, as in <ParameterName * attribute="attrvalue">ParameterValue</ParameterName> * * Conversely, the Factory asks certain Gyoto classes through their * fillElement() method how they should be printed or saved to an XML * file. Those fillElement() methods use the FactoryMessenger::set*() * methods (in particular setParameter()) as well as, occasionally, * makeChild() to describe themselves to the Factory. */ class Gyoto::FactoryMessenger { private: Gyoto::Factory* employer_; ///< The Factory that sent this messenger xercesc::DOMElement *element_; ///< The XML element concerned by this transaction xercesc::DOMNodeList* children_; ///< The children of the XML element concerned by this transaction XMLSize_t nodeCount_; ///< The number of children of the XML element concerned by this transaction XMLSize_t curNodeIndex_; ///< Current child public: FactoryMessenger(Gyoto::Factory*, xercesc::DOMElement*); ///< Constructor called before subcontracting FactoryMessenger(const FactoryMessenger& parent, std::string) ; ///< Constructor called before fillElement void reset(); ///< Get back to first parameter ///// GET METHODS, CALLED FROM A SUBCONTRACTOR /** * An Gyoto XML file may contain at most a single Metric section * and it may be present about anywhere in the XML tree. Individual * subcontractors should not try to interpret this section directly, * but should call getMetric() to find and interpret the Metric * section. */ SmartPointer getMetric () ; ///< Build and get the Metric described in this XML file /** * An Gyoto XML file may contain at most a single Screen section * and it may be present about anywhere in the XML tree. Individual * subcontractors should not try to interpret this section directly, * but should call getScreen() to find and interpret the Screen * section. */ SmartPointer getScreen () ; ///< Build and get the Screen described in this XML file /** * An Gyoto XML file may contain at most a single Photon section * and it may be present about anywhere in the XML tree. Individual * subcontractors should not try to interpret this section directly, * but should call getPhoton() to find and interpret the Photon * section. */ SmartPointer getPhoton () ; ///< Build and get the Photon described in this XML file /** * An Gyoto XML file may contain at most a single Astrobj section * and it may be present about anywhere in the XML tree. Individual * subcontractors should not try to interpret this section directly, * but should call getAstrobj() to find and interpret the Astrobj * section. */ SmartPointer getAstrobj () ; ///< Build and get the Astrobj described in this XML file /** * On each call, return a pair name-content of one of the * children_. Usually, "name" is the name of a parameter and * "content" is the string representation of the corresponding * value. For instance: * \code * Content * \endcode * * \param name upon output, name of the child * \param content of the child * \param unit= propertty of the child * \return 1 if there remains parameters to retrieve, 0 otherwise. */ int getNextParameter(std::string* name, std::string* content, std::string* unit=NULL); ///< Get name and value of next parameter /** * For instance a Spectrometer description looks like this * \code * 2.0e-6 2.4e-6 * \endcode * and the Spectrometer builder uses getSelfAttribute() to retrieve * the attributes "kind" and "nsamples". * * \param attrname name of the attribute * \return attrvalue */ std::string getSelfAttribute(std::string attrname) const ; ///< Get attribute of FactoryMessenger::element_ /** * For instance * \code * ParameterContent * \endcode * * \param attrname name of the attribute * \return attrvalue */ std::string getAttribute(std::string attrname) const ; ///< Get attribute of a last retrieved parameter /** * In exceptional circumstances, it may be necessary to get the * entire text content of the topmost element * FactoryMessenger::element_ instead or getting only the individual * FactoryMessenger::children_ . * * For instance a Spectrometer description looks like this: * \code * 2.0e-6 2.4e-6 * \endcode * and the Spectrometer builder uses getFullContent() to retrieve * the spectral boundaries (2.0e-6 and 2.4e-6 here). */ std::string getFullContent() const ; ///< Get full content of element_ /** * If one of the FactoryMessenger::children_ is complex (for * instance the complete description of a Gyoto::Spectrum), it is * possible to initialize a new FactoryMessenger and call the * correct subcontractor: * \code * SmartPointer spectrum = NULL; * while (messenger->getNextParameter(name, content) { * if (name=="Spectrum") { * content = messenger->getAttribute("kind"); * FactoryMessenger* child = messenger->getChild(); * deliverable->setSpectrum( (*Spectrum::getSubcontractor(content))(child) ); * delete child; * } * } * \endcode * The child is allocated with new and must be deleted after use. */ FactoryMessenger * getChild() const ; ///< Get another FactoryMessenger instance initialized to current child /** * This function takes a relative path (e.g. ../foo/bar.data) and * transforms it into a full path (starting with "/"). It is not * guaranteed to be portable (we assume that the path separator is * "/" and that absolute paths start with "/"). * * \param relpath path relative to the directory where the XML file * on which the Factory works is located. * * \return fullpath at full path specification to the same point pon * the file-system. */ std::string fullPath(std::string relpath) ; ///< Transform path into full path specification ///////// SET METHODS, CALLED FROM FILLELEMENT /** * At most one Metric section may be present in a give Gyoto XML file. * * When an object's fillElement() method is called, if this object * is connected to a Metric, it should call setMetric() with this * Metric. Very often, the Metric will already have been set * previously. The Factory will check that all the objects in the * hierarchy are attached to the same Metric instance, and save this * instance only once. Trying to set the Metric to something else * than the already set Metric instance is an error condition. * * To make things clearer: Assume "scenery" is a fully filled * Scenery. scenery->fillElement(messenger) will call: * \code * messenger->setMetric(Scenery::gg_) * messenger->setScreen(Scenery::screen_) * messenger->setAstrobj(Scenery::obj_); * \endcode * * The Factory will then call screen_->fillElement(child_messenger) * and obj_->fillElement(child_messenger), each of which will also * call setMetric(). If the same Metric is connected to the Astrobj, * to the Screen and to the Scenery, all is well. Else, you have a * bug to fix. */ void setMetric(SmartPointer); ///< Set the Metric /** * Same as setMetric(), but for the Astrobj. */ void setAstrobj(SmartPointer); ///< Set the Astrobj /** * Same as setMetric(), but for the Screen. */ void setScreen(SmartPointer); ///< Set the Screen /** * Create child XML element of the form * \code * * \endcode * for instance when "name" is boolean (present or absent), or only * takes attributes (see FactoryMessenger::setAttribute()). As an * example, Astrobj::Generic::fillElement() uses * setParameter() to set either Opticallythin or OpticallyThick. */ void setParameter(std::string name); ///< Output parameter /** * Convert value to striing "svalue" and create an XML child element * of the form * \code * svalue * \endcode */ void setParameter(std::string name, double value); ///< Output parameter /** * Convert value to striing "svalue" and create an XML child element * of the form * \code * svalue * \endcode */ void setParameter(std::string name, long int value); ///< Output parameter /** * Convert value to striing "svalue" and create an XML child element * of the form * \code * svalue * \endcode */ void setParameter(std::string name, unsigned int value); ///< Output parameter /** * Convert value to striing "svalue" and create an XML child element * of the form * \code * svalue * \endcode */ void setParameter(std::string name, unsigned long value); ///< Output parameter /** * Convert value to string "svalue" and create an XML child element * of the form * \code * svalue * \endcode */ void setParameter(std::string name, int value); ///< Output parameter /** * Create an XML child element of the form * \code * value * \endcode */ void setParameter(std::string name, std::string value); ///< Output parameter /** * For instance: * \code * double val[4] = {1., 2., 3., 4.}; * messenger->setParameter("MyArray", val, 4); * \endcode * will result in something like this: * \code * 1.000000 2.000000 3.000000 4.000000 * \endcode * * The exact format is unspecified, determined at compile time, and * by default, unlike in the example above, outputs a large number * of digits for each double (about 20). * * \param name the name of the parameter * \param val[] an array of doubles * \param n number of cells in val[] * \param child (optional) if not NULL, a new FactoryMessenger is * created to access the new parameter element e.g. to set * attributes in it (using setSelfAttribute()). You then need to * delete the child. */ void setParameter(std::string name, double val[], size_t n, FactoryMessenger** child= NULL); ///< Output an array of parameters /** * For instance Spectrometer::fillElement() sets its "kind" * attribute somewhat like this: * \code * messenger->setSelfAttribute("kind", "wave"); * \endcode * to produce something like this: * \code * * \endcode */ void setSelfAttribute(std::string attrname, std::string value) ; ///< Set attribute in FactoryMessenger::element_ /** * See setSelfAttribute(std::string attrname, std::string value) */ void setSelfAttribute(std::string attrname, unsigned long value) ; ///< Set attribute in FactoryMessenger::element_ /** * See setSelfAttribute(std::string attrname, std::string value) */ void setSelfAttribute(std::string attrname, unsigned int value) ; ///< Set attribute in FactoryMessenger::element_ /** * See setSelfAttribute(std::string attrname, std::string value) */ void setSelfAttribute(std::string attrname, double value) ; ///< Set attribute in FactoryMessenger::element_ /** * Exceptionnaly, a class instance may be best described by setting * the entire content of the correponding element than by setting a * bunch of "parameters". This is the case of the spectrometer, * which sets a couple of attributes and reserves the full content * for the spectral boundaries (see Spectrometer::fillElement()). */ void setFullContent(std::string value) ; ///< Low level, prefer setParameter() /** * To be used from fillElement() methods. For instance, the * Star::fillElement() method calls makeChild() to save the Star's * Spectrum and Opacity members somewhat like this: * \code * FactoryMessenger * child; * child = messenger-> makeChild("Spectrum"); * spectrum_ -> fillElement(child); * delete child; * child = messenger-> makeChild("Opacity"); * opacity_ -> fillElement(child); * delete child; * child=NULL; * \endcode * * The child messenger is allocated with new, you need to delete it * after use. */ FactoryMessenger* makeChild(std::string name); ///< Create child FactoryMessenger }; #endif #endif Gyoto-0.1.0/include/GyotoFixedStar.h000066400000000000000000000055761217470755400173510ustar00rootroot00000000000000/** * \file GyotoFixedStar.h * \brief Fixed (i.e. non-moving) star * * The target of ray-traced Gyoto::Photon */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoFixedStar_H_ #define __GyotoFixedStar_H_ #include #include #include namespace Gyoto{ namespace Astrobj { class FixedStar; } } #include #include /** * \class Gyoto::Astrobj::FixedStar. * \brief Fixed (i.e. non-moving) star (or spherical blob) * * The target of ray-traced Gyoto::Photon */ class Gyoto::Astrobj::FixedStar : public Astrobj::UniformSphere { friend class Gyoto::SmartPointer; // Data : // ----- protected: double pos_[3];///< x, y, z or r, theta, phi // Constructors - Destructor // ------------------------- public: /** * Everything is undefined, call setCoordSys(), setPos() and * setRadius(). */ FixedStar();///< Default constructor FixedStar(const FixedStar& orig);///< Copy constructor virtual FixedStar* clone() const; FixedStar(SmartPointer gg, double StPsn[3], double radius); ///< Standard constructor virtual ~FixedStar() ; ///< Destructor public: // Accessors // --------- public: double const * getPos() const; ///< Get const pointer to pos_ void getPos(double* dst) const; ///< Get a copy of the pos_ array virtual void setMetric(SmartPointer metric) ; using UniformSphere::setRadius; virtual void setRadius(double radius); ///< Set radius void setPos(const double[3]); ///< Set pos_ array // void setCoordSys(int); ///< set coordinate system virtual int setParameter(std::string name, std::string content, std::string unit); public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; #endif // Outputs // ------- protected: virtual void getCartesian(double const * const dates, size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime=NULL, double * const yprime=NULL, double * const zprime=NULL) ; virtual void getVelocity(double const pos[4], double vel[4]) ; }; #endif Gyoto-0.1.0/include/GyotoFunctors.h000066400000000000000000000041511217470755400172470ustar00rootroot00000000000000/** * \file GyotoFunctors.h * \brief Classes with an operator() method */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoFunctors_H_ #define __GyotoFunctors_H_ namespace Gyoto { /** * \namespace Gyoto::Functor * \brief Classes with an operator() method */ namespace Functor { class Double_constDoubleArray; class Double_Double_const; } } /** * \brief A functor like double (func) (double const data[]) */ class Gyoto::Functor::Double_constDoubleArray { public: /** * \brief The actual function */ virtual double operator()(double const data[]) = 0; }; /** * \brief A functor like double (func) (double) const */ class Gyoto::Functor::Double_Double_const { public: /** * \brief Exit status code of "various" methods (at least secant() !) */ int status; /** * \brief The actual function */ virtual double operator()(double) const = 0; /** * \brief Ridder's root-finding method applied on operator()() * \param from, to boundaries for root-searching * \return the root */ double ridders(double from, double to) const; /** * \brief Secant root-finding method applied on operator()() * * Sets status to * -0 in case of convergence * -1 if two distinct inputs evaluated to the same output * -2 if maximum number of iterations (20) reached * * \param from, to boundaries for root-finding * \return the root */ double secant(double from, double to); }; #endif Gyoto-0.1.0/include/GyotoHooks.h000066400000000000000000000070771217470755400165410ustar00rootroot00000000000000/** * \file GyotoHooks.h * \brief Tellers tell Listeners when they mutate * * A Listener can hook() to a Teller. The Teller will tell it when * it mutates using Listener::tell(), usually through the highter * lever Teller::tellListeners(). The Listener can later * unhook(). The Listener must therefore implement Listener::tell() * to react when it is told. */ /* Copyright 2012-2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoHooks_h #define __GyotoHooks_h /** * \namespace Gyoto::Hook * \brief Listeners attach to Tellers * * A Listener can hook() to a Teller. The Teller will tell it when * it mutates using Listener::tell(), usually through the highter * lever Teller::tellListeners(). The Listener can later * unhook(). The Listener must therefore implement Listener::tell() * to react when it is told. */ namespace Gyoto { namespace Hook { /** * \class Teller * \brief Listen to me and I'll warn you when I change * * Listen to me by calling my hook() method. */ class Teller; /** * \class Listener * \brief I might listen to a Teller * * Whisper to my ear by using my tell() method. */ class Listener; }; }; class Gyoto::Hook::Listener { friend class Gyoto::Hook::Teller; public: Listener(); ///< Constructor ~Listener(); ///< Destructor protected: /** * \brief This is how a Teller tells * * A teller will basically call listener->tell(this). * * \param msg Teller* the Teller who is telling... Useful if the * Listener listens to several Tellers. */ virtual void tell(Gyoto::Hook::Teller *msg); }; class Gyoto::Hook::Teller { friend class Gyoto::Hook::Listener; private: /** * \class ListenerItem * \brief Private (undocumented) class to hold listeners_ */ class ListenerItem; /** * \brief Linked list of Listener items */ ListenerItem *listeners_; public: Teller(); ///< Default constructor Teller(const Teller &); ///< Copy constructor ~Teller(); ///< Destructor /** * \brief Start listening * * Use from a Hook::Listener object method: * \code * teller->hook(this) * \endcode * where "this" is a Listener and "teller" is a Teller. * * Use unhook() later to stop listening to a given Teller. * * \param listener pointer to the new listener */ virtual void hook (Listener * listener); /** * \brief Stop listening * * Use from a Hook::Listener object method: * \code * teller->unhook(this) * \endcode * where "this" is a Listener, "teller" is a Teller, and "this" has * called teller->hook(this) previously. * * \param listener pointer to the listener */ virtual void unhook (Listener * listener); protected: /** * \brief Call tell() on each hooked Listener * * Whenever a Teller mutates, it should warn any Listener hooked to * it using tellListeners(). */ virtual void tellListeners(); }; #endif Gyoto-0.1.0/include/GyotoKerrBL.h000066400000000000000000000124241217470755400165670ustar00rootroot00000000000000/** * \file GyotoKerrBL.h * \brief KerrBL metric * */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoKerrBL_H_ #define __GyotoKerrBL_H_ namespace Gyoto { namespace Metric { class KerrBL; } } #include #include #ifdef GYOTO_USE_XERCES #include #endif /** * \class Gyoto::Metric::KerrBL * \brief Metric around a Kerr black-hole in Boyer-Lindquist coordinates */ class Gyoto::Metric::KerrBL : public Metric::Generic { friend class Gyoto::SmartPointer; // Data : // ----- protected: double spin_ ; ///< Angular momentum parameter int modifkerr_CS_; ///< Chern-Simons modification // Constructors - Destructor // ------------------------- public: KerrBL(); ///< Default constructor KerrBL(double spin, double mass) ; ///< Constructor with spin and mass specification // Default is _not_ fine KerrBL(const KerrBL& ) ; ///< Copy constructor virtual ~KerrBL() ; ///< Destructor // Mutators / assignment // --------------------- public: // default operator= is fine void setSpin(const double spin); ///< Set spin virtual KerrBL * clone () const ; // Accessors // --------- public: double getSpin() const ; ///< Returns spin double getRms() const; ///< Returns prograde marginally stable orbit double getRmb() const; ///< Returns prograde marginally bound orbit double gmunu(const double * const x, int mu, int nu) const ; /** * \brief gμ,ν */ double gmunu_up(const double * const x, int mu, int nu) const ; /* it's necessary to define christoffel even if it's not used. KerrBL derives from Metric where christoffel is virtual pure. If the function is not defined in KerrBL, it's considered virtual pure here too. Then KerrBL is considered an abstract class, and it's forbidden to declare any object of type KerrBL.... See Delannoy C++ p.317-318 NB : and it's not necessary to declare "virtual" a function in a derived class if it has been declared "virtual" in the basis class. */ double christoffel(const double[8], const int, const int, const int) const; double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const ; void nullifyCoord(double coord[8], double & tdot2) const; void nullifyCoord(double coord[8]) const; // friend std::ostream& operator<<(std::ostream& , const KerrBL& ) ; // std::ostream& print(std::ostream&) const ; virtual void circularVelocity(double const pos[4], double vel [4], double dir=1.) const ; public: virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const ; ///< Inverse function of MakeMomentumAndCst ///< Computes pr, ptheta, E and L from rdot, thetadot, phidot, tdot void MakeMomentum(const double coordin[8], const double cst[5], double coordout[8]) const; ///< Transforms from Boyer-Lindquist coordinates [t,r,th,phi,tdot,rdot,thdot,phidot] to [t,r,th,phi,pt,pr,pth,pphi] where pt,pr... are generalized momenta. virtual void setParameter(std::string, std::string, std::string); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp); ///< called from Factory #endif protected: // outside the API /* RK4 : y=[r,theta,phi,t,pr,ptheta], cst=[a,E,L,Q,1/Q],dy/dtau=F(y,cst), h=proper time step. For KerrBL geodesic computation. */ int myrk4(Worldline * line, const double coordin[8], double h, double res[8]) const; //external-use RK4 private: int myrk4(const double coor[8], const double cst[5], double h, double res[8]) const;///< Internal-use RK4 proxy int myrk4_adaptive(Gyoto::Worldline* line, const double coor[8], double lastnorm, double normref, double coor1[8], double h0, double& h1) const; ///< Interal-use adaptive RK4 proxy /** * \brief Ensure conservation of the constants of motion * * Tweak thetadot if necessary. */ int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const; /** * \brief Normalize 4-velocity * * To 0 or -1. Changes rdot to allow norm conservation. */ void Normalize4v(double coord[8], const double part_mass) const; /** F function such as dy/dtau=F(y,cst) */ using Metric::Generic::diff; /** * \brief Used in RK4 proxies. */ virtual int diff(const double y[8], const double cst[5], double res[8]) const ; /** Integrator. Computes the evolution of y (initcond=y(0)). */ virtual void computeCst(const double coord[8], double cst[5]) const; public: void setParticleProperties(Worldline* line, const double* coord) const; }; #endif Gyoto-0.1.0/include/GyotoKerrKS.h000066400000000000000000000103421217470755400166040ustar00rootroot00000000000000/** * \file GyotoKerrKS.h * \brief KerrKS metric * */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoKerrKS_H_ #define __GyotoKerrKS_H_ namespace Gyoto { namespace Metric { class KerrKS; } } #include #include #ifdef GYOTO_USE_XERCES #include #endif /** * \class Gyoto::Metric::KerrKS * \brief Metric around a Kerr black-hole in Kerr-Schild coordinates */ class Gyoto::Metric::KerrKS : public Metric::Generic { friend class Gyoto::SmartPointer; // Data : // ----- protected: double spin_ ; ///< Angular momentum parameter // Constructors - Destructor // ------------------------- public: KerrKS(); ///< Default constructor KerrKS(double spin, double mass) ; ///< Constructor with spin and mass specification // Default is fine // KerrKS(const KerrKS& ) ; virtual KerrKS* clone () const; ///< Copy constructor virtual ~KerrKS() ; ///< Destructor // Mutators / assignment // --------------------- public: // default operator= is fine void setSpin(const double spin); ///< Set spin // Accessors // --------- public: double getSpin() const ; ///< Returns spin double gmunu(const double * x, int alpha, int beta) const ; /* it's necessary to define christoffel even if it's not used. KerrKS derives from Metric where christoffel is virtual pure. If the function is not defined in KerrKS, it's considered virtual pure here too. Then KerrKS is considered an abstract class, and it's forbidden to declare any object of type KerrKS.... See Delannoy C++ p.317-318 NB : and it's not necessary to declare "virtual" a function in a derived class if it has been declared "virtual" in the basis class. */ double christoffel(const double[8], const int, const int, const int) const; void nullifyCoord(double coord[8], double &tdot2) const; void nullifyCoord(double coord[8]) const; virtual void circularVelocity(double const pos[4], double vel [4], double dir=1.) const ; virtual void setParameter(std::string, std::string, std::string); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp); #endif public: void MakeCst(const double* coord, double* cst) const; ///< In Kerr-Schild coordinates [T,x,y,z,Tdot,xdot,ydot,zdot], computes the four constants of the movement : particule mass, energy, angular momentum and Carter's constant. protected: /** * \brief RK4 integrator * * Wrapper around myrk4(const double * coord, const double* cst , double h, double* res) const * * */ int myrk4(Worldline * line, const double coord[8], double h, double res[8]) const;//NB non adaptive integration doesn't work for KS ; this function is not implemented /** * \brief RK4 integrator * \param coord [r,theta,phi,t,pr,ptheta] * \param cst [a,E,L,Q],dy/dtau=F(y,cst) * \param h proper time step. * \param res result */ int myrk4(const double * coord, const double* cst , double h, double* res) const; /** * \brief ? * * Is it ever called? */ int myrk4_adaptive(Gyoto::Worldline* line, const double * coord, double lastnorm, double normref, double* coord1, double h0, double& h1) const; /** F function such as dy/dtau=F(y,cst) */ int diff(const double* coord, const double* cst, double* res) const; int diff(const double y[8], double res[8]) const ; virtual int isStopCondition(double const * const coord) const; void setParticleProperties(Worldline* line, const double* coord) const; }; #endif Gyoto-0.1.0/include/GyotoMetric.h000066400000000000000000000305161217470755400166730ustar00rootroot00000000000000/** * \file GyotoMetric.h * \brief Base class for metric description * * Classes which represent a metric (e.g. Gyoto::Kerr) should inherit * from Gyoto::Metric::Generic and implement all of the virtual methods. * */ /* Copyright 2011, 2013 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoMetric_H_ #define __GyotoMetric_H_ #include #include #include #include #include #include #include namespace Gyoto { namespace Metric { class Generic; /// A function to build instances of a specific Metric::Generic sub-class /** * This is a more specific version of the * SmartPointee::Subcontractor_t type. A Metric::Subcontrator_t is * called by the Gyoto::Factory to build an instance of the kind * of metric specified in an XML file (see Register()). The * Factory and Subcontractor_t function communicate through a * Gyoto::FactoryMessenger. */ typedef SmartPointer Subcontractor_t(FactoryMessenger*); /** * \brief Subcontractor template * * Instead of reimplementing the wheel, your subcontractor can simply be * Gyoto::Metric::Subcontractor * * \tparam T Sub-class of Metric::Generic */ template SmartPointer Subcontractor (FactoryMessenger* fmp) { SmartPointer gg = new T(); gg -> setParameters(fmp); return gg; } /// Query the Metric register /** * Query the Metric register to get the Metric::Subcontractor_t * correspondig to a given kind name. This function is normally * called only from the Factory. * * \param name e.g. "KerrBL" * \param errmode int=0. If errmode==0, failure to find a * registered Metric by that name is an error. Else, simply * return NULL pointer in that case. * \return pointer to the corresponding subcontractor. */ Gyoto::Metric::Subcontractor_t* getSubcontractor(std::string name, int errmode=0); /// The Metric register /** * Use the Metric::initRegister() once in your program to * initiliaze it, the Metric::Register() function to fill it, and * the Metric::getSubcontractor() function to query it. */ extern Register::Entry * Register_; /// Make a Metric kind known to the Factory /** * Register a new Metric::Generic sub-class so that the * Gyoto::Factory knows it. * * \param kind The kind name which identifies this object type in * an XML file, as in <Metric kind="name"> * * \param scp A pointer to the subcontractor, which will * communicate whith the Gyoto::Factory to build an instance of * the class from its XML description */ void Register(std::string kind, Gyoto::Metric::Subcontractor_t* scp); /// Empty the Metric register. /** * This must be called once. It is called by * Gyoto::Register::init(). */ void initRegister(); } /* Documented elswhere */ class Worldline; } /** * \namespace Gyoto::Metric * \brief Access to metrics * * Objects which describe space-time geometry must inherit from the * Gyoto::Metric::Generic class. * * To be usable, a Metric::Generic sub-class should register a * Metric::Subcontractor_t function using the Metric::Register() * function. See also \ref writing_plugins_page . */ /** * \class Gyoto::Metric::Generic * \brief Base class for metrics * * Example: class Gyoto::Metric::KerrBL * * See Gyoto::Metric for an introduction. * */ class Gyoto::Metric::Generic : protected Gyoto::SmartPointee, public Gyoto::Hook::Teller { friend class Gyoto::SmartPointer; private: std::string kind_; ///< Metric kind name (e.g. "KerrBL") double mass_; ///< Mass yielding geometrical unit (in kg). int coordkind_; ///< Kind of coordinates (cartesian-like, spherical-like, unspecified) public: const std::string getKind() const; ///< Get kind_ void setKind(const std::string); ///< Set kind_ int getRefCount(); // Constructors - Destructor // ------------------------- //Metric(const Metric& ) ; ///< Copy constructor Generic(); Generic(const int coordkind); ///< Constructor setting Generic::coordkind_ Generic(const double mass, const int coordkind); ///< Constructor setting Generic::mass_ and Generic::coordkind_ virtual ~Generic() ; ///< Destructor // Mutators / assignment // --------------------- virtual Generic * clone() const ; ///< Virtual copy constructor void setMass(const double); ///< Set mass used in unitLength() void setMass(const double, const std::string &unit); ///< Set mass used in unitLength() // Accessors int getCoordKind() const; ///< Get coordinate kind void setCoordKind(int coordkind); ///< Set coordinate kind double getMass() const; ///< Get mass used in unitLength() double getMass(const std::string &unit) const; ///< Get mass used in unitLength() /** * Metrics implementations are free to express lengths and distances * in whatever unit they see fit (presumably most often geometrical * units). This function returns this unit in SI (meters). */ double unitLength() const ; ///< M * G / c^2, M is in kg, unitLength in meters double unitLength(const std::string &unit) const ; ///< unitLength expressed in specified unit virtual void cartesianVelocity(double const coord[8], double vel[3]); ///< Compute xprime, yprime and zprime from 8-coordinates /** * \param coord 4-position (geometrical units); * \param v 3-velocity dx1/dx0, dx2/dx0, dx3/dx0; * \return tdot = dx0/dtau. */ virtual double SysPrimeToTdot(const double coord[4], const double v[3]) const; ///): \code SmartPointer Gyoto::Metric::MyKind::Subcontractor(FactoryMessenger* fmp) { SmartPointer gg = new MyKind(); gg -> setParameters(fmp); return gg; } \endcode * * Each metric kind should implement setParameter(string name, * string content, string unit) to interpret the individual XML * elements. setParameters() can be overloaded in case the specific * Metric class needs low level access to the FactoryMessenger. See * Gyoto::Astrobj::UniformSphere::setParameters(). */ virtual void setParameters(Gyoto::FactoryMessenger *fmp) ; /** * Metrics implementations should impement fillElement to save their * parameters to XML and call the Metric::fillElement(fmp) for the * shared properties */ virtual void fillElement(FactoryMessenger *fmp) ; ///< called from Factory /** * \brief Process generic XML parameters */ void processGenericParameters(Gyoto::FactoryMessenger *fmp) ; #endif /** * \brief Metric coefficients * * \param x 4-position at which to compute the coefficient; * \param mu 1st index of coefficient, 0≤μ≤3; * \param nu 2nd index of coefficient, 0≤ν≤3; * \return Metric coefficient gμ,ν at point x */ virtual double gmunu(const double * x, int mu, int nu) const = 0 ; /** * \brief Chistoffel symbol * * Value of Christoffel symbol * Γαμν at point * (x1, x2, x3). */ virtual double christoffel(const double coord[8], const int alpha, const int mu, const int nu) const = 0; /** * \brief RK4 integrator */ virtual int myrk4(Worldline * line, const double coord[8], double h, double res[8]) const; /** * \brief RK4 integrator with adaptive step */ virtual int myrk4_adaptive(Gyoto::Worldline* line, const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1) const; /** * \brief Check whether integration should stop * * The integrating loop will ask this the Metric through this method * whether or not it is happy to conitnue the integration. * Typically, the Metric should answer 0 when everything is fine, 1 * when too close to the event horizon, inside the BH... * * \param coord 8-coordinate vector to check. */ virtual int isStopCondition(double const * const coord) const; /** * \brief F function such as dy/dtau=F(y,cst) */ virtual int diff(const double y[8], double res[8]) const ; /** * \brief Set Metric-specific constants of motion. Used e.g. in KerrBL. */ virtual void setParticleProperties(Gyoto::Worldline* line, const double * coord) const; }; #endif Gyoto-0.1.0/include/GyotoPageThorneDisk.h000066400000000000000000000105311217470755400203120ustar00rootroot00000000000000/** * \file GyotoPageThorneDisk.h * \brief A geometrically thin, optically thick disk * * This class describes a disk contained in the z=0 (equatorial) * plane, extending from r=r_ISCO to r=infinity. The flux emitted * at radius r is given by Page & Thorne (1974, ApJ 191:499, * Eqs. 11b, 14, 15). * * Only bolometric flux is implemented (as quantity User4), no * spectral resolution. */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoPageThorneDisk_H_ #define __GyotoPageThorneDisk_H_ #include #include #include namespace Gyoto{ namespace Astrobj { class PageThorneDisk; } } //#include #include /** * \class Gyoto::Astrobj::PageThorneDisk * \brief Geometrically thin disk in Kerr metric * * This class describes a disk contained in the z=0 (equatorial) * plane, extending from r=r_ISCO to r=infinity. The flux emitted * at radius r is given by Page & Thorne (1974, ApJ 191:499, * Eqs. 11b, 14, 15). * * The metric must be either KerrBL or KerrKS. Emission, Spectrum * and BinSpectrum are not provide, the only * intensity provided is provided, as quantity User4 and it is the * default quantity returned if nothing is requested. The other * quantities implemented in ThinDisk are also provided. * */ class Gyoto::Astrobj::PageThorneDisk : public Astrobj::ThinDisk, public Hook::Listener { friend class Gyoto::SmartPointer; private: double aa_; ///< Generic::gg_ spin parameter, monitored by tell() double aa2_; ///< aa_2 double x0_; ///< Value cached for bolometricEmission() double x1_; ///< Value cached for bolometricEmission() double x2_; ///< Value cached for bolometricEmission() double x3_; ///< Value cached for bolometricEmission() int rednoise_; ///< Flag for rednoise-like flux int uniflux_; ///< Flag for uniform flux = 1 // Constructors - Destructor // ------------------------- public: PageThorneDisk(); ///< Standard constructor PageThorneDisk(const PageThorneDisk& ) ;///< Copy constructor virtual PageThorneDisk* clone () const; ///< Cloner virtual ~PageThorneDisk() ; ///< Destructor // Accessors // --------- public: virtual void setMetric(SmartPointer); ///< Set metric, checking that it is either KerrBL or KerrKS virtual void updateSpin() ; ///< Get spin from metric, which must be KerrBL or KerrKS public: using ThinDisk::emission; /** * \brief Not implemented * Throws a Gyoto::Error */ virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; /** * \brief Bolometric emission * * Similar to Generic::emission(), but bolometric. */ virtual double bolometricEmission(double dsem, double c_obj[8]) const; /** * \brief * processHitQuantities fills the requested data in Impact. For * PageThorneDisk, only fill User4, which corresponds to bolometric * intensity. */ virtual void processHitQuantities(Photon* ph, double* coord_ph_hit, double* coord_obj_hit, double dt, Astrobj::Properties* data) const; int setParameter(std::string name, std::string content, std::string unit); Quantity_t getDefaultQuantities(); // Hook::Listener API // public: /** * \brief Update PageThorneDisk::aa_ * * Calls updateSpin(). * * See Hook::Listener::tell() */ virtual void tell(Gyoto::Hook::Teller *msg); public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory #endif }; #endif Gyoto-0.1.0/include/GyotoPatternDisk.h000066400000000000000000000223231217470755400176750ustar00rootroot00000000000000/** * \file GyotoPatternDisk.h * \brief A geometrically thin, optically thick disk * * The target of ray-traced Gyoto::Photon */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoPatternDisk_H_ #define __GyotoPatternDisk_H_ #include #include #include namespace Gyoto{ namespace Astrobj { class PatternDisk; } } //#include #include /** * \class Gyoto::Astrobj::PatternDisk * \brief Geometrically thin disk read from FITS file * * This class describes a disk contained in the z=0 (equatorial) * plane, extending from r=r_ISCO to r=infinity. The flux emitted * at radius r and longitude phi at frequency nu is given in a FITS * file. * */ class Gyoto::Astrobj::PatternDisk : public Astrobj::ThinDisk { friend class Gyoto::SmartPointer; private: std::string filename_; ///< Optional FITS file name containing the arrays /** * An array of dimensionality double[nr_][nphi_][nnu_]. In FITS * format, the first dimension is nu, the second phi, and the third * r. */ double * emission_; ///< Iν(ν, r, φ) double * opacity_; ///< Same dimenstions as emission, or NULL /** * An array of dimensionality double[nr_][nphi_][2]. In FITS format, * the second dimension is phi, and the third r. The first plane in * the first FITS dimention is dφ/dt, the second dr/dt. */ double * velocity_; ///< velocity(r, φ) /** * In case of adaptive grid. */ double * radius_; ///< Radius vector /** * XML element: <Omega>. * FITS keyword: HIERARCH GYOTO PatternDisk Omega */ double Omega_; ///< Pattern angular velocity /** * XML element: <T0>. * FITS keyword: HIERARCH GYOTO PatternDisk t0 */ double t0_; ///< Date for which i=0 corresponds to phi=0 double dnu_; ///< Frequency scale of PatternDisk::emission_ in Hz double nu0_; ///< Lowest frequency provided in PatternDisk::emission_ in Hz size_t nnu_; ///< Number of frequencies provided in PatternDisk::emission_ double dphi_; ///< δφ between two grid columns double phimin_;///< Minimum φ in grid size_t nphi_; ///< Grid size in the φ direction double phimax_; ///< Maximum φ in grid /** * XML elment: <RepeatPhi>. * FITS keyword: HIERARCH GYOTO PatternDisk RepeatPhi */ size_t repeat_phi_; ///< Number of times the pattern should be repeated to cover [0, 2Π] double dr_; ///< Radius step size_t nr_; ///< Number of rows in the patternGrid size in the r direction // Constructors - Destructor // ------------------------- public: PatternDisk(); ///< Standard constructor PatternDisk(const PatternDisk& ) ;///< Copy constructor virtual PatternDisk* clone () const; ///< Cloner virtual ~PatternDisk() ; ///< Destructor // Accessors // --------- public: using ThinDisk::setInnerRadius; virtual void setInnerRadius(double); using ThinDisk::setOuterRadius; virtual void setOuterRadius(double); /** * Unit: radians per geometrical unit time. */ virtual void setPatternVelocity(double); ///< Set PatternDisk::Omega_ virtual double getPatternVelocity(); ///< Get PatternDisk::Omega_ /// Read parameters and arrays from FITS file virtual void fitsRead(std::string filename_); /// Write parameters and arrays to FITS file virtual void fitsWrite(std::string filename_); /// Set PatternDisk::emission_ /** * The pointer is copied directly, not the array content. * * This is a low-level function. Beware that: * - previously allocated array will not be freed automatically; * - array attached when the destructor is called will be freed. */ void setEmission(double * pattern); /// Set PatternDisk::velocity__ /** * The pointer is copied directly, not the array content. * * This is a low-level function. Beware that: * - previously allocated array will not be freed automatically; * - array attached when the destructor is called will be freed. */ void setVelocity(double * pattern); /// Set PatternDisk::radius_ /** * The pointer is copied directly, not the array content. * * This is a low-level function. Beware that: * - previously allocated array will not be freed automatically; * - array attached when the destructor is called will be freed. */ void setRadius(double * pattern); /// Set PatternDisk::emission_ /** * PatternDisk::emission_ is freed if not NULL, reallocated, and * pattern is copied into emission_. * * If PatternDisk::opacity_, PatternDisk::velocity_ or * PatternDisk::radius_ have been set previously with mismatching * sizes, they are deallocated too. * * Finally, PatternDisk::nnu_, PatternDisk::nphi_, and * PatternDisk::nr_ are set according to naxes. * * \param pattern Array to copy as emission_. May be NULL in which * case emission_ is simply deallocated and set to NULL. * * \param naxes { nnu_, nphi_, nr_ }. */ virtual void copyIntensity(double const * const pattern = NULL, size_t const naxes[3] = NULL); virtual double const * getIntensity() const;///< Get PatternDisk::emission_ virtual void getIntensityNaxes( size_t naxes[3] ) const ; ///< Get PatternDisk::nnu_, PatternDisk::nphi_, and PatternDisk::nr_ /** * \brief Set PatternDisk::opacity_ * * PatternDisk::opacity_ is first freed if not NULL and set to NULL. * * If pattern is not NULL, PatternDisk::emission_ must have been set * previously with matching dimensions. PatternDisk::opacity_ is * then reallocated, and pattern is copied into opacity_. * * \param pattern Array to copy as opacity_. May be NULL in which * case opacity_ is simply deallocated and set to NULL. * * \param naxes { nnu_, nphi_, nr_ }. */ virtual void copyOpacity(double const * const pattern = NULL, size_t const naxes[3] = NULL); virtual double const * getOpacity() const; ///< Get PatternDisk::opacity_ /// Set PatternDisk::velocity_ /** * PatternDisk::velocity_ is first freed if not NULL and set to NULL. * * If pattern is not NULL, PatternDisk::emission_ must have been set * previously with matching dimensions. PatternDisk::velocity_ is * then reallocated, and pattern is copied into velocity_. * * \param pattern Array to copy as velocity_. May be NULL in which * case velocity_ is simply deallocated and set to NULL. * * \param naxes { nphi_, nr_ }. */ virtual void copyVelocity(double const * const pattern = NULL, size_t const naxes[2] = NULL); virtual double const * getVelocity() const;///< Get PatternDisk::velocity_ /// Set PatternDisk::radius_ /** * PatternDisk::radius_ is first freed if not NULL and set to NULL. * * If pattern is not NULL, PatternDisk::emission_ must have been set * previously with matching dimensions. PatternDisk::radius_ is * then reallocated, and pattern is copied into radius_. * * \param pattern Array to copy as radius_. May be NULL in which * case radius_ is simply deallocated and set to NULL. * * \param nr size of radius array. */ virtual void copyGridRadius(double const * const pattern = NULL, size_t nr = 0 ); virtual double const * getGridRadius() const; ///< Get PatternDisk::radius_ virtual void repeatPhi(size_t n); ///< Set PatternDisk::repeat_phi_ virtual size_t repeatPhi() const; ///< Get PatternDisk::repeat_phi_ virtual void nu0(double freq); ///< Set PatternDisk::nu0_ virtual double nu0() const; ///< Get PatternDisk::nu0_ virtual void dnu(double dfreq); ///< Set PatternDisk::dnu_ virtual double dnu() const; ///< Get PatternDisk::dnu_ void phimin(double phimin); ///< Set PatternDisk::phimin_ double phimin() const; ///< Get PatternDisk::phimin_ void phimax(double phimax); ///< Set PatternDisk::phimax_ double phimax() const; ///< Get PatternDisk::phimax_ virtual int setParameter(std::string name, std::string content, std::string unit); protected: void getIndices(size_t i[3], double const co[4], double nu=0.) const ; ///< Get emission_ cell corresponding to position co[4] public: using ThinDisk::emission; virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; virtual double transmission(double nu_em, double dsem, double coord[8]) const; virtual void getVelocity(double const pos[4], double vel[4]) ; public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; virtual void setParameters(FactoryMessenger *fmp); #endif }; #endif Gyoto-0.1.0/include/GyotoPatternDiskBB.h000066400000000000000000000070241217470755400201020ustar00rootroot00000000000000/** * \file GyotoPatternDiskBB.h * \brief A PatternDisk object with black body spectrum and * a power law extension up to some rmax_ * * A sort of composite of Astrobj::PatternDisk and * Astrobj::ThinDiskPL. Behaves like the latter for r > * PatternDiskBB::rPL_) and mostly like the former for r < * PatternDiskBB::rPL_ except PatternDiskBB::emission_ does not yield * directly Iν but temperature. */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoPatternDiskBB_H_ #define __GyotoPatternDiskBB_H_ #include #include #include namespace Gyoto{ namespace Astrobj { class PatternDiskBB; } } //#include #include #include /** * \class Gyoto::Astrobj::PatternDiskBB * \brief Geometrically thin disk read from FITS file with black body * spectrum and a power law extension up to some rmax_ * * This class describes a disk contained in the z=0 (equatorial) * plane, extending from r=r_ISCO to r=rmax_. The flux emitted * at radius r and longitude phi at frequency nu is given in a FITS * file. * * A sort of composite of Astrobj::PatternDisk and * Astrobj::ThinDiskPL. Behaves like the latter for r > * PatternDiskBB::rPL_) and mostly like the former for r < * PatternDiskBB::rPL_ except PatternDiskBB::emission_ does not yield * directly Iν but temperature. */ class Gyoto::Astrobj::PatternDiskBB : public Astrobj::PatternDisk { friend class Gyoto::SmartPointer; protected: SmartPointer spectrumBB_; ///< disk black body ///< emission law private: /** * \brief 1 if spectral emission. * * XML: SpectralEmission * */ int SpectralEmission_; int PLDisk_; ///< Whether the disk has a power law extension double PLSlope_; ///< Mass density power-law slope double PLRho_; ///< Mass density reference value double rPL_; ///< Mass density reference radius // double rmax_; ///< Maximal extension of the disk !!! see Astrobj::rmax_ // Constructors - Destructor // ------------------------- public: PatternDiskBB(); ///< Standard constructor PatternDiskBB(const PatternDiskBB& ) ;///< Copy constructor virtual PatternDiskBB* clone () const;///< Cloner virtual ~PatternDiskBB() ; ///< Destructor // Accessors // --------- public: int setParameter(std::string name, std::string content, std::string unit); public: using PatternDisk::emission; double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; double const * getVelocity() const ; void getVelocity(double const pos[4], double vel[4]) ; void setMetric(SmartPointer gg); ///< Insures metric is KerrBL public: #ifdef GYOTO_USE_XERCES void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoPhoton.h000066400000000000000000000227351217470755400167230ustar00rootroot00000000000000/** * \file GyotoPhoton.h * \brief A single light ray * * Gyoto::Photon is a class for ray-tracing. * */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoPhoton_H_ #define __GyotoPhoton_H_ #include "GyotoFunctors.h" namespace Gyoto{ class Photon; namespace Astrobj { class Generic; } } #include #include #include #include #include /** * \class Gyoto::Photon * \brief A null geodesic transporting light * * This is the central object for ray-tracing. */ class Gyoto::Photon : public Gyoto::Worldline, protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; // Data : // ----- protected: /// The astronomical target /** * The (only) possible origin for this Photon. */ SmartPointer object_; /// Photon's frequency in observer's frame /** * In Hz, for quantity Emission */ double freq_obs_; /// Integrated optical transmission /** * At Photon::freq_obs_, between current position and observer. */ double transmission_freqobs_; /// Observer's spectrometer /** * Conveying observation frequencies for quantities Spectrum and * BinSpectrum. */ SmartPointer spectro_; /// Integrated optical transmissions /** * For each frequency in Photon::spectro_->getMidpoints(), between * current position and observer. */ double * transmission_; // Constructors - Destructor // ------------------------- public: virtual std::string className() const ; ///< "Photon" virtual std::string className_l() const ; ///< "photon" /** * Allocates the default size (GYOTO_DEFAULT_X_SIZE) for x1, x2 etc. */ Photon() ; ///< Default constructor Photon(const Photon& ) ; ///< Copy constructor Photon* clone() const ; ///< Cloner protected: Photon(Photon* orig, size_t i0, int dir, double step_max); ///< Used by Photon::Refined::Refined() public: /// Same as Photon() followed by setInitialCondition(SmartPointer gg, SmartPointer obj, const double coord[8]) Photon(SmartPointer gg, SmartPointer obj, double* coord) ; /// Same as Photon() followed by setInitialCondition(SmartPointer gg, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta) Photon(SmartPointer gg, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta); virtual ~Photon() ; ///< Destructor virtual double getMass() const ; ///< Return 0. /// Set Photon::object_ void setAstrobj(SmartPointer); /// Get Photon::object_ SmartPointer getAstrobj() const ; /// Set Photon::spectro_ void setSpectrometer(SmartPointer spr); /// Get Photon::spectro_ SmartPointer getSpectrometer() const ; /// Set Photon::freq_obs__ void setFreqObs(double); /// Get Photon::freq_obs__ double getFreqObs() const; // Mutators / assignment // --------------------- public: /// Assignment to another Photon void operator=(const Photon&) ; /// Set or re-set the initial condition prior to integration. /** * Set initial condition for this Photon : * * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this universe; * \param obj Gyoto::SmartPointer to the target Gyoto::Astrobj; * \param coord 8-element array containing the initial condition, * i.e. the 4-position and the 4-velocity of the Photon at * the receiving end; * */ void setInitialCondition(SmartPointer gg, SmartPointer obj, const double coord[8]) ; /// Set or re-set the initial condition prior to integration. /** * Set initial condition for this Photon : * * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this universe; * \param obj Gyoto::SmartPointer to the target Gyoto::Astrobj; * \param screen Observer's screen; * \param d_alpha Direction of arrival (RA offset) in radians; * \param d_delta Direction of arrival (Dec offset) in radians. */ void setInitialCondition(SmartPointer gg, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta); /// Integrate the geodesic /** * \param[in,out] data Optional Astrobj::Properties to fill with * observational quantities. * \return 1 if object was hit, else 0. */ int hit(Astrobj::Properties *data=NULL); /** * \brief Find minimum of photon--object distance * * Return the minimum of (*object)(this->getCoord()) * between t1 and t2. The date of this minimum is returned in tmin. * * \param[in] object * the distance to minimize is given by * object->operator()(). This method is in particular * implemented by the subclasses of Astrobj::Standard. * \param[in] t1 date * \param[in] t2 date * \param[out] tmin on output, date correspondig to the minimum * \param[in] threshold stop searching for a minimum if a value < * threshold is found (very often, we just want to find * a date below the threshold, not the accurate * minimum). */ double findMin(Functor::Double_constDoubleArray* object, double t1, double t2, double &tmin, double threshold = DBL_MIN) ; /// Find date for which the photon is at a given distance from the object /** * \param[in] object Object, must implement operator() * (e.g. Astrobj::Standard, ThinDisk::Standard) * \param[in] value The value to find * \param[in] tinside A date for which * object->Astrobj::operator()(Photon::getCoord()) is < value * \param[in,out] toutside On input: a date for which * object->Astrobj::operator()(Photon::getCoord()) is > * value. on output, (*object)(getCoord(toutside)) is < * value, very close to value. toutside is closer to tinside * on output than on input. */ void findValue(Functor::Double_constDoubleArray* object, double value, double tinside, double &toutside) ; #ifdef GYOTO_USE_XERCES public: /// Write XML description void fillElement(FactoryMessenger *fmp); /// Instanciate Photon from XML description static SmartPointer Subcontractor(Gyoto::FactoryMessenger*); #endif /* transmission stuff */ public: /// Set transmission to 1 for each channel as well as scalar transmission void resetTransmission() ; /// Get transmission /** * Get either Photon::transmission_freqobs_ (with i=-1) or * Photon::transmission_[i]. * * \param i channel number of the requested frequency, -1 for * Photon::freq_obs_. */ double getTransmission(size_t i) const ; /// Get maximum transmission; /** * Get current maximum of all the transmissions, * Photon::transmission_freqobs_ or one elements of the * Photon::transmission_ array. * */ double getTransmissionMax() const ; /// Get Photon::transmission_ /** * getTansmission()[i] == getTransmission(size_t i) */ double const * getTransmission() const ; /// Update transmission in a given channel /** * getTransmission(size_t i) *= t. * * \param i channel number. -1 for scalar Photon::transmission_freqobs_. * \param t transmission of this fluid element. */ virtual void transmit(size_t i, double t); private: /// Allocate Photon::transmission_ void _allocateTransmission(); public: class Refined; }; /** * \class Gyoto::Photon::Refined * \brief Refine last step of integration in a Photon * * The integration step of a Photon's geodesic is adaptive. This is * computationally efficient, but sometimes it is necessary to get the * position of a Photon with a finer * step. Gyoto::ComplexAstrobj::Impact() is a typical use case. * * A Refined photon is linked to its parent. In particular, care is * taken so that the parent's to update the parent's transmissions * whenever the Refined transmissions are touched. * * Don't use this class blindly: what's guaranteed to work is what is * used in Gyoto::ComplexAstrobj::Impact(). * * XML description corresponding to this class is <Photon/>. It * supports all the parameters supported by the Gyoto::Worldline class * plus an optional <Astrobj/> section to attach a instance of a * Gyoto::Astrobj::Generic sub-class. */ class Gyoto::Photon::Refined : public Gyoto::Photon { protected: Photon * parent_; ///< Parent Photon. public: Refined(Photon *parent, size_t i, int dir, double step_max); ///< Constructor virtual void transmit(size_t i, double t); ///< Update transmission both in *this and in *parent_ }; #endif Gyoto-0.1.0/include/GyotoPolishDoughnut.h000066400000000000000000000250141217470755400204210ustar00rootroot00000000000000/** * \file GyotoPolishDoughnut.h * \brief A toroïdal accretion structure * * Reference: Straub, O.; Vincent, F. H.; Abramowicz, M. A.; * Gourgoulhon, E.; & Paumard, T. 2012, Modelling the * black hole silhouette in Sagittarius A* with ion tori, * A&A 543:83. * */ /* Copyright (c) 2012 Frederic Vincent, Odele Straub, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoPolishDoughnut_H_ #define __GyotoPolishDoughnut_H_ namespace Gyoto{ namespace Astrobj { class PolishDoughnut; } class FactoryMessenger; } //#include #include #include #include #include //#include /** * \brief A toroïdal accretion structure * * Reference: Straub, O.; Vincent, F. H.; Abramowicz, M. A.; * Gourgoulhon, E.; & Paumard, T. 2012, Modelling the * black hole silhouette in Sagittarius A* with ion tori, * A&A 543:83. * */ class Gyoto::Astrobj::PolishDoughnut : public Astrobj::Standard, protected Gyoto::Hook::Listener { friend class Gyoto::SmartPointer; // Data : // ----- private: /** * \brief KerrBL metric * * This Astrobj::Generic subclass only works (so far?) in KerrBL * metric. We store a copy of the Astrobj::Generic::gg_ * SmartPointer appropriately cast. The two pointers point to the * same instance. */ SmartPointer gg_; double l0_; ///< Angular momentum. Tied to PolishDoughnut::lambda_. double lambda_; ///< Adimentionned angular momentum double W_surface_; ///< Potential surface value. Tied to PolishDoughnut::lambda_. double W_centre_; ///< Potential central value. Tied to PolishDoughnut::lambda_. double r_cusp_; ///< Cusp radius in geometrical units. Tied to PolishDoughnut::lambda_. double r_centre_; ///< Central radius in geometrical units. Tied to PolishDoughnut::lambda_. double DeltaWm1_; ///< 1./(W_centre_ - W_surface_); double temperature_ratio_; ///< Central ion/electron temperature ratio double central_density_; ///< Central density in kg/L (same as g cm^-3) double centraltemp_over_virial_; ///< Tcenter/Tvirial double beta_; ///< Pmagn/Pgas int use_specific_impact_ ;///< Use PolishDoughnut::Impact_() or Standard::Impact() double aa_; ///< PolishDoughnut::gg_ spin, cached when setting PolishDoughnut::lambda_ double aa2_; ///< aa_2 size_t spectral_oversampling_;///< Oversampling used in integrateEmission() // Constructors - Destructor // ------------------------- public: PolishDoughnut() ; ///< Default constructor //PolishDoughnut(SmartPointer gg, double lambda) ; ///< Standard constructor PolishDoughnut(const PolishDoughnut& ) ; ///< Copy constructor virtual PolishDoughnut* clone() const; virtual ~PolishDoughnut() ; ///< Destructor // Mutators / assignment // --------------------- public: /// Assignment to another PolishDoughnut void operator=(const PolishDoughnut&) ; // Accessors // --------- public: double getL0() const; ///< Get PolishDoughnut::l0_ // void setL0(double l0); set by lambda_ double getLambda() const; ///< Get PolishDoughnut::lambda_ void setLambda(double lambda); ///< Set PolishDoughnut::lambda_ double getTemperatureRatio() const; ///< Get PolishDoughnut::temperature_ratio_ void setTemperatureRatio(double temp); ///< Set PolishDoughnut::temperature_ratio_ double getCentralDensity() const; ///< Get PolishDoughnut::central_density_ double getCentralDensity(std::string unit) const; ///< Get PolishDoughnut::central_density_ in specified unit void setCentralDensity(double density); ///< Set PolishDoughnut::central_density_ void setCentralDensity(double density, std::string unit); ///< Set PolishDoughnut::central_density_ in specified unit double getCentralTempOverVirial() const; ///< Get PolishDoughnut::centraltemp_over_virial_ void setCentralTempOverVirial(double val); ///< Set PolishDoughnut::centraltemp_over_virial_ double getBeta() const; ///< Get PolishDoughnut::beta_ void setBeta(double beta);///< Set PolishDoughnut::beta_ void setSpectralOversampling(size_t); ///< Set PolishDoughnut::spectral_oversampling_ size_t getSpectralOversampling() const ; ///< Get PolishDoughnut::spectral_oversampling_ // Read only members, depend on lambda double getWsurface() const; ///< Get PolishDoughnut::W_surface_ double getWcentre() const; ///< Get PolishDoughnut::W_centre_ double getRcusp() const; ///< Get PolishDoughnut::r_cusp_ double getRcentre() const; ///< Get PolishDoughnut::r_centre_ virtual Gyoto::SmartPointer getMetric() const; virtual void setMetric(Gyoto::SmartPointer); void useSpecificImpact(int yes=1); ///< Set PolishDoughnut::use_specific_impact_ // ASTROBJ API // ----------- /** * Depending on PolishDoughnut::use_specific_impact_. See useSpecificImpact(). */ int Impact(Photon *ph, size_t index, Astrobj::Properties *data); ///< Call either PolishDoughnut::Impact() or Standard::Impact() /** * This should not be better than Standard::Impact(). Call * useSpecificImpact() or Set <UseSpecifictImpact/> in the XML * file to use it. */ int Impact_(Photon *ph, size_t index, Astrobj::Properties *data); ///< A specific implementation of Generic::Impact() virtual double operator()(double const coord[4]) ; virtual int setParameter(std::string name, std::string content, std::string unit) ; #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; #endif // ASTROBJ processHitQuantities API // -------------------------------- protected: /** * \brief Update PolishDoughnut::aa_ * * See Hook::Listener::tell(). */ virtual void tell(Gyoto::Hook::Teller * msg); virtual void getVelocity(double const pos[4], double vel[4]) ; using Standard::integrateEmission; /** * \brief ∫ν1ν2 Iν dν (or jν) * * PolishDought::emission() is slow. Integrating it is very * slow. This implementation simply oversamples the spectrum by * PolishDoughnut::spectral_oversampling_ and sums the trapezoids. * * For general documentation, see Astrobj::Generic::integrateEmission(double * I, double const * boundaries, size_t const * chaninds, size_t nbnu, double dsem, double *cph, double *co) const . */ virtual void integrateEmission(double * I, double * boundaries, size_t* chaninds, size_t nbnu, double dsem, double *cph, double *co) const; virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]) const; virtual void emission(double Inu[], double nu_em[], size_t nbnu, double dsem, double coord_ph[8], double coord_obj[8]=NULL) const ; double emissionBrems(double nu_em, double nu_crit, double numax, double T_electron, double n_e, double n_j, double amplification, double Cbrems, int comptonorder) const; ///< Bremsstrahlung proxy for emission() double emissionSynch(double nu_em, double nu_crit, double numax, double nu_0, double T_electron, double amplification, double Csynch, double alpha1, double alpha2, double alpha3, double preff, int comptonorder) const; ///< Synchrotron proxy for emission() double transmission(double nuem, double dsem, double coord_ph[8]) const ; double BBapprox(double nuem, double Te) const; ///< Approximated Black-Body function static double funcxM(double alpha1, double alpha2, double alpha3, double xM); ///< Mahadevan 96 fit function // PURELY INTERNAL TO ASTROBJ // -------------------------- private: double potential(double r, double theta) const; ///< Potential defining shape, used by operator()() /** * \class Gyoto::Astrobj::PolishDoughnut::intersection_t * \brief double intersection(double) Functor class * * Implement former double intersection(double) function as a * Gyoto::Functor::Double_Double_const subclass to access generic * root-finding methods. * * This class is instanciated in a single * PolishDoughnut::intersection member. */ class intersection_t : public Gyoto::Functor::Double_Double_const { public: double aa_; ///< Metric spin double aa2_;///< aa_2 double l0_; ///< Torus angular momentum virtual double operator() (double) const; }; /** * \class Gyoto::Astrobj::PolishDoughnut::transcendental_t * \brief double transcendental(double) Functor class * * Implement former double transcendental(double, double*) function * as a Gyoto::Functor::Double_Double_const subclass to access * generic root-finding methods. * * This class is as a local variable in PolishDoughnut::emission() */ class transcendental_t : public Gyoto::Functor::Double_Double_const { public: /** * \brief Parameter array * * \code * double rr = par[0] ; * double n_e = par[1] ; * double BB = par[2] ; * double Te = par[3] ; * double alpha1 = par[4] ; * double alpha2 = par[5] ; * double alpha3 = par[6] ; * \endcode */ double const * par; virtual double operator() (double) const; }; intersection_t intersection; ///< double intersection(double) Functor public: static double bessi0(double xx);///< Modified Bessel function I0 static double bessi1(double xx);///< Modified Bessel function I1 static double bessk0(double xx);///< Modified Bessel function K0 static double bessk1(double xx);///< Modified Bessel function K1 static double bessk(int nn, double xx);///< Modified Bessel function // Outputs // ------- public: /// Display friend std::ostream& operator<<(std::ostream& , const PolishDoughnut& ) ; public: }; #endif Gyoto-0.1.0/include/GyotoPowerLawSpectrum.h000066400000000000000000000043551217470755400207350ustar00rootroot00000000000000/** * \file GyotoPowerLawSpectrum.h * \brief A power law spectrum : I_nu=constant_*nu^exponent_ * * Light emitted by an astronomical object */ /* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoPowerLawSpectrum_H_ #define __GyotoPowerLawSpectrum_H_ #include namespace Gyoto { namespace Spectrum { class PowerLaw; } } /** * \class Gyoto::Spectrum::PowerLaw * \brief I_nu=constant_*nu^exponent_ * * Light emitted by e.g. a Star. * * XML stanza: * \code * * 0. * 1. * * \endcode */ class Gyoto::Spectrum::PowerLaw : public Gyoto::Spectrum::Generic { friend class Gyoto::SmartPointer; protected: double constant_; ///< I_nu=constant_*nu^exponent_ double exponent_; ///< I_nu=constant_*nu^exponent_ public: PowerLaw(); /** * \brief Constructor setting exponent_ and optionally constant_ */ PowerLaw(double exponent, double constant=1.); // PowerLaw(const Spectrum &); virtual PowerLaw * clone() const; ///< Cloner double getConstant() const; ///< Get constant_ void setConstant(double); ///< Set constant_ double getExponent() const; ///< Get exponent_ void setExponent(double); ///< Set exponent_ using Gyoto::Spectrum::Generic::operator(); virtual double operator()(double nu) const; #ifdef GYOTO_USE_XERCES virtual void setParameter(std::string name, std::string content, std::string unit); virtual void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoRegister.h000066400000000000000000000076331217470755400172400ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoRegister_H_ #define __GyotoRegister_H_ #include #include "GyotoSmartPointer.h" /** * \file GyotoRegister.h * \brief Gyoto registers * * Gyoto::Register::Entry instances are used to map kind names to * Gyoto::SmartPointee::Subcontractor_t functions used to instanciate * objects from XML files through the Gyoto::Factory. */ namespace Gyoto { #ifdef GYOTO_USE_XERCES /** * \namespace Gyoto::Register * \brief Gyoto registers * * Gyoto::Register::Entry instances are used to map kind names to * Gyoto::SmartPointee::Subcontractor_t functions used to * instanciate objects from XML files through the Gyoto::Factory. */ namespace Register { /* Documented below */ class Entry; /** * \brief Initialise the various registers * * Normally called once at application start-up, Register::init() * initiaizes the registers, loads the plug-ins, and fills the * registers as appropriate. * * \param pluglist Coma-separated list of plug-ins to load. If * NULL, default to the environment variable GYOTO_PLUGINS, if it * exists. Else use GYOTO_DEFAULT_PLUGINS. Failing to load a * plug-in prepended with "nofail:" is not fatal. */ void init( char const * pluglist = NULL ); /** * \brief List the various registers */ void list(); } #endif /** * \brief Load a plugin by name * * Uses dlopen to load the file libgyoto-<plugname>.so, looks for * the function __Gyoto<plugname>Init inside it and run it. * Plug-ins must be located in the runtime link search path, or in * GYOTO_PREFIX/lib/gyoto/, or in * GYOTO_PREFIX/lib/gyoto/GYOTO_SOVERS/. * * \param plugname Plug-in name. * \param nofail Unless nofail evals to true, the inability to find * a plug-in or to run the initialization function inside it throws * an Gyoto::Error. */ void loadPlugin( char const * const plugname, int nofail = 0); } #ifdef GYOTO_USE_XERCES /** * \brief Entry in a register (or a full register) * * A register is actually a chained list of Register::Entry * instances. */ class Gyoto::Register::Entry { /** * \brief List the various registers */ friend void Gyoto::Register::list(); protected: std::string name_; ///< Kind name for the entry, as found in the "kind" XML attribute Gyoto::SmartPointee::Subcontractor_t* subcontractor_; ///< Pointer to the Gyoto::SmartPointee::Subcontractor_t function that produces an object of this kind Register::Entry* next_; ///< Next entry in the register, or NULL public: /** * \brief Constructor */ Entry(std::string name, Gyoto::SmartPointee::Subcontractor_t* subcontractor, Entry* next); ~Entry(); ///< Destructor /** * \brief Get subcontractor for a given name * * Search through the register for an Entry matching name and return * the corresponding subcontractor. * * \param name Name of the kind to look for. * \param errmode 1 if getSubContractor() should return NULL upon * failure. Else a Gyoto::Error is thrown. * \return Pointer to subcontractor function. */ Gyoto::SmartPointee::Subcontractor_t* getSubcontractor(std::string name, int errmode=0); }; #endif #endif Gyoto-0.1.0/include/GyotoRotStar3_1.h000066400000000000000000000101431217470755400173430ustar00rootroot00000000000000/** * \file GyotoRotStar3_1.h * \brief Numerical metric around a rotating star in 3+1 formalism * * */ /* Copyright 2011 Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoRotStar3_1_H_ #define __GyotoRotStar3_1_H_ #include #include class Star_rot; namespace Gyoto { namespace Metric { class RotStar3_1; } } #include #include #include #ifdef GYOTO_USE_XERCES #include #endif /** * \class Gyoto::Metric::RotStar3_1 * \brief Numerical metric around a rotating star in 3+1 formalism */ class Gyoto::Metric::RotStar3_1 : public Gyoto::Metric::Generic { friend class Gyoto::SmartPointer; private: char* filename_; ///< Lorene output file name Star_rot * star_; ///< Pointer to underlying Lorene Star_rot instance int integ_kind_;///< 1 if RotStar3_1::myrk4(), 0 if Metric::myrk4() public: RotStar3_1(); ///< Constructor RotStar3_1(const RotStar3_1& ) ; ///< Copy constructor virtual ~RotStar3_1() ; ///< Destructor virtual RotStar3_1* clone() const ; ///< Cloner (uses RotStar3_1(file, integ_kind)) void setFileName(char const *); ///< Set filename_ char const * getFileName() const; ///< Get filename_ void setIntegKind(int); ///< Set integ_kind_ int getIntegKind() const ; ///< Get integ_kind_ using Metric::Generic::myrk4; /** * \brief RK4 integrator * * NB: we use the 6-coordinates, here, unlike the inherited function. */ int myrk4(const double coord[6], double h, double res[6]) const; /** * \brief Adaptive RK4 integrator * * Dispatches between Generic::myrk4_adaptive() and myrk4_adaptive(const double coor[6], double lastnorm, double normref, double coornew[6], double cst[2], double& tdot_used, double h0, double& h1, double& hused) const depending on RotStar3_1::integ_kind_ */ int myrk4_adaptive(Gyoto::Worldline* line, const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1) const; /** * \brief RK4 integrator (3+1) * * NB: we use the 6-coordinates, here, unlike the inherited function. */ int myrk4_adaptive(const double coor[6], double lastnorm, double normref, double coornew[6], double cst[2], double& tdot_used, double h0, double& h1, double& hused) const; /** * \brief F function such as dy/dtau=F(y,cst) */ int diff(const double coord[8], double res[8]) const ; /** * \brief Alternate version of diff(const double coord[8], double res[8]) const * * Using only 6 parameters. Last int is not used: it is only here to * distinguish the signature of the two methods. Could have been * done choosing another name, too, but hey... */ int diff(const double y[6], double res[6], int) const ; /** * \brief Tweak coordinates to insure conservation of cst */ void Normalize4v(const double coordin[6], double coordout[6], const double cst[2], double& tdot_used) const; double gmunu(const double * x, int mu, int nu) const ; double christoffel(const double coord[8], const int alpha, const int mu, const int nu) const ; double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const ; virtual void setParameter(std::string, std::string, std::string); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp); ///< called from Factory virtual void setParameters(Gyoto::FactoryMessenger *fmp) ; #endif }; #endif Gyoto-0.1.0/include/GyotoScenery.h000066400000000000000000000276411217470755400170650ustar00rootroot00000000000000/** * \file GyotoScenery.h * \brief Ray-tracing framework * * A Metric, an Astrobj and a Screen. */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoScenery_H_ #define __GyotoScenery_H_ namespace Gyoto{ class Scenery; } #include #include #include #include #include #include #include /** * \class Gyoto::Scenery * \brief Ray-tracing scene * * An Scenery contains: * - a Metric: used in Astrobj, Screen and Photon; * - a Screen: sets the field-of-view, the position of the camera, * the observation time, and the Spectrometer; * - an Astrobj: light emitter. * * * In addition, Quantities may be specified (or the default Quantity * will be produced: generally Intensity). Not all Astrobj implement * all Quantities. The order in which Quantities are listed is not * relevant (it is not stored). A value of the integration step for * the Photon's trajectory can be specified in Delta. It will be used * as the initial step, which is adaptive. Possible Quantities: * * - Intensity: the intensity that reaches the object, integrated over * the line-of-sight; * - EmissionTime: date of emission; * - MinDistance: minimum distance between the Photon reaching each * pixel and the Astrobj; * - FirstDistMin: last closest approach between Photon and Astrobj; * - Redshift; * - ImpactCoords: 8-coordinates of the object and photon at impact; * - Spectrum: Iν computed at various values frequencies, * corresponding to the Screen's Spectrometer. * - BinSpectrum: * ∫ν1ν2Iνdν * computed between various (ν1, ν2 * pairs corresponding to the Screen's Spectrometer. This is what a * physical spectrometer measures. * * In addition, it is possible to ray-trace an image using several * cores on a single machine (if Gyoto has been compiled with POSIX * threads support). The number of threads can be specified using * NThreads entity. Setting NThreads to 0 is equivalent to setting it * to 1. Beware that setting NThreads to a number higher than the * actual number of cores available on the machine usually leads to a * decrease in performance. * * Thus a fully populated Scenery XML looks like that: * \code * * * * * * * * * * * * * * * * Spectrum Intensity ... * * 1. * * 2 * * * \endcode */ class Gyoto::Scenery : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; // Data : // ----- protected: /** * The Metric, or stage, for this scenery. */ SmartPointer gg_; /** * Screen, the camera for this scenery. */ SmartPointer screen_; /** * The astrophysical emitting light in this scenery... the actor. */ SmartPointer obj_; bool adaptive_; ///< Whether integration should use adaptive delta /** * Default integration step for the photons */ double delta_; // default integration step for the photons /// Quantities to compute /** * Bitwise OR of quantities that will be computed, for instance: * \code * GYOTO_QUANTITY_INTENSITY | GYOTO_QUANTITY_EMISSIONTIME | ... * \endcode */ Gyoto::Quantity_t quantities_; /** * Used internally to not always reallocate memory when operator() is called. */ Gyoto::Photon ph_; ///< Cached Photon. /** * Computation does not go back before tmin_. Default is -DBL_MAX. tmin_ is * always expressed in geometrical units, it is essentially a tuning * parameter for the ray-tracing process. tmin should be chosen to * always be longer than the distance between the screen and the * object. */ double tmin_; ///< Time limit for the integration (geometrical units) /** * When compiled with libpthread, Scenery::rayTrace() may compute * several points of the image in parallel threads. This is the * number of threads to use. */ size_t nthreads_; ///< Number of parallel threads to use in rayTrace() # ifdef HAVE_UDUNITS /// See Astrobj::Properties::intensity_converter_ Gyoto::SmartPointer intensity_converter_; /// See Astrobj::Properties::intensity_converter_ Gyoto::SmartPointer spectrum_converter_; /// See Astrobj::Properties::intensity_converter_ Gyoto::SmartPointer binspectrum_converter_; # endif size_t maxiter_ ; ///< Maximum number of iterations when integrating // Constructors - Destructor // ------------------------- public: Scenery(); ///< Set everything to defaults Scenery (const Scenery& o); ///< Copy constructor Scenery * clone() const; ///< Cloner /// Constructor setting Scenery::gg_, Scenery::screen_, and Scenery::obj_ /** * To ensure consistency, the Metric will be forcibly attached to * the Screen and to the Astrobj (if they are not NULL). */ Scenery(SmartPointer, SmartPointer, SmartPointer); ~Scenery(); // Mutators / assignment // --------------------- public: // Accessors // --------- SmartPointer getMetric(); ///< Get Scenery::gg_ /** * The provided Metric will also be atached to the Screen and the Astrobj. */ void setMetric(SmartPointer); ///< Set Scenery::gg_ SmartPointer getScreen(); ///< Get Scenery::screen_ /** * The Metric attached to the Scenery will be attached to the Screen */ void setScreen(SmartPointer);///< Set Scenery::screen_ SmartPointer getAstrobj(); ///< Get Scenery::obj_ /** * The Metric attached to the Scenery will be attached to the Astrobj */ void setAstrobj(SmartPointer); ///< Set Scenery::obj_ double getDelta() const ; ///< Get default step in geometrical units double getDelta(const std::string &unit) const ; ///< Get default step in specified units void setDelta(double); ///< set default step in geometrical units void setDelta(double, const std::string &unit); ///< set default step in specified units /// Set Scenery::quantities_ /** * \param quant Bitwise OR of desired quantities, e.g. \code GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_MIN_DISTANCE \endcode */ void setRequestedQuantities(Quantity_t quant) ; /// Set Scenery::quantities_ from string /** * \param squant Coma-separated list of quantities, e.g. "Spectrum * MinDistance". The order is not relevant. */ void setRequestedQuantities(std::string squant) ; /// Get Scenery::quantities_ Quantity_t getRequestedQuantities() const ; /// Get a string representation of Scenery::quantities_ std::string getRequestedQuantitiesString() const ; /// Get number of requested quantities of scalar nature /** * This is all quantities except Spectrum, BinSpectrum and ImpactCoords. */ size_t getScalarQuantitiesCount() const ; /// Get Scenery::tmin_ double getTmin() const ; /// Get Scenery::tmin_ in specified unit double getTmin(const std::string &unit) const ; /// Set Scenery::tmin_ void setTmin(double); /// Set Scenery::tmin_ in specified unit void setTmin(double, const std::string &unit); void adaptive (bool mode) ; ///< Set Scenery::adaptive_ bool adaptive () const ; ///< Get Scenery::adaptive_ void maxiter (size_t miter) ; ///< Set Scenery::maxiter_ size_t maxiter () const ; ///< Get Scenery::maxiter_ void setNThreads(size_t); ///< Set nthreads_; size_t getNThreads() const ; ///< Get nthreads_; /// Set Scenery::intensity_converter_ void setIntensityConverter(std::string unit); /// Set Scenery::spectrum_converter_ void setSpectrumConverter(std::string unit); /// Set Scenery::binspectrum_converter_ void setBinSpectrumConverter(std::string unit); /// Copy converters to Astrobj::Properties instance /** * Copy Scenery::intensity_converter_, Scenery::spectrum_converter_ * and Scenery::binspectrum_converter_ to there alter ego in *prop. */ void setPropertyConverters(Gyoto::Astrobj::Properties *prop); // Worker: public: /// Perform ray-tracing for a square area on Screen /** * For each Scenery::screen_ pixel in the square area limited by * imin, imax, jmin and jmax, launch a Photon back in time to * compute the various quantities. * * At this time, the computed quantities depend on on the pointers * in *data which are not NULL. * * rayTrace() uses * - setPropertyConverters() to set the converters in *data; * - Astrobj::Properties::init() to initialize each cell in *data; * - Astrobj::Properties::operator++() to step through the arrays in *data. * * data must have been instanciated prior to calling rayTrace and * the various pointers in *data must be NULL or point to the first * cell in an array of size at least Screen::npix_ squared. * * If Scenery::nthreads_ is ≥2 and Gyoto has been compiled with * pthreads support, rayTrace() will use Scenery::nthreads_ threads * and launch photons in parallel. This works only if the * Astrobj::Generic::clone() and Metric::Generic::clone() methods * have been properly implemented for the specific astrobj and * metric kind, and if they are both thread-safe. At the moment, * unfortunately, Lorene metrics are known to not be thread-safe. * * \param[in] imin, imax, jmin, jmax First and last rows and columns in * Scenery::screen_ to compute * \param[in, out] data Pointer to a preallocated * Astrobj::Properties instance which sets which quantities must be * computed and where to store the output. * * \param[in] impactcoords Optional pointer to an array of * pre-computed impact coordinates. If impactcoords is provided, * rayTracing is skipped and the quantities in *data are fill * assuming that the impact coordinates are correct. This only makes * sense in optically thick mode, when ray-tracing several sceneries * for which the shape of the object is identical but their emission * distributions are not. impactcoords can be computed using the * ImpactCoords quantity. */ void rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax, Astrobj::Properties* data, double * impactcoords = NULL); /// Ray-trace a single pixel in Scenery::screen_ /** * Almost identical to rayTrace(), but for a single pixel. * * If ph is passed, it is assumed to have been properly initialized * (with the right metric and astrobj etc.) already. Else, use * &Scenery::ph_. */ void operator() (size_t i, size_t j, Astrobj::Properties *data, double * impactcoords = NULL, Photon * ph = NULL); #ifdef GYOTO_USE_XERCES public: /// Fill XML section /** * Akin to Astrobj::Generic::fillElement or * Metric::Generic::fillElement for instance. */ void fillElement(FactoryMessenger *fmp); /// Instanciate Scenery from an XML description. static SmartPointer Subcontractor(Gyoto::FactoryMessenger*); #endif }; #endif Gyoto-0.1.0/include/GyotoScreen.h000066400000000000000000000361421217470755400166700ustar00rootroot00000000000000/** * \file GyotoScreen.h * \brief Description of the observer screen * */ /* Copyright 2011-2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoScreen_H_ #define __GyotoScreen_H_ #include #include #include namespace Gyoto { class Screen; } #include #include #include #include #include /** * \class Gyoto::Screen * \brief The camera with which the Astrobj is observed * * In the observer-centric point-of-view, the center of the Metric's * coordinate system is positioned relatively to the observing Screen * using three Euler angles and the distance (in meters). The three * Euler angles are: * - position angle of the line of nodes (North of East); * - inclination (0 = face-on); * - argument of the X axis of the Metric's coordinate system. * We use the z-x-z convention. * See http://en.wikipedia.org/wiki/Euler_angles * * In addition, the Screen conveys: * - the observing date (in geometrical units, but expect it to * change to seconds in a future version); * - the field-of-view of the image; * - the resolution of the camera: number of pixels on each side * (the camera is square); * - the observing frequency. * * The scalar FreqObs defines the observing frequency for Scenery * quantity Intensity. * * Likewise, a Gyoto::Spectrometer defines for which frequencies * spectra are computed (when the Quantity Spectrum is requested in * the Scenery). * * For the sake of theoreticians, there is an alternate way of * specifying the relative position of the Screen and Metric, by * specifying the 4-coordinates of the Screen in the Metric's * coordinate system (in that case, eerything is specified in * geometrical units). * * So an XML stanza for a Screen may look like that: * \code * * * 0.3141592653589793 * 128 * 1e30 * 3.14159 * 2.0944 * -2.0944 * 17. 23. * 1e20 * * \endcode * * or like that: * * \code * * 1000. 1000. 0.15. 0. * 0.3141592653589793 * 128 * 17. 23. * 1e20 * * \endcode * * * Units can be specified using the unit attribute in the XML file, * for instance: * * \code * 8 * \endcode * * Possible units are (with [] noting the default): * - distance: [m], geometrical, cm, km, AU, ly, pc, kpc, Mpc; * - PALN, inclination, argument: [rad], deg. * - frequency: [Hz], µm, GeV... * * When the distance is really large and most of the ray-tracing would * happen de facto in flat space, the camera is transported to a * location at a reasonable distance from the metric and the images * are scaled accordingly. The default value for this distance should * be fine, but it can be customized using the "dmax" attribute of the * "Distance" element. "dmax" is always expressed in geometrical * units: * * \code * 8 * \endcode * * Symptoms when dmax is too large include pixelization of the image * (neighbouring photons are numerically identical) and other * numerical overflows. dmax is too small when it is apparent that * changing it yields projection effects. dmax must be large compared * to rmax in the Astrobj and ideally, changing it by an order of * magnitude should not yield significant changes in the ray-traced * image. * */ class Gyoto::Screen : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; private: double tobs_; ///< Observing date in s double fov_; ///< Field-of-view in rad // double tmin_; size_t npix_; ///< Resolution in pixels double distance_; ///< Distance to the observer in m double dmax_; ///< Maximum distance from which the photons are launched (geometrical units) int anglekind_; ///< Screen angles kind (0: equatorial, 1: spherical) /** * The angles are position angle of the line of nodes (North of * East), inclination (0 = face-on), argument of X axis. We use the * z-x-z convention. See http://en.wikipedia.org/wiki/Euler_angles */ double euler_[3]; ///< Euler angles double ex_[3]; ///< Sky coordinate of base X vector double ey_[3]; ///< Sky coordinate of base Y vector double ez_[3]; ///< Sky coordinate of base Z vector double fourvel_[4]; ///< Observer's 4-velocity double screen1_[4]; ///< Screen e1 vector double screen2_[4]; ///< Screen e2 vector double screen3_[4]; ///< Screen e3 vector (normal) double alpha0_; ///< Screen orientation (0,0) is right towards the BH double delta0_; ///< Screen orientation (0,0) is right towards the BH SmartPointer gg_; ///< The Metric in this end of the Universe /** * \brief Gyoto::Spectrometer::Generic subclass instance used for quantities Spectrum and BinSpectrum */ SmartPointer spectro_; /** * \brief Frequency at which the observer observes * * For the quantity Intensity */ double freq_obs_; public: // Constructors - Destructor // ------------------------- Screen() ; ///< Default constructor Screen(const Screen& ) ; ///< Copy constructor Screen * clone() const; ///< Cloner virtual ~Screen() ; ///< Destructor // Mutators / assignment // --------------------- /// Set inclination etc. void setProjection(const double paln, const double inclination, const double argument); /// Set distance, inclination etc. void setProjection(const double distance, const double paln, const double inclination, const double argument); /// Set distance from observer /** * \param dist Distance in meters. */ void setDistance(double dist); /// Set ray-tracing maximum distance /** * \param dist Distance in geometrical units. */ void setDmax(double dist); /// Set distance from observer /** * \param dist the distance expressed in the specified unit; * \param unit convertible to meters */ void setDistance(double dist, const std::string unit); /// Set inclination relative to line-of-sight /** * Inclination of z-axis relative to line-of-sight, or inclination * of equatorial plane relative to plane of the sky, in radians */ void setInclination(double); /// Set inclination relative to line-of-sight /** * Inclination of z-axis relative to line-of-sight, or inclination * of equatorial plane relative to plane of the sky, in specified unit. */ void setInclination(double, const std::string &unit); void setPALN(double); ///< Set position angle of the line of nodes void setPALN(double, const std::string &unit); ///< Set position angle of the line of nodes void setArgument(double); ///< Set angle beetwen line of nodes and X axis of object void setArgument(double, const std::string &unit); ///< Set angle beetwen line of nodes and X axis of object void setSpectrometer(SmartPointer spectro); ///< Set Screen::spectro_ SmartPointer getSpectrometer() const ; ///< Get Screen::spectro_ /** * \brief Set freq_obs_ * \param fo double: observing frequency in Hz */ void setFreqObs(double fo); /** * \brief Set freq_obs_ * \param fo double: observing frequency (or wavelength) in "unit" * \param unit string: unit in which fo is expressed, convertable to * Herz or meters or energy. */ void setFreqObs(double fo, const std::string &unit); /** * \brief Get freq_obs_. */ double getFreqObs() const ; /** * \brief Get freq_obs_. * \param unit string: unit in which freq_obs_ should be returned is * expressed, convertable to Herz or meters or energy. */ double getFreqObs(const std::string &unit) const; /// Alternative way to set projection /** * Beware : paln can not be set this way, setting later other * parameters change the observer's coordinates. For observationnal * ray-tracing purposes, prefer setProjection(). * * \param[in] pos position of observer in Screen's coordinate * system. Content is copied. */ void setObserverPos(const double pos[4]); void setFourVel(const double coord[4]); ///< Sets the observer's 4-velocity void setScreen1(const double coord[4]); ///< Sets the screen vector e1 void setScreen2(const double coord[4]); ///< Sets the screen vector e2 void setScreen3(const double coord[4]); ///< Sets the screen vector e3 (normal) // Accessors // --------- /// Get coordinate kind /** * From Screen::gg_. */ int getCoordKind() const; /// Get distance from observer /** * In meters. */ double getDistance() const; /// Get distance from observer /** * In specified unit. */ double getDistance(const std::string&) const; ///< Get distance from observer /// Get maximum ray-tracing distance /** * In geometrical units. */ double getDmax() const; /// Get inclination relative to line-of-sight /** * Inclination of z-axis relative to line-of-sight, or inclination * of equatorial plane relative to plane of the sky, in radians. */ double getInclination() const; /// Get inclination relative to line-of-sight /** * Inclination of z-axis relative to line-of-sight, or inclination * of equatorial plane relative to plane of the sky, in specified unit. */ double getInclination(const std::string&) const; double getPALN() const; ///< Get position angle of the line of nodes double getPALN(const std::string&) const; ///< Get position angle of the line of nodes double getArgument() const; ///< Get angle between line of nodes and X axis of object double getArgument(const std::string&) const; ///< Get angle between line of nodes and X axis of object SmartPointer getMetric() const; ///< Get Screen::gg_ void setMetric(SmartPointer gg); ///< Set Screen::gg_ /// Get observing date in seconds double getTime(); /// Get observing date in seconds double getTime(const std::string &); /// Set observing date in specified unit void setTime(double, const std::string &); /// Set observing date in seconds void setTime(double); /// Get Screen::fov_ in radians double getFieldOfView(); /// Get Screen::fov_ in specified unit double getFieldOfView(std::string unit); /// Set Screen::fov_ in radians void setFieldOfView(double); /// Set Screen::fov_ in specified unit void setFieldOfView(double, const std::string &unit); /// Set direction of the line-of-view void setAlpha0(double); /// Set direction of the line-of-view void setDelta0(double); /// Set Screen::anglekind_ void setAnglekind(int); /// Get Screen::npix_ size_t getResolution(); /// Set Screen::npix_ void setResolution(size_t); /// 4-Position of the observer relative to the metric /** * A Screen is positioned relative to the observer with four elements: * Screen::distance, Screen::inclination, Screen::paln and * Screen::argument. * * This function returns the position of the observer relative to * the metric system in Screen::gg_, using these parameters. The * output parameter is coord. * * \param[out] coord position of the observer. Must be preallocated. */ void getObserverPos(double coord[]) const; /// Get copy of Screen::fourvel_ /** * \param[out] fourvel preallocated 4-element array */ void getFourVel(double fourvel[]) const; /// Get copy of Screen::screen1_ /** * \param[out] output preallocated 4-element array */ void getScreen1(double output[]) const; /// Get copy of Screen::screen2_ /** * \param[out] output preallocated 4-element array */ void getScreen2(double output[]) const; /// Get copy of Screen::screen3_ /** * \param[out] output preallocated 4-element array */ void getScreen3(double output[]) const; /// Get 8-coordinate of Photon hitting screen from a given direction /** * Similar to Screen::getObserverPos() but will return in addition * the 4-velocity of a photon corresponding to the sky direction * given by x and y. * \param[in] x RA (d_alpha*cos(delta)) offset in radians; * \param[in] y Dec offset (d_delta) in radians; * \param[out] coord position-velocity of the observer Photon. Preallocated. * */ void getRayCoord(double x, double y, double coord[]) const; /// Get 8-coordinate of Photon hitting screen pixel /** * Similar to Screen::getObserverPos() but will return in addition * the 4-velocity of a photon corresponding to the sky direction * given by x and y. * \param[in] i, j pixel coordinates * \param[out] coord position-velocity of the Photon. Preallocated. * */ void getRayCoord(const size_t i, const size_t j, double coord[]) const; void coordToSky(const double pos[4], double skypos[3]) const; ///< Convert 4-position to 3-sky position void coordToXYZ(const double pos[4], double xyz[3]) const; ///< Convert 4-position to 3-cartesian coordinates void computeBaseVectors() ; ///< Compute base vectors according to projection parameters /// Display // friend std::ostream& operator<<(std::ostream& , const Screen& ) ; std::ostream& print(std::ostream&) const ; ///< Debug helper std::ostream& printBaseVectors(std::ostream&) const ; ///< Debug helper // UDUNITS # ifdef HAVE_UDUNITS /// Map "pix" and "pixel" to angular pixel width in unit system /** * "pix" or "pixel" can then be used in units. * * There is only one unit system in Gyoto: "pix" can therefore be * registered only for one Screen at a time. See Gyoto::Units. * * The unit must later be unmapped with unmapPixUnit(). */ void mapPixUnit(); /// Unmap "pix" and "pixel" from unit system /** * See also mapPixUnit(). */ void unmapPixUnit(); # endif #ifdef GYOTO_USE_XERCES public: void fillElement(FactoryMessenger *fmp); ///< called from Factory /// Instanciate a Screen from XML entity static SmartPointer Subcontractor(FactoryMessenger* fmp); #endif }; #endif Gyoto-0.1.0/include/GyotoSmartPointer.h000066400000000000000000000215751217470755400201040ustar00rootroot00000000000000/** * \file GyotoSmartPointer.h * \brief Reference-counting pointers Template class Gyoto::SmartPointer performs reference counting on its pointee and makes sure the pointed to object is actually deleted when the number of references to it drops to zero. The pointed-to object must inherit from Gyoto::SmartPointee for this to work and be referenced to only by SmartPointers. @code class Gyoto::Metric : public Gyoto::SmartPointee {...}; SmartPointer ObjPtr (new Gyoto::Metric(...)); @endcode */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoSmartPointer_H_ #define __GyotoSmartPointer_H_ #include "GyotoUtils.h" #ifdef HAVE_PTHREAD #include #endif namespace Gyoto { class SmartPointee; class FactoryMessenger; template class SmartPointer; } #include #include #include #include /** * \brief Can be pointed to by a SmartPointer * * A class can be pointed to by a SmartPointer when it inherits from * class SmartPointee. * * The SmartPointee methods need to be public to be accessed by all * the SmartPointer < T > classes. However, it is a bad idea to * manipulate the counter directly. To protect these methods inside * your derive object, you can do as in the following example: * * @code * class Gyoto::Metric : protected Gyoto::SmartPointee * { * friend class Gyoto::SmartPointer; * ... * }; * @endcode * */ class Gyoto::SmartPointee { private: int refCount; ///< Reference counter. # ifdef HAVE_PTHREAD /** * When compiled with libpthread */ pthread_mutex_t mutex_; ///< A mutex #endif public: SmartPointee () ; SmartPointee (const SmartPointee&) ; ///< Copy constructor void incRefCount () ; ///< Increment the reference counter. Warning: Don't mess with the counter. int decRefCount () ; ///< Decrement the reference counter and return current value. Warning: Don't mess with the counter. int getRefCount () ; ///< Get the current number of references /** * Various classes need to provide a subcontractor to be able to * instanciate themselves upon order from the Factory. A * subcontractor is a function (often a static member function) * which accepts a pointer to a FactoryMessenger as unique * parameter, communicates with the Factory using this messenger to * read an XML description of the object to build, and returns this * objet. SmartPointee::Subcontractor_t* is just generic enough a * typedef to cast to and from other subcontractor types: * Astrobj::Subcontractor_t, Metric::Subcontractor_t, * Spectrum::Subcontractor_t. A subcontractor needs to be registered * using the relevant Register() function: Astrobj::Register(), * Metric::Register(), Spectrum::Register(). */ typedef Gyoto::SmartPointer Subcontractor_t(Gyoto::FactoryMessenger*); ///< A subcontractor builds an object upon order from the Factory }; /** * \brief Pointers performing reference counting * * Pointee must inherit from class SmartPointee. * * To create an object and a SmartPointer pointing to it: * * \code * SmartPointer ObjPtr (new Gyoto::Metric(...)); * \endcode * * \tparam T Sub-class of Gyoto::SmartPointee. */ template< class T > class Gyoto::SmartPointer { private: /** * \brief Real pointer, don't mess with it. */ T *obj; private: /** * \brief Decrement the reference counter. Warning: don't mess with it. */ void decRef () { if (obj && obj->decRefCount() == 0) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(obj); # endif delete obj; obj = NULL; } } public: /** * \brief Constructor from a standard pointer-to-class * * \param orig : a pointer to an instance of class T, created using new T(). * * Example: * \code * SmartPointer ObjPtr (new Gyoto::Metric(...)); // create SmartPointer ObjPtr * \endcode */ SmartPointer (T *orig = NULL) : obj(orig) { if (obj) obj->incRefCount(); } /** * \brief Copy constructor from same type * * \param orig : a SmartPointer to an instance of class T * * Example: * \code * SmartPointer ObjPtr (new Gyoto::Metric(...)); // create SmartPointer ObjPtr * SmartPointer ObjPtr2 = ObjPtr; // create SmartPointer ObjPtr2 * \endcode * * ObjPtr and ObjPtr2 point to the same instance of class T. Copying * increments the reference counter. */ SmartPointer (const SmartPointer< T > &orig) { obj = orig.obj; if (obj) obj->incRefCount (); } /** * \brief Copy constructor from compatible type (used for casting) * * \param orig : a SmartPointer to an instance of another class U * * Example: MetricPtr is a SmartPoiter, but really points to * an instance of the child class Gyoto::Kerr: * * \code * SmartPointer KerrPtr (MetricPtr); * \endcode * * MetricPtr and KerrPtr point to the same instance of class * Kerr. The methods specific to class Kerr are available only to * KerrPtr. */ template SmartPointer(const SmartPointer& orig) { obj = dynamic_cast(const_cast(orig())); if (obj) obj->incRefCount (); } /** * \brief Dereference operator "*" * * \return address of the pointed-to-object */ T& operator* () { if (!obj) Gyoto::throwError("Null Gyoto::SmartPointer dereference in operator*"); return *obj; } /** * \brief Dereference operator "*" * * \return address of the pointed-to-object */ const T& operator* () const { if (!obj) Gyoto::throwError("Null Gyoto::SmartPointer dereference in operator*"); return *obj; } /** * \brief Dereference operator "->" * * Access to the pointed-to-object's members. */ T* operator-> () { if (!obj) Gyoto::throwError("Null Gyoto::SmartPointer dereference in operator->"); return obj; } /** * \brief Dereference operator "->" (const) * * Access to the pointed-to-object's members. */ T* operator-> () const { if (!obj) Gyoto::throwError("Null Gyoto::SmartPointer dereference in operator->"); return obj; } /** * \brief Comparison operator between two SmartPointer of same kind */ bool operator== (const SmartPointer< T >&right) { return obj == right.obj; } /** * \brief Comparison operator between two SmartPointer of same kind */ bool operator!= (const SmartPointer< T >&right) { return obj != right.obj; } /** * \brief Copy a SmartPointer to another (already defined) * SmartPointer of same kind */ SmartPointer< T > &operator= (SmartPointer< T > &right) { if (this == &right) return *this; if (right.obj) right.obj->incRefCount (); decRef (); obj = right.obj; return *this; } /** * \brief Copy a normal pointer to an (already defined) * SmartPointer of same kind */ SmartPointer< T > &operator= (T* right) { if (obj == right) return *this; decRef (); obj = right; if (obj) obj->incRefCount(); return *this; } /** * \brief Cast SmartPointer to normal pointer */ // template operator U() { return obj; } operator T*() const { return obj; } #if 0 operator const T*() { return obj; } /** * \brief Check whether SmartPointer is valid * \return 0 if SmartPointer is NULL, 1 if valid. */ operator bool () const { return obj != NULL; } /** * \brief Check whether SmartPointer is valid * \return 1 if SmartPointer is NULL, 0 if valid. */ bool operator! () const { return obj == NULL; } #endif ~SmartPointer< T > () { decRef(); } public: /** * \brief Get standard, non-smart pointer to object. Use with care. * * This public method is needed to cast from a SmartPointer flavor * to another. It should almost certainly never be used in user * code, except perhaps for debugging purposes. * * \return usual pointer to object, T*. * */ // const T* address() const { return obj; } const T* operator()() const { return obj; } }; #endif Gyoto-0.1.0/include/GyotoSpectrometer.h000066400000000000000000000316651217470755400201320ustar00rootroot00000000000000/** * \file GyotoSpectrometer.h * \brief Spectroscopic capabilities of a Screen * * Describes the spectroscopic capabilites of a Screen. * */ /* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoSpectrometer_H_ #define __GyotoSpectrometer_H_ #include #include #include #include #include /** * \namespace Gyoto::Spectrometer * \brief Access to spectrometers * * Objects which describe spectrometers (including one-channel * devices, a.k.a cameras) space-time geometry must inherit from the * Gyoto::Spectrometer::Generic class. * * To be usable, a Spectrometer::Generic sub-class should register a * Spectrometer::Subcontractor_t function using the Spectrometer::Register() * function. See also \ref writing_plugins_page . */ namespace Gyoto{ namespace Spectrometer { /** * \class Gyoto::Spectrometer::Generic * * \brief Base class for spectrometers * * Example: class Gyoto::Spectrometer::Uniform * * See Gyoto::Spectrometer for an introduction. * * Generic inherits from Gyoto::SmartPointee so that it is * possible to create a SmartPointer to a Spectrometer. * * It also inherits from Gyoto::Hook::Teller. This allows a * consistent implementation of Spectrometer::Complex (in * particular). Any method which mutates a Spectrometer should * call tellListeners(). */ class Generic; /** * \brief Type for Spectrometer kind * * Spectrometer kind is a unique numerical identifier for that kind, * produced as the address to a static C string variable holding the * kind's name. Most of the time, the address is the only * significant part as this is more reliable and allows for direct * numerical comparison instead of slower string comparison. The * value of the string variable can be used for printing and as * anchor name for Register(), although the anchor name could be * different. */ typedef char const * kind_t; #if defined GYOTO_USE_XERCES /** * This is a more specific version of the * SmartPointee::Subcontractor_t type. A Spectrometer::Subcontrator_t * is called by the Gyoto::Factory to build an instance of the * kind of spectrometer specified in an XML file (see * Register()). The Factory and Subcontractor_t function * communicate through a Gyoto::FactoryMessenger. */ typedef SmartPointer Subcontractor_t(Gyoto::FactoryMessenger*); ///< A function to build instances of a specific Astrobj::Generic sub-class /** * \brief Query the Spectrometer register * * Get the Spectrometer::Subcontractor_t correspondig to a given * kind name. This function is normally called only from the * Gyoto::Factory. * * \param name Name of the subclass to build, e.g. "Complex" or "wave". * \param errmode If name is not registered, getSubcontractor() return NULL * errmode==1, throws a Gyoto::Error if errmode==0. * \return pointer to the corresponding subcontractor. */ Gyoto::Spectrometer::Subcontractor_t* getSubcontractor(std::string name, int errmode = 1); /** * \brief A template for Subcontractor_t functions * * Instead of reimplementing the wheel, your subcontractor can * simply be Gyoto::Spectrometer::Subcontractor. It must * however implement setParameters(). * * \tparam T A Spectrometer::Generic sub-class. */ template SmartPointer Subcontractor (FactoryMessenger* fmp) { SmartPointer spectro = new T(); if (fmp) spectro -> setParameters(fmp); return spectro; } /** * \brief The Spectrometer register * * Use the Spectrometer::initRegister() once in your program to * initiliaze it, the Spectrometer::Register() function to fill it, and * the Spectrometer::getSubcontractor() function to query it. */ extern Gyoto::Register::Entry * Register_; /** * \brief Initialize the Spectrometer register * This must be called once. It initializes Register_ and * registers the standard kinds (Uniform and Complex). */ void initRegister(); /** * \brief Register a new Spectrometer kind * * Register a new Spectrometer::Generic sub-class so that the * Gyoto::Factory knows it. * * \param name The kind name which identifies this object type in * an XML file, as in <Spectrometer kind="name">. For * clarity, this should be the same as the value of kind_ for this * object, but it is not mandatory. * * \param scp A pointer to the subcontractor, which will * communicate whith the Gyoto::Factory to build an instance of * the class from its XML description. If all parameters can be * set using setParameter(), this can be: * \code * &(Gyoto::Spectrometer::Subcontractor) * \endcode */ void Register(std::string name, Gyoto::Spectrometer::Subcontractor_t* scp); #endif } } class Gyoto::Spectrometer::Generic : protected Gyoto::SmartPointee, public Gyoto::Hook::Teller { friend class Gyoto::SmartPointer; protected: /** * \brief Spectrometer kind name * * The content is not copied. kind_ should be set (as a parameter to * the Generic() constructor or using setKind()) to the adress of a * static variable holding the name. This allows checking the kind * using pointer comparison rather than string comparison. */ kind_t kind_; public: size_t nsamples_; ///< Number of spectral elements size_t nboundaries_; ///< Size of the boundaries_ array /** * \brief Frequency (in Hz) at the boundaries of the spectral channels * * Array of size nboundaries_ * * Spectral channel i extends from * \code * boundaries_[chanind_[2*i]] * \endcode * to * \code * boundaries_[chanind_[2*i+1]] * \endcode. * Channels may or may not be contiguous or ordered. */ double* boundaries_; /** * \brief Indices in boundaries_ * * Array of size 2*nsamples_ */ size_t* chanind_; /** * \brief Effective frequency (in Hz) of each spectral channel * * Array of size nsamples_ */ double* midpoints_; /** * \brief Width of each channel * * Array of size nsamples_ (in Hz) */ double* widths_; public: /** * \brief Default constructor * * Sets each member to 0. */ Generic(); /** * \brief Constructor setting kind * * Sets the other members to 0. This is usually the right * constructor to use: * \code * Complex::Complex : Generic(Complex::Kind) {} * \endcode * * Always set kind to the adress of a static variable, not to a temporary. * Usually your class should have a static member for that purpose: * \code * class MyKind : public Spectrometer::Generic * { * static kind_t Kind; * }; * kind_t MyKind::Kind = "MyKind"; * \endcode * */ Generic(kind_t kind); /** * \brief Copy constructor * * Takes care of (deep) copying all the members known to the base class. */ Generic(const Generic& ) ; /** * \brief Clone an instance * * Use this to get a deep copy of an instance; * \code * SmartPointer myclone = orig->clone(); * \endcode * * Most implementations will use the copy constructor: * \code * Generic* Uniform::clone() const { return new Uniform(*this); } * \endcode */ virtual Generic * clone() const =0; /** * \brief Destructor * * Takes care of deleting the arrays (if the pointers are not NULL). */ virtual ~Generic(); /** * \brief Get kind_ * * You can check whether the Spectrometer sp is of a given kind * MyKind with something like: * * \code * if (sp->getKind()) == MyKind::Kind; * \endcode * * See Uniform::WaveKind, Uniform::WaveLogKind, Uniform::FreqKind, * Uniform::FreqLogKind and Complex::Kind. * */ virtual kind_t getKind() const ; /** * \brief Set Generic::kind_ * * This should rarely be used as the Generic::kind_ attribute usually is set * in the constructor and doesn't change after that. * * Always set to the adress of a static variable, not to a temporary. * Usually your class should have a static member for that purpose: * \code * class MyKind : public Spectrometer::Generic * { * static kind_t Kind; * }; * kind_t MyKind::Kind = "MyKind"; * ... * SmartPointer sp(); * sp->setKind(MyKind::Kind) * \endcode * */ virtual void setKind(kind_t) ; virtual size_t getNSamples() const ; ///< Get Generic::nsamples_. virtual size_t getNBoundaries() const ; ///< Get Generic::nboundaries_ virtual double const * getMidpoints() const ; ///< Get Generic::midpoints_. /** * \brief Copy Generic::midpoints_, converting to unit * \param data an array of Generic::nsamples_ doubles to fill with result * \param unit a string */ virtual void getMidpoints( double data[], std::string unit); /** * \brief Copy Generic::boundaries_, converting to unit * \param data an array of Generic::nboundaries_ doubles to fill with result * \param unit a string */ virtual void getChannelBoundaries( double data[], std::string unit); virtual double const * getChannelBoundaries() const ; ///< Get Generic::boundaries_. virtual size_t const * getChannelIndices() const ; ///< Get Generic::chanind_. virtual double const * getWidths() const ; ///< Get Generic::widths_. /** * \brief Copy Generic::widths_, converting to unit * * Think carefully before using: widths are often used to convert * spectral flux density to flux. If flux density is per Herz, you * don't need to convert widths. * * \param data an array of Generic::nboundaries_ doubles to fill with result * \param unit a string */ virtual void getWidths( double data[], std::string unit); /** * \brief Set parameter by name * * Assume MyKind is a subclass of Spectrometer::Generic which has * two members (a string StringMember and a double DoubleMember): * * \code * int MyKind::setParameter(std::string name, std::string content, std::string unit) * { * if (name=="StringMember") setStringMember(content); * else if (name=="DoubleMember") setDoubleMemeber(atof(content.c_str()), unit); * else return Generic::setParameter(name, content, unit); * return 0; * } * \endcode * * If MyKind is not a direct subclass of Generic, it should call the * corresponding setParameter() implementation instead of * Generic::setParameter(). * * \param name XML name of the parameter * \param content string representation of the value * \param unit string representation of the unit * \return 0 if this parameter is known, 1 if it is not. */ virtual int setParameter(std::string name, std::string content, std::string unit); #ifdef GYOTO_USE_XERCES /** * \brief Main loop in Subcontractor_t function * * The Subcontractor_t function for each Spectrometer kind should look * somewhat like this (templated as * Gyoto::Spectrometer::Subcontractor): * * \code * SmartPointer * Gyoto::Spectrometer::MyKind::Subcontractor(FactoryMessenger* fmp) * { * SmartPointer gg = new MyKind(); * gg -> setParameters(fmp); * return gg; * } * \endcode * * Each spectrometer kind should implement setParameter(string name, * string content, string unit) to interpret the individual XML * elements. setParameters() can be overloaded in case the specific * Spectrometer class needs low level access to the FactoryMessenger. See * Gyoto::Astrobj::UniformSphere::setParameters(). */ virtual void setParameters(Gyoto::FactoryMessenger *fmp) ; /** * \brief Write out parameters to XML entities * * Spectrometers implementations should impement fillElement to save their * parameters to XML and call the Spectrometer::fillElement(fmp) for the * shared properties. * * This is mainly used by the Yorick plug-in to print out any sort * of GYOTO objects and to save them to XML files. */ virtual void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoSpectrum.h000066400000000000000000000154761217470755400172620ustar00rootroot00000000000000/** * \file GyotoSpectrum.h * \brief Spectrum of a simple object (e.g. Star) * * Light emitted by an astronomical object */ /* Copyright 2011-2012 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoSpectrum_H_ #define __GyotoSpectrum_H_ #include "GyotoRegister.h" namespace Gyoto{ class FactoryMessenger; /// Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star) namespace Spectrum { class Generic; #if defined GYOTO_USE_XERCES /// A function to build instances of a specific Spectrum::Generic sub-class /** * This is a more specific version of the * SmartPointee::Subcontractor_t type. A Spectrum::Subcontrator_t * is called by the Gyoto::Factory to build an instance of the * kind of spectrum specified in an XML file (see * Register()). The Factory and Subcontractor_t function * communicate through a Gyoto::FactoryMessenger. A template is * provided so that you may not have to code anything. */ typedef Gyoto::SmartPointer Subcontractor_t(Gyoto::FactoryMessenger* fmp); /** * \brief Subcontractor template * * Instead of reimplementing the wheel, your subcontractor can simply be * Gyoto::Spectrum::Subcontractor * * \tparam T Sub-class of Spectrum::Generic */ template SmartPointer Subcontractor (FactoryMessenger* fmp) { SmartPointer sp = new T(); sp -> setParameters(fmp); return sp; } /// Make a Spectrum kind known to the Factory /** * Register a new Spectrum::Generic sub-class so that the * Gyoto::Factory knows it. * * \param kind The kind name which identifies this object type in * an XML file, as in <Spectrum kind="name"> * * \param scp A pointer to the subcontractor, which will * communicate whith the Gyoto::Factory to build an instance of * the class from its XML description */ void Register(std::string kind, Gyoto::Spectrum::Subcontractor_t* scp); /// Query the Spectrum register /** * Query the Spectrum register to get the Metric::Subcontractor_t * correspondig to a given kind name. This function is normally * called only from the Factory. * * \param name e.g. "PowerLaw" * \param errmode int=0. If errmode==0, failure to find a * registered Spectrum by that name is an error. Else, simply * return NULL pointer in that case. * \return pointer to the corresponding subcontractor. */ Gyoto::Spectrum::Subcontractor_t* getSubcontractor(std::string name, int errmode=0); /// The Spectrum register /** * Use the Spectrum::initRegister() once in your program to * initiliaze it, the Spectrum::Register() function to fill it, and * the Spectrum::getSubcontractor() function to query it. */ extern Register::Entry* Register_; /// Empty the Spectrum register. /** * This must be called once. It is called by * Gyoto::Register::init(). */ void initRegister(); #endif } } #include #include /** * \class Gyoto::Spectrum::Generic * \brief Spectrum emitted by an Astrobj * * Light emitted by e.g. a Star * */ class Gyoto::Spectrum::Generic : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; protected: std::string kind_; ///< e.g. constants, blackbody... public: Generic(const std::string kind); ///< Set kind in constructor // Spectrum::Generic(const Spectrum::Generic &); ///< Copy constructor. Default is fine. virtual Generic * clone() const; ///< Cloner virtual ~Generic() ; ///< Destructor: does nothing. const std::string getKind() const; ///< Get spectrum kind virtual double operator()(double nu) const =0; ///< I_nu = mySpectrum(nu), nu in Hz. Assumes optically thick regime. /** * Generic implementation assumes emissivity = opacity. * * \param nu frequency in Hz * \param opacity such that opacity*ds=optical thickness. * \param ds in geometrical units */ virtual double operator()(double nu, double opacity, double ds) const; ///< I_nu in optically thin regime. /** * \brief Integrate optically thick I_nu * * See operator()(double nu) const * * \param nu1, nu2 boundaries for the integration * \result I, the integral of I_nu between nu1 and nu2 */ virtual double integrate(double nu1, double nu2) ; /** * \brief Integrate optically thin I_nu * * See operator()(double nu, double opacity, double ds) const * * \param nu1, nu2 boundaries for the integration * \param opacity the frequency-dependent opacity law given as a * pointer to a Gyoto::Spectrum::Generic sub-class instance * \param ds the element length for spatial integration * \result I, the integral of I_nu between nu1 and nu2 */ virtual double integrate(double nu1, double nu2, const Spectrum::Generic * opacity, double ds) ; #ifdef GYOTO_USE_XERCES /** * Spectrum implementations should impement fillElement to save their * parameters to XML and call the generic implementation to save * generic parts. */ virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory virtual void setParameter(std::string name, std::string content, std::string unit) ; ///< To be called by fillElement() /** * The Subcontractor_t function for each Spectrum kind should look * somewhat like this: * \code * SmartPointer * Gyoto::Spectrum::MyKind::Subcontractor(FactoryMessenger* fmp) { * SmartPointer sp = new MyKind(); * sp -> setParameters(fmp); * return sp; * } * \endcode * * Each spectrum kind should implement setParameter(string name, * string content) to interpret the individual XML * elements. setParameters() can be overloaded in case the specific * Spectrum class needs low level access to the FactoryMessenger (see * Astrobj::UniformSphere::setParameters()). */ virtual void setParameters(FactoryMessenger *fmp); ///< Main loop in Subcontractor_t function #endif }; #endif Gyoto-0.1.0/include/GyotoStandardAstrobj.h000066400000000000000000000131211217470755400205260ustar00rootroot00000000000000/** * \file GyotoStandardAstrobj.h * \brief Astronomical objects defined bya a potential/distance * * Many geometrically thick objects can be defined by the value of a * function of the 4 coordinates, and their emission can often be * defined in terms of an emission law and of a transmission law. * * This is a base class for this standard case which simplifies a lot * writting new Astrobjs. */ /* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoStandardAstrobj_H_ #define __GyotoStandardAstrobj_H_ #include #include #include #include #include "GyotoAstrobj.h" #include "GyotoFunctors.h" namespace Gyoto{ namespace Astrobj { class Standard; } } /** * \class Gyoto::Astrobj::Standard * \brief Astronomical objects defined bya a potential/distance * * Many geometrically thick objects can be defined by the value of a * function of the 4 coordinates, and their emission can often be * defined in terms of an emission law and of a transmission law. * * This is a base class for this standard case which simplifies a lot * writting new Astrobjs. * * It is either to implement a sub-class of Astrobj::Standard than a * sub-class of Astrobj::Generic. In particular, there is no need to * implement the Generic::Impact() function. Instead, one needs to * implement a few much simpler functions and most of the complex * ray-tracing algorithms and heuristics is implemented in * Standard::Impact(). It is recommended to read first the * introduction in the Gyoto::Astrobj namespace documentation. * * The geometrical shape of a Gyoto::Astrobj::Standard object is * yielded by a function of the 4 position vector. This function is * implemented as operator()(). The velocity field of the fluid is * implemented in the getVelocity() method. The emission(), * integrateEmission() and transmission() methods implement the * radiative transfer primitives for this object. Finally, you may * choose to reimplement processHitQuantities() and Impact(), but * this should not be necessary (that is the all point of the * Standard class). * * Like any other Astrobj::Generic sub-classes, an Astrobj::Standard * subclass should register an Astrobj::Subcontractor_t function using * the Astrobj::Register() function. See also \ref * writing_plugins_page . */ class Gyoto::Astrobj::Standard : public Gyoto::Astrobj::Generic, public Gyoto::Functor::Double_constDoubleArray { friend class Gyoto::SmartPointer; // Data : // ----- protected: double critical_value_; ///< See operator()(double const coord[4]) double safety_value_; ///< See operator()(double const coord[4]) // Constructors - Destructor // ------------------------- public: /** * kind_ = "Default", rmax_ = 0., rmax_set_ = 0. */ Standard(); ///< Default constructor. /** * kind_ = "Default", rmax_ = radmax, rmax_set_ = 1. */ Standard(double radmax); ///< Set rmax in constructor. /** * kind_ = kind, rmax_ = 0., rmax_set_ = 0. */ Standard(std::string kind); ///< Set kind in constructor. /** * Make a deep copy of an Astrobj::Standard instance */ Standard(const Standard& ) ; ///< Copy constructor. virtual ~Standard() ; ///< Destructor: does nothing. // Accessors // --------- public: virtual void setSafetyValue(double val) ; ///< Set Standard::safety_value_ virtual double getSafetyValue() const ; ///< Get Standard::safety_value_ // Outputs // ------- public: virtual int Impact(Gyoto::Photon* ph, size_t index, Astrobj::Properties *data=NULL) ; /** * \brief Function defining the object interior * * A potential, distance, or whatever function such that * operator()(double const coord[4]) < Standard::critical_value_ if * and only if coord is inside the object. This function is used by * the default implmenetation of Impact(). If Impact() is * overloaded, it is not necessary to overload operator()(double * coord[4]). The default implementation throws an error. */ virtual double operator()(double const coord[4]) = 0; /** * \brief Fluid velocity field. * * Fill vel with the 4-vector velocity of the fluid at 4-position pos. * * \param[in] pos 4-position at which to compute velocity; * \param[out] vel 4-velocity at pos. */ virtual void getVelocity(double const pos[4], double vel[4]) = 0 ; /** * \brief Maximum δ inside object * * Gives the requested integration step δt (in * coordinate time t) between two neighbooring points along a * portion of geodesic inside an astrobj * * \param coord input coordinate at which δt is given */ virtual double giveDelta(double coord[8]); virtual int setParameter(std::string name, std::string content, std::string unit = "") ; #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; #endif }; #endif Gyoto-0.1.0/include/GyotoStar.h000066400000000000000000000130221217470755400163520ustar00rootroot00000000000000/** * \file GyotoStar.h * \brief Mass-less, spherical object following a timelike geodesic * * A Gyoto::Star evolves in a Gyoto::Metric following time-like * geodesics and is a Gyoto::Astrobj::Generic suitable for * ray-tracing. */ /* Copyright 2011, 2013 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoStar_H_ #define __GyotoStar_H_ namespace Gyoto{ namespace Astrobj { class Star; } } #include #include #include #include #ifdef GYOTO_USE_XERCES #include #endif #include /** * \class Gyoto::Astrobj::Star * \brief Mass-less, spherical object following a timelike geodesic * * Gyoto can compute the Star's orbit in a Gyoto::Metric and perform * ray-tracing on this target. The XML description of a Star looks * like: * \code * * * 0. * * 2. * 0. 0. 0.037037 * 600. 9. 1.5707999999999999741 0 * * 6000 * * * 0 * 0.1 * * * * \endcode * * Star supports exactly the union of the parameters supported by * Gyoto::Astrobj::UniformSphere and Gyoto::Worldline. * * The Metric element can be of any kind. This Metric sets the * coordinate system. * * The Star is a coordinate sphere of radius Radius in solid motion. * * Position sets the initial 4-coordinate of the centre of the * sphere. Velocity contains its initial 3-velocity (the time * derivatives of the 3 space coordinates). * * Like many Astrobj::Generic impementations, a Star can be * OpticallyThin or OpticallyThick. * * Spectrum and Opacity (if OpticallyThin) are the descriptions of two * Gyoto::Spectrum::Generic sub-classes. * */ class Gyoto::Astrobj::Star : public Gyoto::Astrobj::UniformSphere, public Gyoto::Worldline { friend class Gyoto::SmartPointer; // Data : // ----- // Constructors - Destructor // ------------------------- public: /** * Create Star object and set initial condition. * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this part of the Universe * \param radius star radius * \param pos initial 4-position * \param v initial 3-velocity */ Star(SmartPointer gg, double radius, double pos[4], double v[3]) ; ///< Standard constructor /** * Create Star object with undefined initial conditions. One needs to * set the coordinate system, the metric, and the initial position * and velocity before integrating the orbit. setInititialCondition() * can be used for that. */ Star(); ///< Default constructor Star(const Star& orig); ///< Copy constructor virtual Star * clone() const ; virtual ~Star() ; ///< Destructor // Accessors // --------- public: virtual std::string className() const ; ///< "Star" virtual std::string className_l() const ; ///< "star" virtual void setMetric(SmartPointer); virtual SmartPointer getMetric() const; /** * The mass of a Star is always 1. Stars do not perturb the * metric. The only relevant point is that Stars are massive * particules, their exact mass is of no importance. */ virtual double getMass() const ; ///< Return 1. public: using UniformSphere::getRmax; virtual double getRmax(); virtual void unsetRmax(); // void setCoordSys(int); ///< Get coordinate system for integration // int getCoordSys(); ///< Set coordinate system for integration void setInitialCondition(double coord[8]); ///< Same as Worldline::setInitialCondition(gg, coord, sys,1) virtual int setParameter(std::string name, std::string content, std::string unit); public: #ifdef GYOTO_USE_XERCES /** * This implementation of UniformSphere::setParameters() uses * wait_pos_ and init_vel_ to make sure setVelocity() is called * after setPosition(). */ virtual void setParameters(FactoryMessenger *fmp) ; virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory #endif public: /// Get the 6 Cartesian coordinates for specific dates. /** * This method is present in both the API of UniformSphere and * Worldline. It is pure virtual in UniformSphere. The Star * reimplementation is a trivial wrapper around * Worldline::getCartesian(). */ virtual void getCartesian(double const * const dates, size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime=NULL, double * const yprime=NULL, double * const zprime=NULL) ; virtual void getVelocity(double const pos[4], double vel[4]) ; }; #endif Gyoto-0.1.0/include/GyotoThinDisk.h000066400000000000000000000121721217470755400171630ustar00rootroot00000000000000/** * \file GyotoThinDisk.h * \brief Geometrically thin disks and rings * * Gyoto::Astrobj::ThinDisk is a class to represent geometrically * thin, optically thick or thin disks or rings in the equatorial * plane of the object. It therefore assumes the metric has an * equatorial plane, which orresponds to z==0 in a Cartesian * coordinate system or to theta==M_PI/2 in a sperical coordinate * system. * * This calls is not abstract and can be used as is (it keeps the * very simplistic Generic::emission() and Generci::transmission()), * but it is also a base class to develop classes with more complex * emission laws. * */ /* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoThinDisk_H_ #define __GyotoThinDisk_H_ namespace Gyoto{ namespace Astrobj { class ThinDisk; } } #include #include #include #include #ifdef GYOTO_USE_XERCES #include #endif #include /** * \class Gyoto::Astrobj::ThinDisk * \brief Geometrically thin disks and rings \code rin_ rout_ \endcode * ThinDisk::setParameter() also takes care of calling * Generic::setParameter(). */ class Gyoto::Astrobj::ThinDisk : public Gyoto::Astrobj::Generic, public Gyoto::Functor::Double_constDoubleArray { friend class Gyoto::SmartPointer; // Data : // ----- protected: double rin_ ; ///< disk inner radius in geometrical units double rout_ ; ///< disk outer radius in geometrical units /** * Geometrical thickness in geometrical units. Used only in the * optically thin regime (flag_radtransf_==1). Should be << * rin_. Default: 1e-3. */ double thickness_; ///< disk thickness int dir_; ///< 1 for corotating (default), -1 for counterrotating. // Constructors - Destructor // ------------------------- public: /** * Create direct ThinDisk object. When initializing a derived class, * always set kind. */ ThinDisk(std::string kind="ThinDisk"); ///< Default constructor ThinDisk(const ThinDisk& orig); ///< Copy constructor virtual ThinDisk* clone () const ; virtual ~ThinDisk() ; ///< Destructor // Accessors // --------- public: virtual double getInnerRadius() const ; ///< Get rin_ virtual double getInnerRadius(std::string unit) const ; ///< Get rin_ virtual void setInnerRadius(double); ///< Set rin_ virtual void setInnerRadius(double, std::string unit); ///< Set rin_ virtual double getOuterRadius() const ; ///< Get rout_ virtual double getOuterRadius(std::string unit) const ; ///< Get rout_ virtual void setOuterRadius(double); ///< Set rout_ virtual void setOuterRadius(double, std::string unit); ///< Set rout_ virtual double getThickness() const ; ///< Get thickness_ virtual double getThickness(std::string unit) const ; ///< Get thickness_ virtual void setThickness(double); ///< Set thickness_ virtual void setThickness(double, std::string unit); ///< Set thickness_ virtual int getDir() const ; ///< Get dir_ virtual void setDir(int); ///< Set dir_ /** * A function which changes sign on the equatorial plane. */ virtual double operator()(double const coord[]) ; ///< theta-pi/2 or z virtual double projectedRadius(double const coord[]) const ; ///< Projected radius of position coord on the equatorial plane virtual double sphericalPhi(double const coord[]) const; ///< Longitude /// Get fluid 4-velocity at point. /** * Fill vel with the 4-vector velocity of the fluid at 4-position * pos. getVelocity() should work at some distance from the * equatorial plane. The default implementation calls * Metric::Generic::circularVelocity(). * * \param[in] pos 4-position at which to compute velocity; * \param[out] vel 4-velocity at pos. */ virtual void getVelocity(double const pos[4], double vel[4]) ; public: virtual int setParameter(std::string name, std::string content, std::string unit) ; #ifdef GYOTO_USE_XERCES /** * The sub-classes implementations of the * Astrobj::Generic::fillElement() method should call * Astrobj::ThinDisk::fillElement() to fill the common bits. */ virtual void fillElement(FactoryMessenger *fmp) const ; ///< Fill the generic XML bits #endif public: virtual int Impact(Gyoto::Photon* ph, size_t index, Astrobj::Properties *data=NULL) ; }; #endif Gyoto-0.1.0/include/GyotoThinDiskPL.h000066400000000000000000000051371217470755400174220ustar00rootroot00000000000000/** * \file GyotoThinDiskPL.h * \brief A subclass of ThinDisk emitting according to a powerlaw * * The target of ray-traced Gyoto::Photon */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoThinDiskPL_H_ #define __GyotoThinDiskPL_H_ #include #include #include namespace Gyoto{ namespace Astrobj { class ThinDiskPL; } } //#include #include #include /** * \class Gyoto::Astrobj::ThinDiskPL * \brief Geometrically thin disk with black-body emission * * Mass density varies with a power-law, temperature depends on density. * * ρ = ρ0 (rcur/r0)α * * XML entities: * - PLSlope: ThinDiskPL::PLSlope_ * - PLRho: ThinDiskPL::PLRho_ * - PLRadRef: ThinDiskPL::PLRadRef_ */ class Gyoto::Astrobj::ThinDiskPL : public Astrobj::ThinDisk { friend class Gyoto::SmartPointer; private: double PLSlope_; ///< Power law index double PLRho_; ///< Reference density double PLRadRef_; ///< Reference radius protected: SmartPointer spectrumBB_; ///< disk black body // Constructors - Destructor // ------------------------- public: ThinDiskPL(); ///< Standard constructor ThinDiskPL(const ThinDiskPL& ) ;///< Copy constructor virtual ThinDiskPL* clone () const; ///< Cloner virtual ~ThinDiskPL() ; ///< Destructor // Accessors // --------- public: using ThinDisk::emission; virtual double emission(double nu_em, double dsem, double c_ph[8],double c_obj[8]) const; private: /** * \brief emission() helper */ double emissionBB(double nu, double co[8]) const; public: int setParameter(std::string name, std::string content, std::string unit); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory #endif }; #endif Gyoto-0.1.0/include/GyotoTorus.h000066400000000000000000000102231217470755400165550ustar00rootroot00000000000000/** * \file GyotoTorus.h * \brief A simple torus * */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoTorus_H_ #define __GyotoTorus_H_ #include #include #include #include namespace Gyoto{ namespace Astrobj { class Torus; } } #include #include #include /** * \class Gyoto::Astrobj::Torus * \brief Optically thin or thick torus in circular rotation * * Any Metric::Generic is acceptable as long as it implements * Metric::Generic::circularVelocity(). */ class Gyoto::Astrobj::Torus : public Gyoto::Astrobj::Standard { friend class Gyoto::SmartPointer; // Data : // ----- protected: /** * Distance from the center of the coordinate system to the center * of the torus tube. The (square of the) radius of a vertical * cross-section is stored in critical_value_. */ double c_; ///< Large Radius SmartPointer spectrum_; ///< Emission law SmartPointer opacity_; ///< Absorption law // Constructors - Destructor // ------------------------- public: /** * kind_ = "Torus", c_ = 3.5, a_=0.5 */ Torus(); ///< Default constructor. Torus(const Torus& ) ; ///< Copy constructor. virtual Torus* clone() const; ///< "Virtual" copy constructor virtual ~Torus() ; ///< Destructor: does nothing. // Accessors // --------- public: /** * Get large radius Torus::c_ in geometrical units */ double getLargeRadius() const; /** * Get large radius Torus::c_ in specified unit */ double getLargeRadius(std::string unit) const; /** * Get small radius in geometrical units */ double getSmallRadius() const; /** * Get small radius in specified unit */ double getSmallRadius(std::string unit) const; /** * \brief Set large radius Torus::c_ */ void setLargeRadius(double c); /** * \brief Set small radius */ void setSmallRadius(double a); /** * \brief Set large radius Torus::c_ in specified unit */ void setLargeRadius(double c, std::string unit); /** * \brief Set small radius in specified unit */ void setSmallRadius(double a, std::string unit); /** * \brief Set Torus::spectrum_ */ virtual void setSpectrum(SmartPointer); /** * \brief Get Torus::spectrum_ */ virtual SmartPointer getSpectrum() const; /** * \brief Set Torus::opacity_ */ virtual void setOpacity(SmartPointer); /** * \brief Get Torus::opacity_ */ virtual SmartPointer getOpacity() const; using Standard::getRmax; virtual double getRmax(); //XML I/O public: virtual int setParameter(std::string name, std::string content, std::string unit) ; #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; virtual void setParameters(FactoryMessenger *fmp) ; #endif // Outputs // ------- public: virtual double operator()(double const coord[4]) ; protected: virtual void getVelocity(double const pos[4], double vel[4]) ; using Standard::emission; virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]=NULL) const ; using Standard::integrateEmission; virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const; virtual double transmission(double nuem, double dsem, double coord[8]) const ; }; #endif Gyoto-0.1.0/include/GyotoUniformSpectrometer.h000066400000000000000000000125051217470755400214620ustar00rootroot00000000000000/** * \file GyotoUniformSpectrometer.h * \brief Uniformly spaced spectrometers * * Spectral channels are contiguous and uniformly spaced in either * wavelength, frequency or log10 of * either. Gyoto::Spectrometer::Uniform is registered four times in * the factory: as kind="wave", "wavelog", "freq" and * "freqlog". Example XML entity: * \code * * 2.0 2.4 * * \endcode * * The content of the entity yields the band pass expressed in "unit" * or in log10(unit). * */ /* Copyright 2011-2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoUniformSpectrometer_H_ #define __GyotoUniformSpectrometer_H_ #include namespace Gyoto{ namespace Spectrometer { class Uniform; } } /** * \class Gyoto::Spectrometer::Uniform * \brief Uniformly spaced spectrometers * * Spectral channels are contiguous and uniformly spaced in either * wavelength, frequency or log10 of * either. Gyoto::Spectrometer::Uniform is registered four times in * the factory: as kind="wave", "wavelog", "freq" and * "freqlog". Example XML entity: * \code * * 2.0 2.4 * * \endcode * * The content of the entity yields the band pass expressed in "unit" * or in log10(unit). */ class Gyoto::Spectrometer::Uniform : public Gyoto::Spectrometer::Generic { friend class Gyoto::SmartPointer; protected: /** * \brief boundaries of the spectro. * * Depending on the kind, band_ is stored in Hz, log10(Hz), m or log10(m). */ double band_[2]; void reset_(); ///< Computes boundaries_, midpoints_ and widths_ public: Uniform() ; ///< Default constructor Uniform(size_t nsamples, double band_min, double band_max, kind_t kind); ///< Constructor setting everything Uniform(const Uniform& ) ; ///< Copy constructor Generic * clone() const; ///< Cloner virtual ~Uniform() ; ///< Destructor void setKind(kind_t); /** * \brief Set Generic::kind_ from a std::string * * Generic::kind_ will actually be set to one of Uniform::WaveKind, * Uniform::WaveLogKind, Uniform::FreqKind or Uniform::FreqLogKind. * * \param name std::string, one of "wave", "wavelog", "freq" or * "freqlog" */ void setKind(std::string name); /** * \brief Set Generic::nsamples_ */ void setNSamples(size_t n); /** * \brief Set Uniform::band_ * * \param nu 2-element vector, in Hz, m, log10(Hz) or log10(m) * depending on Generic::kind_ */ void setBand(double nu[2]); /** * \brief Set the spectral band boundaries in specified unit * * If kind is not specified, member kind_ is used. Else kind_ is updated. * * unit is actually the unit for 10^nu for freqlog and wavelog. Defaults: * - kind==freq: nu in Hz * - kind==freqlog: 10^nu in Hz * - kind==wave: nu in meters * - kind==wavelog: 10^nu in meters * */ void setBand(double nu[2], std::string unit, std::string kind=""); double const * getBand() const ; ///< Get Uniform::band_ #ifdef GYOTO_USE_XERCES public: void fillElement(FactoryMessenger *fmp) const ; /** * \brief Main loop in the (templated) subcontractor * * In the case of Spectrometer::Complex, the setParameter() API is * not sufficient: setParameters() needs acces to the * FactoryMessenger to instanciate childs for the SubSpectrometers. */ virtual void setParameters(FactoryMessenger *fmp); #endif virtual int setParameter(std::string name, std::string content, std::string unit); /** * \brief "wave" * * Use this static member attribute to check whether a Spectrometer * object spectro is of this kind: * \code * if (spectro->getKind() == Uniform::WaveKind) ... ; * \endcode * */ static kind_t const WaveKind; ///< "wave" /** * \brief "wavelog" * * Use this static member attribute to check whether a Spectrometer * object spectro is of this kind: * \code * if (spectro->getKind() == Uniform::WaveLogKind) ... ; * \endcode * */ static kind_t const WaveLogKind; /** * \brief "freq" * * Use this static member attribute to check whether a Spectrometer * object spectro is of this kind: * \code * if (spectro->getKind() == Uniform::FreqKind) ... ; * \endcode * */ static kind_t const FreqKind; /** * \brief "freqlog" * * Use this static member attribute to check whether a Spectrometer * object spectro is of this kind: * \code * if (spectro->getKind() == Uniform::FreqLogKind) ... ; * \endcode * */ static kind_t const FreqLogKind; }; #endif Gyoto-0.1.0/include/GyotoUniformSphere.h000066400000000000000000000151211217470755400202310ustar00rootroot00000000000000/** * \file GyotoUniformSphere.h * \brief Optically thick or thin, spherical objects * * Gyoto::Astrobj::UniformSphere is an abstract type from which * uniform, spherical objects inherit (in particular, the * Gyoto::Astrobj::Star and Gyoto::Astrobj::FixedStar classes). * */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoUniformSphere_H_ #define __GyotoUniformSphere_H_ namespace Gyoto{ namespace Astrobj { class UniformSphere; } } #include #include #include #ifdef GYOTO_USE_XERCES #include #endif #include /** * \class Gyoto::Astrobj::UniformSphere * \brief Optically thick or thin, spherical objects * * Gyoto::Astrobj::UniformSphere is an abstract type from which * uniform, spherical objects inherit (in particular, the * Gyoto::Astrobj::Star and Gyoto::Astrobj::FixedStar classes). * * These objects are coordinate-spherical: they comprise all the * points within a given radius from a centre. The distance is the * usual Euclidian distance in a Cartesian coordinate system which is * trivially determined by the coordinate system in which the Metric * is expressed. * * The sphere is in solid motion: all the points have the same * 4-velocity. The centre of the sphere may move. This motion and the * velocity are provided by the derived classes through the * getCartesian() and getVelocity() methods. * * The spheres can be optically thick or optically thin. In the * optically thin case, the opacity law provided as a Gyoto::Spectrum * also sets both the emissivity. Another Gyoto::Spectrum provides * the emission law of the source, which is uniform. * * Gyoto::Astrobj::UniformSphere::setParameters() take care of * interpreting the XML elements describing the parameters of the * sphere: * \code * value * parameters for this spectrum kind * parameters for this spectrum kind * \endcode * setGenericParameters() also takes care of calling * setParameter(). */ class Gyoto::Astrobj::UniformSphere : public Gyoto::Astrobj::Standard { friend class Gyoto::SmartPointer; // Data : // ----- protected: double radius_ ; ///< sphere radius [geometrical units] SmartPointer spectrum_; ///< sphere emission law SmartPointer opacity_; ///< if optically thin, opacity law // Constructors - Destructor // ------------------------- public: /** * Create UniformSphere object. * \param kind: specifi kind (e.g. "Star" or "FixedStar") * \param gg: Gyoto::SmartPointer to the Gyoto::Metric in this part of the Universe * \param radius: sphere radius */ UniformSphere(std::string kind, SmartPointer gg, double radius) ; ///< Standard constructor /** * Create UniformSphere object. Use setMetric(), setRadius(), * setSpectrum() and setOpacity() to set the members. * * \param kind: specifi kind (e.g. "Star" or "FixedStar") */ UniformSphere(std::string kind); ///< Default constructor UniformSphere(const UniformSphere& orig); ///< Copy constructor virtual ~UniformSphere() ; ///< Destructor // Accessors // --------- public: virtual std::string className() const ; ///< "UniformSphere" virtual std::string className_l() const ; ///< "uniformsphere" virtual void setSpectrum(SmartPointer); ///< Set spectrum_ virtual SmartPointer getSpectrum() const; ///< Get spectrum_ virtual void setOpacity(SmartPointer); ///< Set opacity_ virtual SmartPointer getOpacity() const; ///< Get opacity_ double getRadius() const ; ///< Get radius_ in geometrical units void setRadius(double); ///< Set radius_ in geometrical units double getRadius(std::string) const ; ///< Get radius_ in specified unit void setRadius(double, std::string); ///< Set radius_ in specified unit public: virtual int setParameter(std::string name, std::string content, std::string unit) ; #ifdef GYOTO_USE_XERCES /** * The sub-classes implementations of the * Astrobj::Generic::fillElement() method should call * Astrobj::UniformSphere::fillElement() to fill the common bits. */ virtual void fillElement(FactoryMessenger *fmp) const ; ///< Fill the generic XML bits /** * The sub-classes subcontractor function (see * Astrobj::Subcontractor_t) should call this after creating the * object to interpret the common bits (Spectrum, Opacity, Radius): \code SmartPointer object = new MyObject (.....); fmp -> reset(); object -> setParameters(fmp); \endcode */ virtual void setParameters(FactoryMessenger *fmp) ; ///< Interpret common XML sections #endif virtual double operator()(double const coord[4]) ; ///< Square distance to the center of the sphere protected: /** * If the coordinate system of the Metric object is spherical, use a * trivial conversion. */ virtual void getCartesian(double const * const dates, size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime=NULL, double * const yprime=NULL, double * const zprime=NULL) =0; ///< Yield the Cartesian coordinates of the center of the sphere virtual void getVelocity(double const pos[4], double vel[4]) = 0; ///< Yield velocity of the center of the sphere. using Standard::emission; virtual double emission(double nu_em, double dsem, double cp[8], double co[8]=NULL) const; ///< Emission is determined by spectrum_ and opacity_ using Standard::integrateEmission; virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const; virtual double transmission(double nuem, double dsem, double*) const ; ///< Transmission is determined by opacity_ }; #endif Gyoto-0.1.0/include/GyotoUtils.h000066400000000000000000000043241217470755400165460ustar00rootroot00000000000000/** * \file GyotoUtils.h * \brief GYOTO utilities * * Various utilities */ /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoUtils_H_ #define __GyotoUtils_H_ #include "GyotoDefs.h" #include namespace Gyoto { /// Set debug mode /** * \param mode 1 to turn on debug mode, 0 to turn it off. */ void debug(int mode); /// Get debug mode /** * \return >=1 if debug mode is on, else 0. */ int debug(); /// Set verbosity level /** * See standard verbosity levels defined in GyotoDefs.h: * * - GYOTO_DEFAULT_DEBUG_MODE * - GYOTO_QUIET_VERBOSITY * - GYOTO_SEVERE_VERBOSITY * - GYOTO_WARNING_VERBOSITY * - GYOTO_DEFAULT_VERBOSITY * - GYOTO_INFO_VERBOSITY * - GYOTO_DEBUG_VERBOSITY */ void verbose(int mode); /// Get verbosity level /** * See verbose(int mode). */ int verbose(); /// Convert lengths (deprecated) /** * \deprecated Will be removed once it is not used anymore in Gyoto * per se. Prefer Gyoto::Units framework. * * \param[in,out] x Lengths to convert, in geometrical units on * input, in specified unit on output. * \param[in] nelem Size of x array. * \param[in] mass_sun Black-hole mass in Solar masses. * \param[in] distance_kpc Distance from observer in kiloparsecs. * \param[in] unit One of "geometrical", "m", "km", "sun radius", * "rad", "degree", "arcmin", "arcsec", "mas", "uas". */ void convert(double * const x, const std::size_t nelem, const double mass_sun, const double distance_kpc, const std::string unit); } #endif Gyoto-0.1.0/include/GyotoWorldline.h000066400000000000000000000345701217470755400174130ustar00rootroot00000000000000/** * \file GyotoWorldline.h * \brief Timelike or null geodesics */ /* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __GyotoWorldline_H_ #define __GyotoWorldline_H_ #include #include #include #include namespace Gyoto { class Worldline; class FactoryMessenger; } #include #include #include #include /** * \class Gyoto::Worldline * \brief Timelike or null geodesics * * Supported XML parameters: * - InitialCoordinate or InitCoord: 8-element vector yielding the initial * 4-position and 4-velocity; * - Only for massive particle (Gyoto::Astrobj::Star): Position * (yielding initial 4-position) and Velocity (yielding initial * 3-velocity); * - Delta: integration step, initial in case or adaptive step; * - Adaptive or NonAdaptive: sets whether integration step should be * adaptive; default: Adaptive.; * - MaxIter: maximum number of iterations for the integration; * default: 100000. * */ class Gyoto::Worldline : protected Gyoto::Hook::Listener { // Data : // ----- protected: SmartPointer metric_ ; ///< The Gyoto::Metric in this part of the universe double* x0_;///< t or T double* x1_;///< r or x double* x2_;///< theta or y double* x3_;///< phi or z double* x0dot_;///< tdot or Tdot double* x1dot_;///< rdot or xdot double* x2dot_;///< thetadot or ydot double* x3dot_;///< phidot or zdot size_t x_size_;///< Size of x0, x1... arrays size_t imin_;///< Minimum index for which x0, x1... have been computed size_t i0_; ///< Index of initial condition in array size_t imax_;///< Maximum index for which x0, x1... have been computed bool adaptive_; ///< Whether integration should use adaptive delta double delta_;///< Initial integrating step ; defaults to 0.01 double tmin_;///< Minimum time for integration, stop integration if t); ///< Set metric Smartpointer SmartPointer getMetric() const; ///< Get metric virtual void setInitCoord(const double coord[8], int dir = 0); ///< Set Initial coordinate /** * \brief Set initial coordinate * * \param pos initial 4-position * \param vel initial 3-velocity * \param dir direction of integration */ virtual void setInitCoord(double pos[4], double vel[3], int dir=1); virtual void setPosition(double pos[4]); ///< Set initial 4-position virtual void setVelocity(double vel[3]); ///< Set initial 3-velocity void reset() ; ///< Forget integration, keeping initial contition void reInit() ; ///< Reset and recompute particle properties virtual std::string className() const ; ///< "Worldline" virtual std::string className_l() const ; ///< "worldline" // Memory management // ----------------- protected: /** * The default size is GYOTO_DEFAULT_X_SIZE */ void xAllocate(); ///< Allocate x0, x1 etc. with default size /** * \param size : number of cells in each array x0, x1 etc. */ void xAllocate(size_t size); ///< Allocate x0, x1 etc. with a specified size. /** * Double the size of arrays x0, x1 etc. and copy old version of the * array in the first half if dir =1 and in the second half if dir * =-1. * * \param dir : 1 to expand after last element, -1 to expand before * first element * * \return ind : if dir=1, new index of old last element, if dir=-1, * new index of old first element */ size_t xExpand(int dir); ///< Expand x0, x1 etc... to hold more elements // Mutators / assignment // --------------------- public: /// Assignment to another Worldline void operator=(const Worldline&) ; void setDelta(const double delta); ///< Set delta void setDelta(double, const std::string &unit); ///< Set default step in specified units double getDelta() const ; ///< Get delta double getDelta(const std::string &unit) const ; ///< Get default step in specified units double getTmin() const ; ///< Get tmin value void setTmin(double tlim); ///< Set tmin to a given value void adaptive (bool mode) ; ///< Set adaptive_ bool adaptive () const ; ///< Get adaptive_ void maxiter (size_t miter) ; ///< Set maxiter_ size_t maxiter () const ; ///< Get maxiter_ /** * Return pointer to array holding the previously set * Metric-specific constants of motion */ double const * getCst() const ; ///< Returns the worldline's cst of motion (if any) /// Set Metric-specific constants of motion /** * The will (re)allocate Worldline::cst_, copy cst into it, and set * Worldline::cst_n_. */ void setCst(double const * cst, size_t const ncsts) ; /// Set or re-set the initial condition prior to integration. /** * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this universe; * \param coord 8 element array containing the initial condition, * i.e. the 4-position and the 4-velocity of the Photon at * the receiving end; * \param dir direction: 1 for future, -1 for past. */ void setInitialCondition(SmartPointer gg, const double coord[8], const int dir) ; void getInitialCoord(double dest[8]) const; ///< Get initial coordinate void getCoord(size_t index, double dest[8]) const; ///< Get coordinates corresponding to index void getCartesianPos(size_t index, double dest[4]) const; ///< Get Cartesian expression of 4-position at index. void xFill(double tlim) ; ///< Fill x0, x1... by integrating the Worldline from previously set inittial condition to time tlim /** * \brief Set parameter by name * * Assume MyKind is a subclass of Worldline which has two * members (a string StringMember and a double DoubleMember): * \code * int MyKind::setParameter(std::string name, * std::string content, * std::string unit) { * if (name=="StringMember") setStringMember(content); * else if (name=="DoubleMember") setDoubleMember(atof(content.c_str()), * unit); * else return Worldline::setParameter(name, content, unit); * return 0; * } * \endcode * * \param name XML name of the parameter * \param content string representation of the value * \param unit string representation of the unit * \return 0 if this parameter is known, 1 if it is not. */ virtual int setParameter(std::string name, std::string content, std::string unit) ; #ifdef GYOTO_USE_XERCES /** * \brief Process XML entity * Uses wait_pos_ and init_vel_ to make sure setVelocity() is called * after setPosition(). */ virtual void setParameters(FactoryMessenger *fmp) ; /** * Derived classes implementations should implement fillElement to save their * parameters to XML and call the generic implementation to save * generic parts such as adaptive_: Worldline::fillElement(fmp). */ virtual void fillElement(FactoryMessenger *fmp) const ; ///< XML output #endif // Accessors // --------- public: /** * \brief Get number of computed dates */ size_t get_nelements() const; /** * \brief Get computed dates */ void get_t(double *dest) const; /// Get the 6 Cartesian coordinates for specific dates. /** * The 6 coordinates (x, y, z, dx/dt, dy/dt, dz/dt) will be computed * using the integrator and interpolated if necessary, so they will * be as accurate as possible. Transforming to Cartesian coordinates * is not necessarily meaningful. * * \param[in] dates List of dates for which the coordinates are to * be computed; * * \param[in] n_dates Number of dates to compute ; * * \param[out] x, y, z, xprime, yprime, zprime Arrays in which to * store the result. These pointer may be set to NULL to retrieve * only part of the information. Else, they must be pre-allocated. * */ void getCartesian(double const * const dates, size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime=NULL, double * const yprime=NULL, double * const zprime=NULL) ; /** * \brief Get 3-position in cartesian coordinates for computed dates */ void get_xyz(double* x, double *y, double *z) const; /** * \brief Get 8-coordinates for specific dates. * * The coordinates will be * computed using the integrator, so they will be as accurate as * possible. Some heuristics are used to speed up the process and it * is presumably faster to call this routine with a sorted list of * dates. The line will be integrated further as required. An error * will be thrown if it is not possible to reach a certain date. * * \param dates the list of dates for which the coordinates are to * be computed; * \param n_dates the number of dates to compute ; * \param x1dest, x2dest, x3dest, x0dot, x1dot, x2dot, x3dot arrays * in which to store the result. These pointer may be * set to NULL to retrieve only part of the * information. They must be pre-allocated. * */ void getCoord(double const * const dates, size_t const n_dates, double * const x1dest, double * const x2dest, double * const x3dest, double * const x0dot=NULL, double * const x1dot=NULL, double * const x2dot=NULL, double * const x3dot=NULL) ; /** * \brief Get all computed positions * * Get all the pre-computed 8 coordinates (e.g. thanks to a prior * call to xFill()) of this worldline. */ void getCoord(double *x0, double *x1, double *x2, double *x3) const ; /** * \brief Bring θ in [0,Π] and φ in [0,2Π] * * checkPhiTheta() Modifies coord if the corrdinates are spherical-like * so that coord[2]=theta is in [0,pi] and coord[3]=phi is in [0,2pi]. * Important to use in all astrobj in spherical coordinates * to prevent "z-axis problems". */ void checkPhiTheta(double coord[8]) const; /** * \brief Get computed positions in sky coordinates */ void getSkyPos(SmartPointer screen, double *dalpha, double *ddellta, double *dD) const; /** * \brief Get computed 4-velocities */ void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const ; /** * \brief Get computed 3-velocities */ void get_prime(double *x1prime, double *x2prime, double *x3prime) const ; // Outputs // ------- public: //virtual void sauve(FILE *) const ; ///< Save in a file void save_txyz(char * fichierxyz) const ; ///< Save in a file void save_txyz(char* const filename, double const t1, double const mass_sun, double const distance_kpc, std::string const unit, SmartPointer sc = NULL);///< Save, converted /// Display friend std::ostream& operator<<(std::ostream& , const Worldline& ) ; protected: virtual void tell(Gyoto::Hook::Teller*); class IntegState; }; /** * \class Gyoto::Worldline::IntegState * \brief Current state of a geodesic integration */ class Gyoto::Worldline::IntegState : SmartPointee { friend class Gyoto::SmartPointer; private: /// Worldline that we are integrating. /** * Beware this is not a SmartPointer. Make sure line_ still exists * when calling nestStep(). */ Worldline * line_; /// The Metric in this end of the Universe. /** * Taken from Worldline::line_, never updated. */ Gyoto::SmartPointer gg_; double coord_[8]; ///< Previously determined coordinate. double norm_; ///< Current norm of the 4-velocity. double normref_; ///< Initial norm of the 4-velocity. double delta_; ///< Integration step (current in case of adaptive). /// Whether Worldline::delta_ is adaptive. /** * Taken from Worldline::line_, never updated. */ bool adaptive_; public: /// Constructor /** * \param line The Worldline that we are integrating. Sets: * Worldline::line_, Worldline::gg_, Worldline::adaptive_. * \param coord Initial coordinate. * \param delta Integration step. Sign determines direction. */ IntegState(Worldline * line, const double *coord, const double delta); /// Make one step. /** * \param[out] coord Next position-velocity; */ virtual int nextStep(double *coord); virtual ~IntegState(); }; #endif Gyoto-0.1.0/install-sh000077500000000000000000000332551217470755400146410ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: Gyoto-0.1.0/lib/000077500000000000000000000000001217470755400133735ustar00rootroot00000000000000Gyoto-0.1.0/lib/Astrobj.C000066400000000000000000000370331217470755400151110ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // GYOTO HEADERS #include "GyotoUtils.h" #include "GyotoAstrobj.h" #include "GyotoMetric.h" #include "GyotoPhoton.h" #include "GyotoRegister.h" #include "GyotoFactoryMessenger.h" // SYSTEM HEADERS #include #include #include #include #include #include #include // NAMESPACES using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; #if defined GYOTO_USE_XERCES Register::Entry* Gyoto::Astrobj::Register_ = NULL; #endif Generic::Generic(string kind) : gg_(NULL), rmax_(DBL_MAX), rmax_set_(0), kind_(kind), flag_radtransf_(0) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif } Generic::Generic() : gg_(NULL), rmax_(DBL_MAX), rmax_set_(0), kind_("Default"), flag_radtransf_(0) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif } Generic::Generic(double radmax) : gg_(NULL), rmax_(radmax), rmax_set_(1), kind_("Default"), flag_radtransf_(0) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif } Generic::Generic(const Generic& orig) : SmartPointee(orig), gg_(NULL), rmax_(orig.rmax_), rmax_set_(orig.rmax_set_), kind_(orig.kind_), flag_radtransf_(orig.flag_radtransf_) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif if (orig.gg_()) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "orig had a metric, cloning"<< endl; #endif gg_=orig.gg_->clone(); } #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "done" << endl; #endif } Generic::~Generic() { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif } SmartPointer Generic::getMetric() const { return gg_; } void Generic::setMetric(SmartPointer gg) {gg_=gg;} double Generic::getRmax() { return rmax_; } double Generic::getRmax(string unit) { return Units::FromGeometrical(getRmax(), unit, gg_); } const string Generic::getKind() const { return kind_; } void Generic::setRmax(double val) { rmax_set_=1; rmax_=val; } void Generic::setRmax(double val, string unit) { setRmax(Units::ToGeometrical(val, unit, gg_)); } void Generic::unsetRmax() { rmax_set_=0; } #ifdef GYOTO_USE_XERCES void Generic::fillElement(FactoryMessenger *fmp) const { if (rmax_set_) fmp -> setParameter ( "RMax", rmax_ ) ; fmp -> setMetric(gg_); fmp -> setSelfAttribute("kind", kind_); fmp -> setParameter ( flag_radtransf_? "OpticallyThin" : "OpticallyThick"); } void Generic::setParameters(FactoryMessenger *fmp) { string name="", content="", unit=""; if (fmp) { setMetric(fmp->getMetric()); while (fmp->getNextParameter(&name, &content, &unit)) setParameter(name, content, unit); } } #endif void Generic::setFlag_radtransf(int flag) {flag_radtransf_=flag;} int Generic::getFlag_radtransf() const {return flag_radtransf_;} int Generic::setParameter(string name, string content, string unit) { char* tc = const_cast(content.c_str()); if (name=="Flag_radtransf") flag_radtransf_= atoi(tc); else if (name=="OpticallyThin") flag_radtransf_= 1; else if (name=="OpticallyThick") flag_radtransf_= 0; else if (name=="RMax") setRmax(atof(tc), unit); else return 1; return 0; } void Generic::processHitQuantities(Photon* ph, double* coord_ph_hit, double* coord_obj_hit, double dt, Properties* data) const { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif /* NB: freqObs is the observer's frequency chosen in Screen::getRayCoord for the actual computation of the geodesic ; the physical value of nuobs will be used in spectrum computations by resorting to the xml specifications of the user (see below) ; this freqObs is used to transform the null worldline parameter dlambda (see below) */ double freqObs=ph->getFreqObs(); // this is a useless quantity, always 1 SmartPointer spr = ph -> getSpectrometer(); size_t nbnuobs = spr() ? spr -> getNSamples() : 0 ; double const * const nuobs = nbnuobs ? spr -> getMidpoints() : NULL; double dlambda = dt/coord_ph_hit[4]; //dlambda = dt/tdot // cout << "freqObs="<ScalarProd(coord_ph_hit,coord_obj_hit+4, coord_ph_hit+4);// / 1.; //this is nu_em/nu_obs // for nuobs=1. Hz double ggred = 1./ggredm1; //this is nu_obs/nu_em double dsem = dlambda*ggredm1; // * 1Hz ? double inc =0.; if (data) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "data requested. " << "freqObs=" << freqObs << ", ggredm1=" << ggredm1 << ", ggred=" << ggred << endl; #endif if (data->redshift) { *data->redshift=ggred; #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(*data->redshift); #endif } if (data->time) { *data->time=coord_ph_hit[0]; #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(*data->time); #endif } if (data->impactcoords) { memcpy(data->impactcoords, coord_obj_hit, 8 * sizeof(double)); memcpy(data->impactcoords+8, coord_ph_hit, 8 * sizeof(double)); } #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "dlambda = (dt="<< dt << ")/(tdot="<< coord_ph_hit[4] << ") = " << dlambda << ", dsem=" << dsem << endl; #endif if (data->intensity) { /* Comment on intensity integration: Eq of radiative transfer used: dI_nu_em/ds_em = j_nu_em (assumes no absorption for simplicity) where : nu_em is measured by the emitter, ds_em is the proper length measured by the emitter corresponding to an increase dlambda of the parameter of the null worldline of the photon ; We have (see manual for demo) : ds_em = dlambda*nu_em BUT: dlambda is depending on the choice of freqObs (defined above) ; indeed we have: dlambda(freqObs) * freqObs = cst (i.e. independent of the choice of freqObs). Thus, for spectra computations where the observed frequency varies, we have to use the dlambda corresponding to the physical frequency chosen by the user, dlambda(nuobs), instead of dlambda(freqObs). The conversion is easy : dlambda(nuobs) = dlambda(freqObs)*freqObs/nuobs Thus: ds_em = dlambda(nuobs)*nu_em = dlambda(freqObs)*freqObs*ggredm1 Then, j_nu_em is computed by the emission() function of the Astrobj [NB: with rad. transfer emission() computes j_nu*dsem, without rad. transfer it computes I_nu, thus the result is always homogenous to intensity] Finally: I_nu_obs = I_nu_em*(nu_obs/nu_em)^3 */ //Intensity increment : GYOTO_DEBUG_EXPR(freqObs); GYOTO_DEBUG_EXPR(freqObs*ggredm1); inc = (emission(freqObs*ggredm1, dsem, coord_ph_hit, coord_obj_hit)) * (ph -> getTransmission(size_t(-1))) * ggred*ggred*ggred; // I_nu/nu^3 invariant # ifdef HAVE_UDUNITS if (data -> intensity_converter_) inc = (*data -> intensity_converter_)(inc); # endif *data->intensity += inc; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "intensity +=" << *data->intensity << "= emission((dsem=" << dsem << "))=" << (emission(freqObs*ggredm1,dsem,coord_ph_hit, coord_obj_hit)) << ")*(ggred=" << ggred << ")^3*(transmission=" << (ph -> getTransmission(size_t(-1))) << ")" << endl; # endif } if (data->binspectrum) { size_t nbounds = spr-> getNBoundaries(); double const * const channels = spr -> getChannelBoundaries(); size_t const * const chaninds = spr -> getChannelIndices(); double * I = new double[nbnuobs]; double * boundaries = new double[nbounds]; for (size_t ii=0; ii getTransmission(ii) * ggred*ggred*ggred*ggred; # ifdef HAVE_UDUNITS if (data -> binspectrum_converter_) inc = (*data -> binspectrum_converter_)(inc); # endif data->binspectrum[ii*data->offset] += inc ; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "nuobs[" << ii << "]="<< channels[ii] << ", nuem=" << boundaries[ii] << ", binspectrum[" << ii+data->offset << "]=" << data->binspectrum[ii*data->offset]<< endl; # endif } delete [] I; delete [] boundaries; } if (data->spectrum) { double * Inu = new double[nbnuobs]; double * nuem = new double[nbnuobs]; for (size_t ii=0; ii getTransmission(ii) * ggred*ggred*ggred; # ifdef HAVE_UDUNITS if (data -> spectrum_converter_) inc = (*data -> spectrum_converter_)(inc); # endif data->spectrum[ii*data->offset] += inc; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "DEBUG: Generic::processHitQuantities(): " << "nuobs[" << ii << "]="<< nuobs[ii] << ", nuem=" << nuem << ", dsem=" << dsem << ", Inu * GM/c2=" << Inu[ii] << ", spectrum[" << ii*data->offset << "]=" << data->spectrum[ii*data->offset] << ", transmission=" << ph -> getTransmission(ii) << ", redshift=" << ggred << ")\n"; # endif } delete [] Inu; delete [] nuem; } /* update photon's transmission */ ph -> transmit(size_t(-1), transmission(freqObs*ggredm1, dsem,coord_ph_hit)); for (size_t ii=0; ii transmit(ii,transmission(nuobs[ii]*ggredm1,dsem,coord_ph_hit)); } else { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "NO data requested!" << endl; # endif } } double Generic::transmission(double, double, double*) const { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(flag_radtransf_); # endif return double(flag_radtransf_); } double Generic::emission(double , double dsem, double *, double *) const { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(flag_radtransf_); # endif if (flag_radtransf_) return dsem; return 1.; } void Generic::emission(double * Inu, double * nuem , size_t nbnu, double dsem, double *cph, double *co) const { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(flag_radtransf_); # endif for (size_t i=0; i< nbnu; ++i) Inu[i]=emission(nuem[i], dsem, cph, co); } void Generic::integrateEmission(double * I, double const * boundaries, size_t const * chaninds, size_t nbnu, double dsem, double *cph, double *co) const { for (size_t i=0; inu2) {nu=nu1; nu1=nu2; nu2=nu;} double Inu1 = emission(nu1, dsem, coord_ph, coord_obj); double Inu2 = emission(nu2, dsem, coord_ph, coord_obj); double dnux2 = ((nu2-nu1)*2.); double Icur = (Inu2+Inu1)*dnux2*0.25; double Iprev; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(Icur); # endif do { Iprev = Icur; dnux2 *= 0.5; for (nu = nu1 + 0.5*dnux2; nu < nu2; nu += dnux2) { Icur += emission(nu, dsem, coord_ph, coord_obj) * dnux2; } Icur *= 0.5; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(Icur); # endif } while( fabs(Icur-Iprev) > (1e-2 * Icur) ); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "dnu=" << dnux2*0.5 << "=(nu2-nu1)/" << (nu2-nu1)/(dnux2*0.5) << endl; # endif return Icur; } Quantity_t Generic::getDefaultQuantities() { return GYOTO_QUANTITY_INTENSITY; } #if defined GYOTO_USE_XERCES void Astrobj::initRegister() { if (Gyoto::Astrobj::Register_) delete Gyoto::Astrobj::Register_; Gyoto::Astrobj::Register_ = NULL; } void Gyoto::Astrobj::Register(std::string name, Subcontractor_t* scp){ Register::Entry* ne = new Register::Entry(name, (SmartPointee::Subcontractor_t*)scp, Gyoto::Astrobj::Register_); Gyoto::Astrobj::Register_ = ne; } Gyoto::Astrobj::Subcontractor_t* Astrobj::getSubcontractor(std::string name, int errmode) { if (!Gyoto::Astrobj::Register_) throwError("No Astrobj kind registered!"); return (Subcontractor_t*)Gyoto::Astrobj::Register_ -> getSubcontractor(name, errmode); } #endif Astrobj::Properties::Properties() : intensity(NULL), time(NULL), distance(NULL), first_dmin(NULL), first_dmin_found(0), redshift(NULL), spectrum(NULL), binspectrum(NULL), offset(1), impactcoords(NULL), user1(NULL), user2(NULL), user3(NULL), user4(NULL), user5(NULL) # ifdef HAVE_UDUNITS , intensity_converter_(NULL), spectrum_converter_(NULL), binspectrum_converter_(NULL) # endif {} Astrobj::Properties::Properties( double * I, double * t) : intensity(I), time(t), distance(NULL), first_dmin(NULL), first_dmin_found(0), redshift(NULL), spectrum(NULL), binspectrum(NULL), offset(1), impactcoords(NULL), user1(NULL), user2(NULL), user3(NULL), user4(NULL), user5(NULL) # ifdef HAVE_UDUNITS , intensity_converter_(NULL), spectrum_converter_(NULL), binspectrum_converter_(NULL) # endif {} void Astrobj::Properties::init(size_t nbnuobs) { if (intensity) *intensity = 0.; if (time) *time = DBL_MAX; if (distance) *distance = DBL_MAX; if (first_dmin){*first_dmin = DBL_MAX; first_dmin_found=0;} if (redshift) *redshift = 0.; if (spectrum) for (size_t ii=0; ii conv) { intensity_converter_ = conv ; } void Astrobj::Properties::setIntensityConverter(string unit) { intensity_converter_ = new Units::Converter("J.m-2.s-1.sr-1.Hz-1", unit!=""?unit:"J.m-2.s-1.sr-1.Hz-1"); } void Astrobj::Properties::setSpectrumConverter(SmartPointer conv) { spectrum_converter_ = conv; } void Astrobj::Properties::setSpectrumConverter(string unit) { spectrum_converter_ = new Units::Converter("J.m-2.s-1.sr-1.Hz-1", unit!=""?unit:"J.m-2.s-1.sr-1.Hz-1"); } void Astrobj::Properties::setBinSpectrumConverter(SmartPointer conv) { binspectrum_converter_ = conv; } void Astrobj::Properties::setBinSpectrumConverter(string unit) { binspectrum_converter_ = new Units::Converter("J.m-2.s-1.sr-1", unit!=""?unit:"J.m-2.s-1.sr-1"); } #endif Astrobj::Properties Astrobj::Properties::operator++() { if (intensity) ++intensity; if (time) ++time; if (distance) ++distance; if (first_dmin) ++first_dmin; if (redshift) ++redshift; if (spectrum) ++spectrum; if (binspectrum)++binspectrum; if (impactcoords) impactcoords += 16; if (user1) ++user1; if (user2) ++user2; if (user3) ++user3; if (user4) ++user4; if (user5) ++user5; return *this; } Gyoto-0.1.0/lib/BlackBodySpectrum.C000066400000000000000000000042411217470755400170550ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoBlackBodySpectrum.h" #include "GyotoDefs.h" #include #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #include "GyotoFactoryMessenger.h" #endif using namespace Gyoto; Spectrum::BlackBody::BlackBody() : Spectrum::Generic("BlackBody"), T_(10000.), cst_(2.*GYOTO_PLANCK_OVER_C_SQUARE) {Tm1_=1./T_;} Spectrum::BlackBody::BlackBody(double T, double c) : Spectrum::Generic("BlackBody"), T_(T), cst_(c) {Tm1_=1./T_;} Spectrum::BlackBody * Spectrum::BlackBody::clone() const { return new Spectrum::BlackBody(*this); } double Spectrum::BlackBody::getTemperature() const { return T_; } void Spectrum::BlackBody::setTemperature(double c) { T_ = c; Tm1_=1./T_; } double Spectrum::BlackBody::getScaling() const { return cst_; } void Spectrum::BlackBody::setScaling(double c) { cst_ = c; } double Spectrum::BlackBody::operator()(double nu) const { return cst_*nu*nu*nu /(exp(GYOTO_PLANCK_OVER_BOLTZMANN*nu*Tm1_)-1.); } void Spectrum::BlackBody::setParameter(std::string name, std::string content, std::string unit) { char * tc=const_cast(content.c_str()); if (name=="Temperature") setTemperature(atof(tc)); else if (name=="Scaling") setScaling(atof(tc)); else Spectrum::Generic::setParameter(name, content, unit); } #ifdef GYOTO_USE_XERCES void Spectrum::BlackBody::fillElement(FactoryMessenger *fmp) const { fmp->setParameter("Temperature", T_); fmp->setParameter("Scaling", cst_); Spectrum::Generic::fillElement(fmp); } #endif Gyoto-0.1.0/lib/ComplexAstrobj.C000066400000000000000000000126701217470755400164410ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoComplexAstrobj.h" #include "GyotoFactoryMessenger.h" #include "GyotoMetric.h" #include "GyotoPhoton.h" using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; Complex::Complex() : Generic("Complex"), cardinal_(0), elements_(NULL), step_max_(GYOTO_DEFAULT_DELTA) { } Complex::Complex(const Complex& o) : Astrobj::Generic(o), cardinal_(o.cardinal_), elements_(NULL), step_max_(o.step_max_) { if (cardinal_) { elements_ = new SmartPointer [cardinal_]; for (size_t i=0; i< cardinal_; ++i) { elements_[i] = o[i]->clone(); } } setMetric(gg_); // to set the same metric in all elements } Complex *Complex::clone() const {return new Complex(*this); } Complex::~Complex() { if (cardinal_) for (size_t i=0; i< cardinal_; ++i) elements_[i] = NULL; } void Complex::setMetric(SmartPointer gg) { Generic::setMetric(gg); for (size_t i=0; igetKind(); cerr << ". Setting metric." << endl; } elements_[i]->setMetric(gg_); } } void Complex::append(SmartPointer e) { if (debug()) cerr << "DEBUG: in Complex::append(SmartPointer e)" << endl; if (cardinal_+1 == 0) throwError("Complex::append(): OVERFLOW"); SmartPointer * orig = elements_; elements_ = new SmartPointer [cardinal_+1]; for (size_t i=0; i< cardinal_; ++i) { elements_[i] = orig[i]; orig[i] = NULL; } delete [] orig; orig = NULL; elements_[cardinal_] = e; ++cardinal_; if (gg_) e->setMetric(gg_); else gg_ = e->getMetric(); if (debug()) cerr << "DEBUG: out Complex::append(SmartPointer e)" << endl; } SmartPointer Complex::operator[](size_t i) { if (i > cardinal_) throwError("Complex::operator[](size_t i): no such element"); return elements_[i]; } SmartPointer const Complex::operator[](size_t i) const { if (i > cardinal_) throwError("Complex::operator[](size_t i): no such element"); return elements_[i]; } void Complex::remove(size_t i) { if (i >= cardinal_) throwError("Complex::remove(size_t i): no such element"); SmartPointer * orig = elements_; if (--cardinal_) elements_ = new SmartPointer [cardinal_]; else elements_ = NULL; size_t k, j=0; for (k=0; k<= cardinal_; ++k) { if (k != i) elements_[j++] = orig[k]; orig[k] = NULL; } delete [] orig; } size_t Complex::getCardinal() const {return cardinal_; } int Complex::Impact(Photon* ph, size_t index, Properties *data) { int res=0, *impact = new int[cardinal_]; size_t n_impact = 0; for (size_t i=0; i Impact(ph, index, NULL); if (debug()) cerr << "DEBUG: Complex::Impact(...): " < Impact(ph, index, data); } else if (n_impact >= 2) { res = 1; if (debug()) cerr << "DEBUG: Complex::Impact(...): refining Photon" << endl; Photon::Refined refine (ph, index, 1, step_max_); size_t n_refine = refine . get_nelements(); if (debug()) cerr << "DEBUG: Complex::Impact(...): n_refine=="<getKind() << ")" << endl; elements_[i]->Impact(&refine, n, data); } } } delete [] impact; return res; } #ifdef GYOTO_USE_XERCES void Complex::fillElement(FactoryMessenger *fmp) const { FactoryMessenger * childfmp=NULL; fmp -> setMetric (getMetric()) ; for (size_t i=0; i makeChild ( "SubAstrobj" ); elements_[i] -> fillElement(childfmp); delete childfmp; } Astrobj::Generic::fillElement(fmp); } void Complex::setParameters(FactoryMessenger *fmp) { if (debug()) cerr << "DEBUG: in Complex::setParameters()" << endl; string name="", content="", unit=""; FactoryMessenger * child = NULL; setMetric( fmp->getMetric() ); while (fmp->getNextParameter(&name, &content, &unit)) { if (debug()) cerr << "DEBUG: Astrobj::Complex::Subcontractor(): name=" << name << endl; if (name=="SubAstrobj") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); append ((*Astrobj::getSubcontractor(content))(child)); delete child; } else setParameter(name, content, unit); } if (debug()) cerr << "DEBUG: out Complex::setParameters()" << endl; } #endif Gyoto-0.1.0/lib/ComplexSpectrometer.C000066400000000000000000000122231217470755400175030ustar00rootroot00000000000000/* Copyright 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoComplexSpectrometer.h" #include "GyotoFactoryMessenger.h" #include "GyotoMetric.h" #include "GyotoPhoton.h" #include using namespace std; using namespace Gyoto; using namespace Gyoto::Spectrometer; kind_t const Complex::Kind = "Complex"; Complex::Complex() : Generic(Complex::Kind), cardinal_(0), elements_(NULL) { } Complex::Complex(const Complex& o) : Generic(o), cardinal_(o.cardinal_), elements_(NULL) { if (cardinal_) { elements_ = new SmartPointer [cardinal_]; for (size_t i=0; i< cardinal_; ++i) { elements_[i] = o[i]->clone(); } } } Complex *Complex::clone() const {return new Complex(*this); } Complex::~Complex() { if (cardinal_) for (size_t i=0; i< cardinal_; ++i) elements_[i] = NULL; } void Complex::append(SmartPointer e) { GYOTO_DEBUG << "DEBUG: in Complex::append(SmartPointer e)" << endl; if (cardinal_+1 == 0) throwError("Complex::append(): OVERFLOW"); SmartPointer * orig = elements_; elements_ = new SmartPointer [cardinal_+1]; for (size_t i=0; i< cardinal_; ++i) { elements_[i] = orig[i]; orig[i] = NULL; } delete [] orig; orig = NULL; elements_[cardinal_] = e; ++cardinal_; e->hook(this); GYOTO_DEBUG << "DEBUG: out Complex::append(SmartPointer e)" << endl; tell(this); } SmartPointer Complex::operator[](size_t i) { if (i > cardinal_) throwError("Complex::operator[](size_t i): no such element"); return elements_[i]; } SmartPointer const Complex::operator[](size_t i) const { if (i > cardinal_) throwError("Complex::operator[](size_t i): no such element"); return elements_[i]; } void Complex::remove(size_t i) { if (i >= cardinal_) throwError("Complex::remove(size_t i): no such element"); elements_[i]->unhook(this); SmartPointer * orig = elements_; if (--cardinal_) elements_ = new SmartPointer [cardinal_]; else elements_ = NULL; size_t k, j=0; for (k=0; k<= cardinal_; ++k) { if (k != i) elements_[j++] = orig[k]; orig[k] = NULL; } delete [] orig; tell(this); // tell self! } size_t Complex::getCardinal() const {return cardinal_; } #ifdef GYOTO_USE_XERCES void Complex::fillElement(FactoryMessenger *fmp) const { FactoryMessenger * childfmp=NULL; for (size_t i=0; i makeChild ( "SubSpectrometer" ); elements_[i] -> fillElement(childfmp); delete childfmp; } Spectrometer::Generic::fillElement(fmp); } void Complex::setParameters(FactoryMessenger *fmp) { if (debug()) cerr << "DEBUG: in Complex::setParameters()" << endl; string name="", content="", unit=""; FactoryMessenger * child = NULL; while (fmp->getNextParameter(&name, &content, &unit)) { if (debug()) cerr << "DEBUG: Spectrometer::Complex::Subcontractor(): name=" << name << endl; if (name=="SubSpectrometer") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); append ((*Spectrometer::getSubcontractor(content))(child)); delete child; } else setParameter(name, content, unit); } if (debug()) cerr << "DEBUG: out Complex::setParameters()" << endl; } #endif void Complex::tell(Gyoto::Hook::Teller *) { // This is called each time an element is added or mutated // This is suboptimal, but most straightforward nboundaries_=nsamples_=0; for (size_t i=0; igetNSamples(); nboundaries_ += elements_[i]->getNBoundaries(); } if (boundaries_) delete [] boundaries_; if (widths_) delete [] widths_; if (midpoints_) delete [] midpoints_; if (chanind_) delete [] chanind_; boundaries_ = new double [nboundaries_]; widths_ = new double [nsamples_]; midpoints_ = new double [nsamples_]; chanind_ = new size_t [2*nsamples_]; size_t boffset=0, offset=0; size_t const * chanind=0; for (size_t i=0; igetNBoundaries(); double ens = elements_[i]->getNSamples(); memcpy(boundaries_+boffset, elements_[i]->getChannelBoundaries(), enb*sizeof(double)); memcpy(widths_+offset, elements_[i]->getWidths(), ens*sizeof(double)); memcpy(midpoints_+offset, elements_[i]->getMidpoints(), ens*sizeof(double)); chanind=elements_[i]->getChannelIndices(); for (size_t j=0; j<2*ens; ++j) chanind_[2*offset+j]=chanind[j]+boffset; boffset += enb; offset += ens ; } tellListeners(); } Gyoto-0.1.0/lib/Converters.C000066400000000000000000000302561217470755400156370ustar00rootroot00000000000000#include "GyotoConverters.h" #include "GyotoError.h" #include "GyotoMetric.h" using namespace Gyoto::Units ; using namespace std ; #ifdef HAVE_UDUNITS static ut_system * SI (NULL); static Gyoto::SmartPointer Meter (NULL); static Gyoto::SmartPointer Second (NULL); static Gyoto::SmartPointer KiloGram (NULL); #endif void Gyoto::Units::Init() { #ifdef HAVE_UDUNITS ut_set_error_message_handler(ut_ignore); SI = ut_read_xml(NULL); ut_unit * tmpu = NULL, * tmpu2 = NULL; /* Map pc for parsec */ tmpu = ut_get_unit_by_name(SI, "parsec"); ut_map_symbol_to_unit("pc", UT_UTF8, tmpu); ut_free(tmpu); tmpu = NULL; /* astronomical_unit aliases */ tmpu = ut_get_unit_by_name(SI, "astronomical_unit"); ut_map_symbol_to_unit("au", UT_UTF8, tmpu); ut_map_symbol_to_unit("AU", UT_UTF8, tmpu); ut_map_symbol_to_unit("ua", UT_UTF8, tmpu); ut_map_symbol_to_unit("astronomicalunit", UT_UTF8, tmpu); ut_free(tmpu); tmpu = NULL; /* as symbol for arcsec */ tmpu = ut_get_unit_by_name(SI, "arcsec"); if (!tmpu) throwError("error initializing arcsec unit"); ut_map_symbol_to_unit("as", UT_UTF8, tmpu); ut_free(tmpu); tmpu = NULL; /* sunradius */ tmpu = ut_get_unit_by_name(SI, "meter"); tmpu2 = ut_scale(GYOTO_SUN_RADIUS, tmpu); ut_map_symbol_to_unit("sunradius", UT_UTF8, tmpu); ut_free(tmpu2); ut_free(tmpu); /* ly */ tmpu = ut_get_unit_by_name(SI, "light_year"); ut_map_symbol_to_unit("ly", UT_UTF8, tmpu); ut_free(tmpu); /* sunmass */ tmpu = ut_get_unit_by_symbol(SI, "kg"); tmpu2 = ut_scale(GYOTO_SUN_MASS, tmpu); ut_map_symbol_to_unit("sunmass", UT_UTF8, tmpu2); ut_free(tmpu2); ut_free(tmpu); /* Jansky */ tmpu = ut_parse(SI, "W.m-2.Hz-1", UT_UTF8); if (!tmpu) throwError("Cannot initialize Jansky"); tmpu2=ut_scale(1e-26, tmpu); ut_map_name_to_unit("Jansky", UT_UTF8, tmpu2); ut_map_symbol_to_unit("Jy", UT_UTF8, tmpu2); ut_free(tmpu2); ut_free(tmpu); Meter = new Unit("meter"); Second = new Unit("second"); KiloGram = new Unit("kilogram"); #endif } #ifdef HAVE_UDUNITS /* Unit class */ Unit::Unit(const string &unit) : unit_(NULL), kind_(unit) { # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(kind_); # endif if (kind_!="") { unit_ = ut_parse(SI, unit.c_str(), UT_UTF8); # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(unit_); # endif if (!unit_) throwError("Error initializing Unit"); } } Unit::Unit(char const * const unit) : unit_(NULL), kind_(unit) { # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(kind_); # endif if (kind_!="") { unit_ = ut_parse(SI, unit, UT_UTF8); # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(unit_); # endif if (!unit_) throwError("Error initializing Unit"); } } Unit::~Unit() { ut_free(unit_); } double Unit::To(double val, const Unit &from_unit) { return Converter(from_unit, *this)(val); } double Unit::From(double val, const Unit &to_unit) { return Converter(*this, to_unit)(val); } Unit::operator std::string() const { return kind_; } Unit::operator ut_unit*() const { return unit_; } /* Converter */ Converter::Converter() : converter_(cv_get_trivial()) {} Converter::Converter(const Gyoto::Units::Unit &from, const Gyoto::Units::Unit &to) : converter_(NULL) { reset(from, to); } void Converter::reset() { if (converter_) cv_free(converter_); converter_ = cv_get_trivial(); } void Converter::reset(const Gyoto::Units::Unit &from, const Gyoto::Units::Unit &to) { if (converter_) { cv_free(converter_); converter_=NULL; } if ((ut_unit*)(from) && (ut_unit*)(to)) { if (areConvertible(from, to)) converter_ = ut_get_converter(from, to); else { stringstream ss; ss << "Unsupported conversion: from \"" << string(from) << "\" to " << string(to) << "\""; throwError(ss.str()); } } else reset(); } Converter::~Converter() { if (converter_) { cv_free(converter_); converter_ = NULL; } } double Converter::operator()(double val) const { return cv_convert_double(converter_, val); } ut_system * Gyoto::Units::getSystem() { return SI; } #endif double Gyoto::Units::ToMeters(double val, const string &unit, const SmartPointer &gg) { if (unit=="" || unit=="m") return val ; if (unit=="geometrical") { if (gg) return val * gg -> unitLength(); else throwError("Metric required for geometrical -> meter conversion"); } # ifdef HAVE_UDUNITS Unit from(unit); if (areConvertible(from, *Meter)) return Meter->To(val, from); if (areConvertible(from, *Second)) return Second->To(val, from)*GYOTO_C; return GYOTO_C/ToHerz(val, unit); # else if (unit=="cm") return val * 1e-2; if (unit=="km") return val * 1e3; if (unit=="sunradius") return val * GYOTO_SUN_RADIUS; if ((unit=="astronomicalunit") || (unit=="astronomical_unit") || (unit=="AU") || (unit=="au") || (unit=="ua")) return val * GYOTO_ASTRONOMICAL_UNIT; if (unit=="ly") return val * GYOTO_LIGHT_YEAR; if (unit=="pc") return val * GYOTO_KPC * 1e-3; if (unit=="kpc") return val * GYOTO_KPC; if (unit=="Mpc") return val * GYOTO_KPC * 1e3; stringstream ss; ss << "Unsupported conversion: \"" << unit; throwError(ss.str()); return 0; # endif } double Gyoto::Units::FromMeters(double val, const string &unit, const SmartPointer &gg) { if ((unit=="") || (unit=="m")) return val ; if (unit=="geometrical") { if (gg) return val / gg -> unitLength(); else throwError("Metric required for meter -> geometrical conversion"); } # ifdef HAVE_UDUNITS Unit to (unit); if (areConvertible(to, *Meter)) return Meter->From(val, to); if (areConvertible(to, *Second)) return Second->From(val*GYOTO_C, to); return FromHerz(GYOTO_C/val, unit); # else if (unit=="cm") return val * 1e2; if (unit=="km") return val * 1e-3; if (unit=="sunradius") return val / GYOTO_SUN_RADIUS; if ((unit=="astronomicalunit") || (unit=="astronomical_unit") || (unit=="AU") || (unit=="au") || (unit=="ua")) return val / GYOTO_ASTRONOMICAL_UNIT; if (unit=="ly") return val / GYOTO_LIGHT_YEAR; if (unit=="pc") return val / GYOTO_KPC * 1e3; if (unit=="kpc") return val / GYOTO_KPC; if (unit=="Mpc") return val / GYOTO_KPC * 1e-3; stringstream ss; ss << "Unsupported conversion: \"" << unit; throwError(ss.str()); return 0; # endif } double Gyoto::Units::ToSeconds(double val, const string &unit, const SmartPointer &gg) { # ifdef GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_EXPR(val); GYOTO_DEBUG_EXPR(unit); GYOTO_DEBUG_EXPR(gg); GYOTO_ENDIF_DEBUG # endif if (unit=="" || unit=="s") ; else if (unit=="geometrical_time" || unit=="geometrical") { if (unit=="geometrical") GYOTO_WARNING << "Please use \"geometrical_time\" instead of " "\"geometrical\" for time unit, \"geometrical\" in this context " "is deprecated and will be removed soon"; if (gg) val *= gg -> unitLength() / GYOTO_C ; else throwError("Metric required for geometrical_time -> second conversion"); } # ifdef HAVE_UDUNITS else val = Second->To(val, unit); # else else if (unit=="min") val *= 60. ; else if (unit=="h") val *= 3600. ; else if (unit=="d") val *= 86400. ; else if (unit=="yr") val *= 3.15576e+07; else if (unit=="kyr") val *= 3.15576e+10; else { stringstream ss; ss << "Screen::setTime(): unknown unit \"" << unit << "\". Accepted units: " << "[s] geometrical min h d y"; throwError (ss.str()); } # endif return val; } double Gyoto::Units::FromSeconds(double val, const string &unit, const SmartPointer &gg) { if (unit=="" || unit=="s") ; else if (unit=="geometrical_time" || unit=="geometrical") { if (unit=="geometrical") GYOTO_WARNING << "Please use \"geometrical_time\" instead of " "\"geometrical\" for time unit, \"geometrical\" in this context " "is deprecated and will be removed soon"; if (gg) val *= GYOTO_C / gg -> unitLength() ; else throwError("Metric required for second -> geometrical_time conversion"); } # ifdef HAVE_UDUNITS else val = Second->From(val, unit); # else else if (unit=="min") val /= 60. ; else if (unit=="h") val /= 3600. ; else if (unit=="d") val /= 86400. ; else if (unit=="yr") val /= 3.15576e+07; else if (unit=="kyr") val /= 3.15576e+10; else { stringstream ss; ss << "Screen::setTime(): unknown unit \"" << unit << "\". Accepted units: " << "[s] geometrical min h d y"; throwError (ss.str()); } # endif return val; } double Gyoto::Units::ToKilograms(double val, const string &unit) { # ifdef HAVE_UDUNITS if (unit=="" || unit=="kg") return val; return KiloGram->To(val, unit); # else if (unit=="" || unit=="kg") ; // do nothing ! else if (unit=="sunmass") val *= GYOTO_SUN_MASS; else if (unit=="g") val*= 1e-3; else { stringstream ss; ss << "Unsupported mass unit: \"" << unit << "\". Supported units: [kg] g sunmass"; throwError(ss.str()); } return val; # endif } double Gyoto::Units::FromKilograms(double val, const string &unit) { if (unit=="" || unit=="kg") return val; # ifdef HAVE_UDUNITS return KiloGram->From(val, unit); # else else if (unit=="sunmass") val /= GYOTO_SUN_MASS; else if (unit=="g") val*= 1e3; else { stringstream ss; ss << "Unsupported mass unit: \"" << unit << "\". Supported units: [kg] g sunmass"; throwError(ss.str()); } return val; # endif } double Gyoto::Units::ToGeometrical(double val, const string &unit, const SmartPointer &gg) { if (unit == "" || unit == "geometrical") return val; if (!gg) throwError("Need Metric to convert to geometrical units"); return ToMeters(val, unit) / gg->unitLength(); } double Gyoto::Units::FromGeometrical(double val, const string &unit, const SmartPointer &gg) { if (unit == "" || unit == "geometrical") return val; if (!gg) throwError("Need Metric to convert from geometrical units"); return FromMeters(val * gg->unitLength(), unit); } double Gyoto::Units::ToGeometricalTime(double val, const string &unit, const SmartPointer &gg) { if (unit == "" || unit == "geometrical_time") return val; if (!gg) throwError("Need Metric to convert to geometrical units"); return ToSeconds(val, unit) / gg->unitLength() * GYOTO_C; } double Gyoto::Units::FromGeometricalTime(double val, const string &unit, const SmartPointer &gg) { if (unit == "" || unit == "geometrical_time") return val; if (!gg) throwError("Need Metric to convert from geometrical units"); return FromSeconds(val * gg->unitLength() / GYOTO_C, unit); } double Gyoto::Units::ToHerz(double value, const string &unit) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "converting " << value << string(unit) << "to Herz" << endl; # endif # ifdef HAVE_UDUNITS if (unit == "" || unit == "Hz") return value; Unit from (unit), Hz("Hz"); if (areConvertible(from, Hz)) return Hz.To(value, from); if (areConvertible(from, *Meter)) return GYOTO_C/Meter->To(value, from); Unit eV("eV"); if (areConvertible(from, eV)) return eV.To(value, from) * GYOTO_eV2Hz; stringstream ss; ss << "Units::ToHerz(): unknown unit \"" << unit << "\"."; throwError (ss.str()); # else GYOTO_WARNING_UDUNITS(unit, "Hz"); # endif return 0.; } double Gyoto::Units::FromHerz(double value, const string &unit) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "converting " << value << "Hz to " << string(unit) << endl; # endif # ifdef HAVE_UDUNITS if (unit == "" || unit == "Hz") return value; Unit to(unit), Hz("Hz"); if (areConvertible(to, Hz)) return Hz.From(value, to); if (areConvertible(to, *Meter)) return Meter->From(GYOTO_C/value, to); Unit eV("eV"); if (areConvertible(to, eV)) return eV.From(value / GYOTO_eV2Hz, to); stringstream ss; ss << "Units::ToHerz(): unknown unit \"" << unit << "\"."; throwError (ss.str()); # else GYOTO_WARNING_UDUNITS(unit, "Hz"); # endif return 0.; } # ifdef HAVE_UDUNITS bool Gyoto::Units::areConvertible(const Unit &unit1, const Unit &unit2) { return ut_are_convertible(unit1, unit2); } # endif Gyoto-0.1.0/lib/Disk3D.C000066400000000000000000000537061217470755400145730ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #define throwCfitsioError(status) \ { fits_get_errstatus(status, ermsg); throwError(ermsg); } #include "GyotoPhoton.h" #include "GyotoDisk3D.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; Disk3D::Disk3D() : Generic("Disk3D"), filename_(""), emissquant_(NULL), velocity_(NULL), dnu_(1.), nu0_(0), nnu_(0), dphi_(0.), phimin_(-DBL_MAX), nphi_(0), phimax_(DBL_MAX), repeat_phi_(1), dz_(0.), zmin_(-DBL_MAX), nz_(0), zmax_(DBL_MAX), dr_(0.), rin_(-DBL_MAX), nr_(0), rout_(DBL_MAX) { GYOTO_DEBUG << "Disk3D Construction" << endl; } Disk3D::Disk3D(const Disk3D& o) : Generic(o), filename_(o.filename_), emissquant_(NULL), velocity_(NULL), dnu_(o.dnu_), nu0_(o.nu0_), nnu_(o.nnu_), dphi_(o.dphi_), phimin_(o.phimin_), nphi_(o.nphi_), phimax_(o.phimax_), repeat_phi_(o.repeat_phi_), dz_(o.dz_), zmin_(o.zmin_), nz_(o.nz_), zmax_(o.zmax_), dr_(o.dr_), rin_(o.rin_), nr_(o.nr_), rout_(o.rout_) { GYOTO_DEBUG << "Disk3D Copy" << endl; size_t ncells = 0; if (o.emissquant_) { emissquant_ = new double[ncells = nnu_ * nphi_ * nz_ * nr_]; memcpy(emissquant_, o.emissquant_, ncells * sizeof(double)); } if (o.velocity_) { velocity_ = new double[ncells = 3 * nphi_ * nz_ * nr_]; memcpy(velocity_, o.velocity_, ncells * sizeof(double)); } } Disk3D* Disk3D::clone() const { return new Disk3D(*this); } Disk3D::~Disk3D() { GYOTO_DEBUG << "Disk3D Destruction" << endl; if (emissquant_) delete [] emissquant_; if (velocity_) delete [] velocity_; } void Disk3D::setEmissquant(double * pattern) { emissquant_ = pattern; } void Disk3D::setVelocity(double * pattern) { velocity_ = pattern; } void Disk3D::copyEmissquant(double const *const pattern, size_t const naxes[4]) { GYOTO_DEBUG << endl; if (emissquant_) { GYOTO_DEBUG << "delete [] emissquant_;" << endl; delete [] emissquant_; emissquant_ = NULL; } if (pattern) { size_t nel; if (nphi_ != naxes[1]) { GYOTO_DEBUG <<"nphi_ changed, freeing velocity_" << endl; if (velocity_) { delete [] velocity_; velocity_= NULL; } } if (nz_ != naxes[2]) { GYOTO_DEBUG <<"nz_ changed, freeing velocity_" << endl; if (velocity_) { delete [] velocity_; velocity_= NULL; } } if (nr_ != naxes[3]) { GYOTO_DEBUG <<"nr_ changed, freeing velocity_" << endl; if (velocity_) { delete [] velocity_; velocity_= NULL; } } if (!(nel=(nnu_ = naxes[0]) * (nphi_=naxes[1]) * (nz_=naxes[2]) * (nr_=naxes[3]))) throwError( "dimensions can't be null"); if (nr_==1 || nz_==1 || nphi_==1) throwError("In Disk3D::CopyEmissquant: dimensions should be >1"); dr_ = (rout_ - rin_) / double(nr_-1); dz_ = (zmax_ - zmin_) / double(nz_-1); if (repeat_phi_==0.) throwError("In Disk3D::CopyEmissquant: repeat_phi is 0!"); //dphi_ = 2.*M_PI/double((nphi_-1.)*repeat_phi_); dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); GYOTO_DEBUG << "allocate emissquant_;" << endl; emissquant_ = new double[nel]; GYOTO_DEBUG << "pattern >> emissquant_" << endl; memcpy(emissquant_, pattern, nel*sizeof(double)); } } double const * Disk3D::getEmissquant() const { return emissquant_; } void Disk3D::getEmissquantNaxes( size_t naxes[3] ) const { naxes[0] = nnu_; naxes[1] = nphi_; naxes[2] = nz_; naxes[3] = nr_; } void Disk3D::copyVelocity(double const *const velocity, size_t const naxes[3]) { GYOTO_DEBUG << endl; if (velocity_) { GYOTO_DEBUG << "delete [] velocity_;\n"; delete [] velocity_; velocity_ = NULL; } if (velocity) { if (!emissquant_) throwError("Please use copyEmissquant() before copyVelocity()"); if (nphi_ != naxes[0] || nz_ != naxes[1] || nr_ != naxes[2]) throwError("emissquant_ and velocity_ have inconsistent dimensions"); GYOTO_DEBUG << "allocate velocity_;" << endl; velocity_ = new double[3*nphi_*nz_*nr_]; GYOTO_DEBUG << "velocity >> velocity_" << endl; memcpy(velocity_, velocity, 3*nphi_*nz_*nr_*sizeof(double)); } } double const * Disk3D::getVelocity() const { return velocity_; } void Disk3D::repeatPhi(size_t n) { repeat_phi_ = n; if ((nphi_-1)*repeat_phi_>0.) dphi_=(phimax_-phimin_)/double((nphi_-1)*repeat_phi_); //dphi_=2.*M_PI/double((nphi_-1.)*repeat_phi_); } size_t Disk3D::repeatPhi() const { return repeat_phi_; } void Disk3D::nu0(double freq) { nu0_ = freq; } double Disk3D::nu0() const { return nu0_; } void Disk3D::dnu(double dfreq) { dnu_ = dfreq; } double Disk3D::dnu() const { return dnu_; } void Disk3D::rin(double rrin) { rin_ = rrin; if (nr_>1) dr_ = (rout_-rin_) / double(nr_-1); } double Disk3D::rin() const {return rin_;} void Disk3D::rout(double rrout) { rout_ = rrout; if (nr_>1) dr_ = (rout_-rin_) / double(nr_-1); } double Disk3D::rout() const {return rout_;} void Disk3D::zmin(double zzmin) { zmin_ = zzmin; if (nz_>1) dz_ = (zmax_-zmin_) / double(nz_-1); } double Disk3D::zmin() const {return zmin_;} void Disk3D::zmax(double zzmax) { zmax_ = zzmax; if (nz_>1) dz_ = (zmax_-zmin_) / double(nz_-1); } double Disk3D::zmax() const {return zmax_;} void Disk3D::phimin(double phimn) { phimin_ = phimn; if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double Disk3D::phimin() const {return phimin_;} void Disk3D::phimax(double phimx) { phimax_ = phimx; if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double Disk3D::phimax() const {return phimax_;} void Disk3D::fitsRead(string filename) { GYOTO_MSG << "Disk3D reading FITS file: " << filename << endl; filename_ = filename; char* pixfile = const_cast(filename_.c_str()); fitsfile* fptr = NULL; int status = 0; int anynul = 0; long tmpl; double tmpd; long naxes [] = {1, 1, 1, 1}; long fpixel[] = {1,1,1,1}; long inc [] = {1,1,1,1}; char ermsg[31] = ""; // ermsg is used in throwCfitsioError() GYOTO_DEBUG << "Disk3D::fitsRead(): opening file" << endl; if (fits_open_file(&fptr, pixfile, 0, &status)) throwCfitsioError(status) ; ////// READ FITS KEYWORDS COMMON TO ALL TABLES /////// GYOTO_DEBUG << "Disk3D::fitsRead(): read RepeatPhi_" << endl; fits_read_key(fptr, TLONG, "GYOTO Disk3D RepeatPhi", &tmpl, NULL, &status); if (status) { if (status == KEY_NO_EXIST) status = 0; // not fatal else throwCfitsioError(status) ; } else repeat_phi_ = size_t(tmpl); // RepeatPhi found GYOTO_DEBUG << "Disk3D::fitsRead(): read Rin_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO Disk3D Rin", &tmpd, NULL, &status); if (status) { //if (status == KEY_NO_EXIST) status = 0; // not fatal -> now fatal in 3D throwCfitsioError(status) ; } else { rin_ = tmpd; // InnerRadius found } GYOTO_DEBUG << "Disk3D::fitsRead(): read Rout_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO Disk3D Rout", &tmpd, NULL, &status); if (status) { //if (status == KEY_NO_EXIST) status = 0; // not fatal -> now fatal in 3D throwCfitsioError(status) ; } else { rout_ = tmpd; // OuterRadius found } GYOTO_DEBUG << "Disk3D::fitsRead(): read Zmin_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO Disk3D Zmin", &tmpd, NULL, &status); if (status) { throwCfitsioError(status) ; } else { zmin_ = tmpd; // Zmin found } GYOTO_DEBUG << "Disk3D::fitsRead(): read Zmax_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO Disk3D Zmax", &tmpd, NULL, &status); if (status) { throwCfitsioError(status) ; } else { zmax_ = tmpd; // Zmax found } GYOTO_DEBUG << "Disk3D::fitsRead(): read Phimin_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO Disk3D Phimin", &tmpd, NULL, &status); if (status) { throwCfitsioError(status) ; } else { phimin_ = tmpd; // Phimin found } GYOTO_DEBUG << "Disk3D::fitsRead(): read Phimax_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO Disk3D Phimax", &tmpd, NULL, &status); if (status) { throwCfitsioError(status) ; } else { phimax_ = tmpd; // Phimax found } ////// FIND MANDATORY EMISSION HDU, READ KWDS & DATA /////// GYOTO_DEBUG << "Disk3D::fitsRead(): search emissquant HDU" << endl; if (fits_movnam_hdu(fptr, ANY_HDU, const_cast("GYOTO Disk3D emissquant"), 0, &status)) throwCfitsioError(status) ; GYOTO_DEBUG << "Disk3D::fitsRead(): get image size" << endl; if (fits_get_img_size(fptr, 4, naxes, &status)) throwCfitsioError(status) ; //update nu0_, nnu_, dnu_; nnu_ = naxes[0]; double CRPIX1; GYOTO_DEBUG << "Disk3D::fitsRead(): read CRPIX1, CRVAL1, CDELT1" << endl; fits_read_key(fptr, TDOUBLE, "CRVAL1", &nu0_, NULL, &status); fits_read_key(fptr, TDOUBLE, "CDELT1", &dnu_, NULL, &status); fits_read_key(fptr, TDOUBLE, "CRPIX1", &CRPIX1, NULL, &status); if (status) throwCfitsioError(status) ; if (CRPIX1 != 1) nu0_ -= dnu_*(CRPIX1 - 1.); if (naxes[1]*naxes[2]*naxes[3]==0.) throwError("In Disk3D::fitsRead: dimensions can't be null!"); // update nphi_, dphi_ nphi_ = naxes[1]; if (nphi_==1) throwError("In Disk3D::fitsRead: dimensions should be >1"); //dphi_ = 2.*M_PI/double((nphi_-1.)*repeat_phi_); dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); // update nz_, nr_, dz_, dr_ nz_ = naxes[2]; nr_ = naxes[3]; if (nr_==1 || nz_==1) throwError("In Disk3D::fitsRead: dimensions should be >1"); dr_ = (rout_ - rin_) / double(nr_-1); dz_ = (zmax_ - zmin_) / double(nz_-1); if (emissquant_) { delete [] emissquant_; emissquant_ = NULL; } emissquant_ = new double[nnu_ * nphi_ * nz_ * nr_]; if (debug()) cerr << "Disk3D::fitsRead(): read emission: " << "nnu_=" << nnu_ << ", nphi_="<("GYOTO Disk3D velocity"), 0, &status); if (status) { if (status == BAD_HDU_NUM) throwCfitsioError(status) ; } else { if (fits_get_img_size(fptr, 4, naxes, &status)) throwCfitsioError(status) ; if ( size_t(naxes[0]) != size_t(3) || size_t(naxes[1]) != nphi_ || size_t(naxes[2]) != nz_ || size_t(naxes[3]) != nr_) throwError("Disk3D::fitsRead(): velocity array not conformable"); if (velocity_) { delete [] velocity_; velocity_ = NULL; } velocity_ = new double[3 * nphi_ * nz_ * nr_]; if (fits_read_subset(fptr, TDOUBLE, fpixel, naxes, inc, 0, velocity_,&anynul,&status)) { delete [] velocity_; velocity_=NULL; throwCfitsioError(status) ; } } if (fits_close_file(fptr, &status)) throwCfitsioError(status) ; fptr = NULL; } void Disk3D::fitsWrite(string filename) { if (!emissquant_) throwError("Disk3D::fitsWrite(filename): nothing to save!"); filename_ = filename; char* pixfile = const_cast(filename_.c_str()); fitsfile* fptr = NULL; int status = 0; long naxes [] = {long(nnu_), long(nphi_), long(nz_), long(nr_)}; long fpixel[] = {1,1,1,1}; char * CNULL=NULL; char ermsg[31] = ""; // ermsg is used in throwCfitsioError() ////// CREATE FILE GYOTO_DEBUG << "creating file" << endl; fits_create_file(&fptr, pixfile, &status); fits_create_img(fptr, DOUBLE_IMG, 4, naxes, &status); if (status) throwCfitsioError(status) ; ////// WRITE FITS KEYWORDS COMMON TO ALL TABLES /////// if (repeat_phi_!=1) fits_write_key(fptr, TLONG, const_cast("GYOTO Disk3D RepeatPhi"), &repeat_phi_, CNULL, &status); if (rin_ > -DBL_MAX){ fits_write_key(fptr, TDOUBLE, const_cast("GYOTO Disk3D Rin"), &rin_, CNULL, &status); }else{ cout << "Disk3D::fitsWrite Error rin_ not set!" << endl; status=1; throwCfitsioError(status) } if (rout_ < DBL_MAX){ fits_write_key(fptr, TDOUBLE, const_cast("GYOTO Disk3D Rout"), &rout_, CNULL, &status); }else{ cout << "Disk3D::fitsWrite Error rout_ not set!" << endl; status=1; throwCfitsioError(status) } if (zmin_ > -DBL_MAX){ fits_write_key(fptr, TDOUBLE, const_cast("GYOTO Disk3D Zmin"), &zmin_, CNULL, &status); }else{ cout << "Disk3D::fitsWrite Error zmin_ not set!" << endl; status=1; throwCfitsioError(status) } if (zmax_ < DBL_MAX){ fits_write_key(fptr, TDOUBLE, const_cast("GYOTO Disk3D Zmax"), &zmax_, CNULL, &status); }else{ cout << "Disk3D::fitsWrite Error zmax_ not set!" << endl; status=1; throwCfitsioError(status) } if (phimin_ > -DBL_MAX){ fits_write_key(fptr, TDOUBLE, const_cast("GYOTO Disk3D Phimin"), &phimin_, CNULL, &status); }else{ cout << "Disk3D::fitsWrite Error Phimin_ not set!" << endl; status=1; throwCfitsioError(status) } if (phimax_ < DBL_MAX){ fits_write_key(fptr, TDOUBLE, const_cast("GYOTO Disk3D Phimax"), &phimax_, CNULL, &status); }else{ cout << "Disk3D::fitsWrite Error Phimax_ not set!" << endl; status=1; throwCfitsioError(status) } ////// SAVE EMISSION IN PRIMARY HDU /////// GYOTO_DEBUG << "saving emissquant_\n"; fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("GYOTO Disk3D emissquant"), CNULL, &status); fits_write_key(fptr, TDOUBLE, const_cast("CRVAL1"), &nu0_, CNULL, &status); fits_write_key(fptr, TDOUBLE, const_cast("CDELT1"), &dnu_, CNULL, &status); double CRPIX1 = 1.; fits_write_key(fptr, TDOUBLE, const_cast("CRPIX1"), &CRPIX1, CNULL, &status); fits_write_pix(fptr, TDOUBLE, fpixel, nnu_*nphi_*nz_*nr_, emissquant_, &status); if (status) throwCfitsioError(status) ; ////// SAVE MANDATORY VELOCITY HDU /////// if (velocity_) { GYOTO_DEBUG << "saving velocity_\n"; naxes[0]=3; fits_create_img(fptr, DOUBLE_IMG, 4, naxes, &status); fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("GYOTO Disk3D velocity"), CNULL, &status); fits_write_pix(fptr, TDOUBLE, fpixel, 3*nphi_*nz_*nr_, velocity_, &status); if (status) throwCfitsioError(status) ; } ////// CLOSING FILE /////// GYOTO_DEBUG << "close FITS file\n"; if (fits_close_file(fptr, &status)) throwCfitsioError(status) ; fptr = NULL; } void Disk3D::getIndices(size_t i[4], double const co[4], double nu) const { GYOTO_DEBUG << "dnu_="<phimax_) i[1]=nphi_-1; else i[1] = size_t(floor((phi-phimin_)/dphi_+0.5)) % nphi_; //z indice if (zz<0. && zmin_>=0.) zz*=-1.; //if zmin>=0, assume disk is symmetric i[2] = size_t(floor((zz-zmin_)/dz_+0.5)); if (i[2] == nz_) i[2] = nz_ - 1; else if (i[2] > nz_) throwError("In Disk3D::getIndices() impossible indice value for z"); //r indice i[3] = size_t(floor((rr-rin_)/dr_+0.5)); if (i[3] == nr_) i[3] = nr_ - 1; else if (i[3] > nr_) throwError("In Disk3D::getIndices() impossible indice value for r"); } void Disk3D::getVelocity(double const pos[4], double vel[4]) { if (velocity_) { size_t i[4]; // {i_nu, i_phi, i_z, i_r} getIndices(i, pos); double phiprime=velocity_[i[3]*3*nphi_*nz_+i[2]*3*nphi_+i[1]*3+0]; double zprime=velocity_[i[3]*3*nphi_*nz_+i[2]*3*nphi_+i[1]*3+1]; double rprime=velocity_[i[3]*3*nphi_*nz_+i[2]*3*nphi_+i[1]*3+2]; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: { //Formula from derivation of rsph^2=rcyl^2+zz^2 //and rsph*cos(th)=zz where rsph and rcyl //are spherical and cylindrical radii double rsph=pos[1], th=pos[2], zz= rsph*cos(th), rcyl=sqrt(rsph*rsph-zz*zz); vel[1] = (rcyl*rprime+zz*zprime)/rsph; vel[2] = (vel[1]*cos(th)-zprime)/(rsph*sin(th)); vel[3] = phiprime; vel[0] = gg_->SysPrimeToTdot(pos, vel+1); vel[1] *= vel[0]; vel[2] *= vel[0]; vel[3] *= vel[0]; } break; case GYOTO_COORDKIND_CARTESIAN: throwError("Disk3D::getVelocity(): metric must be in " "spherical coordinates"); break; default: throwError("Disk3D::getVelocity(): unknown COORDKIND"); } }else throwError("In Disk3D::getVelocity(): velocity_==NULL!"); } int Disk3D::Impact(Photon *ph, size_t index, Astrobj::Properties *data) { GYOTO_DEBUG << endl; double coord_ph_hit[8], coord_obj_hit[8]; double coord1[8], coord2[8]; ph->getCoord(index, coord1); ph->getCoord(index+1, coord2); ph->checkPhiTheta(coord1); ph->checkPhiTheta(coord2); // HEURISTIC TESTS TO PREVENT TOO MANY INTEGRATION STEPS // Speeds up a lot! // Idea: no test if r1,r2 > factr*rdiskmax_ AND z1,z2 have same sign double r1=coord1[1], r2=coord2[1], z1=r1*cos(coord1[2]), z2=r2*cos(coord2[2]); double factr=2.; double rtol=factr*rout_; if (r1>rtol && r2>rtol && z1*z2>0.) return 0; double t1=coord1[0], t2=coord2[0]; double deltatmin=0.1, deltat12=fabs(t2-t1)*0.1; //Break the worldline in pieces of "size" deltat: double deltat= deltat12 < deltatmin ? deltat12 : deltatmin; double tcur=t2; double myrcur=coord2[1], thetacur=coord2[2], zcur=myrcur*cos(thetacur),rcur=sqrt(myrcur*myrcur-zcur*zcur); //NB: myrcur is r in spherical coord, rcur is r in cylindrical coord /*** FIND GRID ENTRY POINT BETWEEN t1 AND t2 ***/ //Following while loop determines (if any) the entry and out points //along the geodesic that goes throw the disk while (tcur>t1+deltat && ( ((zmin_<0. && zcur=0. && zcur<-zmax_)) || zcur>zmax_ || rcur>rout_ || rcur=0 tcur-=deltat; coord_ph_hit[0]=tcur; ph -> getCoord( coord_ph_hit, 1, coord_ph_hit+1, coord_ph_hit+2, coord_ph_hit+3, coord_ph_hit+4, coord_ph_hit+5, coord_ph_hit+6, coord_ph_hit+7); //Cylindrical z and r coordinates myrcur=coord_ph_hit[1]; thetacur=coord_ph_hit[2]; zcur=myrcur*cos(thetacur); rcur=sqrt(myrcur*myrcur-zcur*zcur); } /*** IF NO INTERSECTION WITH GRID, RETURN ***/ if (tcur<=t1+deltat) { //Then no point inside grid found between t1 and t2 return 0; } // Else: t1t1){ if (tcur>t1+deltat){ tcur-=deltat; }else{//this is for last step of this loop //to integrate until t1 deltat=tcur-t1; tcur=t1; } coord_ph_hit[0]=tcur; ph -> getCoord( coord_ph_hit, 1, coord_ph_hit+1, coord_ph_hit+2, coord_ph_hit+3, coord_ph_hit+4, coord_ph_hit+5, coord_ph_hit+6, coord_ph_hit+7); //Cylindrical z and r coordinates myrcur=coord_ph_hit[1]; thetacur=coord_ph_hit[2]; zcur=myrcur*cos(thetacur); rcur=sqrt(myrcur*myrcur-zcur*zcur); if ( ((zmin_<0. && zcur=0. && zcur<-zmax_)) || zcur>zmax_ || rcur>rout_ || rcurcheckPhiTheta(coord_ph_hit); for (int ii=0;ii<4;ii++) coord_obj_hit[ii]=coord_ph_hit[ii]; getVelocity(coord_obj_hit, coord_obj_hit+4); if (data) { //Store impact time in user1 if (data->user1) *data->user1=tcur; } processHitQuantities(ph, coord_ph_hit, coord_obj_hit, deltat, data); if (!flag_radtransf_) indisk=0;//not to go on integrating } } return 1; } int Disk3D::setParameter(std::string name, std::string content, std::string unit) { if (name == "File") fitsRead( content ); else return Generic::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void Disk3D::fillElement(FactoryMessenger *fmp) const { fmp->setParameter("File", (filename_.compare(0,1,"!") ? filename_ : filename_.substr(1))); Generic::fillElement(fmp); } void Disk3D::setParameters(FactoryMessenger* fmp) { string name, content, unit; setMetric(fmp->getMetric()); while (fmp->getNextParameter(&name, &content, &unit)) { if (name == "File") setParameter(name, fmp -> fullPath(content), unit); else setParameter(name, content, unit); } } #endif Gyoto-0.1.0/lib/Disk3D_BB.C000066400000000000000000000311371217470755400151300ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #define throwCfitsioError(status) \ { fits_get_errstatus(status, ermsg); throwError(ermsg); } #include "GyotoPhoton.h" #include "GyotoDisk3D_BB.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; Disk3D_BB::Disk3D_BB() : Disk3D(), spectrumBB_(NULL), tinit_(0.), dt_(1.) { GYOTO_DEBUG << "Disk3D_BB Construction" << endl; spectrumBB_ = new Spectrum::BlackBody(); } Disk3D_BB::Disk3D_BB(const Disk3D_BB& o) : Disk3D(o), spectrumBB_(NULL), tinit_(o.tinit_), dt_(o.dt_) { GYOTO_DEBUG << "Disk3D_BB Copy" << endl; if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); } Disk3D_BB* Disk3D_BB::clone() const { return new Disk3D_BB(*this); } Disk3D_BB::~Disk3D_BB() { GYOTO_DEBUG << "Disk3D_BB Destruction" << endl; delete [] temperature_array_; delete [] velocity_array_; } double const * Disk3D_BB::getVelocity() const { return Disk3D::getVelocity(); } void Disk3D_BB::copyQuantities(int iq) { if (iq<1 || iq>nb_times_) throwError("In Disk3D_BB::copyQuantities: incoherent value of iq"); setEmissquant(temperature_array_[iq-1]); setVelocity(velocity_array_[iq-1]); } void Disk3D_BB::getVelocity(double const pos[4], double vel[4]) { double rcur=pos[1]; double risco; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: risco = static_cast >(gg_) -> getRms(); break; default: throwError("Disk3D_BB::getVelocity: bad COORDKIND"); risco=0.; } if (rcurtcomp && ifits(getEmissquant()); double risco; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: risco = static_cast >(gg_) -> getRms(); break; default: throwError("Disk3D_BB::emission1date(): bad COORDKIND" ", should be BL corrdinates"); risco=0.; } double rcur=co[1]; //double th=co[2]; if (rcur > rout() || rcur < risco) return 0.; size_t i[4]; // {i_nu, i_phi, i_z, i_r} getIndices(i,co,nu); size_t naxes[4]; getEmissquantNaxes(naxes); size_t nnu=naxes[0], nphi=naxes[1], nz=naxes[2]; double TT = temperature[i[3]*nphi*nz*nnu+i[2]*nphi*nnu+i[1]*nnu+i[0]]; //This is local temperature in K spectrumBB_->setTemperature(TT); double Iem=(*spectrumBB_)(nu); double Ires=0.; if (!flag_radtransf_){ Ires=Iem; }else{ //SI value of cylindrical r coordinate: double dist_unit = gg_->unitLength(); //double r_si=rcur*dist_unit; //spherical //double r_si=rcur*sin(th)*dist_unit; //cylindrical //cout << "cyl: " << rcur << " " << th << " " << rcur*sin(th) << " " << risco << endl; //double risco_si=risco*dist_unit; //Local density in cgs: /* Following fact (in SI units) is defined by: fact=RR/(Mm*kappa*gamma) with: RR=8.3144621; // Perfect gas constant in SI Mm=6e-4; //This is N_avogadro*M_atomicmassunit/gamma in kg/mol kappa=3e10; // p = kappa*density^gamma gamma=1.66667; [see DynaDisk3D.i] */ double fact=2.77149e-07; //See DynaDisk3D.i, or paper, for relation between TT and density double density=pow(fact*TT,1.5);// 1.5 is 1/(gamma-1) //density is in SI units, kg/m^3 /*** Computing emission coef: ***/ //Emission coef jnu for thermal bremsstrahlung (see RybickiLightman 5.14a) /* fact2=1/4pi * 2^5*pi*e^6/(3*me*c^3) * sqrt(2pi/(3*kB*me)) * 1/mu^2 in SI, with: me=electron mass, e=electron charge, kB=boltzman, mu=atomic mass unit Anyway this factor has no importance, we are interested in relative values */ double fact2=7.83315e-12; double hok=4.79924e-11; //planck cst / boltzman cst double jnu = fact2 * 1./sqrt(TT) * density*density * exp(-hok*nu/TT); //Elementary intensity added by current dsem segment of worldline //in SI units: Ires=jnu*dsem*dist_unit; //cout << "at end emission1date nu jnu deltaI= " << nu << " " << jnu << " " << Ires << endl; //cout << rcur << " " << TT << endl; //cout << Iem << " " << Sem/Vem << " " << dsem << " " << Ires << endl; //cout << "stuff 3D= " << TT << " " << Iem << " " << Ires << " " << jnu << " " << Sem/Vem << " " << dsem << endl; } return Ires; } double Disk3D_BB::emission(double nu, double dsem, double *, double co[8]) const { GYOTO_DEBUG << endl; double time = co[0], tcomp=tinit_; int ifits=1; while(time>tcomp && ifits(this)->copyQuantities(ifits); //awful trick to avoid problems with constness of function emission -> to improve return emission1date(nu,dsem,NULL,co); }else{ double I1, I2; const_cast(this)->copyQuantities(ifits-1); I1=emission1date(nu,dsem,NULL,co); const_cast(this)->copyQuantities(ifits); I2=emission1date(nu,dsem,NULL,co); double t1 = tinit_+(ifits-2)*dt_; return I1+(I2-I1)/dt_*(time-t1); } return 0.; } double Disk3D_BB::transmission1date(double nu, double dsem, double*, double co[8]) const{ GYOTO_DEBUG << endl; double * temperature = const_cast(getEmissquant()); double dist_unit = GYOTO_G_OVER_C_SQUARE*gg_->getMass(); double risco; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: risco = static_cast >(gg_) -> getRms(); break; default: throwError("Disk3D_BB::emission1date(): bad COORDKIND" ", should be BL corrdinates"); risco=0.; } double rcur=co[1]; //double th=co[2]; //cout << "rcur, risco= " << rcur << " " << risco << endl; if (rcur > rout() || rcur < risco) return 0.; size_t i[4]; // {i_nu, i_phi, i_z, i_r} getIndices(i,co,nu); size_t naxes[4]; getEmissquantNaxes(naxes); size_t nnu=naxes[0], nphi=naxes[1], nz=naxes[2]; double TT = temperature[i[3]*nphi*nz*nnu+i[2]*nphi*nnu+i[1]*nnu+i[0]]; //This is local temperature in K spectrumBB_->setTemperature(TT); double BnuT=(*spectrumBB_)(nu); //Planck function double jnu=emission1date(nu,dsem,NULL,co); // Emission coef double alphanu=0.; //absorption coef. if (BnuT==0.){ /* BnuT can be 0 in the region close to ISCO where density decreases very fast. Then jnu should be 0 too (density~0). If both are 0, then nothing happens (no absorption, no emission, it's free space). Thus leave alphanu=0. If jnu!=0 then alphanu is not defined, this should not happen. */ if (jnu!=0.) throwError("In Disk3D_BB::transmission1date absorption coef. undefined!"); }else{ alphanu=jnu/BnuT; } //cout << "at end transmission1date nu alphanu argexp= " << nu << " " << TT << " " << jnu << " " << BnuT << " " << exp(-alphanu*dsem*dist_unit) << endl; //Thermal emission assumed, use Kirchhoff alphanu=jnu/Bnu return exp(-alphanu*dsem*dist_unit); } double Disk3D_BB::transmission(double nuem, double dsem, double* co) const { GYOTO_DEBUG << endl; double time = co[0], tcomp=tinit_; int ifits=1; while(time>tcomp && ifits(this)->copyQuantities(ifits); //awful trick to avoid problems with constness of function transmission -> to improve return transmission1date(nuem,dsem,NULL,co); }else{ double I1, I2; const_cast(this)->copyQuantities(ifits-1); I1=transmission1date(nuem,dsem,NULL,co); const_cast(this)->copyQuantities(ifits); I2=transmission1date(nuem,dsem,NULL,co); double t1 = tinit_+(ifits-2)*dt_; return I1+(I2-I1)/dt_*(time-t1); } return double(flag_radtransf_); } void Disk3D_BB::setMetric(SmartPointer gg) { //Metric must be KerrBL (see emission function) string kind = gg->getKind(); if (kind != "KerrBL") throwError ("Disk3D_BB::setMetric(): metric must be KerrBL"); Disk3D::setMetric(gg); } int Disk3D_BB::setParameter(std::string name, std::string content, std::string unit) { if (name == "File") { dirname_ = new char[strlen(content.c_str())+1]; strcpy(dirname_,content.c_str()); DIR *dp; struct dirent *dirp; if((dp = opendir(dirname_)) == NULL) { throwError("In Disk3D_BB.C constructor : bad dirname_"); } nb_times_=0; while ((dirp = readdir(dp)) != NULL) { nb_times_++; } nb_times_-=2; //for directories . and .. /* NB: ***Caution***, here it is assumed that dirname_ contains ONLY the FITS files, nothing else. */ closedir(dp); GYOTO_DEBUG << "FITS directory, number of FITS files= " << dirname_ << " " << nb_times_ << endl; if (nb_times_<1) throwError("In Disk3D_BB.C: bad nb_times_ value"); temperature_array_ = new double*[nb_times_] ; velocity_array_ = new double*[nb_times_] ; double nu0b=0., zminb=0., zmaxb=0., rinb=0., routb=0.; size_t nnub=0, nphib=0, nzb=0, nrb=0; for (int i=1; i<=nb_times_; i++) { ostringstream stream_name ; stream_name << dirname_ << "pseudoN3D" << setw(4) << setfill('0') << i << ".fits.gz" ; string filename = stream_name.str(); GYOTO_DEBUG << "Reading FITS file: " << filename << endl ; fitsRead(filename); size_t naxes[4]; getEmissquantNaxes(naxes); size_t nnu=naxes[0], nphi=naxes[1], nz=naxes[2], nr=naxes[3]; size_t nel1=nnu*nphi*nz*nr, nel2=3*nr*nz*nphi; //save temperature if (getEmissquant()){ double * emtemp = const_cast(getEmissquant()); temperature_array_[i-1] = new double[nel1]; for (size_t j=0;j(getVelocity()); velocity_array_[i-1] = new double[nel2]; for (size_t j=0;jsetParameter("tinit", tinit_); if (dt_) fmp->setParameter("dt", dt_); Disk3D::fillElement(fmp); } #endif Gyoto-0.1.0/lib/DynamicalDisk.C000066400000000000000000000162061217470755400162200ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #define throwCfitsioError(status) \ { fits_get_errstatus(status, ermsg); throwError(ermsg); } #include "GyotoPhoton.h" #include "GyotoDynamicalDisk.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; DynamicalDisk::DynamicalDisk() : PatternDiskBB(), tinit_(0.), dt_(1.) { GYOTO_DEBUG << "DynamicalDisk Construction" << endl; } DynamicalDisk::DynamicalDisk(const DynamicalDisk& o) : PatternDiskBB(o), tinit_(o.tinit_), dt_(o.dt_) { GYOTO_DEBUG << "DynamicalDisk Copy" << endl; } DynamicalDisk* DynamicalDisk::clone() const { return new DynamicalDisk(*this); } DynamicalDisk::~DynamicalDisk() { GYOTO_DEBUG << "DynamicalDisk Destruction" << endl; delete [] emission_array_; delete [] opacity_array_; delete [] velocity_array_; delete [] radius_array_; delete [] dnu_array_; delete [] nu0_array_; delete [] nnu_array_; delete [] nphi_array_; delete [] nr_array_; } double const * DynamicalDisk::getVelocity() const { return PatternDiskBB::getVelocity(); } void DynamicalDisk::copyQuantities(int iq) { if (iq<1 || iq>nb_times_) throwError("In DynamicalDisk::copyQuantities: incoherent value of iq"); setEmission(emission_array_[iq-1]); setVelocity(velocity_array_[iq-1]); setRadius(radius_array_[iq-1]); } void DynamicalDisk::getVelocity(double const pos[4], double vel[4]) { double time = pos[0], tcomp=tinit_; int ifits=1; while(time>tcomp && ifitstcomp && ifits(this)->copyQuantities(ifits); //awful trick to avoid problems with constness of function emission -> to improve return PatternDiskBB::emission(nu,dsem,NULL,co); }else{ double I1, I2; const_cast(this)->copyQuantities(ifits-1); I1=PatternDiskBB::emission(nu,dsem,NULL,co); const_cast(this)->copyQuantities(ifits); I2=PatternDiskBB::emission(nu,dsem,NULL,co); double t1 = tinit_+(ifits-2)*dt_; return I1+(I2-I1)/dt_*(time-t1); } return 0.; } int DynamicalDisk::setParameter(std::string name, std::string content, std::string unit) { if (name == "File") { dirname_ = new char[strlen(content.c_str())+1]; strcpy(dirname_,content.c_str()); DIR *dp; struct dirent *dirp; if((dp = opendir(dirname_)) == NULL) { throwError("In DynamicalDisk.C constructor : bad dirname_"); } nb_times_=0; while ((dirp = readdir(dp)) != NULL) { nb_times_++; } nb_times_-=2; //for directories . and .. /* NB: ***Caution***, here it is assumed that dirname_ contains ONLY the FITS files, nothing else. */ closedir(dp); GYOTO_DEBUG << "FITS directory, number of FITS files= " << dirname_ << " " << nb_times_ << endl; if (nb_times_<1) throwError("In DynamicalDisk.C: bad nb_times_ value"); emission_array_ = new double*[nb_times_] ; opacity_array_ = new double*[nb_times_] ; velocity_array_ = new double*[nb_times_] ; radius_array_ = new double*[nb_times_] ; dnu_array_ = new double[nb_times_]; nu0_array_ = new double[nb_times_]; nnu_array_ = new size_t[nb_times_]; nphi_array_ = new size_t[nb_times_]; nr_array_ = new size_t[nb_times_]; for (int i=1; i<=nb_times_; i++) { ostringstream stream_name ; stream_name << dirname_ << "pseudoN2D" << setw(4) << setfill('0') << i << ".fits.gz" ; string filename = stream_name.str(); GYOTO_DEBUG << "Reading FITS file: " << filename << endl ; fitsRead(filename); size_t naxes[3]; getIntensityNaxes(naxes); size_t nnu=naxes[0],nphi=naxes[1],nr=naxes[2]; // nel = (nnu=naxes[0])*(nphi=naxes[1])*(nr=naxes[2]); size_t nel1=nnu*nphi*nr, nel2=2*nr*nphi; //save emission if (getIntensity()){ double * emtemp = const_cast(getIntensity()); emission_array_[i-1] = new double[nel1]; for (size_t j=0;j(getOpacity()); opacity_array_[i-1] = new double[nel1]; for (size_t j=0;j(getVelocity()); velocity_array_[i-1] = new double[nel2]; for (size_t j=0;j(getGridRadius()); radius_array_[i-1] = new double[nr]; for (size_t j=0;jsetParameter("tinit", tinit_); if (dt_) fmp->setParameter("dt", dt_); PatternDiskBB::fillElement(fmp); } #endif Gyoto-0.1.0/lib/Error.C000066400000000000000000000027351217470755400145770ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include using namespace Gyoto; using namespace std; Error::Error( const std::string m ) : message(m), errcode(EXIT_FAILURE) { } void Error::Report() const { cerr << message << endl; } int Error::getErrcode() const { return errcode ; } //char const * const Error::get_message() const { return message; } std::string Error::get_message() const { return message; } static Gyoto::Error::Handler_t * GyotoErrorHandler = NULL; void Gyoto::Error::setHandler( Gyoto::Error::Handler_t* handler ) { GyotoErrorHandler = handler ; } void Gyoto::throwError( const std::string m ) { if (GyotoErrorHandler) (*GyotoErrorHandler)(Error(m)); else throw Error(m); } Gyoto::Error::operator const char * () const { return message.c_str(); } Gyoto-0.1.0/lib/Factory.C000066400000000000000000000706761217470755400151260ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoConfig.h" #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #include "GyotoFactoryMessenger.h" #include "GyotoUtils.h" #include #include #include #include "GyotoMetric.h" #include "GyotoAstrobj.h" #include "GyotoSpectrum.h" #include "GyotoSpectrometer.h" #include #include #include #include #include #include using namespace Gyoto; using namespace xercesc; using namespace std; #define dvalLength 25 #define dfmt " %.16g " #define d2txt(txt, val) sprintf( txt , dfmt, val) #define ifmt " %li " #define i2txt(txt, val) sprintf( txt, ifmt, val); class XStr { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XStr(const char* const toTranscode) : fASCIIForm(NULL) { // Call the private transcoding method fUnicodeForm = XMLString::transcode(toTranscode); } XStr(const XMLCh* const toTranscode) : fUnicodeForm(NULL) { // Call the private transcoding method fASCIIForm = XMLString::transcode(toTranscode); } ~XStr() { if (fUnicodeForm) XMLString::release(&fUnicodeForm); if (fASCIIForm) XMLString::release(&fASCIIForm); } // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const XMLCh* getXForm() const { return fUnicodeForm; } const char* getCForm() const { return fASCIIForm; } private : // ----------------------------------------------------------------------- // Private data members // // fUnicodeForm // This is the Unicode XMLCh format of the string. // ----------------------------------------------------------------------- XMLCh* fUnicodeForm; char* fASCIIForm; }; #define X(str) XStr(str).getXForm() string Cs (const XMLCh* str) { XStr bidule (str); string truc(bidule.getCForm()); return truc;} //#define C(str) string(XStr(str).getCForm()).c_str() #define C(str) Cs(str).c_str() ///// First setup the reporter class. It doesn't need to be in the API. namespace Gyoto { class DOMErrorReporter; } class Gyoto::DOMErrorReporter : public ErrorHandler { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DOMErrorReporter() : fSawErrors(false) { } ~DOMErrorReporter() { } // ----------------------------------------------------------------------- // Implementation of the error handler interface // ----------------------------------------------------------------------- void warning(const SAXParseException& toCatch); void error(const SAXParseException& toCatch); void fatalError(const SAXParseException& toCatch); void resetErrors(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getSawErrors() const; // ----------------------------------------------------------------------- // Private data members // // fSawErrors // This is set if we get any errors, and is queryable via a getter // method. Its used by the main code to suppress output if there are // errors. // ----------------------------------------------------------------------- bool fSawErrors; }; void DOMErrorReporter::warning(const SAXParseException&) { //y_print(); } void DOMErrorReporter::error(const SAXParseException& toCatch) { fSawErrors = true; throwError(C(toCatch.getMessage())); } void DOMErrorReporter::fatalError(const SAXParseException& toCatch) { fSawErrors = true; throwError(C(toCatch.getMessage())); } void DOMErrorReporter::resetErrors() { fSawErrors = false; } //// Now for the public API Factory::Factory(char * filename) : reporter_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(NULL), gg_(NULL), screen_(NULL), obj_(NULL), photon_(NULL), spectro_(NULL), filename_(filename) { // Initialize Xerces XML parser XMLPlatformUtils::Initialize(); parser_ = new XercesDOMParser(); parser_->setValidationScheme(XercesDOMParser::Val_Never); parser_->setDoNamespaces(true); // optional DOMErrorReporter *errReporter = new DOMErrorReporter(); reporter_=errReporter; parser_->setErrorHandler(errReporter); // Parse file parser_->parse(filename); doc_ = parser_ -> getDocument(); root_ = doc_ -> getDocumentElement(); if (!root_ ) throw(Error( "empty XML document" )); resolver_=doc_->createNSResolver(root_); kind_=(C(root_->getTagName())); } Factory::~Factory() { // XMLString::release(&kind_); if (resolver_) delete resolver_; if (reporter_) delete reporter_; if (parser_) delete parser_; else if (doc_) delete doc_; // parser_ takes care of doc_ // if (impl_) delete impl_; // Terminate takes care of that one XMLPlatformUtils::Terminate(); gg_=NULL; obj_=NULL; scenery_=NULL; photon_=NULL; spectro_=NULL; } void Factory::setReporter(ErrorHandler* eh) { reporter_=eh; parser_->setErrorHandler(eh); } DOMElement * Factory::getRoot() { return root_; } DOMDocument * Factory::getDoc() { return doc_; } SmartPointer Factory::getMetric() { if (!gg_) { DOMElement *MetricDOM; if (kind_.compare("Metric")){ DOMXPathResult* result; result=doc_->evaluate( X(("/"+kind_+"/Metric").c_str()), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); if (!result->getSnapshotLength()) throwError("No Metric found"); MetricDOM = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } else MetricDOM = root_; string Plugin = C(MetricDOM->getAttribute(X("plugin"))); if (Plugin != "") loadPlugin(Plugin.c_str()); string Kind = C(MetricDOM->getAttribute(X("kind"))); FactoryMessenger fm(this, MetricDOM); gg_= (*Metric::getSubcontractor(Kind))(&fm); } return gg_; } SmartPointer Factory::getAstrobj(){ if (!obj_) { DOMXPathResult* result; DOMElement *tmpEl; if (kind_=="Astrobj") { obj_el_ = tmpEl = root_; } else { result=doc_->evaluate( X(("/"+kind_+"/Astrobj").c_str()), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); if (!result->getSnapshotLength()) throwError("GYOTO error: an Astrobj MUST be specified"); tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } string Plugin = C(tmpEl->getAttribute(X("plugin"))); if (Plugin != "") loadPlugin(Plugin.c_str()); string AstrobjKind = Cs(tmpEl->getAttribute(X("kind"))); if (debug()) cout << "Astrobj kind : " << AstrobjKind << endl ; FactoryMessenger fm(this, tmpEl); obj_ = (*Astrobj::getSubcontractor(AstrobjKind))(&fm); } return obj_; } SmartPointer Factory::getPhoton(){ if (!photon_) { DOMXPathResult* result; DOMElement *tmpEl; if (kind_=="Photon") { ph_el_ = tmpEl = root_; } else { result=doc_->evaluate( X(("/"+kind_+"/Photon").c_str()), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); if (!result->getSnapshotLength()) throwError("GYOTO error: an Photon MUST be specified"); tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } FactoryMessenger fm(this, tmpEl); photon_ = Photon::Subcontractor(&fm); } return photon_; } SmartPointer Factory::getSpectrum(){ DOMXPathResult* result; DOMElement *tmpEl; if (kind_=="Spectrum") { tmpEl = root_; } else { result=doc_->evaluate( X(("/"+kind_+"/Spectrum").c_str()), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); if (!result->getSnapshotLength()) throwError("GYOTO error: an Spectrum MUST be specified"); tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } string Plugin = C(tmpEl->getAttribute(X("plugin"))); if (Plugin != "") loadPlugin(Plugin.c_str()); string Kind = Cs(tmpEl->getAttribute(X("kind"))); if (debug()) cout << "Spectrum kind : " << Kind << endl ; FactoryMessenger fm(this, tmpEl); return (*Spectrum::getSubcontractor(Kind))(&fm); } SmartPointer Factory::getSpectrometer(){ DOMXPathResult* result; DOMElement *tmpEl; if (kind_=="Spectrometer") { tmpEl = root_; } else { result=doc_->evaluate( X(("/"+kind_+"/Spectrometer").c_str()), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); if (!result->getSnapshotLength()) throwError("GYOTO error: an Spectrometer MUST be specified"); tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } string Plugin = C(tmpEl->getAttribute(X("plugin"))); if (Plugin != "") loadPlugin(Plugin.c_str()); string Kind = Cs(tmpEl->getAttribute(X("kind"))); if (debug()) cout << "Spectrometer kind : " << Kind << endl ; FactoryMessenger fm(this, tmpEl); return (*Spectrometer::getSubcontractor(Kind))(&fm); } /// Scenery SmartPointer Factory::getScenery () { if (!scenery_) { scenery_ = new Scenery(getMetric(), getScreen(), getAstrobj()); DOMXPathResult* result; DOMElement *tmpEl; result=doc_->evaluate( X("/Scenery"), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); FactoryMessenger fm(this, tmpEl); scenery_ = Scenery::Subcontractor(&fm); delete result; } return scenery_; } SmartPointer Factory::getScreen(){ if (!screen_) { DOMXPathResult* result; DOMElement *ScreenDOM; result=doc_->evaluate( X(("/"+kind_+"/Screen").c_str()), root_, resolver_, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, NULL); if (!result->getSnapshotLength()) throwError("No Screen found"); ScreenDOM = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); FactoryMessenger fm ( this, ScreenDOM ); screen_ = Screen::Subcontractor(&fm); delete result; } return screen_; } const string Factory::getKind() { return kind_ ; } Factory::Factory(SmartPointer sc) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(sc), gg_(sc->getMetric()), screen_(sc->getScreen()), obj_(sc->getAstrobj()), photon_(NULL), spectro_(NULL), filename_("") { GYOTO_DEBUG << "Initializing XML stuff" << endl; XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Scenery"), // root element name 0); // document type object (DTD). root_ = doc_->getDocumentElement(); GYOTO_DEBUG << "Creating FactoryMessenger" << endl; FactoryMessenger fm(this, root_); GYOTO_DEBUG << "scenery_ -> fillElement(&fm);" << endl; scenery_ -> fillElement(&fm); } Factory::Factory(SmartPointer scr) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(NULL), gg_(scr->getMetric()), screen_(scr), obj_(), photon_(NULL), spectro_(NULL), filename_("") { XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Screen"), // root element name 0); // document type object (DTD). root_ = doc_->getDocumentElement(); FactoryMessenger fm(this, root_); screen_ -> fillElement(&fm); } Factory::Factory(SmartPointer gg) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(NULL), gg_(gg), screen_(NULL), obj_(NULL), photon_(NULL), spectro_(NULL), filename_("") { XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Metric"), // root element name 0); // document type object (DTD). gg_el_ = root_ = doc_->getDocumentElement(); FactoryMessenger fm(this, gg_el_); gg -> fillElement(&fm); } Factory::Factory(SmartPointer ao) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), scenery_(NULL), gg_(NULL), obj_(ao), photon_(NULL), spectro_(NULL), filename_("") { XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Astrobj"), // root element name 0); // document type object (DTD). obj_el_ = root_ = doc_->getDocumentElement(); FactoryMessenger fm(this, obj_el_); ao -> fillElement(&fm); } Factory::Factory(SmartPointer sp) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), scenery_(NULL), gg_(NULL), obj_(NULL), photon_(NULL), spectro_(NULL), filename_("") { XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Spectrum"), // root element name 0); // document type object (DTD). obj_el_ = root_ = doc_->getDocumentElement(); FactoryMessenger fm(this, obj_el_); sp -> fillElement(&fm); } Factory::Factory(SmartPointer ph) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(NULL), gg_(ph->getMetric()), obj_(ph->getAstrobj()), photon_(ph), spectro_(NULL), filename_("") { XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Photon"), // root element name 0); // document type object (DTD). ph_el_ = root_ = doc_->getDocumentElement(); FactoryMessenger fm(this, root_); photon_ -> fillElement(&fm); } Factory::Factory(SmartPointer sp) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(NULL), gg_(NULL), obj_(NULL), photon_(NULL), spectro_(sp), filename_("") { XMLPlatformUtils::Initialize(); impl_ = DOMImplementationRegistry::getDOMImplementation(X("Core")); if (!impl_) throwError("Problem initializing DOMImplementation"); doc_ = impl_->createDocument( 0, // root element namespace URI. X("Spectrometer"), // root element name 0); // document type object (DTD). root_ = doc_->getDocumentElement(); FactoryMessenger fm(this, root_); spectro_ -> fillElement(&fm); } void Factory::setMetric(SmartPointer gg, DOMElement *el) { if (gg_ && gg && gg!= gg_) throwError("Inconsistent use of Metrics"); if (gg && !gg_el_) { gg_ = gg; gg_el_ = doc_->createElement(X("Metric")); el->appendChild(gg_el_); FactoryMessenger fm(this, gg_el_); gg -> fillElement(&fm); } } void Factory::setAstrobj(SmartPointer ao, DOMElement *el) { GYOTO_DEBUG << endl; if (obj_ && ao && ao!= obj_) throwError("Inconsistent use of Astrobjs"); if (ao && !obj_el_) { GYOTO_DEBUG <<"obj_ = ao;" << endl; obj_ = ao; GYOTO_DEBUG <<"XML stuff" << endl; obj_el_ = doc_->createElement(X("Astrobj")); el->appendChild(obj_el_); GYOTO_DEBUG <<"XML stuffnew FactoryMessenger" << endl; FactoryMessenger fm(this, obj_el_); GYOTO_DEBUG <<"ao -> fillElement(&fm);" << endl; ao -> fillElement(&fm); } } void Factory::setScreen(SmartPointer scr, DOMElement *el) { if (screen_ && scr && scr!= screen_) throwError("Inconsistent use of Screens"); screen_ = scr; DOMElement * scr_el = doc_->createElement(X("Screen")); el->appendChild(scr_el); FactoryMessenger fm(this, scr_el); scr -> fillElement(&fm); } void Factory::write(const char* const goutputfile) { filename_ = goutputfile; // write file DOMLSSerializer *theSerializer = (static_cast(impl_))->createLSSerializer(); DOMConfiguration *serializerConfig = theSerializer->getDomConfig(); DOMLSOutput *theOutputDesc = (static_cast(impl_))->createLSOutput(); XMLFormatTarget *myFormTarget; if (serializerConfig->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,true)) serializerConfig->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); if (goutputfile) myFormTarget=new LocalFileFormatTarget(goutputfile); else myFormTarget=new StdOutFormatTarget(); theOutputDesc->setByteStream(myFormTarget); theSerializer->write(doc_, theOutputDesc); delete myFormTarget; theOutputDesc->release(); theSerializer->release(); } string Factory::format() { // write file DOMLSSerializer *theSerializer = (static_cast(impl_))->createLSSerializer(); DOMConfiguration *serializerConfig = theSerializer->getDomConfig(); DOMLSOutput *theOutputDesc = (static_cast(impl_))->createLSOutput(); MemBufFormatTarget *myFormTarget = new MemBufFormatTarget(); if (serializerConfig->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,true)) serializerConfig->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); theOutputDesc->setByteStream(myFormTarget); theSerializer->write(doc_, theOutputDesc); string res=(const char*) myFormTarget->getRawBuffer(); delete myFormTarget; theOutputDesc->release(); theSerializer->release(); return res; } void Factory::setParameter(std::string name, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); } void Factory::setParameter(std::string name, double value, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); char val_string[dvalLength]; d2txt(val_string,value); el->appendChild(doc_->createTextNode(X(val_string))); } void Factory::setParameter(std::string name, int value, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); char val_string[dvalLength]; sprintf( val_string, " %i ", value); el->appendChild(doc_->createTextNode(X(val_string))); } void Factory::setParameter(std::string name, unsigned int value, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); char val_string[dvalLength]; sprintf( val_string, " %u ", value); el->appendChild(doc_->createTextNode(X(val_string))); } void Factory::setParameter(std::string name, long value, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); char val_string[dvalLength]; sprintf( val_string, " %li ", value); el->appendChild(doc_->createTextNode(X(val_string))); } void Factory::setParameter(std::string name, unsigned long int value, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); char val_string[dvalLength]; sprintf( val_string, " %lu ", value); el->appendChild(doc_->createTextNode(X(val_string))); } void Factory::setParameter(std::string name, std::string val, DOMElement *pel) { DOMElement* el = doc_->createElement(X(name.c_str())); pel -> appendChild(el); el->appendChild(doc_->createTextNode(X(val.c_str()))); } void Factory::setParameter(std::string name, double val[], size_t n, DOMElement *pel, FactoryMessenger **child){ ostringstream ss; ss << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << val[0]; for (size_t i=1; icreateElement(X(name.c_str())); pel -> appendChild(el); el->appendChild( doc_->createTextNode(X(ss.str().c_str())) ); if (child) *child = new FactoryMessenger(this, el); } void Factory::setContent(std::string content, DOMElement *el) { el -> appendChild( doc_->createTextNode( X( content.c_str() ) ) ); } ///////// Factory Messenger Class /////////// FactoryMessenger::FactoryMessenger(Gyoto::Factory* emp, xercesc::DOMElement* el) : employer_(emp), element_(el), curNodeIndex_(0) { children_ = element_->getChildNodes(); nodeCount_ = children_->getLength(); } FactoryMessenger::FactoryMessenger(const FactoryMessenger& fm, std::string name) : employer_(fm.employer_), element_(NULL), curNodeIndex_(0) { element_ = employer_ -> doc_ -> createElement(X(name.c_str())); fm.element_ -> appendChild (element_) ; children_ = element_->getChildNodes(); nodeCount_ = children_->getLength(); } void FactoryMessenger::reset() { curNodeIndex_=0; } int FactoryMessenger::getNextParameter(std::string* namep, std::string* contp, std::string* unitp) { if (debug()) { cerr << "DEBUG: FactoryMessenger::getNextParameter(" << namep << ", " << contp << "): " ; cerr << "*namep=" << *namep; cerr << ", *contp=" << *contp << endl; } if (curNodeIndex_ >= nodeCount_) return 0; DOMNode *currentNode = children_->item(curNodeIndex_++); if( currentNode->getNodeType() && // true is not NULL currentNode->getNodeType() == DOMNode::ELEMENT_NODE ) // is element { // Found node which is an Element. Re-cast node as element DOMElement *currentElement = static_cast< xercesc::DOMElement* >( currentNode ); *namep = C(currentElement->getTagName()); *contp = C(currentElement->getTextContent()); if (unitp) *unitp = C(currentElement->getAttribute(X("unit"))); return 1; } return getNextParameter(namep, contp, unitp); } FactoryMessenger* FactoryMessenger::makeChild(std::string name) { return new FactoryMessenger(*this, name); } void FactoryMessenger::setSelfAttribute(std::string attrname, std::string attrvalue) { element_->setAttribute(X(attrname.c_str()), X(attrvalue.c_str())); } void FactoryMessenger::setSelfAttribute(std::string attrname, unsigned long attrvalue) { char val_string[dvalLength]; sprintf( val_string, "%lu", attrvalue); element_->setAttribute(X(attrname.c_str()), X(val_string)); } void FactoryMessenger::setSelfAttribute(std::string attrname, unsigned int attrvalue) { setSelfAttribute(attrname, (unsigned long)(attrvalue)); } void FactoryMessenger::setSelfAttribute(std::string attrname, double attrvalue) { char val_string[dvalLength]; sprintf( val_string, dfmt, attrvalue); element_->setAttribute(X(attrname.c_str()), X(val_string)); } string FactoryMessenger::getAttribute(std::string attrname) const { DOMNode *currentNode = children_->item(curNodeIndex_-1); DOMElement *currentElement = static_cast< xercesc::DOMElement* >( currentNode ); return Cs(currentElement->getAttribute(X(attrname.c_str()))); } string FactoryMessenger::getSelfAttribute(std::string attrname) const { return Cs(element_->getAttribute(X(attrname.c_str()))); } string FactoryMessenger::getFullContent() const { return Cs(element_->getTextContent()); } void FactoryMessenger::setFullContent(std::string content) { employer_ -> setContent (content, element_) ; } FactoryMessenger* FactoryMessenger::getChild() const { DOMNode *currentNode = children_->item(curNodeIndex_-1); DOMElement *currentElement = static_cast< xercesc::DOMElement* >( currentNode ); return new FactoryMessenger(employer_, currentElement); } void FactoryMessenger::setAstrobj(SmartPointer gg) { employer_ -> setAstrobj (gg, element_); } void FactoryMessenger::setScreen(SmartPointer gg) { employer_ -> setScreen (gg, element_); } void FactoryMessenger::setMetric(SmartPointer gg) { employer_ -> setMetric (gg, element_); } SmartPointer FactoryMessenger::getMetric() { return employer_ -> getMetric (); } SmartPointer FactoryMessenger::getScreen() { return employer_ -> getScreen (); } SmartPointer FactoryMessenger::getPhoton() { return employer_ -> getPhoton (); } SmartPointer FactoryMessenger::getAstrobj() { return employer_ -> getAstrobj (); } void FactoryMessenger::setParameter(std::string name){ employer_ -> setParameter(name, element_); } void FactoryMessenger::setParameter(std::string name, double value){ employer_ -> setParameter(name, value, element_); } void FactoryMessenger::setParameter(std::string name, int value){ employer_ -> setParameter(name, value, element_); } void FactoryMessenger::setParameter(std::string name, long value){ employer_ -> setParameter(name, value, element_); } void FactoryMessenger::setParameter(std::string name, unsigned int value){ employer_ -> setParameter(name, value, element_); } void FactoryMessenger::setParameter(std::string name, unsigned long value){ employer_ -> setParameter(name, value, element_); } void FactoryMessenger::setParameter(std::string name, std::string value){ employer_ -> setParameter(name, value, element_); } void FactoryMessenger::setParameter(std::string name, double val[], size_t n, FactoryMessenger **child){ employer_ -> setParameter(name, val, n, element_, child); } std::string FactoryMessenger::fullPath(std::string fname) { return employer_ -> fullPath(fname); } std::string Factory::fullPath(std::string fname) { if (debug()) cerr << "DEBUG: Factory::fullPath("<< fname << ")" << endl; if (!fname.compare(0, 1, "/")) return fname; // fname is already absolute string fpath = ""; string xmlpath="", curwd=""; { // Make sure we call dirname and getcwd correctly and free memory. // We do this in a block to scope the temporary variables. char * xmlfile = strdup(filename_.c_str()); // why strdup? because xmlpath = dirname(xmlfile); // dirname may modify xmlfile. free (xmlfile); xmlfile = NULL; char * cwd = getcwd(NULL, 0); curwd = cwd; free (cwd); cwd = NULL; } if (xmlpath.compare(0, 1, "/")) fpath = curwd + "/" ; fpath += xmlpath + "/"; fpath += fname; if (debug()) cerr << "DEBUG: Factory::fullPath() returns " << fpath << endl; return fpath; } #endif Gyoto-0.1.0/lib/FixedStar.C000066400000000000000000000106361217470755400153760ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoPhoton.h" #include "GyotoFixedStar.h" #include "GyotoFactoryMessenger.h" #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; FixedStar::FixedStar() : UniformSphere("FixedStar") { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif for (int i=0;i<3;++i) pos_[i]=0.; } FixedStar::FixedStar(SmartPointer gg, double StPsn[3], double rad) : UniformSphere("FixedStar", gg, rad) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "(metric, pos, rad)" << endl; # endif for (int i=0;i<3;++i) pos_[i] = StPsn[i]; setRadius(rad); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "done" << endl; # endif } FixedStar::FixedStar(const FixedStar& orig) : UniformSphere(orig) { for (int i=0; i<3; ++i) pos_[i] = orig.pos_[i]; } FixedStar* FixedStar::clone() const { return new FixedStar(*this); } FixedStar::~FixedStar() { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } void FixedStar::getCartesian(double const * const , size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime, double * const yprime, double * const zprime) { double xs, ys, zs; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_CARTESIAN: xs= pos_[0]; ys= pos_[1]; zs= pos_[2]; break; case GYOTO_COORDKIND_SPHERICAL: { double rs=pos_[0]; double ths=pos_[1]; double phs=pos_[2]; double st, ct, sp, cp; sincos(ths, &st, &ct); sincos(phs, &sp, &cp); xs= rs*st*cp; ys= rs*st*sp; zs= rs*ct; } break; default: throwError("unsupported coordkind"); xs=ys=zs=0.; } for (size_t i=0; iSysPrimeToTdot(pos, vel+1); } double const * FixedStar::getPos() const { return pos_; } void FixedStar::getPos(double dst[3]) const { for (int i=0; i<3;++i) dst[i]=pos_[i]; } void FixedStar::setMetric(SmartPointer gg) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif Generic::setMetric(gg); setRadius(radius_); } void FixedStar::setRadius(double r) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(r) ; # endif radius_ = r; critical_value_=r*r; safety_value_=1.1*critical_value_; if (!gg_()) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "metric is not set yet" << endl; # endif return; } switch (gg_ -> getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: rmax_=3.*(pos_[0]+radius_); break; case GYOTO_COORDKIND_CARTESIAN: rmax_=3.*(sqrt(pos_[0]*pos_[0]+pos_[1]*pos_[1]+pos_[2]*pos_[2])+radius_); break; default: throwError("unimplemented coordinate system in FixedStar"); } } void FixedStar::setPos(const double p[3]) { for (int i=0; i<3; ++i) pos_[i]=p[i]; setRadius(radius_);} int FixedStar::setParameter(string name, string content, string unit) { if (name=="Position") { char* tc = const_cast(content.c_str()); double pos[3]; for (int i=0;i<3;++i) pos[i] = strtod(tc, &tc); setPos(pos); } else return UniformSphere::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void FixedStar::fillElement(FactoryMessenger *fmp) const { fmp -> setParameter ("Position", const_cast(pos_), 3); UniformSphere::fillElement(fmp); } #endif Gyoto-0.1.0/lib/Functors.C000066400000000000000000000044641217470755400153120ustar00rootroot00000000000000/* Copyright 2012 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoFunctors.h" #include "GyotoError.h" #include #include #include #define dr_tol 1e-5 #define f_tol 1e-9 #define sign(a) (a>=0?1:-1) double Gyoto::Functor::Double_Double_const::ridders(double r1, double r2) const { // Ridders' root-finding method applied to operator() double val1 = operator()(r1); double val2 = operator()(r2); double r3, r4, val3, val4; do { r3 = 0.5*(r1+r2); val3 = operator()(r3); r4 = r3+(r3-r1) * sign(val1-val2)*val3/sqrt(val3*val3-val1*val2); val4 = operator()(r4); if (sign(val3)!=sign(val4)) { // use r3 and r4 for next iteration r1=r3; val1=val3; r2=r4; val2=val4; } else if (sign(val1) != sign(val4)) { // use r1 and r4 for next iteration r2=r4; val2=val4; } else { // use r4 and r2 for next iteration r1=r4; val1=val4; } } while (fabs(r1-r2) >= dr_tol && fabs(val4) > f_tol) ; return r4; } double Gyoto::Functor::Double_Double_const::secant(double r1, double r2) { // Secant root-finding method applied to operator() double val1 = operator()(r1); double val2 = operator()(r2); double r3, val3=DBL_MAX; unsigned int maxiter=20, iter; for (iter = 0; iter < maxiter; ++iter) { r3=r1-val1*(r2-r1)/(val2-val1); val3 = operator()(r3); if (fabs(r2-r3) <= fabs(r1-r3)) { r1=r3; val1=val3; } else { r2=r3; val2=val3; } if ( (fabs(r1-r2) < dr_tol) || (fabs(val3) < f_tol) ) break; if (val2==val1) { status=1; return r3; } } if (iter==maxiter) { status=2; return r3; } status=0; return r3; } Gyoto-0.1.0/lib/Hooks.C000066400000000000000000000051061217470755400145640ustar00rootroot00000000000000/* Copyright 2012 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoHooks.h" #include "GyotoDefs.h" #include "GyotoUtils.h" #include #include using namespace Gyoto; using namespace Gyoto::Hook; //////// LOCAL TO THIS FILE //////// /* LISTENER LIST */ class Gyoto::Hook::Teller::ListenerItem { friend class Gyoto::Hook::Teller; friend class Gyoto::Hook::Listener; protected: Listener * listener; ListenerItem * next; public: ListenerItem(Listener*, ListenerItem*); ~ListenerItem(); virtual void tell(Gyoto::Hook::Teller *); size_t len() const; }; Teller::ListenerItem::ListenerItem(Listener*hear, ListenerItem * nxt) : listener(hear), next(nxt) {} Teller::ListenerItem::~ListenerItem() {if (next) delete next;} void Teller::ListenerItem::tell(Teller * teller) { GYOTO_DEBUG<tell(teller); if (next) next->tell(teller); } size_t Teller::ListenerItem::len() const { size_t l = 1; if (next) l += next->len(); return l; } ///////////////////////////////////// /* LISTENER */ Listener::Listener() {} Listener::~Listener() {} void Listener::tell(Teller *) {}; /* TELLER */ Teller::Teller() : listeners_(0) {} Teller::Teller(const Teller &o) : listeners_(0) {} Teller::~Teller() {if (listeners_) delete listeners_;} void Teller::hook(Listener * hear) { GYOTO_DEBUG <<"new hook: "<< hear <<" for Teller " << this << std::endl; listeners_ = new ListenerItem(hear, listeners_); } void Teller::unhook(Listener * hear) { GYOTO_DEBUG <<"removing hook: "<< hear <<" from Teller " << this << std::endl; ListenerItem * item = listeners_; ListenerItem ** parent = &listeners_; while (item) { if (item->listener==hear) { *parent=item->next; item->next=0; delete item; item=*parent; } else { parent=&(item->next); item=item->next; } } } void Teller::tellListeners() { if (listeners_) listeners_->tell(this); } Gyoto-0.1.0/lib/KerrBL.C000066400000000000000000000752221217470755400146300ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoWorldline.h" #include "GyotoError.h" #include #include #include #include #include #include #include using namespace std ; using namespace Gyoto ; using namespace Gyoto::Metric ; /* NB: points delicats de KerrBL: - z-axis problems (d'ou interet de KS? a creuser) - probleme pres de l'horizon (d'ou interet de KS? a creuser) - changement de thetadot dans CheckCons (mais: test dans RK4ada pour eviter de "trop" changer) - changement de rdot dans Normalize4v (mais: test dans RK4ada pour eviter de "trop" changer) */ /* Comment on z-axis problem: z-axis pb is never launched by the condition theta 50 && zaxis)....) which should never be read : the integration is stopped brutally if it's read. A message is printed on the screen and the case must be investigated. The parameter 50 (=countbis_max) can also be changed (put higher) in order to try to avoid the manu militari stop. [*] see also the same .C just changing delta to pi/4N. With same value of i. */ //#define GYOTO_MIN_THETA 1e-5 //seems too big #define GYOTO_MIN_THETA 1e-10 #define drhor 1e-1 //stop integration at r_horizon+drhor ; it speeds up a lot if high //enough (prevents geodesic from "accumulating" next to horizon) ; //but must not be too big not to erase multiple images photons who //can travel close to horizon In any case, for debug calculation, //chose drhor high enough (1e-1 eg, not 1e-3) If ray-tracing ISCO, //be at least sure that r_ISCO > rhor+drhor (eg for drhor=1e-1, it's //OK for a<0.999) KerrBL::KerrBL() : Generic(GYOTO_COORDKIND_SPHERICAL), spin_(0.) { setKind("KerrBL"); } KerrBL::KerrBL(double a, double m) : Generic(m, GYOTO_COORDKIND_SPHERICAL), spin_(a) { //DEBUG!!! //spin_=0.; //setMass(0.); //****************** setKind("KerrBL"); } // default copy constructor should be fine KerrBL::KerrBL(const KerrBL& gg) : Metric::Generic(gg), spin_(gg.spin_) {setKind("KerrBL");} KerrBL * KerrBL::clone () const { return new KerrBL(*this); } KerrBL::~KerrBL() { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } // Output /* std::ostream& Gyoto::operator<<( std::ostream& o, const KerrBL& met ) { return met.print(o); } std::ostream& KerrBL::print( std::ostream& o) const { o << "spin=" << spin_ << ", " ; Metric::print(o); return o; } */ // Mutators void KerrBL::setSpin(const double spin) { spin_=spin; tellListeners(); } // Accessors double KerrBL::getSpin() const { return spin_ ; } //Prograde marginally stable orbit double KerrBL::getRms() const { double aa=spin_, aa2=aa*aa; double z1 = 1. + pow((1. - aa2),1./3.)*(pow((1. + aa),1./3.) + pow((1. - aa),1./3.)); double z2 = pow(3.*aa2 + z1*z1,1./2.); return (3. + z2 - pow((3. - z1)*(3. + z1 + 2.*z2),1./2.)); } //Prograde marginally bound orbit double KerrBL::getRmb() const { return 2.-spin_+2.*sqrt(1.-spin_); } //Computation of metric coefficients in covariant form double KerrBL::gmunu(const double * pos, int mu, int nu) const { double r = pos[1]; double sth2, cth2; sincos(pos[2], &sth2, &cth2); sth2*=sth2; cth2*=cth2; double r2=r*r; double a2=spin_*spin_; double sigma=r2+a2*cth2; double delta=r2-2.*r+a2; if ((mu==0) && (nu==0)) return -(1.-2.*r/sigma); if ((mu==1) && (nu==1)) return sigma/delta; if ((mu==2) && (nu==2)) return sigma; if ((mu==3) && (nu==3)) return (r2+a2+2.*r*a2*sth2/sigma)*sth2; if (((mu==0) && (nu==3)) || ((mu==3) && (nu==0))){ return -2*spin_*r*sth2/sigma; } return 0.; } //Computation of metric coefficients in contravariant form double KerrBL::gmunu_up(const double * pos, int mu, int nu) const { double r = pos[1]; double sth2, cth2; sincos(pos[2], &sth2, &cth2); sth2*=sth2; cth2*=cth2; double r2=r*r; double a2=spin_*spin_; double sigma=r2+a2*cth2; double delta=r2-2.*r+a2; double xi=(r2+a2)*(r2+a2)-a2*delta*sth2; if ((mu==0) && (nu==0)) { return -xi/(delta*sigma); } if ((mu==1) && (nu==1)) return delta/sigma; if ((mu==2) && (nu==2)) return 1./sigma; if ((mu==3) && (nu==3)) { return (delta-a2*sth2)/(sigma*delta*sth2); } if (((mu==0) && (nu==3)) || ((mu==3) && (nu==0))){ return -2*spin_*r/(sigma*delta); } return 0.; } double KerrBL::christoffel(const double[8], const int, const int, const int) const{ throwError( "KerrBL.C : should never come here to find christoffel!!" ); return 0.; // avoid warning } // Optimized version double KerrBL::ScalarProd(const double* pos, const double* u1, const double* u2) const { # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_ARRAY(pos, 4); GYOTO_DEBUG_ARRAY(u1, 4); GYOTO_DEBUG_ARRAY(u2, 4); GYOTO_DEBUG << "ScalarProd(pos, u1, u2)=" << (gmunu(pos,0,0)*u1[0]*u2[0] +gmunu(pos,1,1)*u1[1]*u2[1] +gmunu(pos,2,2)*u1[2]*u2[2] +gmunu(pos,3,3)*u1[3]*u2[3] +gmunu(pos,0,3)*u1[0]*u2[3] +gmunu(pos,3,0)*u1[3]*u2[0]) << endl; GYOTO_ENDIF_DEBUG # endif return gmunu(pos,0,0)*u1[0]*u2[0] +gmunu(pos,1,1)*u1[1]*u2[1] +gmunu(pos,2,2)*u1[2]*u2[2] +gmunu(pos,3,3)*u1[3]*u2[3] +gmunu(pos,0,3)*u1[0]*u2[3] +gmunu(pos,3,0)*u1[3]*u2[0]; } /*For integration of KerrBL geodesics. diff is such that : y_dot=diff(y,cst) where cst are constants of motion (mu,E,L,Q in KerrBL) and y contains [r,theta,phi,t,pr,ptheta] (pr and ptheta are canonical momentum) and y_dot is [rdot,thetadot,phidot,tdot,prdot,pthetadot] */ int KerrBL::diff(const double* coordGen, const double* cst, double* res) const{ double a=spin_; double a2=a*a; //int width=25;//15; //int prec=15;//8; double rsink=1.+sqrt(1.-a2)+drhor; double r = coordGen[1] ; if (r < 0.) { cerr << "r= " << r << endl; throwError( "KerrBL.C : r negative!!!!! the horizon may have been crossed..." ); } if (r < rsink) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "Too close to horizon in KerrBL::diff at r= " << r << endl; # endif return 1; } double r2 = r*r ; double r3 = r2*r ; // compute and store efficiently sin, cos, cotan double theta=coordGen[2]; double costheta, sintheta; sincos(theta, &sintheta, &costheta); double costheta2=costheta*costheta; if (sintheta==0.) throwError("sintheta==0"); double cotantheta=costheta/sintheta; double cotantheta2=cotantheta*cotantheta; double cotantheta3=cotantheta2*cotantheta; double sin2theta=2.*sintheta*costheta; double cos2theta=2.*costheta2-1.; double pr=coordGen[5]; double ptheta=coordGen[6]; double a3=a2*a; double Sigma=r2+a2*costheta2; if (Sigma==0) throwError("In KerrBL::diff(): Sigma==0"); double Sigmam1=1./Sigma; double Sigmam2=Sigmam1*Sigmam1; double Delta=r2-2*r+a2; double E=cst[1]; double E2=E*E; double L=cst[2]; double L2=L*L; double tmp1=(2.*Delta*Sigma); if (tmp1==0) throwError("In KerrBL::diff(): 2.*Delta*Sigma==0"); double tmp1m1=1./tmp1; if (Delta==0) throwError("In KerrBL::diff(): Delta==0"); //NB: equations of motion are independent of Carter constant in this //form. However, the dependency of the dynamic on this constant //appears when transforming from principal momenta to coordinate //derivatives (e.g. p_theta -> thetadot) /* ---> Standard Kerr equations of geodesics */ res[0] = tmp1m1*(2.*(r*(-2.*a*L+E*r3+a2*E*(2.+r))+a2*E*(a2+r*(-2.+r)) *costheta2));// tdot res[1] = Delta*Sigmam1*pr; //rdot res[2] = Sigmam1*ptheta; //thetadot res[3] = -tmp1m1*(-2.*(r*(2.*a*E+L*(-2.+r))+L*(a2+r*(-2.+r)) *cotantheta2)); //phidot res[4] = 0.;// ptdot: pt = cst = -E double tmp2=r2+a2*costheta2; if (tmp2==0) throwError("r2+a2*costheta2==0"); double tmp2m2=1./(tmp2*tmp2); double tmp3=a2+r*(-2.+r); double tmp3_2=tmp3*tmp3; res[5] = -0.5*(2.*(r*(r-a2)-a2*(1.-r)*costheta2)*tmp2m2)*pr*pr -0.5*(-2.*r*tmp2m2)*ptheta*ptheta +(tmp2m2/tmp3_2 *(a2*(a2*a2*E2-2.*a3*E*L+2.*a*E*L*r2+E2*r3*(-4.+r) +a2*(L2*(1.-r)+2*E2*r2))*costheta2 +r*(-r*(a2*a2*E2-2.*a3*E*L+2.*a*E*L*(4.-3.*r)*r +a2*(L2+2.*E2*r*(-2.+r))+r*(E2*r3-L2*(-2.+r)*(-2.+r))) +L2*tmp3_2*cotantheta2)));// prdot res[6]= -0.5*(a2*Delta*sin2theta*Sigmam2)*pr*pr -0.5*(a2*sin2theta*Sigmam2)*ptheta*ptheta +( Sigmam2 *( L2*r2*cotantheta +0.5*L2*(a2+2.*r2+a2*cos2theta)*cotantheta3 +a2*r*(2.*a2*E2-4.*a*E*L+L2*(2.-r)+2.*E2*r2)*costheta*sintheta/Delta ) ); // pthetadot res[7] = 0.;//pphidot: pphi = cst = L return 0; } void KerrBL::circularVelocity(double const coor[4], double vel[4], double dir) const { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG<<"coor=["< throw z-axis pb by // returning 1; if ( (thetacompare < thetatol) && (fabs(k1[5]) > derlim || fabs(k1[6]) > derlim) ){ return 1; } for (int i=0;i<8;i++) { k1[i]=h*k1[i]; coor_plus_halfk1[i]=coor[i]+0.5*k1[i]; sixth_k1[i]=1./6.*k1[i]; } if (diff(coor_plus_halfk1,cst,k2)) return 2; if ( (thetacompare < thetatol) && (fabs(k2[5]) > derlim || fabs(k2[6]) > derlim) ){ return 1; } for (int i=0;i<8;i++) { k2[i]=h*k2[i]; coor_plus_halfk2[i]=coor[i]+0.5*k2[i]; third_k2[i]=1./3.*k2[i]; } if (diff(coor_plus_halfk2,cst,k3)) return 2 ; if ( (thetacompare < thetatol) && (fabs(k3[5]) > derlim || fabs(k3[6]) > derlim) ){ return 1; } for (int i=0;i<8;i++) { k3[i]=h*k3[i]; coor_plus_k3[i]=coor[i]+k3[i]; third_k3[i]=1./3.*k3[i]; } if (diff(coor_plus_k3,cst,k4)) return 2 ; if ( (thetacompare < thetatol) && (fabs(k4[5]) > derlim || fabs(k4[6]) > derlim) ){ return 1; } for (int i=0;i<8;i++) { k4[i]=h*k4[i]; sixth_k4[i]=1./6.*k4[i]; } for (int i=0;i<8;i++) res[i]=coor[i]+sixth_k1[i]+third_k2[i]+third_k3[i]+sixth_k4[i]; return 0; } int KerrBL::myrk4_adaptive(Worldline * line, const double coordin[8], double , double , double coordout1[8], double h0, double& h1) const { /*Switch BL -> principal momenta*/ double coor[8], coor1[8], cstest[5], coorhalf[8], coor2[8], coor1bis[8], mycoor[8], delta1[8]; double const * const cst = line -> getCst(); MakeMomentum(coordin,cst,coor); double delta0[8], dcoor[8]; double delta0min=1e-15, eps=0.0001, S=0.9, errmin=1e-6, hbis=0.5*h0, err, h1min=0.01, h1max=coor[1]*0.5, diffr, diffth, difftol=0.01, normtemp, cstol_gen=1e-3, cstol_hor=1e-2, cstol, div, QCarter; int countbis=0, countbislim=50, zaxis=0; // for z-axis problem in myrk4 //int norm1=0, normhalf=0, norm2=0, rk1=0, rkhalf=0, rk2=0, update, makerr=0.; int norm1=0, rk1=0, rkhalf=0, rk2=0, update, makerr=0; double a=spin_, factrtol=3., rtol=factrtol*(1.+sqrt(1.-a*a)), rlimitol=10.; if (coor[1] < rtol) cstol = cstol_hor; // for tests of cst of motion conservation; don't ask too much // if near horizon... else cstol = cstol_gen; //NB: following test ok only if theta is 0-pi // coz -pi/2[pi]=-pi/2 ... /*if (fabs(fmod(coor[2]+M_PI/2, M_PI)-M_PI/2) < GYOTO_MIN_THETA) { cout << "in kerr th= " << coor[2] << endl; GYOTO_WARNING << "Too close to Z axis: stopping integration"<< endl; return 1; }*/ //Fred: Test removed Feb 2013, seems not necessary if (diff(coor,cst,dcoor)) return 1 ; for (int i = 0;i<8;i++) delta0[i]=delta0min+eps*(fabs(h0*dcoor[i])); while (1){ err=0.; countbis++; //*** z-axis problem *** /* This while loop tests whether theta is too close to zero (coordinate singularity in BL) and whether we are outside horizon. */ double hinit=h0, steptol=1e3; while ( (( (rk1 =myrk4(coor,cst,h0,coor1) ) == 1) || (rk1 == 2)) || (( (rkhalf=myrk4(coor,cst,hbis,coorhalf) ) == 1) || (rkhalf == 2)) || (( (rk2 =myrk4(coorhalf,cst,hbis,coor2)) == 1) || (rk2 == 2)) ) { if (rk1==2 || rkhalf==2 || rk2==2){ //if any of rks is 2, stop integration, we're inside horizon return 1; } zaxis=1; h0*=1.1; hbis*=1.1; GYOTO_INFO << "NOTE: Passing close to z-axis at theta= " << coor[2] << " and r= " << coor[1] << ", jumping ahead with h0= " << h0 << endl; if (h0/hinit>steptol){ GYOTO_SEVERE << "In KerrBL::myrk4_adaptive: " "stop integration because unsolved z-axis problem" << endl; return 1; } } if (countbis > countbislim && zaxis) { // If the "jumping ahead" trick above does not work and leads to // infinite jumping ahead behavior (should never happen of // course) GYOTO_INFO << "WARNING: " << endl << "in KerrBL.C couldn't solve z-axis problem ; stopping..." << endl; return 1; } //*** Error determination: *** for (int i = 0;i<8;i++){ delta1[i]=coor2[i]-coor1[i]; if ((err1) { h0=S*h0*pow(err,-0.25); hbis=0.5*h0; }else{ h1=(err > errmin ? S*h0*pow(err,-0.2) : 4.*h0);//pour éviter les explosions if (fabs(h1)0)?h1min:-h1min; } if (fabs(h1)>h1max) h1=(h1>0.)?h1max:-h1max; //*** Normalizing *** update=1; norm1=CheckCons(coor1,cst,coor1bis); // pr and ptheta relative difference (NB: only pr and ptheta are modified in CheckCons) if (coor1[5]) diffr = fabs(coor1[5]-coor1bis[5])/fabs(coor1[5]); else if (coor1bis[5]) diffr = fabs(coor1[5]-coor1bis[5])/fabs(coor1[5]); else diffr = 0.; if (coor1[6]) diffth = fabs(coor1[6]-coor1bis[6])/fabs(coor1[6]); else if (coor1bis[6]) diffth = fabs(coor1[6]-coor1bis[6])/fabs(coor1[6]); else diffth = 0.; if ((diffr > difftol || diffth > difftol)) { // don't update coordinates if the relative differences are // more than 1% --> consequence = norm and Carter cst // won't be exactly the same for this step --> below, // test to be sure they're not "too much violated"; NB: // if this test is not performed, the "corrected" // worldline can diverge from the "true" one after a long // time of integration. update=0; MakeCoord(coor1,cst,mycoor); normtemp = ScalarProd(mycoor, mycoor+4, mycoor+4); computeCst(mycoor,cstest); if (cst[3]>cstol) { QCarter=cst[3]; div = cst[4]; // cst[4] = cst[3]==0? 1. : 1./cst[3] } else { QCarter=0.; div=1.; } if ( fabs(normtemp+cst[0])>cstol ) makerr=1; // cst[0] == -real_norm if ( makerr && (fabs(cstest[3]-QCarter)*div>cstol) ) makerr=3; if ( fabs(cstest[3]-QCarter)*div>cstol ) makerr=2; if (makerr) { if (verbose() >= GYOTO_SEVERE_VERBOSITY) { cerr << "WARNING:" << endl; if (makerr==1) cerr << "Real norm, current norm= " << (cst[0]?-1.:0.) << " " << normtemp << endl; else if (makerr==2){ cerr << "Carter cst error= (" << QCarter << "-" << cstest[3] << ")*" << div << "*100.= " << fabs(QCarter-cstest[3])*div*100. << " %, cstol=" << cstol << endl; }else{ cerr << "Real norm, current norm= " << (cst[0]?-1.:0.) << " " << normtemp << endl << "Carter cst error= (" << QCarter << "-" << cstest[3] << ")*" << div << "*100.= " << fabs(QCarter-cstest[3])*div*100. << " %" << endl; } } if (coor1[1] to be investigated" << ", or maybe increase parameter cstol" << "in KerrBL.C" << endl; } } } //Update coord if (update && !norm1){ // norm1=1 if impossible to normalize in CheckCons due to z-axis pb for (int i=0;i<8;i++) coor1[i]=coor1bis[i]; } // cout << "KerrBL Used h0= " << h0 << endl; //*** Switch principal momenta -> BL: *** MakeCoord(coor1,cst,coordout1); break; } //err>1 if-loop end } // while loop end //line -> checkPhiTheta(coordout1); //for some reason the above line leads to infinite iteration with fixed star return 0; } int KerrBL::CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const { /* Ensures that the cst of motion are conserved. E and L always are (see diff). But Q and norm may not be. */ double mycoor[8]; //int thetalert=0; /* *** From momenta to normal BL coordinates *** */ MakeCoord(coor_init,cst,mycoor); //Computes mycoor=[t,r,theta,phi,tdot,rdot,thetadot,phidot] from coor_init=[t,r,theta,phi,pt=-E,pr,ptheta,pphi=L] and cst /* *** Carter constant's check *** As the equations of motion (cf diff) are independent of Q, it is necessary to check whether this constant is conserved. */ double argsqrt, limarg=1e-5, limargbis=0.1; double costh, sinth, a2=spin_*spin_; sincos(mycoor[2], &sinth, &costh); double sinthm2=1./(sinth*sinth), costh2=costh*costh; double mu=cst[0], EE=cst[1], LL=cst[2], QQ=cst[3], QQm1=cst[4]; double mu2=mu*mu, EE2=EE*EE, LL2=LL*LL; double Sigma=mycoor[1]*mycoor[1]+a2*costh2; double Sigma2=Sigma*Sigma; double Qtest= Sigma2*mycoor[6]*mycoor[6]+costh2*(a2*(mu2-EE2)+LL2*sinthm2); //this should be equal to constant QQ int thdotpos=1; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "mu="<limarg) {//if it is <0 and "big", two cases: either we are too close to z-axis which causes theta coordinate to behave badly (then return 1: "z-axis problem" in RK4 adaptive); or Error if (fabs(fmod(coor_init[2]+M_PI/2, M_PI)-M_PI/2) < M_PI/50.) { return 1; // z-axis problem }else{ if (fabs(argsqrt)>limargbis) throwError("In KerrBL::CheckCons Impossible to determine thetadot; " "maybe try to increase parameter limarg"); GYOTO_INFO << "KerrBL::CheckCons argsqrt= " << argsqrt << " at theta= " << coor_init[2] << ". Putting it to 0..." << endl; argsqrt=0.; } } mycoor[6]=sqrt(argsqrt)/Sigma;//update thetadot to impose QQ constant if (!thdotpos) mycoor[6]*=-1.; } //*** Normalizing 4v: *** Normalize4v(mycoor,mu); //*** Back to generalized momenta: *** MakeMomentum(mycoor,cst,coor_fin); return 0; } void KerrBL::Normalize4v(double coord[8], const double part_mass) const { /* Changes rdot to allow norm conservation. */ double aa=spin_; double rhor=1.+sqrt(1.-aa*aa); double gtt=gmunu(coord, 0, 0), gtph=gmunu(coord, 0, 3), grr=gmunu(coord, 1, 1), gthth=gmunu(coord, 2, 2), gphph=gmunu(coord, 3, 3); double rr=coord[1], tdot=coord[4], rdot=coord[5], thdot=coord[6], phdot=coord[7]; int valuepos;//to preserve rdot sign if (rdot>0.) valuepos=1; else valuepos=0; if (part_mass==0.){// *** ZERO - NORM CASE *** double argrac=-(gtt*tdot*tdot+2.*gtph*phdot*tdot+gthth*thdot*thdot+gphph*phdot*phdot)/grr;//rdot should be equal to the sqrt of this quantity double arglim=1e-4;//generates lots of warning with argrac /approx 1e-5... if (argrac<0 && fabs(argrac) put it to 0 argrac=0.; } if (argrac<0 && fabs(argrac)>arglim) { if (rr/rhor < 2.) {//A AFFINER?? //if the quantity is <0 and "big", but we are close to horizon --> put it to zero with Warning message if (verbose() >= GYOTO_WARNING_VERBOSITY) { GYOTO_WARNING << "0-NORM CLOSE TO HORIZON : " << "in KerrBL::Normalize4v impossible to normalize 0-mass " << "particule next to horizon. Putting argrac to 0. " << "Effective value of argrac= " << argrac << endl << "with coord= "; for (int myind=0;myind<8;myind++) cerr << coord[myind] << " "; cerr << endl; } argrac=0.; }else{//if the quantity is <0 and "big", and we are not close to horizon --> error throwError( "In KerrBL::Normalize4v impossible to normalize 0-mass particle outside horizon!" ); } } coord[5]=sqrt(argrac);//update rdot if (!valuepos) coord[5]*=-1.; }else if (part_mass>0.){ // *** -1 - NORM CASE *** double argrac=-(1.+gtt*tdot*tdot+2.*gtph*phdot*tdot+gthth*thdot*thdot+gphph*phdot*phdot)/grr; double arglim=1e-7; GYOTO_DEBUG_ARRAY(coord, 8); GYOTO_DEBUG_EXPR(argrac); GYOTO_DEBUG_EXPR(rr/rhor); if (argrac<0 && fabs(argrac)arglim) { if (rr/rhor < 2.) {//A AFFINER?? if (verbose()>=GYOTO_WARNING_VERBOSITY) { cerr << "WARNING -1 - NORM CLOSE TO HORIZON : " << "in KerrBL::Normalize4v impossible to normalize massive " << "particle next to horizon. Putting argrac to 0. " << "Effective value of argrac= " << argrac << endl << "with coord= "; for (int myind=0;myind<8;myind++) cerr << coord[myind] << " "; cerr << endl; } argrac=0.; }else{ throwError( "In KerrBL::Normalize4v impossible to normalize massive particule outside horizon!" ); } } coord[5]=sqrt(argrac);//update rdot if (!valuepos) coord[5]*=-1.; }else{ throwError("In KerrBL::Normalize4v: negative mass!"); } } void KerrBL::MakeCoord(const double coordin[8], const double cst[5], double coord[8]) const { double tt=coordin[0], rr = coordin[1], theta=coordin[2], phi=coordin[3], pr=coordin[5], ptheta=coordin[6]; double r2 = rr*rr ; double sinth, costh; sincos(theta, &sinth, &costh); double costheta2=costh*costh, sintheta2=sinth*sinth, aa=spin_, a2=aa*aa; double Sigma=r2+a2*costheta2, Delta=r2-2*rr+a2, gtt=-(1.-2*rr/Sigma), gtp=-2.*aa*rr*sintheta2/Sigma, gpp = sintheta2*(r2+a2+2.*a2*rr*sintheta2/Sigma), det=gtp*gtp-gtt*gpp, detm1=1./det; double EE=cst[1], LL=cst[2]; double rdot=Delta/Sigma*pr, thetadot=1./Sigma*ptheta, phidot=-(gtt*LL+gtp*EE)*detm1, tdot=(gtp*LL+gpp*EE)*detm1; coord[0]=tt;coord[1]=rr;coord[2]=theta;coord[3]=phi;coord[4]=tdot; coord[5]=rdot;coord[6]=thetadot;coord[7]=phidot; } void KerrBL::MakeMomentum(const double coord[8], const double cst[5], double coordout[8]) const{ double EE=cst[1], LL=cst[2]; double tt=coord[0], rr = coord[1], theta=coord[2], phi=coord[3], rdot=coord[5], thetadot=coord[6]; double r2 = rr*rr, costheta2=cos(theta); costheta2*=costheta2; // sintheta2=sin(theta)*sin(theta); double aa=spin_, a2=aa*aa; double Sigma=r2+a2*costheta2, Delta=r2-2*rr+a2; double pr=Sigma/Delta*rdot, ptheta=Sigma*thetadot; coordout[0]=tt;coordout[1]=rr;coordout[2]=theta; coordout[3]=phi;coordout[4]=-EE;coordout[5]=pr; coordout[6]=ptheta;coordout[7]=LL; } void KerrBL::nullifyCoord(double coord[8]) const { double tdot2; nullifyCoord(coord,tdot2); } void KerrBL::nullifyCoord(double coord[4], double & tdot2) const { int i; double a, b=0., c=0.; a=gmunu(coord, 0, 0); b=gmunu(coord, 0, 3)*coord[7]; for (i=1;i<=3;++i){ c+=gmunu(coord, i, i)*coord[4+i]*coord[4+i]; } double sDelta=sqrt(b*b-a*c), am1=1./a; tdot2=(-b+sDelta)*am1; coord[4]=(-b-sDelta)*am1; } void KerrBL::computeCst(const double coord[8], double cst[5]) const{ //double tt=coord[0], rr = coord[1], theta=coord[2], phi=coord[3], tdot=coord[4], // rdot=coord[5], thetadot=coord[6], phidot=coord[7]; double rr = coord[1], theta=coord[2], tdot=coord[4], thetadot=coord[6], phidot=coord[7]; double norm=ScalarProd(coord, coord+4, coord+4); double sinth, costh; sincos(theta, &sinth, &costh); double r2 = rr*rr, rm1=1./rr, costheta2=costh*costh, sintheta2=sinth*sinth; double a2=spin_*spin_; double Sigma=r2+a2*costheta2, fact=2.*spin_*rr*sintheta2/Sigma; //fact is -g_tphi double mu;//Particule mass: 0 or 1 if (fabs(norm) setCst(cst,5); } #ifdef GYOTO_USE_XERCES void KerrBL::fillElement(Gyoto::FactoryMessenger *fmp) { fmp -> setParameter("Spin", spin_); Metric::Generic::fillElement(fmp); } void KerrBL::setParameter(string name, string content, string unit) { if(name=="Spin") setSpin(atof(content.c_str())); else Generic::setParameter(name, content, unit); } #endif Gyoto-0.1.0/lib/KerrKS.C000066400000000000000000000400161217470755400146410ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrKS.h" #include "GyotoWorldline.h" #include "GyotoError.h" #include #include #include #include #include #include #include using namespace std ; using namespace Gyoto ; using namespace Gyoto::Metric ; #define drhor 0.5 //stop integration at r_horizon+drhor for outgoing geodesics /* NOTA BENE: to improve KerrKS So far (March 2011) KerrKS is just a stub ; to improve it, it's necessary to imporve myrk4_adaptive, which is really obsolete (and longer!) as compared to KerrBL ; a check of cst of motion conservation should be implemented: so far, the norm behaves badly when approaching (not-so-)close to horizon, that's why drhor is chosen so big. In particular, don't trust too much the result with spin>0 */ KerrKS::KerrKS() : Generic(GYOTO_COORDKIND_CARTESIAN), spin_(0.) {setKind("KerrKS");} KerrKS::KerrKS(double a, double m) : Generic(m, GYOTO_COORDKIND_CARTESIAN), spin_(a) {setKind("KerrKS");} // default copy constructor should be fine // KerrKS::KerrKS(const KerrKS& gg) : // Metric(gg), spin_(gg.spin_) {setKind("KerrKS");} // "virtual" copy constructor: KerrKS * KerrKS::clone () const { return new KerrKS(*this); } KerrKS::~KerrKS() {} // Output /* std::ostream& Gyoto::operator<<( std::ostream& o, const KerrKS& met ) { return met.print(o); } std::ostream& KerrKS::print( std::ostream& o) const { o << "spin=" << spin_ << ", " ; Metric::print(o); return o; } */ // Mutators void KerrKS::setSpin(const double spin) { spin_=spin; tellListeners(); } // Accessors double KerrKS::getSpin() const { return spin_ ; } double KerrKS::christoffel(const double[8], const int, const int, const int) const{ throwError( "KerrKS.C : should never come here to find christoffel!!" ); return 0.; } double KerrKS::gmunu(const double * pos, int mu, int nu) const { if (mu<0 || nu<0 || mu>3 || nu>3) throwError ("KerrKS::gmunu: incorrect value for mu or nu"); //double x=pos[0], y=pos[1], z=pos[2]; double x=pos[1], y=pos[2], z=pos[3]; double x2=x*x; double y2=y*y; double z2=z*z; double a2=spin_*spin_; double temp=x2+y2+z2-a2; double rr=sqrt(0.5*(temp+sqrt(temp*temp+4*a2*z2))); double r2=rr*rr; double r3=rr*r2; double r4=rr*r3; double fact=2.*r3/(r4+a2*z2); double res=0.; if (mu==nu) { if ((mu==0) && (nu==0)) res=fact-1.; if ((mu==1) && (nu==1)) res= 1.+fact*pow((rr*x+spin_*y)/(r2+a2),2); if ((mu==2) && (nu==2)) res= 1.+fact*pow((rr*y-spin_*x)/(r2+a2),2); if ((mu==3) && (nu==3)) res= 1.+fact*z2/r2; } if (nu0 && Tdot>0) {// even if KS is okay at the horizon, a geodesic can't escape the horizon, so the eq of geodesic fail there --> must check we're far enough if (debug()) cerr << "Too close to horizon in KerrKS::diff at r= " << rr << endl; return 1; } res[0]=Tdot; res[1]=xdot; res[2]=ydot; res[3]=zdot; res[4]=1./Sigma3*(-4.*spin_*rr*QoverD*Sigma*ydot +(Sigma-4.*r2)*sico*(KK-spin2*QoverD*QoverD) -spin_*rr*sisi*QoverD*(4*(EE*Sigma-BigQ)+(4.*spin2-Sigma)*QoverD));//xdotdot res[5]=1./Sigma3*(4.*spin_*rr*QoverD*Sigma*ydot +(Sigma-4.*r2)*sisi*(KK-spin2*QoverD*QoverD) +spin_*rr*sico*QoverD*(4*(EE*Sigma-BigQ)+(4.*spin2-Sigma)*QoverD));//ydotdot res[6]=-1./Sigma3*KK*zz/rr*(3.*r2-spin2*zz*zz/r2);//zdotdot ; NB: cos(theta)=z/r return 0; } int KerrKS::diff(const double*, double*) const{ throwError("In KerrKS::diff should never get here!"); return 0; } int KerrKS::myrk4_adaptive(Worldline* line, const double * coord, double , double , double* coord1, double h0, double& h1) const{ double const * const cst = line -> getCst(); /* cout << "Cst motion in KerrKS= "; for (int ii=0;ii<4;ii++) cout << cst[ii] << " " ; cout << endl;*/ // int width=15; // int prec=8; double delta0[7]; //caution, diff's result is a 7-sized vector, there's no Tdotdot equation double delta0min=1e-15; double dcoord[7]; double eps=1e-4;//0.0001; double S=0.9; double errmin=1e-6; double h1min=0.001; double h1max=1.; //NB : .1 is necessary to obtain nice images! but long... //1e6; //low h1max necessary to integrate properly the thin disk //double factnorm=2.; // double newnorm1, newnorm2; double coordtemp[7]={coord[0],coord[1],coord[2],coord[3],coord[5],coord[6],coord[7]}; //Caution!! diff must be fed with 7-sized vectors! see comment in diff if (diff(coordtemp,cst,dcoord)) return 1; for (int i = 0;i<7;i++){ delta0[i]=eps*(fabs(coord[i])+fabs(h0*dcoord[i])); delta0[i]=delta0min+eps*(fabs(h0*dcoord[i])); } double hbis=0.5*h0; double coordhalf[8]; double coord2[8]; double delta1[7]; double err; int count=0; // double newnorm; while (1){ count++; //cout << "count= " << count << endl; err=0.; if (myrk4(coord,cst,h0,coord1)) return 1; //NB: myrk4 is fed with 8-sized vector, no pb here if (myrk4(coord,cst,hbis,coordhalf)) return 1; if (myrk4(coordhalf,cst,hbis,coord2)) return 1; for (int i = 0;i<4;i++){ delta1[i]=coord2[i]-coord1[i]; //cout << "del= " << delta1[i] << endl; if (err0?h1min:-h1min; if (fabs(h1)>h1max) h1=h0>0?h1max:-h1max; /* !!! Don't remove the line below !!!*/ /* Although it should be useless, removing it renders the Metric useless under Linux! Further investigation is needed...*/ // newnorm=ScalarProd(coord1, coord1+4, coord1+4); //This "norm check" is trash, it's of no use, except to slow down drastically the computation (even with it, the norm can be very bad) /*if (fabs(newnorm-normref) > factnorm*fabs(lastnorm-normref)) { if (myrk4(coord,cst,h0/10.,coord1)) return 1; h1/=10.; }*/ break; } } /*cout << "coordnew in RK= " ; for (int ii=0;ii<8;ii++) cout << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << coord1[ii] << " "; cout << endl;*/ //cout << "KerrKS: norm, h1= " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << newnorm << " " << ScalarProd(coord1, coord1+4, coord1+4) << endl; /*double xx=coord1[1], yy=coord1[2], zz=coord1[3]; double aa=spin_, a2=aa*aa; double temp=xx*xx+yy*yy+zz*zz-a2; double rr=sqrt(0.5*(temp+sqrt(temp*temp+4*a2*zz*zz))); cout << "In KerrKS::ada r= " << rr << endl;*/ return 0; } int KerrKS::myrk4(Worldline *line, const double coord[8], double hh, double res[8]) const { double const * const cst = line -> getCst(); return myrk4(coord,cst,hh,res); } int KerrKS::myrk4(const double* coord, const double* cst , double h, double* res) const{ //cout << "In KerrKS rk4 h= " << h << endl; double coordtemp[7]={coord[0],coord[1],coord[2],coord[3],coord[5],coord[6],coord[7]}; double restemp[7]; double k1[7] ; double k2[7] ; double k3[7] ; double k4[7] ; double coord_plus_halfk1[7] ; double sixth_k1[7] ; double coord_plus_halfk2[7] ; double third_k2[7] ; double coord_plus_k3[7] ; double third_k3[7] ; double sixth_k4[7] ; if (diff(coordtemp,cst, k1)) return 1; //cout << "TEST dans rk= " << coordtemp[4] << endl; for (int i=0;i<7;i++) { k1[i]=h*k1[i]; coord_plus_halfk1[i]=coordtemp[i]+0.5*k1[i]; sixth_k1[i]=1./6.*k1[i]; } if (diff(coord_plus_halfk1,cst,k2)) return 1; for (int i=0;i<7;i++) { k2[i]=h*k2[i]; coord_plus_halfk2[i]=coordtemp[i]+0.5*k2[i]; third_k2[i]=1./3.*k2[i]; } if (diff(coord_plus_halfk2,cst,k3)) return 1; for (int i=0;i<7;i++) { k3[i]=h*k3[i]; coord_plus_k3[i]=coordtemp[i]+k3[i]; third_k3[i]=1./3.*k3[i]; } if (diff(coord_plus_k3,cst,k4)) return 1; for (int i=0;i<7;i++) { k4[i]=h*k4[i]; sixth_k4[i]=1./6.*k4[i]; } for (int i=0;i<7;i++) { restemp[i]=coordtemp[i]+sixth_k1[i]+third_k2[i]+third_k3[i]+sixth_k4[i]; } for (int i=0;i<4;i++) { res[i]=restemp[i]; } for (int i=5;i<8;i++) { res[i]=restemp[i-1]; } //computing Tdot double ktemp[7]; if (diff(restemp,cst,ktemp)) return 1; res[4]=ktemp[0]; return 0; } void KerrKS::circularVelocity(double const coor[4], double vel[4], double dir) const { double rcross=sqrt ( coor[1]*coor[1] + coor[2]*coor[2] - spin_*spin_); double Omega=dir*pow(rcross*rcross*rcross, -0.5);//angular Keplerian velocity vel[1] = -coor[2]*Omega; vel[2] = coor[1]*Omega; vel[3] = 0.; vel[0] = SysPrimeToTdot(coor, vel+1); vel[1] *= vel[0]; vel[2] *= vel[0]; } void KerrKS::MakeCst(const double* coord, double cst[4]) const{ /* To keep in mind : check the cst of integration by comparing to BL case, it must be the same for the same initial condition. Pay attention to the fact that it is NORMAL if the integration fails near the horizon when rdot<0 and Tdot<0 (see Eq 7 in Marck 96, if E=rdot - sign of E is related to sign of Tdot ; and Marck 96 reminds that at the horizon, E=abs(rdot)): a geodesic can't escape the horizon! However, if rdot<0 and Tdot >0 (which was the case in the earliest version of the code), the horizon can be passed. But it is an ingoing geodesic that is being integrated (here E=rdot never happens, E=-rdot at the horizon). Don't forget that near the horizon, the behavior of a photon can't be reversed. */ //for the transformation between KS and BL see Hameury, Marck, Pelat 94 // int width=15, prec=10; double xx=coord[1], yy=coord[2], zz=coord[3], Tdot=coord[4], xdot=coord[5], ydot=coord[6], zdot=coord[7]; double norm=ScalarProd(coord, coord+4, coord+4); // cout << "norm in MakeCst= " << norm << endl; double aa=spin_, a2=aa*aa; double temp=xx*xx+yy*yy+zz*zz-a2; double rr=sqrt(0.5*(temp+sqrt(temp*temp+4*a2*zz*zz))), r2=rr*rr; //double z2=zz*zz; double costh=zz/rr, costheta2=costh*costh, sintheta2=1.-costheta2, theta=acos(costh), sinth=sin(theta); //NB: acos gives a value between 0 and pi, which is exactly what we want for theta if (sinth==0) { throwError("KerrKS::MakeCst : Initial condition on z-axis : BL coordinates singular at this point with theta=0"); } double rdot=(xx*xdot+yy*ydot+zz*zdot+a2*zz*zdot/r2)/(rr+a2*zz*zz/(rr*r2)), thetadot=(rdot*costh-zdot)/(rr*sinth); //See Hameury, Mark & Pelat 94 double Sigma=r2+a2*costheta2, Delta=r2-2*rr+a2, fact=2.*aa*rr*sintheta2/Sigma; double BLtdot=Tdot-2.*rr/Delta*rdot; double cosp=(rr*xx+aa*yy)/(sinth*(a2+r2)), sinp=(rr*yy-aa*xx)/(sinth*(a2+r2));//cos(psi) and sin(psi) double psidot; if (aa != 0.) { psidot=(xdot*cosp+ydot*sinp-rdot*sinth-rr*thetadot*costh)/(-aa*sinth); }else{ if (cosp!=0.) { psidot=(ydot - sinp*(rdot*sinth+rr*thetadot*costh))/(rr*sinth*cosp); }else{ psidot=(xdot - cosp*(rdot*sinth+rr*thetadot*costh))/(-rr*sinth*sinp); } } double phidot=psidot-aa/Delta*rdot; //cout << "Make Cst psidot= " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << psidot << endl; double mu;//Particule mass: 0 or 1 if (fabs(norm) setCst(cst,4); } int KerrKS::isStopCondition(double const * const coord) const { if (fabs(coord[5]) > 5000.) return 1; return 0; } void KerrKS::setParameter(string name, string content, string unit) { if (name=="Spin") setSpin(atof(content.c_str())); else Generic::setParameter(name, content, unit); } #ifdef GYOTO_USE_XERCES void KerrKS::fillElement(Gyoto::FactoryMessenger *fmp) { fmp -> setParameter("Spin", spin_); Metric::Generic::fillElement(fmp); } #endif Gyoto-0.1.0/lib/LorenePlug.C000066400000000000000000000017071217470755400155600ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // include Metric headers #include "GyotoRotStar3_1.h" /* namespace Gyoto { void __StdLibInit(); } */ extern "C" void __GyotoloreneInit() { Gyoto::Metric::Register("RotStar3_1", &(Gyoto::Metric::Subcontractor )); } Gyoto-0.1.0/lib/Makefile.am000066400000000000000000000035431217470755400154340ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I@top_srcdir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) AM_LDFLAGS = $(XERCESLDFLAGS) -export-dynamic $(PTHREAD_LIBS) \ $(UDUNITS_LDFLAGS) AM_CXXFLAGS = $(PTHREAD_CFLAGS) -DGYOTO_PREFIX=\"${prefix}\" # HEADERS: where they are, where to install them library_includedir=$(includedir)/Gyoto library_include_HEADERS=$(top_srcdir)/include/*.h # MAIN LIBRARY lib_LTLIBRARIES = libgyoto.la libgyoto_la_SOURCES = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ Worldline.C Photon.C Scenery.C \ WorldlineIntegState.C Error.C Screen.C Spectrum.C \ Spectrometer.C ComplexSpectrometer.C UniformSpectrometer.C \ ThinDisk.C Converters.C Functors.C Hooks.C libgyoto_la_LIBS = $(XERCESLDFLAGS) libgyoto_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSINFO) # STANDARD PLUGIN soverdir=$(pkglibdir)/@sovers@ sover_LTLIBRARIES = libgyoto-stdplug.la libgyoto_stdplug_la_SOURCES = KerrBL.C KerrKS.C \ Star.C FixedStar.C Torus.C \ PowerLawSpectrum.C BlackBodySpectrum.C \ ComplexAstrobj.C UniformSphere.C \ StandardAstrobj.C PageThorneDisk.C \ ThinDiskPL.C PolishDoughnut.C \ StdPlug.C # those files are used only if cfitsio is available cfitsio_stdplug_sources = PatternDisk.C PatternDiskBB.C DynamicalDisk.C \ Disk3D.C Disk3D_BB.C EXTRA_libgyoto_stdplug_la_SOURCES = $(cfitsio_stdplug_sources) if HAVE_CFITSIO libgyoto_stdplug_la_SOURCES += $(cfitsio_stdplug_sources) endif libgyoto_stdplug_la_LDFLAGS = -module -export-dynamic $(CFITSIOLDFLAGS) \ $(AM_LDFLAGS) # LORENE PLUGIN if HAVE_LORENE sover_LTLIBRARIES += libgyoto-lorene.la endif libgyoto_lorene_la_SOURCES = RotStar3_1.C LorenePlug.C libgyoto_lorene_la_LDFLAGS = -module -export-dynamic $(LORENELDFLAGS) $(AM_LDFLAGS) libgyoto_lorene_la_CPPFLAGS = $(AM_CPPFLAGS) $(LORENECPPFLAGS) # pkg-config file pkgconfigdir=$(libdir)/pkgconfig pkgconfig_DATA=gyoto.pc Gyoto-0.1.0/lib/Makefile.in000066400000000000000000000776661217470755400154660ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.6 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@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ target_triplet = @target@ @HAVE_CFITSIO_TRUE@am__append_1 = $(cfitsio_stdplug_sources) # LORENE PLUGIN @HAVE_LORENE_TRUE@am__append_2 = libgyoto-lorene.la subdir = lib DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/gyoto-uninstalled.pc.in \ $(srcdir)/gyoto.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(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)/m4/pkg.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 \ $(top_builddir)/include/GyotoConfig.h CONFIG_CLEAN_FILES = gyoto.pc gyoto-uninstalled.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soverdir)" \ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(library_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(sover_LTLIBRARIES) libgyoto_lorene_la_LIBADD = am_libgyoto_lorene_la_OBJECTS = libgyoto_lorene_la-RotStar3_1.lo \ libgyoto_lorene_la-LorenePlug.lo libgyoto_lorene_la_OBJECTS = $(am_libgyoto_lorene_la_OBJECTS) libgyoto_lorene_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libgyoto_lorene_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LORENE_TRUE@am_libgyoto_lorene_la_rpath = -rpath $(soverdir) libgyoto_stdplug_la_LIBADD = am__libgyoto_stdplug_la_SOURCES_DIST = KerrBL.C KerrKS.C Star.C \ FixedStar.C Torus.C PowerLawSpectrum.C BlackBodySpectrum.C \ ComplexAstrobj.C UniformSphere.C StandardAstrobj.C \ PageThorneDisk.C ThinDiskPL.C PolishDoughnut.C StdPlug.C \ PatternDisk.C PatternDiskBB.C DynamicalDisk.C Disk3D.C \ Disk3D_BB.C am__objects_1 = PatternDisk.lo PatternDiskBB.lo DynamicalDisk.lo \ Disk3D.lo Disk3D_BB.lo @HAVE_CFITSIO_TRUE@am__objects_2 = $(am__objects_1) am_libgyoto_stdplug_la_OBJECTS = KerrBL.lo KerrKS.lo Star.lo \ FixedStar.lo Torus.lo PowerLawSpectrum.lo BlackBodySpectrum.lo \ ComplexAstrobj.lo UniformSphere.lo StandardAstrobj.lo \ PageThorneDisk.lo ThinDiskPL.lo PolishDoughnut.lo StdPlug.lo \ $(am__objects_2) libgyoto_stdplug_la_OBJECTS = $(am_libgyoto_stdplug_la_OBJECTS) libgyoto_stdplug_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libgyoto_stdplug_la_LDFLAGS) $(LDFLAGS) -o $@ libgyoto_la_LIBADD = am_libgyoto_la_OBJECTS = Astrobj.lo Factory.lo Register.lo \ SmartPointer.lo Utils.lo Metric.lo Worldline.lo Photon.lo \ Scenery.lo WorldlineIntegState.lo Error.lo Screen.lo \ Spectrum.lo Spectrometer.lo ComplexSpectrometer.lo \ UniformSpectrometer.lo ThinDisk.lo Converters.lo Functors.lo \ Hooks.lo libgyoto_la_OBJECTS = $(am_libgyoto_la_OBJECTS) libgyoto_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libgyoto_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f 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 = $(libgyoto_lorene_la_SOURCES) $(libgyoto_stdplug_la_SOURCES) \ $(EXTRA_libgyoto_stdplug_la_SOURCES) $(libgyoto_la_SOURCES) DIST_SOURCES = $(libgyoto_lorene_la_SOURCES) \ $(am__libgyoto_stdplug_la_SOURCES_DIST) \ $(EXTRA_libgyoto_stdplug_la_SOURCES) $(libgyoto_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) HEADERS = $(library_include_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@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFITSIOCPPFLAGS = @CFITSIOCPPFLAGS@ CFITSIOLDFLAGS = @CFITSIOLDFLAGS@ CFITSIO_CFLAGS = @CFITSIO_CFLAGS@ CFITSIO_LIBS = @CFITSIO_LIBS@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DYLIB_VAR = @DYLIB_VAR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HOME_LORENE = @HOME_LORENE@ 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@ LORENECPPFLAGS = @LORENECPPFLAGS@ LORENELDFLAGS = @LORENELDFLAGS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_S = @MAKE_S@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYS = @SYS@ UDUNITS_CFLAGS = @UDUNITS_CFLAGS@ UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@ UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@ UDUNITS_LIBS = @UDUNITS_LIBS@ VERSINFO = @VERSINFO@ VERSION = @VERSION@ XERCESCPPFLAGS = @XERCESCPPFLAGS@ XERCESLDFLAGS = @XERCESLDFLAGS@ XERCES_CFLAGS = @XERCES_CFLAGS@ XERCES_LIBS = @XERCES_LIBS@ YORICK = @YORICK@ Y_INST_HOME = @Y_INST_HOME@ Y_INST_SITE = @Y_INST_SITE@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mySUBDIRS = @mySUBDIRS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkg_cflags = @pkg_cflags@ pkg_libs = @pkg_libs@ pkg_requires = @pkg_requires@ plugin_sfx = @plugin_sfx@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sovers = @sovers@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I@top_srcdir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) AM_LDFLAGS = $(XERCESLDFLAGS) -export-dynamic $(PTHREAD_LIBS) \ $(UDUNITS_LDFLAGS) AM_CXXFLAGS = $(PTHREAD_CFLAGS) -DGYOTO_PREFIX=\"${prefix}\" # HEADERS: where they are, where to install them library_includedir = $(includedir)/Gyoto library_include_HEADERS = $(top_srcdir)/include/*.h # MAIN LIBRARY lib_LTLIBRARIES = libgyoto.la libgyoto_la_SOURCES = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ Worldline.C Photon.C Scenery.C \ WorldlineIntegState.C Error.C Screen.C Spectrum.C \ Spectrometer.C ComplexSpectrometer.C UniformSpectrometer.C \ ThinDisk.C Converters.C Functors.C Hooks.C libgyoto_la_LIBS = $(XERCESLDFLAGS) libgyoto_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSINFO) # STANDARD PLUGIN soverdir = $(pkglibdir)/@sovers@ sover_LTLIBRARIES = libgyoto-stdplug.la $(am__append_2) libgyoto_stdplug_la_SOURCES = KerrBL.C KerrKS.C Star.C FixedStar.C \ Torus.C PowerLawSpectrum.C BlackBodySpectrum.C \ ComplexAstrobj.C UniformSphere.C StandardAstrobj.C \ PageThorneDisk.C ThinDiskPL.C PolishDoughnut.C StdPlug.C \ $(am__append_1) # those files are used only if cfitsio is available cfitsio_stdplug_sources = PatternDisk.C PatternDiskBB.C DynamicalDisk.C \ Disk3D.C Disk3D_BB.C EXTRA_libgyoto_stdplug_la_SOURCES = $(cfitsio_stdplug_sources) libgyoto_stdplug_la_LDFLAGS = -module -export-dynamic $(CFITSIOLDFLAGS) \ $(AM_LDFLAGS) libgyoto_lorene_la_SOURCES = RotStar3_1.C LorenePlug.C libgyoto_lorene_la_LDFLAGS = -module -export-dynamic $(LORENELDFLAGS) $(AM_LDFLAGS) libgyoto_lorene_la_CPPFLAGS = $(AM_CPPFLAGS) $(LORENECPPFLAGS) # pkg-config file pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gyoto.pc all: all-am .SUFFIXES: .SUFFIXES: .C .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) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/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): gyoto.pc: $(top_builddir)/config.status $(srcdir)/gyoto.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gyoto-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/gyoto-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-soverLTLIBRARIES: $(sover_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(sover_LTLIBRARIES)'; test -n "$(soverdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(soverdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(soverdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(soverdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(soverdir)"; \ } uninstall-soverLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(sover_LTLIBRARIES)'; test -n "$(soverdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(soverdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(soverdir)/$$f"; \ done clean-soverLTLIBRARIES: -test -z "$(sover_LTLIBRARIES)" || rm -f $(sover_LTLIBRARIES) @list='$(sover_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgyoto-lorene.la: $(libgyoto_lorene_la_OBJECTS) $(libgyoto_lorene_la_DEPENDENCIES) $(EXTRA_libgyoto_lorene_la_DEPENDENCIES) $(libgyoto_lorene_la_LINK) $(am_libgyoto_lorene_la_rpath) $(libgyoto_lorene_la_OBJECTS) $(libgyoto_lorene_la_LIBADD) $(LIBS) libgyoto-stdplug.la: $(libgyoto_stdplug_la_OBJECTS) $(libgyoto_stdplug_la_DEPENDENCIES) $(EXTRA_libgyoto_stdplug_la_DEPENDENCIES) $(libgyoto_stdplug_la_LINK) -rpath $(soverdir) $(libgyoto_stdplug_la_OBJECTS) $(libgyoto_stdplug_la_LIBADD) $(LIBS) libgyoto.la: $(libgyoto_la_OBJECTS) $(libgyoto_la_DEPENDENCIES) $(EXTRA_libgyoto_la_DEPENDENCIES) $(libgyoto_la_LINK) -rpath $(libdir) $(libgyoto_la_OBJECTS) $(libgyoto_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Astrobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BlackBodySpectrum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ComplexAstrobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ComplexSpectrometer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Converters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Disk3D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Disk3D_BB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynamicalDisk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FixedStar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Functors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Hooks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KerrBL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KerrKS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Metric.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PageThorneDisk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PatternDisk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PatternDiskBB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Photon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PolishDoughnut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PowerLawSpectrum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Register.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Scenery.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Screen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SmartPointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Spectrometer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Spectrum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StandardAstrobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Star.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StdPlug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ThinDisk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ThinDiskPL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Torus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniformSpectrometer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniformSphere.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Worldline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WorldlineIntegState.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgyoto_lorene_la-LorenePlug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Plo@am__quote@ .C.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 $@ $< .C.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) '$<'` .C.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 $@ $< libgyoto_lorene_la-RotStar3_1.lo: RotStar3_1.C @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgyoto_lorene_la-RotStar3_1.lo -MD -MP -MF $(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Tpo -c -o libgyoto_lorene_la-RotStar3_1.lo `test -f 'RotStar3_1.C' || echo '$(srcdir)/'`RotStar3_1.C @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Tpo $(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RotStar3_1.C' object='libgyoto_lorene_la-RotStar3_1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgyoto_lorene_la-RotStar3_1.lo `test -f 'RotStar3_1.C' || echo '$(srcdir)/'`RotStar3_1.C libgyoto_lorene_la-LorenePlug.lo: LorenePlug.C @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgyoto_lorene_la-LorenePlug.lo -MD -MP -MF $(DEPDIR)/libgyoto_lorene_la-LorenePlug.Tpo -c -o libgyoto_lorene_la-LorenePlug.lo `test -f 'LorenePlug.C' || echo '$(srcdir)/'`LorenePlug.C @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libgyoto_lorene_la-LorenePlug.Tpo $(DEPDIR)/libgyoto_lorene_la-LorenePlug.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LorenePlug.C' object='libgyoto_lorene_la-LorenePlug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgyoto_lorene_la-LorenePlug.lo `test -f 'LorenePlug.C' || echo '$(srcdir)/'`LorenePlug.C mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-library_includeHEADERS: $(library_include_HEADERS) @$(NORMAL_INSTALL) @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(library_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(library_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(library_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(library_includedir)" || exit $$?; \ done uninstall-library_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(library_includedir)'; $(am__uninstall_files_from_dir) 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 $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soverdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(library_includedir)"; 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-generic clean-libLTLIBRARIES clean-libtool \ clean-soverLTLIBRARIES 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-library_includeHEADERS install-pkgconfigDATA \ install-soverLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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-libLTLIBRARIES \ uninstall-library_includeHEADERS uninstall-pkgconfigDATA \ uninstall-soverLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-soverLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ install-library_includeHEADERS install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-soverLTLIBRARIES 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-libLTLIBRARIES \ uninstall-library_includeHEADERS uninstall-pkgconfigDATA \ uninstall-soverLTLIBRARIES # 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: Gyoto-0.1.0/lib/Metric.C000066400000000000000000000271311217470755400147260ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include #include #include "GyotoMetric.h" #include "GyotoFactoryMessenger.h" #include "GyotoConverters.h" #include #include #include using namespace std ; using namespace Gyoto; Register::Entry* Metric::Register_ = NULL; // Default constructor Metric::Generic::Generic() : mass_(1.), coordkind_(GYOTO_COORDKIND_UNSPECIFIED) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif setKind("Unspecified"); } Metric::Generic::Generic(const double mass, const int coordkind) : mass_(mass), coordkind_(coordkind) { # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG; GYOTO_DEBUG_EXPR(mass_); GYOTO_DEBUG_EXPR(coordkind_); GYOTO_ENDIF_DEBUG; # endif setKind("Unspecified"); } Metric::Generic::Generic(const int coordkind) : mass_(1.), coordkind_(coordkind) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(coordkind_); # endif setKind("Unspecified"); } // No copy constructor needed, default is fine Metric::Generic * Metric::Generic::clone() const { string msg = "Metric::Generic::clone() called: cloning not supported for metric kind "; msg += getKind(); throwError (msg); return const_cast(this); // to avoid warning } Metric::Generic::~Generic(){ # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } // Output const string Metric::Generic::getKind() const {return kind_;} void Metric::Generic::setKind(const string src) { kind_ = src;} /***************Definition of the physical scene**************/ void Metric::Generic::setMass(const double mass) { mass_=mass; tellListeners(); } void Metric::Generic::setMass(const double mass, const string &unit) { # ifdef GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_EXPR(mass); GYOTO_DEBUG_EXPR(unit); GYOTO_ENDIF_DEBUG # endif setMass(Units::ToKilograms(mass, unit)); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "(mass="<=0) { GYOTO_WARNING << "v>c\n"; return 0.; } return pow(-sum, -0.5); } void Metric::Generic::nullifyCoord(double coord[8]) const { double tdot2; nullifyCoord(coord, tdot2); } void Metric::Generic::nullifyCoord(double coord[8], double& tdot2) const { int i, j; double a, b=0., c=0.; a=gmunu(coord, 0, 0); for (i=1;i<=3;++i) { b+=gmunu(coord, 0, i)*coord[4+i]; for (j=1;j<=3;++j) { c+=gmunu(coord, i, j)*coord[4+i]*coord[4+j]; } } double sDelta=sqrt(b*b-a*c), am1=1./a; tdot2=(-b+sDelta)*am1; coord[4]=(-b-sDelta)*am1; } double Metric::Generic::ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const { double res=0.; for (int i=0;i<4;i++) { for (int j=0;j<4;j++) { res+=gmunu(pos, i, j)*u1[i]*u2[j]; } } return res; } double Metric::Generic::Norm3D(double* pos) const { throwError("Check Norm3D"); double res=0.; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { res+=gmunu(pos,i+1, j+1)*pos[i]*pos[j]; } } return sqrt(res); } /***************Geodesic most general integration**************/ /* Let : Y=[x0,x1,x2,x3,x0_dot,x1_dot,x2_dot,x3_dot] (dot=d/dtau, tau=proper time) diff is such as : Y_dot=diff(Y) The general equation of geodesics is used. */ int Metric::Generic::diff(const double coord[8], double res[8]) const{ # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif res[0]=coord[4]; res[1]=coord[5]; res[2]=coord[6]; res[3]=coord[7]; res[4]=res[5]=res[6]=res[7]=0.; for (int i=0;i<4;i++) { for (int j=0;j<4;j++) { res[4]-=christoffel(coord,0,i,j)*coord[4+i]*coord[4+j]; res[5]-=christoffel(coord,1,i,j)*coord[4+i]*coord[4+j]; res[6]-=christoffel(coord,2,i,j)*coord[4+i]*coord[4+j]; res[7]-=christoffel(coord,3,i,j)*coord[4+i]*coord[4+j]; } } return 0; } /*Runge Kutta to order 4 */ //int Metric::Generic::myrk4(const double y[6], const double* cst , double h, double* res) const{ int Metric::Generic::myrk4(Worldline *, const double coord[8], double h, double res[8]) const{ //cout << "In Metric::Generic::myrk4" << endl; double k1[8] ; double k2[8] ; double k3[8] ; double k4[8] ; double coord_plus_halfk1[8] ; double sixth_k1[8] ; double coord_plus_halfk2[8] ; double third_k2[8] ; double coord_plus_k3[8] ; double third_k3[8] ; double sixth_k4[8] ; if (diff(coord, k1)) return 1 ; for (int i=0;i<8;i++) { k1[i]=h*k1[i]; coord_plus_halfk1[i]=coord[i]+0.5*k1[i]; sixth_k1[i]=1./6.*k1[i]; } if (diff(coord_plus_halfk1,k2)) return 1 ; for (int i=0;i<8;i++) { k2[i]=h*k2[i]; coord_plus_halfk2[i]=coord[i]+0.5*k2[i]; third_k2[i]=1./3.*k2[i]; } if (diff(coord_plus_halfk2,k3)) return 1 ; for (int i=0;i<8;i++) { k3[i]=h*k3[i]; coord_plus_k3[i]=coord[i]+k3[i]; third_k3[i]=1./3.*k3[i]; } if (diff(coord_plus_k3,k4)) return 1 ; for (int i=0;i<8;i++) { k4[i]=h*k4[i]; sixth_k4[i]=1./6.*k4[i]; } for (int i=0;i<8;i++) { res[i]=coord[i]+sixth_k1[i]+third_k2[i]+third_k3[i]+sixth_k4[i]; } return 0; } void Metric::Generic::circularVelocity(double const * , double*, double) const { stringstream ss; ss << kind_ << "::circularVelocity() is not implemented"; throwError(ss.str()); } void Metric::Generic::cartesianVelocity(double const coord[8], double vel[3]) { double tauprime; switch(coordkind_) { case GYOTO_COORDKIND_SPHERICAL: { double r = coord[1]; double costheta = cos(coord[2]), sintheta = sin(coord[2]); double cosphi = cos(coord[3]), sinphi = sin(coord[3]); tauprime = 1./coord[4]; double rprime = coord[5]*tauprime; double thetaprime = coord[6]*tauprime; double phiprime = coord[7]*tauprime; vel[0] = rprime * sintheta * cosphi + r * thetaprime * costheta * cosphi - r * phiprime * sintheta * sinphi; vel[1] = rprime * sintheta * sinphi + r * thetaprime * costheta * sinphi + r * phiprime * cosphi; vel[2] = rprime * costheta - r * thetaprime * sintheta ; } break; case GYOTO_COORDKIND_CARTESIAN: tauprime = 1./coord[4]; vel[0] = coord[5]*tauprime; vel[1] = coord[6]*tauprime; vel[2] = coord[7]*tauprime; break; default: Gyoto::throwError ("Metric::Generic::cartesianVelocity: unknown coordinate kind"); } } int Metric::Generic::myrk4_adaptive(Worldline* line, const double * coord, double lastnorm , double normref, double* coordnew , double h0, double& h1) const{ double delta0[8]; double delta0min=1e-15; double dcoord[8]; double eps=0.0001; double S=0.9; double errmin=1e-6; double h1min=0.001; double h1max=1e6; double factnorm=2.; //cout << "1st diff" << endl; diff(coord,dcoord) ; for (int i = 0;i<8;i++) delta0[i]=delta0min+eps*(fabs(h0*dcoord[i])); double hbis=0.5*h0; double coordhalf[8]; double coord2[8]; double delta1[8]; double err; int count=0; double newnorm; /*cout << "coord= "; for (int jj=0;jj<8;jj++) { cout << coord[jj] << " " ; } cout << endl;*/ while (1){ count++; //cout << "count in rk Met= " << count << endl; err=0.; //cout << "then diff" << endl; myrk4(line,coord,h0,coordnew); myrk4(line,coord,hbis,coordhalf); myrk4(line,coordhalf,hbis,coord2); //cout << "end then diff" << endl; /* cout << "coordnew= "; for (int jj=0;jj<8;jj++) { cout << coordnew[jj] << " " ; } cout << endl;*/ for (int i = 0;i<8;i++){ delta1[i]=coord2[i]-coordnew[i]; if (err1) { h0=S*h0*pow(err,-0.25); hbis=0.5*h0; }else{ h1=(err > errmin ? S*h0*pow(err,-0.2) : 4.*h0);//pour éviter les explosions if (fabs(h1)0.)?h1min:-h1min; if (fabs(h1)>h1max) h1=(h0>0.)?h1max:-h1max; //Testing tangent vector norm stays next to 0 : newnorm=ScalarProd(coordnew, coordnew+4, coordnew+4); if ( fabs(newnorm-normref) > factnorm*fabs(lastnorm-normref) ) { //cout << "norm big!" << endl; //cout << "newnorm= " << newnorm << endl; //myrk4(coord,h0/10.,coordnew); //h1/=10.; } //cout << "Metric.C: step used= " << h0 << endl; break; } } return 0; } double Metric::Generic::unitLength() const { return mass_ * GYOTO_G_OVER_C_SQUARE; } double Metric::Generic::unitLength(const string &unit) const { return Units::FromMeters(unitLength(), unit); } int Metric::Generic::isStopCondition(double const * const ) const { return 0; } void Metric::Generic::setParticleProperties(Worldline*, const double*) const { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } /***************For SmartPointers**************/ int Metric::Generic::getRefCount() { return SmartPointee::getRefCount(); } #ifdef GYOTO_USE_XERCES void Metric::Generic::fillElement(Gyoto::FactoryMessenger *fmp) { fmp -> setSelfAttribute("kind", kind_); fmp -> setParameter("Mass", getMass()); } void Metric::Generic::setParameter(string name, string content, string unit) { if(name=="Mass") setMass(atof(content.c_str()), unit); } void Metric::Generic::setParameters(Gyoto::FactoryMessenger *fmp) { string name="", content="", unit=""; if (fmp) while (fmp->getNextParameter(&name, &content, &unit)) setParameter(name, content, unit); } void Metric::Generic::processGenericParameters(Gyoto::FactoryMessenger *fmp) { if (!fmp) return; string name="", content=""; fmp -> reset(); while (fmp->getNextParameter(&name, &content)) { if(name=="Mass") setMass(atof(content.c_str()), fmp -> getAttribute("unit")); } } void Metric::initRegister() { if (Gyoto::Metric::Register_) delete Gyoto::Metric::Register_; Gyoto::Metric::Register_ = NULL; } void Gyoto::Metric::Register(std::string name, Metric::Subcontractor_t* scp) { Register::Entry* ne = new Register::Entry(name, (Gyoto::SmartPointee::Subcontractor_t*) scp, Gyoto::Metric::Register_); Gyoto::Metric::Register_ = ne; } Metric::Subcontractor_t* Metric::getSubcontractor(std::string name, int errmode) { if (!Gyoto::Metric::Register_) throwError("No Metric kind registered!"); return (Metric::Subcontractor_t*)Gyoto::Metric::Register_ -> getSubcontractor(name, errmode); } #endif Gyoto-0.1.0/lib/PageThorneDisk.C000066400000000000000000000201061217470755400163450ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoPhoton.h" #include "GyotoPageThorneDisk.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; PageThorneDisk::PageThorneDisk() : ThinDisk("PageThorneDisk"), aa_(0.), aa2_(0.), x0_(0.), x1_(0.), x2_(0.), x3_(0.), rednoise_(0), uniflux_(0) { if (debug()) cerr << "DEBUG: PageThorneDisk Construction" << endl; } PageThorneDisk::PageThorneDisk(const PageThorneDisk& o) : ThinDisk(o), aa_(o.aa_), aa2_(o.aa2_), x0_(o.x0_), x1_(o.x1_), x2_(o.x2_), x3_(o.x3_), rednoise_(o.rednoise_), uniflux_(o.uniflux_) { if (o.gg_()) gg_=o.gg_->clone(); Generic::gg_=gg_; gg_->hook(this); } PageThorneDisk* PageThorneDisk::clone() const { return new PageThorneDisk(*this); } PageThorneDisk::~PageThorneDisk() { GYOTO_DEBUG<unhook(this); } void PageThorneDisk::updateSpin() { if (!gg_) return; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: aa_ = static_cast >(gg_) -> getSpin(); break; case GYOTO_COORDKIND_CARTESIAN: aa_ = static_cast >(gg_) -> getSpin(); break; default: throwError("PageThorneDisk::getSpin(): unknown COORDKIND"); } aa2_=aa_*aa_; double z1 =1.+pow((1.-aa2_),1./3.)*(pow((1.+ aa_),1./3.)+pow((1.-aa_),1./3.)); double z2 = pow(3.*aa2_ + z1*z1,0.5); double acosaao3= acos(aa_)/3.; x0_ = sqrt((3. + z2 - pow((3. - z1)*(3. + z1 + 2.*z2),0.5))); x1_ = 2.*cos(acosaao3 - M_PI/3.); x2_ = 2.*cos(acosaao3 + M_PI/3.); x3_ = -2.*cos(acosaao3); rin_=(3.+z2-sqrt((3.-z1)*(3.+z1+2.*z2))); } void PageThorneDisk::setMetric(SmartPointer gg) { if (gg_) gg_->unhook(this); string kind = gg->getKind(); if (kind != "KerrBL" && kind != "KerrKS" && kind != "ChernSimons") throwError ("PageThorneDisk::setMetric(): metric must be KerrBL or KerrKS"); ThinDisk::setMetric(gg); updateSpin(); gg->hook(this); } double PageThorneDisk::emission(double nu_em, double dsem, double *, double coord_obj[8]) const{ throwError("not implemented"); } Quantity_t PageThorneDisk::getDefaultQuantities() { return GYOTO_QUANTITY_USER4; } double PageThorneDisk::bolometricEmission(double dsem, double coord_obj[8]) const{ //See Page & Thorne 74 Eqs. 11b, 14, 15. This is F(r). // Important remark: this emision function gives I(r), // not I_nu(r). And I(r)/nu^4 is conserved. // cout << "r hit= " << coord_obj[1] << endl; if (uniflux_) return 1; double xx; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: xx=sqrt(coord_obj[1]); break; case GYOTO_COORDKIND_CARTESIAN: xx=pow(coord_obj[1]*coord_obj[1]+coord_obj[2]*coord_obj[2]-aa2_, 0.25); break; default: throwError("Unknown coordinate system kind"); xx=0; } // the above formula assume M=1 (x=sqrt(r/M)=sqrt(r)) double x2=xx*xx; double ff= 3./(2.)*1./(xx*xx*(xx*xx*xx-3.*xx+2.*aa_)) *( xx-x0_-3./2.*aa_*log(xx/x0_) -3.*(x1_-aa_)*(x1_-aa_)/(x1_*(x1_-x2_)*(x1_-x3_))*log((xx-x1_) /(x0_-x1_)) -3.*(x2_-aa_)*(x2_-aa_)/(x2_*(x2_-x1_)*(x2_-x3_))*log((xx-x2_) /(x0_-x2_)) -3.*(x3_-aa_)*(x3_-aa_)/(x3_*(x3_-x1_)*(x3_-x2_))*log((xx-x3_) /(x0_-x3_)) ); // f of Page&Thorne, in units M=1 double Iem=ff/(4.*M_PI*M_PI*x2); /* with Mdot=1 (NB: Mdot is a constant) Assuming isotropic emission: flux at r = (I at r)* \int cos\theta dOmega = pi*I thus intensity is only: 1/pi * flux NB: this is frequency integrated (bolometric) intensity, not I_nu NBB: the cgs value of I is c^6/G^2*Mdot/M^2 * Iem, it can be recovered from the dimensionless Iem a posteriori if needed */ if (flag_radtransf_) Iem *= dsem; GYOTO_DEBUG_EXPR(Iem); if (rednoise_) { double rr=coord_obj[1], r32 = pow(rr,1.5), tt=coord_obj[0], cst_aa=0.1*sqrt(6), // amplitude cst cst_tt=1.; // period cst srand (time(NULL)); double random = double(rand() % 100)/100. ; Iem*=1.+cst_aa*random*pow(rr,-0.5)*sin(cst_tt*1./r32*tt); if (Iem < 0.) throwError("In PageThorneDisk::bolometricEmission" " rednoised emission is negative!"); } return Iem; } void PageThorneDisk::processHitQuantities(Photon* ph, double* coord_ph_hit, double* coord_obj_hit, double dt, Properties* data) const { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif /* NB: freqObs is the observer's frequency chosen in Screen::getRayCoord for the actual computation of the geodesic ; the physical value of nuobs will be used in spectrum computations by resorting to the xml specifications of the user (see below) ; this freqObs is used to transform the null worldline parameter dlambda (see below) */ double freqObs=ph->getFreqObs(); // this is a useless quantity, always 1 double dlambda = dt/coord_ph_hit[4]; //dlambda = dt/tdot double ggredm1 = -gg_->ScalarProd(coord_ph_hit,coord_obj_hit+4, coord_ph_hit+4);// / 1.; //this is nu_em/nu_obs double ggred = 1./ggredm1; //this is nu_obs/nu_em if (uniflux_) ggred=1.; double dsem = dlambda*ggredm1; // *1. double inc =0.; if (data) { #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "data requested. " << ", ggredm1=" << ggredm1 << ", ggred=" << ggred << endl; #endif if (data->redshift) { *data->redshift=ggred; #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(*data->redshift); #endif } if (data->time) { *data->time=coord_ph_hit[0]; #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(*data->time); #endif } if (data->impactcoords) { memcpy(data->impactcoords, coord_obj_hit, 8 * sizeof(double)); memcpy(data->impactcoords+8, coord_ph_hit, 8 * sizeof(double)); } #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "dlambda = (dt="<< dt << ")/(tdot="<< coord_ph_hit[4] << ") = " << dlambda << ", dsem=" << dsem << endl; #endif if (data->intensity) throwError("unimplemented"); else if (data->user4) { inc = (bolometricEmission(dsem, coord_obj_hit)) * (ph -> getTransmission(size_t(-1))) * ggred*ggred*ggred*ggred; // I/nu^4 invariant *data->user4 += inc; #if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(*data->user4); #endif } if (data->binspectrum) throwError("unimplemented"); if (data->spectrum) throwError("unimplemented"); /* update photon's transmission */ ph -> transmit(size_t(-1), transmission(freqObs*ggredm1, dsem,coord_ph_hit)); } else { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "NO data requested!" << endl; # endif } } void PageThorneDisk::tell(Hook::Teller* msg) { updateSpin(); } int PageThorneDisk::setParameter(std::string name, std::string content, std::string unit) { char* tc = const_cast(content.c_str()); if (name=="RedNoise") rednoise_=1; if (name=="UniFlux") uniflux_=1; else return ThinDisk::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void PageThorneDisk::fillElement(FactoryMessenger *fmp) const { fmp->setMetric(gg_); ThinDisk::fillElement(fmp); } #endif Gyoto-0.1.0/lib/PatternDisk.C000066400000000000000000000566271217470755400157470ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #define throwCfitsioError(status) \ { fits_get_errstatus(status, ermsg); throwError(ermsg); } #include "GyotoPhoton.h" #include "GyotoPatternDisk.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; PatternDisk::PatternDisk() : ThinDisk("PatternDisk"), filename_(""), emission_(NULL), opacity_(NULL), velocity_(NULL), radius_(NULL), Omega_(0.), t0_(0.), dnu_(1.), nu0_(0), nnu_(0), dphi_(0.), phimin_(0.), nphi_(0), phimax_(2*M_PI), repeat_phi_(1), dr_(0.), nr_(0) { GYOTO_DEBUG << "PatternDisk Construction" << endl; } PatternDisk::PatternDisk(const PatternDisk& o) : ThinDisk(o), filename_(o.filename_), emission_(NULL), opacity_(NULL), velocity_(NULL), radius_(NULL), Omega_(o.Omega_), t0_(o.t0_), dnu_(o.dnu_), nu0_(o.nu0_), nnu_(o.nnu_), dphi_(o.dphi_), phimin_(o.phimin_), nphi_(o.nphi_), phimax_(o.phimax_), repeat_phi_(o.repeat_phi_), dr_(o.dr_), nr_(o.nr_) { GYOTO_DEBUG << "PatternDisk Copy" << endl; size_t ncells = 0; if (o.emission_) { emission_ = new double[ncells = nnu_ * nphi_ * nr_]; memcpy(emission_, o.emission_, ncells * sizeof(double)); } if (o.opacity_) { opacity_ = new double[ncells = nnu_ * nphi_ * nr_]; memcpy(opacity_, o.opacity_, ncells * sizeof(double)); } if (o.velocity_) { velocity_ = new double[ncells = 2 * nphi_ * nr_]; memcpy(velocity_, o.velocity_, ncells * sizeof(double)); } if (o.radius_) { radius_ = new double[ncells = 2 * nphi_ * nr_]; memcpy(radius_, o.radius_, ncells * sizeof(double)); } } PatternDisk* PatternDisk::clone() const { return new PatternDisk(*this); } PatternDisk::~PatternDisk() { GYOTO_DEBUG << "PatternDisk Destruction" << endl; if (emission_) delete [] emission_; if (opacity_) delete [] opacity_; if (velocity_) delete [] velocity_; if (radius_) delete [] radius_; } void PatternDisk::setEmission(double * pattern) { emission_ = pattern; } void PatternDisk::setVelocity(double * pattern) { velocity_ = pattern; } void PatternDisk::setRadius(double * pattern) { radius_ = pattern; } void PatternDisk::copyIntensity(double const *const pattern, size_t const naxes[3]) { GYOTO_DEBUG << endl; if (emission_) { GYOTO_DEBUG << "delete [] emission_;" << endl; delete [] emission_; emission_ = NULL; } if (pattern) { size_t nel; if (nnu_ != naxes[0]) { if (opacity_) { delete [] opacity_; opacity_ = NULL; } } if (nphi_ != naxes[1]) { GYOTO_DEBUG <<"nphi_ changed, freeing velocity_" << endl; if (opacity_) { delete [] opacity_; opacity_ = NULL; } if (velocity_) { delete [] velocity_; velocity_= NULL; } } if (nr_ != naxes[2]) { GYOTO_DEBUG <<"nr_ changed, freeing velocity_ and radius_" << endl; if (opacity_) { delete [] opacity_; opacity_ = NULL; } if (velocity_) { delete [] velocity_; velocity_= NULL; } if (radius_) { delete [] radius_; radius_ = NULL; } } if (!(nel=(nnu_ = naxes[0]) * (nphi_=naxes[1]) * (nr_=naxes[2]))) throwError( "dimensions can't be null"); if (nr_==1 || nphi_==1) throwError("In PatternDisk::copyIntensity: dimensions should be >1"); dr_ = (rout_ - rin_) / double(nr_-1); if (repeat_phi_==0.) throwError("In PatternDisk::copyIntensity: repeat_phi is 0!"); dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); GYOTO_DEBUG << "allocate emission_;" << endl; emission_ = new double[nel]; GYOTO_DEBUG << "pattern >> emission_" << endl; memcpy(emission_, pattern, nel*sizeof(double)); } } double const * PatternDisk::getIntensity() const { return emission_; } void PatternDisk::getIntensityNaxes( size_t naxes[3] ) const { naxes[0] = nnu_; naxes[1] = nphi_; naxes[2] = nr_; } void PatternDisk::copyOpacity(double const *const opacity, size_t const naxes[3]) { GYOTO_DEBUG << endl; if (opacity_) { GYOTO_DEBUG << "delete [] opacity_;" << endl; delete [] opacity_; opacity_ = NULL; flag_radtransf_=0; } if (opacity) { if (nnu_ != naxes[0] || nphi_ != naxes[1] || nr_ != naxes[2]) throwError("Please set intensity before opacity. " "The two arrays must have the same dimensions."); GYOTO_DEBUG << "allocate opacity_;" << endl; opacity_ = new double[nnu_ * nphi_ * nr_]; GYOTO_DEBUG << "opacity >> opacity_" << endl; memcpy(opacity_, opacity, nnu_ * nphi_ * nr_ * sizeof(double)); flag_radtransf_=1; } } double const * PatternDisk::getOpacity() const { return opacity_; } void PatternDisk::copyVelocity(double const *const velocity, size_t const naxes[2]) { GYOTO_DEBUG << endl; if (velocity_) { GYOTO_DEBUG << "delete [] velocity_;\n"; delete [] velocity_; velocity_ = NULL; } if (velocity) { if (!emission_) throwError("Please use copyIntensity() before copyVelocity()"); if (nphi_ != naxes[0] || nr_ != naxes[1]) throwError("emission_ and velocity_ have inconsistent dimensions"); GYOTO_DEBUG << "allocate velocity_;" << endl; velocity_ = new double[2*nphi_*nr_]; GYOTO_DEBUG << "velocity >> velocity_" << endl; memcpy(velocity_, velocity, 2*nphi_*nr_*sizeof(double)); } } double const * PatternDisk::getVelocity() const { return velocity_; } void PatternDisk::copyGridRadius(double const *const radius, size_t nr) { GYOTO_DEBUG << endl; if (radius_) { GYOTO_DEBUG << "delete [] radius_;" << endl; delete [] radius_; radius_ = NULL; } if (radius) { if (!emission_) throwError("Please use copyIntensity() before copyGridRadius()"); if (nr_ != nr) throwError("emission_ and radius_ have inconsistent dimensions"); GYOTO_DEBUG << "allocate velocity_;" << endl; radius_ = new double[nr_]; GYOTO_DEBUG << "velocity >> velocity_" << endl; memcpy(radius_, radius, nr_*sizeof(double)); rin_=radius_[0]; rout_=radius_[nr_-1]; } } double const * PatternDisk::getGridRadius() const { return radius_; } void PatternDisk::repeatPhi(size_t n) { repeat_phi_ = n; if ((nphi_-1)*repeat_phi_>0) dphi_=(phimax_-phimin_)/double((nphi_-1)*repeat_phi_); } size_t PatternDisk::repeatPhi() const { return repeat_phi_; } void PatternDisk::nu0(double freq) { nu0_ = freq; } double PatternDisk::nu0() const { return nu0_; } void PatternDisk::dnu(double dfreq) { dnu_ = dfreq; } double PatternDisk::dnu() const { return dnu_; } void PatternDisk::phimin(double phimn) { phimin_ = phimn; if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double PatternDisk::phimin() const {return phimin_;} void PatternDisk::phimax(double phimx) { phimax_ = phimx; if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double PatternDisk::phimax() const {return phimax_;} void PatternDisk::fitsRead(string filename) { GYOTO_MSG << "PatternDisk reading FITS file: " << filename << endl; filename_ = filename; int rin_set=0, rout_set=0; char* pixfile = const_cast(filename_.c_str()); fitsfile* fptr = NULL; int status = 0; int anynul = 0; long tmpl; double tmpd; long naxes [] = {1, 1, 1}; long fpixel[] = {1,1,1}; long inc [] = {1,1,1}; char ermsg[31] = ""; // ermsg is used in throwCfitsioError() GYOTO_DEBUG << "PatternDisk::readFile(): opening file" << endl; if (fits_open_file(&fptr, pixfile, 0, &status)) throwCfitsioError(status) ; ////// READ FITS KEYWORDS COMMON TO ALL TABLES /////// //get Omega and t0; GYOTO_DEBUG << "PatternDisk::readFile(): read Omega_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO PatternDisk Omega", &tmpd, NULL, &status); if (status) { if (status == KEY_NO_EXIST) status = 0; // not fatal else throwCfitsioError(status) ; } else Omega_ = tmpd; // Omega_ found GYOTO_DEBUG << "PatternDisk::readFile(): read t0_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO PatternDisk t0", &tmpd, NULL, &status); if (status) { if (status == KEY_NO_EXIST) status = 0; // not fatal else throwCfitsioError(status) ; } else t0_ = tmpd; // T0_ found GYOTO_DEBUG << "PatternDisk::readFile(): read RepeatPhi_" << endl; fits_read_key(fptr, TLONG, "GYOTO PatternDisk RepeatPhi", &tmpl, NULL, &status); if (status) { if (status == KEY_NO_EXIST) status = 0; // not fatal else throwCfitsioError(status) ; } else repeat_phi_ = size_t(tmpl); // RepeatPhi found GYOTO_DEBUG << "PatternDisk::readFile(): read InnerRadius_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO ThinDisk InnerRadius", &tmpd, NULL, &status); if (status) { if (status == KEY_NO_EXIST) status = 0; // not fatal else throwCfitsioError(status) ; } else { rin_ = tmpd; // InnerRadius found rin_set=1; } GYOTO_DEBUG << "PatternDisk::readFile(): read OuterRadius_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO ThinDisk OuterRadius", &tmpd, NULL, &status); if (status) { if (status == KEY_NO_EXIST) status = 0; // not fatal else throwCfitsioError(status) ; } else { rout_ = tmpd; // OuterRadius found rout_set=1; } GYOTO_DEBUG << "PatternDisk::fitsRead(): read Phimin_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO PatternDisk Phimin", &tmpd, NULL, &status); if (status) { if (status == KEY_NO_EXIST) { status = 0; // not fatal phimin_=0.; //phimin defaults to 0 } else throwCfitsioError(status) ; } else { phimin_ = tmpd; // Phimin found } GYOTO_DEBUG << "PatternDisk::fitsRead(): read Phimax_" << endl; fits_read_key(fptr, TDOUBLE, "GYOTO PatternDisk Phimax", &tmpd, NULL, &status); if (status) { if (status == KEY_NO_EXIST) { status = 0; // not fatal phimax_=2.*M_PI; //phimin defaults to 0 } else throwCfitsioError(status) ; } else { phimax_ = tmpd; // Phimax found } ////// FIND MANDATORY EMISSION HDU, READ KWDS & DATA /////// GYOTO_DEBUG << "PatternDisk::readFile(): search emission HDU" << endl; if (fits_movnam_hdu(fptr, ANY_HDU, const_cast("GYOTO PatternDisk emission"), 0, &status)) throwCfitsioError(status) ; GYOTO_DEBUG << "PatternDisk::readFile(): get image size" << endl; if (fits_get_img_size(fptr, 3, naxes, &status)) throwCfitsioError(status) ; //update nu0_, nnu_, dnu_; nnu_ = naxes[0]; double CRPIX1; GYOTO_DEBUG << "PatternDisk::readFile(): read CRPIX1, CRVAL1, CDELT1" << endl; fits_read_key(fptr, TDOUBLE, "CRVAL1", &nu0_, NULL, &status); fits_read_key(fptr, TDOUBLE, "CDELT1", &dnu_, NULL, &status); fits_read_key(fptr, TDOUBLE, "CRPIX1", &CRPIX1, NULL, &status); if (status) throwCfitsioError(status) ; if (CRPIX1 != 1) nu0_ -= dnu_*(CRPIX1 - 1.); // update repeat_phi_, nphi_, dphi_ nphi_ = naxes[1]; if (nphi_==1 || repeat_phi_==0) throwError("In PatternDisk::fitsRead: nphi is 1 or repeat_phi is 0!"); dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); // update rin_, rout_, nr_, dr_ nr_ = naxes[2]; if (emission_) { delete [] emission_; emission_ = NULL; } emission_ = new double[nnu_ * nphi_ * nr_]; if (debug()) cerr << "PatternDisk::readFile(): read emission: " << "nnu_=" << nnu_ << ", nphi_="<("GYOTO PatternDisk opacity"), 0, &status); if (status) { if (status == BAD_HDU_NUM) { // FITS file does not contain opacity information status = 0; if (opacity_) { delete [] opacity_; opacity_ = NULL; } } else throwCfitsioError(status) ; } else { if (fits_get_img_size(fptr, 3, naxes, &status)) throwCfitsioError(status) ; if ( size_t(naxes[0]) != nnu_ || size_t(naxes[1]) != nphi_ || size_t(naxes[2]) != nr_) throwError("PatternDisk::readFile(): opacity array not conformable"); if (opacity_) { delete [] opacity_; opacity_ = NULL; } opacity_ = new double[nnu_ * nphi_ * nr_]; if (fits_read_subset(fptr, TDOUBLE, fpixel, naxes, inc, 0, opacity_,&anynul,&status)) { delete [] opacity_; opacity_=NULL; throwCfitsioError(status) ; } } ////// FIND OPTIONAL VELOCITY HDU /////// fits_movnam_hdu(fptr, ANY_HDU, const_cast("GYOTO PatternDisk velocity"), 0, &status); if (status) { if (status == BAD_HDU_NUM) { // FITS file does not contain velocity information status = 0; if (velocity_) { delete [] velocity_; velocity_ = NULL; } } else throwCfitsioError(status) ; } else { if (fits_get_img_size(fptr, 3, naxes, &status)) throwCfitsioError(status) ; if ( size_t(naxes[0]) != size_t(2) || size_t(naxes[1]) != nphi_ || size_t(naxes[2]) != nr_) throwError("PatternDisk::readFile(): velocity array not conformable"); if (velocity_) { delete [] velocity_; velocity_ = NULL; } velocity_ = new double[2 * nphi_ * nr_]; if (fits_read_subset(fptr, TDOUBLE, fpixel, naxes, inc, 0, velocity_,&anynul,&status)) { delete [] velocity_; velocity_=NULL; throwCfitsioError(status) ; } } ////// FIND OPTIONAL RADIUS HDU /////// fits_movnam_hdu(fptr, ANY_HDU, const_cast("GYOTO PatternDisk radius"), 0, &status); if (status) { if (status == BAD_HDU_NUM) { // FITS file does not contain explicit radius information status = 0; if (radius_) { delete [] radius_; radius_ = NULL; } } else throwCfitsioError(status) ; } else { if (fits_get_img_size(fptr, 1, naxes, &status)) throwCfitsioError(status) ; if (size_t(naxes[0]) != nr_) throwError("PatternDisk::readFile(): radius array not conformable"); if (radius_) { delete [] radius_; radius_ = NULL; } radius_ = new double[nr_]; if (fits_read_subset(fptr, TDOUBLE, fpixel, naxes, inc, 0, radius_,&anynul,&status)) { delete [] radius_; radius_=NULL; throwCfitsioError(status) ; } if (!rin_set) rin_=radius_[0]; if (!rout_set) rout_=radius_[nr_-1]; } if (nr_ == 1.) throwError("In PatternDisk::fitsRead: nr_ should not be 0 here!"); dr_ = (rout_-rin_) / double(nr_-1); if (fits_close_file(fptr, &status)) throwCfitsioError(status) ; fptr = NULL; } void PatternDisk::fitsWrite(string filename) { if (!emission_) throwError("PatternDisk::fitsWrite(filename): nothing to save!"); filename_ = filename; char* pixfile = const_cast(filename_.c_str()); fitsfile* fptr = NULL; int status = 0; long naxes [] = {long(nnu_), long(nphi_), long(nr_)}; long fpixel[] = {1,1,1}; char * CNULL=NULL; char ermsg[31] = ""; // ermsg is used in throwCfitsioError() ////// CREATE FILE GYOTO_DEBUG << "creating file \"" << pixfile << "\"... "; fits_create_file(&fptr, pixfile, &status); if (debug()) cerr << "done." << endl; fits_create_img(fptr, DOUBLE_IMG, 3, naxes, &status); if (status) throwCfitsioError(status) ; ////// WRITE FITS KEYWORDS COMMON TO ALL TABLES /////// //set Omega and t0; if (Omega_!=0) fits_write_key(fptr, TDOUBLE, const_cast("GYOTO PatternDisk Omega"), &Omega_, CNULL, &status); if (t0_!=0) fits_write_key(fptr, TDOUBLE, const_cast("GYOTO PatternDisk t0"), &t0_, CNULL, &status); if (repeat_phi_!=1) fits_write_key(fptr, TLONG, const_cast("GYOTO PatternDisk RepeatPhi"), &repeat_phi_, CNULL, &status); if ((radius_ && rin_ != radius_[0]) || (!radius_ && rin_ != 0.)) fits_write_key(fptr, TDOUBLE, const_cast("GYOTO ThinDisk InnerRadius"), &rin_, CNULL, &status); if ((radius_ && rout_ != radius_[nr_-1]) || (!radius_ && rout_ != DBL_MAX)) fits_write_key(fptr, TDOUBLE, const_cast("GYOTO ThinDisk OuterRadius"), &rout_, CNULL, &status); if (phimin_ > -DBL_MAX) fits_write_key(fptr, TDOUBLE, const_cast("GYOTO PatternDisk Phimin"), &phimin_, CNULL, &status); if (phimax_ < DBL_MAX) fits_write_key(fptr, TDOUBLE, const_cast("GYOTO PatternDisk Phimax"), &phimax_, CNULL, &status); ////// SAVE EMISSION IN PRIMARY HDU /////// GYOTO_DEBUG << "saving emission_\n"; fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("GYOTO PatternDisk emission"), CNULL, &status); fits_write_key(fptr, TDOUBLE, const_cast("CRVAL1"), &nu0_, CNULL, &status); fits_write_key(fptr, TDOUBLE, const_cast("CDELT1"), &dnu_, CNULL, &status); double CRPIX1 = 1.; fits_write_key(fptr, TDOUBLE, const_cast("CRPIX1"), &CRPIX1, CNULL, &status); fits_write_pix(fptr, TDOUBLE, fpixel, nnu_*nphi_*nr_, emission_, &status); if (status) throwCfitsioError(status) ; ////// SAVE OPTIONAL OPACITY HDU /////// if (opacity_) { GYOTO_DEBUG << "saving opacity_\n"; fits_create_img(fptr, DOUBLE_IMG, 3, naxes, &status); fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("GYOTO PatternDisk opacity"), CNULL, &status); fits_write_pix(fptr, TDOUBLE, fpixel, nnu_*nphi_*nr_, opacity_, &status); if (status) throwCfitsioError(status) ; } ////// SAVE OPTIONAL VELOCITY HDU /////// if (velocity_) { GYOTO_DEBUG << "saving velocity_\n"; naxes[0]=2; fits_create_img(fptr, DOUBLE_IMG, 3, naxes, &status); fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("GYOTO PatternDisk velocity"), CNULL, &status); fits_write_pix(fptr, TDOUBLE, fpixel, 2*nphi_*nr_, velocity_, &status); if (status) throwCfitsioError(status) ; } ////// SAVE OPTIONAL RADIUS HDU /////// if (radius_) { GYOTO_DEBUG << "saving velocity_\n"; fits_create_img(fptr, DOUBLE_IMG, 1, naxes+2, &status); fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("GYOTO PatternDisk radius"), CNULL, &status); fits_write_pix(fptr, TDOUBLE, fpixel, nr_, radius_, &status); if (status) throwCfitsioError(status) ; } ////// CLOSING FILE /////// GYOTO_DEBUG << "close FITS file\n"; if (fits_close_file(fptr, &status)) throwCfitsioError(status) ; fptr = NULL; } void PatternDisk::getIndices(size_t i[3], double const co[4], double nu) const { GYOTO_DEBUG << "dnu_="<phimax_) i[1]=nphi_-1; else i[1] = size_t(floor((phi-phimin_)/dphi_+0.5)) % nphi_; if (radius_) { GYOTO_DEBUG <<"radius_ != NULL" << endl; // if the radius_ vector is set, find closest value if (r >= radius_[nr_-1]) i[2] = nr_-1; else { for(i[2]=0; r > radius_[i[2]]; ++i[2]){} if (i[2]>0 && r-radius_[i[2]-1] < radius_[i[2]]) --i[2]; } } else { GYOTO_DEBUG <<"radius_ == NULL, dr_==" << dr_ << endl; // radius_ is not set: assume linear repartition if (dr_==0.) throwError("In PatternDisk::getIndices: dr_ should not be 0 here!"); i[2] = size_t(floor((r-rin_)/dr_+0.5)); if (i[2] >= nr_) i[2] = nr_ - 1; } } void PatternDisk::getVelocity(double const pos[4], double vel[4]) { if (velocity_) { if (dir_ != 1) throwError("PatternDisk::getVelocity(): " "dir_ should be 1 if velocity_ is provided"); size_t i[3]; // {i_nu, i_phi, i_r} getIndices(i, pos); double phiprime=velocity_[i[2]*(nphi_*2)+i[1]*2+0]; double rprime=velocity_[i[2]*(nphi_*2)+i[1]*2+1]; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: { double pos2[4] = {pos[0], pos[1], pos[2], pos[3]}; pos2[1] = radius_ ? radius_[i[2]] : rin_+double(i[2])*dr_; vel[1] = rprime; vel[2] = 0.; vel[3] = phiprime; vel[0] = gg_->SysPrimeToTdot(pos2, vel+1); vel[1] *= vel[0]; vel[3] *= vel[0]; } break; case GYOTO_COORDKIND_CARTESIAN: throwError("PatternDisk::getVelocity(): metric must be in " "spherical coordinaites if velocity field is provided"); break; default: throwError("PatternDisk::getVelocity(): unknown COORDKIND"); } }else ThinDisk::getVelocity(pos, vel); } double PatternDisk::emission(double nu, double dsem, double *, double co[8]) const{ //See Page & Thorne 74 Eqs. 11b, 14, 15. This is F(r). GYOTO_DEBUG << endl; size_t i[3]; // {i_nu, i_phi, i_r} getIndices(i, co, nu); double Iem = emission_[i[2]*(nphi_*nnu_)+i[1]*nnu_+i[0]]; if (!flag_radtransf_) return Iem; double thickness; if (opacity_ && (thickness=opacity_[i[2]*(nphi_*nnu_)+i[1]*nnu_+i[0]]*dsem)) return Iem * (1. - exp (-thickness)) ; return 0.; } double PatternDisk::transmission(double nu, double dsem, double*co) const { GYOTO_DEBUG << endl; if (!flag_radtransf_) return 0.; if (!opacity_) return 1.; size_t i[3]; // {i_nu, i_phi, i_r} getIndices(i, co, nu); double opacity = opacity_[i[2]*(nphi_*nnu_)+i[1]*nnu_+i[0]]; GYOTO_DEBUG << "nu="<setParameter("File", (filename_.compare(0,1,"!") ? filename_ : filename_.substr(1))); if (Omega_) fmp->setParameter("PatternVelocity", Omega_); ThinDisk::fillElement(fmp); } void PatternDisk::setParameters(FactoryMessenger* fmp) { string name, content, unit; setMetric(fmp->getMetric()); while (fmp->getNextParameter(&name, &content, &unit)) { if (name == "File") setParameter(name, fmp -> fullPath(content), unit); else setParameter(name, content, unit); } } #endif Gyoto-0.1.0/lib/PatternDiskBB.C000066400000000000000000000150631217470755400161400ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #define throwCfitsioError(status) \ { fits_get_errstatus(status, ermsg); throwError(ermsg); } #include "GyotoPhoton.h" #include "GyotoPatternDiskBB.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; PatternDiskBB::PatternDiskBB() : PatternDisk(), spectrumBB_(NULL), SpectralEmission_(0), PLDisk_(0), PLSlope_(0.), PLRho_(0.), rPL_(DBL_MAX) { GYOTO_DEBUG << "PatternDiskBB Construction" << endl; spectrumBB_ = new Spectrum::BlackBody(); } PatternDiskBB::PatternDiskBB(const PatternDiskBB& o) : PatternDisk(o), spectrumBB_(NULL), SpectralEmission_(o.SpectralEmission_), PLDisk_(o.PLDisk_), PLSlope_(o.PLSlope_),PLRho_(o.PLRho_),rPL_(o.rPL_) { GYOTO_DEBUG << "PatternDiskBB Copy" << endl; if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); } PatternDiskBB* PatternDiskBB::clone() const { return new PatternDiskBB(*this); } PatternDiskBB::~PatternDiskBB() { GYOTO_DEBUG << "PatternDiskBB Destruction" << endl; } double const * PatternDiskBB::getVelocity() const { return PatternDisk::getVelocity(); } void PatternDiskBB::getVelocity(double const pos[4], double vel[4]) { double rcur=projectedRadius(pos); double risco; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: risco = static_cast >(gg_) -> getRms(); break; default: throwError("PatternDiskBB::getVelocity: bad COORDKIND"); risco=0.; } double const * const radius=getGridRadius(); size_t i[3]; // {i_nu, i_phi, i_r} //Search for indices only in non-power-law region if (rcurrPL_) || !getVelocity()){ //Keplerian circ velocity for power law disk region //as well as if PatternDisk::velocity_ not provided ThinDisk::getVelocity(pos, vel); }else if (rgridgetCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: risco = static_cast >(gg_) -> getRms(); break; default: throwError("PatternDiskBB::emission: bad COORDKIND"); risco=0.; } double rcur=projectedRadius(co); // if (rcur > rout_ || rcur < risco) return 0.; // no emission in any case above rmax_ size_t i[3]; // {i_nu, i_phi, i_r} //Search for indices only in non-power-law region if (rcur rmax_ || rgrid < risco) return 0.; // no emission in any case above rmax_ double Iem=0.; double const * const emiss = getIntensity(); size_t naxes[3]; getIntensityNaxes(naxes); size_t nnu=naxes[0], nphi=naxes[1]; if (!SpectralEmission_){ if (rPL_ rPL_ should be DBL_MAX"); Iem = emiss[i[2]*(nphi*nnu)+i[1]*nnu+i[0]]; }else{ //Spectral emission double TT; if (rcur If rsetTemperature(TT); Iem=(*spectrumBB_)(nu); }else if (PLDisk_){ // -> If r>rPL_ compute temperature from first principles double rho_si = PLRho_*pow(rcur/risco,PLSlope_); //Assuming: pressure = kappa*(mass density)^gamma, gamma=5/3 (eq of state) // and: pressure = (mass density)*R/Mm*T (Mm = molar mass) double gamma=5./3.; double Mm=6e-4;//Navogadro*Munit/gamma double kappa=3e10;//pressure coef: p = kappa*rho^gamma, rho=mass density double cs2=kappa*gamma*pow(rho_si,gamma-1.); TT=Mm/GYOTO_GAS_CST*cs2;//Temperature in SI //cout << "TT after rl= " << TT << endl; //cout << "r,rho,T= " << rcross << " " << rho_si << " " << TT << endl; spectrumBB_->setTemperature(TT); Iem=(*spectrumBB_)(nu); } //cout << "Iem= " << Iem << endl; } if (!flag_radtransf_) return Iem; double thickness; double const * const opacity = getOpacity(); if (rcur>rPL_) throwError("In PatternDiskBB::emission: optically thin integration not supported yet"); if (opacity && (thickness=opacity[i[2]*(nphi*nnu)+i[1]*nnu+i[0]]*dsem)) return Iem * (1. - exp (-thickness)) ; return 0.; } void PatternDiskBB::setMetric(SmartPointer gg) { //Metric must be KerrBL (see emission function) string kind = gg->getKind(); if (kind != "KerrBL") throwError ("PatternDiskBB::setMetric(): metric must be KerrBL"); ThinDisk::setMetric(gg); } int PatternDiskBB::setParameter(std::string name, std::string content, std::string unit) { if (name=="PLSlope"){ PLDisk_=1; PLSlope_=atof(content.c_str()); rPL_=getOuterRadius();//radius where power law disk begins setOuterRadius(DBL_MAX);//infinite power law disk } else if (name=="PLRho") PLRho_=atof(content.c_str()); else if (name=="SpectralEmission") SpectralEmission_=1; else return PatternDisk::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void PatternDiskBB::fillElement(FactoryMessenger *fmp) const { if (PLSlope_) fmp->setParameter("PLSlope", PLSlope_); fmp -> setParameter ( SpectralEmission_? "SpectralEmission" : "BolometricEmission"); PatternDisk::fillElement(fmp); } #endif Gyoto-0.1.0/lib/Photon.C000066400000000000000000000364441217470755400147610ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoPhoton.h" #include "GyotoScreen.h" #include "GyotoDefs.h" #include "GyotoError.h" #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; Photon::Photon() : Worldline(), object_(NULL), freq_obs_(1.), transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) {} Photon::Photon(const Photon& o) : Worldline(o), SmartPointee(o), object_(NULL), freq_obs_(o.freq_obs_), transmission_freqobs_(o.transmission_freqobs_), spectro_(NULL), transmission_(NULL) { if (o.object_()) { object_ = o.object_ -> clone(); object_ -> setMetric(metric_); } if (o.spectro_()) { spectro_ = o.spectro_ -> clone(); _allocateTransmission(); if (size_t nsamples = spectro_->getNSamples()) memcpy(transmission_, o.getTransmission(), nsamples*sizeof(double)); } } Photon * Photon::clone() const { return new Photon(*this); } Photon::Photon(Photon* orig, size_t i0, int dir, double step_max) : Worldline(orig, i0, dir, step_max), SmartPointee(), object_(orig->object_), freq_obs_(orig->freq_obs_), transmission_freqobs_(orig->transmission_freqobs_), spectro_(orig->spectro_), transmission_(orig->transmission_) { } Photon::Refined::Refined(Photon* orig, size_t i0, int dir, double step_max) : Photon(orig, i0, dir, step_max), parent_(orig) { setFreqObs(orig->getFreqObs()); } Photon::Photon(SmartPointer met, SmartPointer obj, double* coord): Worldline(), freq_obs_(1.), transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) { setInitialCondition(met, obj, coord); } Photon::Photon(SmartPointer met, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta): Worldline(), object_(obj), freq_obs_(screen->getFreqObs()), transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) { double coord[8]; screen -> getRayCoord(d_alpha, d_delta, coord); Worldline::setInitialCondition(met, coord, -1); setSpectrometer(screen); } Photon::~Photon() {} /* TRANSMISSION STUFF */ void Photon::_allocateTransmission() { if (transmission_) { delete [] transmission_; transmission_ = NULL; } if (spectro_()) { size_t nsamples = spectro_->getNSamples(); if (nsamples) { transmission_ = new double[nsamples]; resetTransmission(); } } } void Photon::resetTransmission() { transmission_freqobs_ = 1.; if (spectro_() && transmission_) { size_t nsamples = spectro_->getNSamples(); for (size_t i = 0; i < nsamples; ++i) transmission_[i] = 1.; } } double Photon::getMass() const { return 0.; } void Photon::setAstrobj(SmartPointer ao) { imin_=imax_=i0_; object_=ao; } void Photon::setSpectrometer(SmartPointer spr) { spectro_=spr; _allocateTransmission(); } SmartPointer Photon::getSpectrometer() const { return spectro_; } string Photon::className() const { return string("Photon"); } string Photon::className_l() const { return string("photon"); } SmartPointer Photon::getAstrobj() const { return object_; } void Photon::setInitialCondition(SmartPointer met, SmartPointer obj, SmartPointer screen, const double d_alpha, const double d_delta) { double coord[8]; screen -> getRayCoord(d_alpha, d_delta, coord); Worldline::setInitialCondition(met, coord, -1); if (obj) object_=obj; } void Photon::setInitialCondition(SmartPointer met, SmartPointer obj, const double coord[8]) { if (!met) met = metric_; Worldline::setInitialCondition(met, coord, -1); if (obj) object_=obj; } int Photon::hit(Astrobj::Properties *data) { /* Ray-tracing of the photon until the object_ is hit. Radiative transfer inside the object_ may then be performed depending on flag_radtransf. Final result (observed flux for instance, depending on object_'s Astrobj::Properties) will be stored in data. */ //tmin_=-1000.;//DEBUG //NB: integration stops when t < Worldline::tmin_ transmission_freqobs_=1.; size_t nsamples; if (spectro_() && (nsamples = spectro_->getNSamples())) for (size_t ii=0; ii getRmax(); int coordkind = metric_ -> getCoordKind(); int hitt=0; //hitted=1 if object is hitted at least one time (hitt can be 0 even //if the object was hit if cross_max>0) ; hitt_crude=1 if the object //is not yet hit with adaptive integration step. A second integration //with small fixed step will be performed to determine more precisely //the surface point. double coord[8]; int dir=(tmin_>x0_[i0_])?1:-1; size_t ind=i0_; int stopcond=0; double rr=DBL_MAX, rr_prev=DBL_MAX; //------------------------------------------------- /* 1- Call object_->Impact on the already computed part of the geodesic to check whether the object_ was hit. */ for (ind=i0_+dir; ((dir==1)? (ind<=imax_ && x0_[ind]<=tmin_): // conditions if dir== 1 (ind>=imin_ && x0_[ind]>=tmin_)) // conditions if dir==-1 && !hitt; // condition in all cases ind+=dir) { switch (coordkind) { case GYOTO_COORDKIND_SPHERICAL: rr=x1_[ind]; break; case GYOTO_COORDKIND_CARTESIAN: rr=sqrt(x1_[ind]*x1_[ind]+x2_[ind]*x2_[ind]+x3_[ind]*x3_[ind]); break; default: throwError("Incompatible coordinate kind in Photon.C"); } } if (rr Impact(this, ind, data); if (hitt) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "DEBUG: Photon.C: Hit for already computed position; " << "Warning: radiative transfer not implemented " << "for that case" << endl; # endif return hitt; } else if (((dir==1)? (ind==imax_ && x0_[ind]>=tmin_): // conditions if dir== 1 (ind>=imin_ && x0_[ind]<=tmin_)) // conditions if dir==-1 && !hitt) return hitt; if (ind!=i0_) ind-=dir; //------------------------------------------------- //------------------------------------------------- /* 2- Need to compute geodesic further. Set up integration. */ // Check whether the arrays need to be expanded first if (dir==1 && ind==x_size_) ind=xExpand(1); else if (dir==-1 && ind==0) ind=xExpand(-1); // Set up integration getCoord(ind, coord); switch (coordkind) { case GYOTO_COORDKIND_SPHERICAL: rr=coord[1]; break; case GYOTO_COORDKIND_CARTESIAN: rr=sqrt(coord[1]*coord[1]+coord[2]*coord[2]+coord[3]*coord[3]); break; default: throwError("Incompatible coordinate kind in Photon.C"); } SmartPointer state = new Worldline::IntegState(this, coord, delta_* dir); //delta_ = initial integration step (defaults to 0.01) size_t count=0;// Must remain below count_max (prevents infinite integration) //------------------------------------------------- //------------------------------------------------- /* 3- Integration loop: integrate the geodesic until stopcond is 1. Possible stopping conditions: - transmission_freqobs_ low [see transmission() function in astrobjs, which defaults to 0 (optically thick) or 1 (optically thin) in Astrobj.C] - t < tmin_ (if dir=-1), [NB: tmin_ defaults to -DBL_MAX in Worldline.C] - photon is at r>rmax (defined for each object) and goes even further - metric tells it's time to stop (eg horizon crossing) - t does not evolve [to investigate, metric should have stopped integration before, see above] - count>count_max [should never be used, just to prevent infinite integration in case of a bug] */ while (!stopcond) { // Next step along photon's worldline stopcond = state -> nextStep(coord); if (stopcond) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "stopcond set by integrator\n"; # endif break; } if (coord[0] == x0_[ind]) { // here, ind denotes previous step stopcond=1; if (verbose() >= GYOTO_SEVERE_VERBOSITY) cerr << "SEVERE: Photon::hit(): time did not evolve, break." << endl; break; } if((stopcond=metric_->isStopCondition(coord))) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "stopcond step by metric"< maxiter_ ) { GYOTO_SEVERE << "***WARNING (severe): Photon::hit: too many iterations, " <<" break" << endl; stopcond = 1; break; } ind +=dir; // store photon's trajectory for later use x0_[ind] = coord[0]; x1_[ind] = coord[1]; x2_[ind] = coord[2]; x3_[ind] = coord[3]; x0dot_[ind] = coord[4]; x1dot_[ind] = coord[5]; x2dot_[ind] = coord[6]; x3dot_[ind] = coord[7]; if (dir==1) ++imax_; else --imin_; if (imin_!=ind && imax_!=ind) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "imin_=" << imin_ << ", imax_=" << imax_ << ", ind=" << ind << endl; # endif throwError("BUG: Photon.C: bad index evolution, " "ind should be equal to imin or imax"); } //************************************ /* 3-a Call to object_ -> Impact */ // Check if we can reach the object_ switch (coordkind) { case GYOTO_COORDKIND_SPHERICAL: rr = x1_[ind]; break; case GYOTO_COORDKIND_CARTESIAN: rr=sqrt(x1_[ind]*x1_[ind]+x2_[ind]*x2_[ind]+x3_[ind]*x3_[ind]); break; default: throwError("Incompatible coordinate kind in Photon.C"); } # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_EXPR(rmax); GYOTO_DEBUG_EXPR(rr); GYOTO_ENDIF_DEBUG # endif if (rr Impact(this, ind, data); if (hitt && !data) stopcond=1; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(transmission_freqobs_); # endif if ( getTransmissionMax() < 1e-6 ) { stopcond=1; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "stopping because we are optically thick\n"; # endif } } else { if ( rr > rr_prev ) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "Stopping because " << "1) we are far from this object and " << "2) we are flying away" << endl; # endif stopcond=1; break; } } rr_prev=rr; //************************************ //************************************ /* 3-c Checks whether t < tmin_ (with dir=-1) and expands arrays if necessary to be able to store next step's results */ switch (dir) { case 1: if (coord[0]>tmin_) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "stopping because time goes beyond time limit\n"; # endif stopcond=1; } if ((!stopcond) && (ind==x_size_)) { imax_=x_size_-1; ind=xExpand(1); } break; default: if (coord[0]GYOTO_T_TOL) && (curval>threshold) ) { pcur[0] = 0.5*(t1+t2); getCoord(pcur, 1, pcur+1, pcur+2, pcur+3, pcur+4, pcur+5, pcur+6, pcur+7); curval=(*object)(pcur); if (val1 GYOTO_T_TOL) { pcur[0] = 0.5*(tinside+toutside); getCoord(pcur, 1, pcur+1, pcur+2, pcur+3, pcur+4, pcur+5, pcur+6, pcur+7); if ( (*object)(pcur) < value ) tinside = pcur[0]; else toutside = pcur[0]; } toutside = tinside; } void Photon::setFreqObs(double fo) { freq_obs_=fo; GYOTO_DEBUG_EXPR(freq_obs_); } double Photon::getFreqObs() const { GYOTO_DEBUG_EXPR(freq_obs_); return freq_obs_; } double Photon::getTransmission(size_t i) const { if (i==size_t(-1)) return transmission_freqobs_; if (!spectro_() || i>=spectro_->getNSamples()) throwError("Photon::getTransmission(): i > nsamples"); return transmission_[i]; } double Photon::getTransmissionMax() const { double transmax=transmission_freqobs_; if (spectro_()) { size_t i=0, imax= spectro_->getNSamples(); for (i=0; i < imax; ++i) if (transmission_[i] > transmax) transmax = transmission_[i]; } # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(transmax); # endif return transmax; } double const * Photon::getTransmission() const { return transmission_; } void Photon::transmit(size_t i, double t) { if (i==size_t(-1)) { transmission_freqobs_ *= t; return; } if (!spectro_() || i>=spectro_->getNSamples()) throwError("Photon::getTransmission(): i > nsamples"); transmission_[i] *= t; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "(i="<transmit(i, t); if (i==size_t(-1)) transmission_freqobs_ = parent_->transmission_freqobs_; } #ifdef GYOTO_USE_XERCES void Photon::fillElement(FactoryMessenger *fmp) { if (object_) fmp -> setAstrobj (object_) ; Worldline::fillElement(fmp); } SmartPointer Gyoto::Photon::Subcontractor(FactoryMessenger* fmp) { string name="", content=""; SmartPointer gg = NULL; SmartPointer ao = NULL; SmartPointer ph = new Photon(); ph -> setAstrobj( fmp->getAstrobj() ); ph -> setParameters(fmp); return ph; } #endif Gyoto-0.1.0/lib/PolishDoughnut.C000066400000000000000000001361031217470755400164570ustar00rootroot00000000000000/* Copyright (c) 2012 Frederic Vincent, Odele Straub, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoPolishDoughnut.h" #include "GyotoPhoton.h" #include "GyotoFactoryMessenger.h" #include "GyotoDefs.h" #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; #define CST_POLY_INDEX 1.5//polytropic index (gamma=1+1/n=5/3) #define CST_POLY_INDEX_M1 0.666666666666666666666666666666666666666667 // 1./ CST_POLY_INDEX #define CST_HYDRO_FRAC 0.75//hydrogen fraction #define CST_Z_1 1.//atomic number #define CST_Z_2 2. #define CST_MU_ION 1.2307692307692308375521861 //(4./(1. + 3. * CST_HYDRO_FRAC)) #define CST_MU_ELEC 1.1428571428571427937015414 //(2./(1. + CST_HYDRO_FRAC)) #define GYOTO_C2_CGS 8.98755178736817668096e+20 //c^2 in cgs #define GYOTO_C2_CGS_M1 1.1126500560536184087938986e-21 // 1./GYOTO_C2_CGS #define w_tol 1e-9 PolishDoughnut::PolishDoughnut() : Standard("PolishDoughnut"), gg_(NULL), l0_(0.), lambda_(0.5), W_surface_(0.), W_centre_(0.), r_cusp_(0.), r_centre_(0.), temperature_ratio_(1.), central_density_(1.), centraltemp_over_virial_(1.), beta_(0.), use_specific_impact_(0), //aa_ and aa2_ are set by setLambda() spectral_oversampling_(10) //intersection doesn't need initilizing { #ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; #endif critical_value_=0.; safety_value_=.1; //rmax_=25.; } PolishDoughnut::PolishDoughnut(const PolishDoughnut& orig) : Standard(orig), gg_(NULL), l0_(orig.l0_), lambda_(orig.lambda_), W_surface_(orig.W_surface_), W_centre_(orig.W_centre_), r_cusp_(orig.r_cusp_), r_centre_(orig.r_centre_), DeltaWm1_(orig.DeltaWm1_), temperature_ratio_(orig.temperature_ratio_), central_density_(orig.central_density_), centraltemp_over_virial_(orig.centraltemp_over_virial_), beta_(orig.beta_), use_specific_impact_(orig.use_specific_impact_), aa_(orig.aa_), aa2_(orig.aa2_), spectral_oversampling_(orig.spectral_oversampling_), intersection(orig.intersection) { if (orig.gg_()) { gg_=orig.gg_->clone(); Standard::gg_ = gg_; } } PolishDoughnut* PolishDoughnut::clone() const {return new PolishDoughnut(*this);} double PolishDoughnut::getL0() const { return l0_; } //void PolishDoughnut::setL0(double l0) { l0_ = l0; } double PolishDoughnut::getWsurface() const { return W_surface_; } double PolishDoughnut::getWcentre() const { return W_centre_; } double PolishDoughnut::getRcusp() const { return r_cusp_; } double PolishDoughnut::getRcentre() const { return r_centre_; } double PolishDoughnut::getLambda() const { return lambda_; } void PolishDoughnut::setLambda(double lambda) { if (!gg_) throwError("Metric but be set before lambda in PolishDoughnut"); //Computing marginally stable and marginally bound radii: lambda_=lambda; aa_=gg_->getSpin(), aa2_=aa_*aa_; double rms = gg_->getRms();//(3. + z2 - pow((3. - z1)*(3. + z1 + // 2.*z2),1./2.)); double rmb = gg_->getRmb();//pow(1. + sqrt(1. - aa),2); // marginally stable & marginally bound keplerian angular momentum // lK(rms), lK(rmb): NB: this is Bardeen 74 L/E (2.12-2.13), not L // (Polish doughnut l is rescaled) double l_ms = (rms*rms - 2.*aa_*sqrt(rms) + aa2_)/(pow(rms,3./2.) - 2.*sqrt(rms) + aa_); double l_mb = (rmb*rmb - 2.*aa_*sqrt(rmb) + aa2_)/(pow(rmb,3./2.) - 2.*sqrt(rmb) + aa_); l0_ = lambda_*(l_mb-l_ms)+l_ms ;//torus angular momentum //Computing the potential at the photon position: double r1_min = rmb ; double r1_max = rms ; double r2_min = rms ; double r2_max = 1000. ; // update intersection functor: intersection.aa_=aa_; intersection.aa2_=aa2_; intersection.l0_=l0_; r_cusp_ = intersection.ridders(r1_min, r1_max) ; r_centre_ = intersection.ridders(r2_min, r2_max) ; W_surface_ = potential(r_cusp_, M_PI/2.) ; W_centre_ = potential(r_centre_, M_PI/2.) ; GYOTO_IF_DEBUG GYOTO_DEBUG_EXPR(lambda_); GYOTO_DEBUG_EXPR(l0_); GYOTO_DEBUG_EXPR(aa_); GYOTO_DEBUG_EXPR(r_cusp_); GYOTO_DEBUG_EXPR(r_centre_); GYOTO_DEBUG_EXPR(W_surface_); GYOTO_DEBUG_EXPR(W_centre_); GYOTO_ENDIF_DEBUG DeltaWm1_= 1./(W_centre_ - W_surface_); } double PolishDoughnut::getTemperatureRatio() const {return temperature_ratio_;} void PolishDoughnut::setTemperatureRatio(double t){temperature_ratio_=t;} double PolishDoughnut::getCentralDensity() const {return central_density_;} double PolishDoughnut::getCentralDensity(string unit) const { double dens = getCentralDensity(); if (unit != "") { # ifdef HAVE_UDUNITS dens = Units::Converter("kg/L", unit)(dens); # else GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" << endl ; # endif } return dens; } void PolishDoughnut::setCentralDensity(double dens) { central_density_=dens; } void PolishDoughnut::setCentralDensity(double dens, string unit) { if (unit != "") { # ifdef HAVE_UDUNITS dens = Units::Converter(unit, "kg/L")(dens); # else GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" << endl ; # endif } setCentralDensity(dens); } double PolishDoughnut::getCentralTempOverVirial() const {return centraltemp_over_virial_;} void PolishDoughnut::setCentralTempOverVirial(double val) {centraltemp_over_virial_=val;} double PolishDoughnut::getBeta() const { return beta_; } void PolishDoughnut::setBeta(double beta) { beta_ = beta; } size_t PolishDoughnut::getSpectralOversampling() const { return spectral_oversampling_; } void PolishDoughnut::setSpectralOversampling(size_t val) { spectral_oversampling_ = val; } PolishDoughnut::~PolishDoughnut() { GYOTO_DEBUG << "PolishDoughnut Destruction" << endl; if (gg_) gg_ -> unhook(this); } Gyoto::SmartPointer PolishDoughnut::getMetric() const { return SmartPointer(gg_); } void PolishDoughnut::setMetric(Gyoto::SmartPointer met) { if (met->getKind() != "KerrBL") throwError("PolishDoughnut::setMetric(): only KerrBL, please"); if (gg_) gg_ -> unhook(this); gg_ = SmartPointer(met); Generic::gg_ = gg_; if (gg_) gg_ -> hook(this); GYOTO_DEBUG << "Metric set, calling setLambda\n"; setLambda(lambda_); // setLambda_ initializes other members } void PolishDoughnut::tell(Hook::Teller * met) { if (met == gg_) setLambda(lambda_); else throwError("BUG: PolishDoughnut::tell(Hook::Teller * met) called with" "wrong metric"); } int PolishDoughnut::Impact(Photon *ph, size_t index, Astrobj::Properties *data) { if (beta_==1.) throwError("Please set beta to != 1."); GYOTO_DEBUG_EXPR(use_specific_impact_); if (use_specific_impact_) return Impact_(ph, index, data); return Standard::Impact(ph, index, data); } int PolishDoughnut::Impact_(Photon *ph, size_t index, Astrobj::Properties *data) { /* Should not be used anymore, use Standard::Impact */ GYOTO_DEBUG << endl; // int width=15, prec=12; double coord_ph_hit[8], coord_obj_hit[8]; double dt = 0.1; // seems to be OK if not so little (0.1) int hit=0; double coord[8], coord2[8]; ph->getCoord(index, coord2); // coord2 is the earliest point, t2getCoord(index+1, coord); // which must be processed last double t1=coord[0], r1=coord[1], theta1=coord[2], tprev=t1, rprev=r1, thetaprev=theta1, t2=coord2[0], r2=coord2[1], theta2=coord2[2], tcur, rcur, thetacur, phicur, tdotcur, rdotcur, thetadotcur, phidotcur; // remember : t1 > t2, we integrate backwards in time //NB: to keep in mind: inside doughnut 0<=w<=1 with w=0 at the surface, // outside, excluding the funnel w<0, in the funnel w>0 (can be >1) // Funnel = open field lines with projected distance to the axis < r_cusp_ double wcur, w1 = (potential(r1, theta1) - W_surface_)*DeltaWm1_, wprev = w1 ; double w2 = (potential(r2, theta2) - W_surface_)*DeltaWm1_; double w_lim=3.; if (debug()) cerr << "DEBUG: PolishDoughnut::Impact():" << "w1=" << w1 << ", w2=" << w2 << ", r1*sin(theta1)/r_cusp_="< 1 outside the funnel!"); //checks whether both w are far from 0 (surface value) or inside funnel //if yes: no impact if ( (w1 < 0.-w_lim || r1*fabs(sin(theta1)) < r_cusp_) && (w2 < 0.-w_lim || r2*fabs(sin(theta2)) < r_cusp_) ) { return 0; } coord_obj_hit[5] = 0.; coord_obj_hit[6] = 0.; double tfirst = t1, tlast=t2, wfirst=w1, wlast=w2; // At least one of the ends is close to the doughnut. Refine. We // want t1 inside the object. If entering the object, we want to // stay close to the surface. if ( r1*fabs(sin(theta1)) < r_cusp_ ) { // t1 is in the funnel. So t2 is not (see if loop above). // Bring t1 closer to t2, outside funnel. tfirst=t1; tlast=t2; while ((tfirst-tlast)>GYOTO_T_TOL) { tcur = 0.5*(tfirst+tlast); ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, &tdotcur, &rdotcur, &thetadotcur, &phidotcur); if (rcur*fabs(sin(thetacur)) look for // a maximum in between, is it inside the object ? if (debug()) cout << "DEBUG: PD::Impact():" << "t1 and t2 close to surface" << endl; while (wcur < 0.) { if ((tfirst-tlast) getCoord( &tcur, 1, &rcur, &thetacur, &phicur, &tdotcur, &rdotcur, &thetadotcur, &phidotcur); wcur = (potential(rcur, thetacur) - W_surface_)*DeltaWm1_; if (wlast < wfirst) { tlast=tcur; wlast=wcur; } else { tfirst=tcur; wfirst=wcur; } } } wlast=wcur; tlast=tcur; if (rcur*fabs(sin(thetacur)) check this one if new bug if (wcur<0) {tfirst=tcur; wfirst=wcur; } else { tlast=tcur; wlast=wcur; } } // tlast, wlast is inside of the object, close to the surface: t1=tlast; w1=wlast; if (debug()) cerr << "DEBUG: PD::Impact(): found entry point: t1="<0). t1 is in the object by now. // Bring t2 out of the funnel, just outside doughnut (with w2<0) tfirst=t1; tlast=t2; while ((tfirst-tlast)>GYOTO_T_TOL) { tcur = 0.5*(tfirst+tlast); ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, &tdotcur, &rdotcur, &thetadotcur, &phidotcur); if (rcur*fabs(sin(thetacur))>r_cusp_) tfirst=tcur; else tlast=tcur; } t2=tcur; w2 =(potential(rcur, thetacur) - W_surface_)*DeltaWm1_; if (debug()) cerr << "DEBUG: PD::Impact: Funnel handling for t2," << " new w2="<GYOTO_T_TOL) { tcur = 0.5*(tfirst+tlast); ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, &tdotcur, &rdotcur, &thetadotcur, &phidotcur); wcur = (potential(rcur, thetacur) - W_surface_)*DeltaWm1_; if (debug()) cerr << "DEBUG: PD::Impact: wfirst="< 0.) { tfirst=tcur; wfirst=wcur; } else { tlast=tcur; wlast=wcur; } } t2=tcur; w2=wcur; } // Phew, now both t1 and t2 are inside the object. Guaranteed. // Now we split the line in small bits by interpolation. if (debug()) cerr << "DEBUG: PD::Impact(): ***HIT*** interpolating worldline between " << "t1="< getCoord( &tcur, 1, &rcur, &thetacur, &phicur, &tdotcur, &rdotcur, &thetadotcur, &phidotcur); coord_obj_hit[0] = coord_ph_hit[0] = tcur; coord_obj_hit[1] = coord_ph_hit[1] = rcur; coord_obj_hit[2] = coord_ph_hit[2] = thetacur; coord_obj_hit[3] = coord_ph_hit[3] = phicur; coord_ph_hit[4] = tdotcur; coord_ph_hit[5] = rdotcur; coord_ph_hit[6] = thetadotcur; coord_ph_hit[7] = phidotcur; gtt=gg_->gmunu(coord_ph_hit,0,0); gtph=gg_->gmunu(coord_ph_hit,0,3); gphph=gg_->gmunu(coord_ph_hit,3,3); Omega=-(l0_*gtt+gtph)/(l0_*gtph+gphph); ut2=-1./(gtt+2.*gtph*Omega+gphph*Omega*Omega); if (ut2 < 0.) throwError("In PolishDoughnut.C PROBLEM!!!: ut^2 is negative."); coord_obj_hit[4] = sqrt(ut2); coord_obj_hit[7] = Omega*sqrt(ut2); processHitQuantities(ph, coord_ph_hit, coord_obj_hit, 1., data); return hit; } //RADIATIVE TRANSFER CASE for (tprev = t1, tcur=t1-dt; tprev>t2; tprev=tcur, wprev=wcur, rprev=rcur, thetaprev=thetacur, tcur-=dt) { if (tcur < t2) tcur=t2; ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, &tdotcur, &rdotcur, &thetadotcur, &phidotcur); wcur = (potential(rcur, thetacur) - W_surface_)*DeltaWm1_; if (debug()) cerr << "**********DEBUG: PD::Impact(): tcur="<gmunu(coord_ph_hit,0,0); gtph=gg_->gmunu(coord_ph_hit,0,3); gphph=gg_->gmunu(coord_ph_hit,3,3); Omega=-(l0_*gtt+gtph)/(l0_*gtph+gphph); ut2=-1./(gtt+2.*gtph*Omega+gphph*Omega*Omega); if (ut2 < 0.) throwError("In PolishDoughnut.C PROBLEM!!!: ut^2 is negative."); coord_obj_hit[4] = sqrt(ut2); coord_obj_hit[7] = Omega*sqrt(ut2); /*cout << "coords ph obj at hit= " << endl; for (int ii=0;ii<8;ii++) cout << coord_ph_hit[ii] << " "; cout << endl; for (int ii=0;ii<8;ii++) cout << coord_obj_hit[ii] << " "; cout << endl;*/ processHitQuantities(ph, coord_ph_hit, coord_obj_hit, tprev-tcur, data); } if (debug()) cerr<< "DEBUG: PD::Impact() returning after HIT" << endl; return hit; } double PolishDoughnut::operator()(double const coord[4]) { // w1 = ((potential(r1, theta1, aa) - W_surface_) // /(W_centre_ - W_surface_)); // // w1 < 0. outside polishdoughnut, anything inside funnel, 0 inside PolishDoughnut. double tmp = W_surface_-potential(coord[1], coord[2]); double rproj = coord[1] * sin(coord[2]); if (rprojgmunu(pos,0,0); double gtph=gg_->gmunu(pos,0,3); double gphph=gg_->gmunu(pos,3,3); double Omega=-(l0_*gtt+gtph)/(l0_*gtph+gphph); double ut2=-1./(gtt+2.*gtph*Omega+gphph*Omega*Omega); if (ut2 < 0.) { stringstream ss; ss << "PolishDoughnut::getVelocity(pos=["; for (int i=0; i<3; ++i) ss << pos[i] << ", "; ss << pos[3] << "]): ut^2 is negative."; throwError(ss.str()); } vel[0] = sqrt(ut2); vel[1] = vel[2] = 0.; vel[3] = Omega*sqrt(ut2); } void PolishDoughnut::integrateEmission (double * I, double * boundaries, size_t * chaninds, size_t nbnu, double dsem, double *cph, double *co) const { // The original channels may or may not be contiguous. We split // each original channels into spectral_oversampling_ subchannels. // All we know is that each chunk of spectral_oversampling_ // subchannels are contiguous. Don't try to recover contiguousness // in the original channels, it's too hard for now. double som1=1./double(spectral_oversampling_); size_t onbnu=nbnu*spectral_oversampling_; // number of subchannels size_t onbb = onbnu+nbnu; // number of subchannel boundaries : most // are used twice as subchannels are // contiguous in each channel. double * Inu = new double[onbnu+1]; double * bo = new double[onbb]; size_t * ii = new size_t[2*onbnu]; // two indices for each subchannel double dnu; size_t k=0; for (size_t i=0; i(this)->getVelocity(coord_obj, vel); //double Omega=vel[3]/vel[0]; double Msgr = gg_->getMass()*1e3; // Gyoto speaks in SI --> here we // switch to cgs units double rr = coord_ph[1], theta = coord_ph[2];//NB: rr is units of GM/c^2 //rr=8.00926;theta=M_PI/2.; //TEST!!!!! //nu_em = 1e24; //TEST!!! double rcgs = rr * gg_ -> unitLength() * 100.;//rr in cgs //r_centre_ in cgs: double r_centre_cgs = r_centre_ * gg_ -> unitLength() * 100.; double ww = (potential(rr, theta) - W_surface_)*DeltaWm1_; if (ww<=0.){//Will generate nan in computations w must be strictly positive if (fabs(ww)0.){ xmax*=10.; } xM_crit = transcendental.ridders(xmin, xmax) ; } // cout << "xmin="< 0 nu_crit shifted brems (NB not shifted if comptonorder=0, in this case amplinu=nu) nu_em>numax -> wien tail smoothly connected to previous brems */ double temp_e = GYOTO_BOLTZMANN_CGS * T_electron / (GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS) ; double Fee, Fei; if (temp_e < 1.) { Fee = 20./(9.*sqrt(M_PI))*(44.- 3.*M_PI*M_PI)*pow(temp_e,3./2.) *(1.+1.1*temp_e+temp_e*temp_e - 1.25*pow(temp_e,5./2.)); Fei = 4.*sqrt(2.*temp_e / (M_PI*M_PI*M_PI))*(1.+1.781*pow(temp_e,1.34)); }else{ Fee = 24.*temp_e*(log(2.*exp(-GYOTO_EULER_MASCHERONI)*temp_e)+1.28); Fei = 9.*temp_e / (2.*M_PI)*(log(1.123*temp_e + 0.48) + 1.5); } double fee = n_e*n_e*GYOTO_C_CGS*GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS *GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS *GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS*GYOTO_ALPHA_F*Fee; double fei = n_e*n_j*GYOTO_THOMSON_CGS*GYOTO_C_CGS *GYOTO_ALPHA_F*GYOTO_ELECTRON_MASS_CGS *GYOTO_C2_CGS*Fei; double f_brems = fee + fei ; if (nu_em > nu_crit){ if (nu_em < numax) { /* Brems at shifted freq between nu_crit and numax */ double Gaunt; // Gaunt factor at shifted frequency if ( GYOTO_BOLTZMANN_CGS*T_electron/ (GYOTO_PLANCK_CGS*nu_em) < 1.){ Gaunt = sqrt( 3./M_PI*GYOTO_BOLTZMANN_CGS*T_electron /(GYOTO_PLANCK_CGS*amplinu) ) ; }else{ Gaunt = sqrt(3.) / M_PI * log( 4./GYOTO_EULER_MASCHERONI * GYOTO_BOLTZMANN_CGS*T_electron /(GYOTO_PLANCK_CGS*amplinu) ) ; } //Brems emission at shifted freq: double emissbrems = 1./(4.*M_PI)*f_brems*Gaunt *exp(-GYOTO_PLANCK_CGS*amplinu/(GYOTO_BOLTZMANN_CGS*T_electron)) * GYOTO_PLANCK_CGS/(GYOTO_BOLTZMANN_CGS*T_electron); //NB: the 1/4pi factor is just to have the per steradian //dependency, the emission being assumed isotropic in //emitter's frame return emissbrems*Cbrems; } else { /* Wien tail above numax */ double MaxGaunt; // Gaunt factor with max frequency if ( GYOTO_BOLTZMANN_CGS*T_electron/ (GYOTO_PLANCK_CGS*numax) < 1.){ MaxGaunt = sqrt( 3./M_PI*GYOTO_BOLTZMANN_CGS*T_electron /(GYOTO_PLANCK_CGS*numax) ) ; }else{ MaxGaunt = sqrt(3.) / M_PI * log( 4./GYOTO_EULER_MASCHERONI * GYOTO_BOLTZMANN_CGS*T_electron /(GYOTO_PLANCK_CGS*numax) ) ; } //Wien tail smoothly connected to brems emission below numax: double WienEm=BBapprox(nu_em,T_electron); double WienEmMax = BBapprox(numax,T_electron); double emissbremsmax = 1./(4.*M_PI)*f_brems*MaxGaunt *exp(-GYOTO_PLANCK_CGS*numax/(GYOTO_BOLTZMANN_CGS*T_electron)) * GYOTO_PLANCK_CGS/(GYOTO_BOLTZMANN_CGS*T_electron); double emiss_bremsmax = Cbrems*emissbremsmax; double fact = WienEmMax/emiss_bremsmax; return WienEm/fact; } }else{ return 0.; } } double PolishDoughnut::emissionSynch(double nu_em, double nu_crit, double numax, double nu_0, double T_electron, double amplification, double Csynch, double alpha1, double alpha2, double alpha3, double preff, int comptonorder) const{ double amplinu=nu_em; if (comptonorder>0){ amplinu/=pow(amplification,comptonorder); Csynch=pow(Csynch,comptonorder); }else if (Csynch!=1.) throwError("In PolishDoughnut::emissionSynch: Csynch should be 1" "if no Compton amplification"); /* Cases: nu_em Rayleigh-Jeans emission smoothly connected to following synch emission nu_crit shifted synchrotron (NB not shifted if comptonorder=0, in this case amplinu=nu) nu_em>numax -> 0 */ double temp_e = GYOTO_BOLTZMANN_CGS * T_electron / (GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS) ; if (nu_emgetMass()*1e3; // Gyoto speaks in SI --> here we */ /* // switch to cgs units */ /* double rr = coord_ph[1], theta = coord_ph[2];//NB: rr is units of GM/c^2 */ /* // double rcgs = rr * gg_ -> unitLength() * 100.;//rr in cgs */ /* //r_centre_ in cgs: */ /* double r_centre_cgs = r_centre_ * gg_ -> unitLength() * 100.; */ /* double ww = (potential(rr, theta) - W_surface_)*DeltaWm1_; */ /* if (ww<=0.){//Will generate nan in computations w must be strictly positive */ /* if (fabs(ww)1./tol) //Wien return 2.*GYOTO_PLANCK_CGS*nuem*nuem*nuem*GYOTO_C2_CGS_M1 *exp(-HnuOverKt); else //Planck return 2.*GYOTO_PLANCK_CGS*nuem*nuem*nuem*GYOTO_C2_CGS_M1 *1./(exp(HnuOverKt)-1.); } double PolishDoughnut::funcxM(double alpha1, double alpha2, double alpha3, double xM) { //Mahadevan 96 fit function return 4.0505*alpha1/pow(xM,1./6.) *(1.+0.4*alpha2/pow(xM,1./4.)+0.5316*alpha3/sqrt(xM)) *exp(-1.8899*pow(xM,1./3.)); } // Intersection of the constant angular momentum l0 with the Keplerian one //double PolishDoughnut::intersection(double rr) const double PolishDoughnut::intersection_t::operator()(double rr) const { double y = ((rr*rr - 2.*aa_*sqrt(rr) + aa2_)/(pow(rr,3./2.) - 2.*sqrt(rr) + aa_)) - l0_ ; return y ; // y = 0 gives 2 intersections, //the cusp and the central radius of the torus } // Solving the transcendental equation for "xM" numerically at each r double PolishDoughnut::transcendental_t::operator()(double xM) const { double rr = par[0] ; double n_e = par[1] ; double BB = par[2] ; double Te = par[3] ; double alpha1 = par[4] ; double alpha2 = par[5] ; double alpha3 = par[6] ; double temp_e = GYOTO_BOLTZMANN_CGS*Te /(GYOTO_ELECTRON_MASS_CGS*GYOTO_C_CGS*GYOTO_C_CGS); double nu_0 = GYOTO_ELEMENTARY_CHARGE_CGS* BB / (2. * M_PI * GYOTO_ELECTRON_MASS_CGS * GYOTO_C_CGS); double func_xM = PolishDoughnut::funcxM(alpha1,alpha2,alpha3,xM); double BesselK2 = bessk(2,1./temp_e); double nuem = 3./2.*xM*nu_0*temp_e*temp_e; // double y = GYOTO_ELEMENTARY_CHARGE_CGS*GYOTO_ELEMENTARY_CHARGE_CGS // /(sqrt(3.)*GYOTO_C_CGS) * (4.*M_PI*n_e)/BesselK2 // * nuem * func_xM * 4./3.*M_PI*rr*rr*rr // - M_PI * 2.*GYOTO_PLANCK_CGS/(GYOTO_C_CGS*GYOTO_C_CGS)*nuem*nuem*nuem // / (exp(GYOTO_PLANCK_CGS*nuem/(GYOTO_BOLTZMANN_CGS*Te))-1.) // * 4.*M_PI*rr*rr; double Bnu=0.; //if (exp(GYOTO_PLANCK_CGS*nuem/(GYOTO_BOLTZMANN_CGS*Te))==1.){ //Rayleigh Jeans //AJOUTER TEST hnu<2!"); tox=2.0/xx; bkm=bessk0(xx); bk=bessk1(xx); for(int j=1;jsetMetric(gg_); fmp->setParameter("Lambda", lambda_); fmp->setParameter("TempRatio", temperature_ratio_); fmp->setParameter("CentralDensity", central_density_); fmp->setParameter("CentralTempOverVirial", centraltemp_over_virial_); fmp->setParameter("Beta", beta_); if (use_specific_impact_) fmp->setParameter("UseSpecificImpact"); fmp->setParameter("SpectralOversampling", spectral_oversampling_); Standard::fillElement(fmp); } #endif Gyoto-0.1.0/lib/PowerLawSpectrum.C000066400000000000000000000041121217470755400167600ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoPowerLawSpectrum.h" #include "GyotoFactoryMessenger.h" #include #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #endif using namespace Gyoto; Spectrum::PowerLaw::PowerLaw() : Spectrum::Generic("PowerLaw"), constant_(1.), exponent_(0.) {} Spectrum::PowerLaw::PowerLaw(double p, double c) : Spectrum::Generic("PowerLaw"), constant_(c), exponent_(p) {} Spectrum::PowerLaw * Spectrum::PowerLaw::clone() const { return new Spectrum::PowerLaw(*this); } double Spectrum::PowerLaw::getConstant() const { return constant_; } void Spectrum::PowerLaw::setConstant(double c) { constant_ = c; } double Spectrum::PowerLaw::getExponent() const { return exponent_; } void Spectrum::PowerLaw::setExponent(double c) { exponent_ = c; } double Spectrum::PowerLaw::operator()(double nu) const { return constant_ * pow(nu, exponent_); } #ifdef GYOTO_USE_XERCES void Spectrum::PowerLaw::fillElement(FactoryMessenger *fmp) const { fmp->setParameter("Exponent", exponent_); fmp->setParameter("Constant", constant_); Spectrum::Generic::fillElement(fmp); } void Gyoto::Spectrum::PowerLaw::setParameter(std::string name, std::string content, std::string unit) { char * tc=const_cast(content.c_str()); if (name=="Exponent") setExponent(atof(tc)); else if (name=="Constant") setConstant(atof(tc)); else Spectrum::Generic::setParameter(name, content, unit); } #endif Gyoto-0.1.0/lib/Register.C000066400000000000000000000120731217470755400152660ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoRegister.h" #include "GyotoUtils.h" #include "GyotoAstrobj.h" #include "GyotoMetric.h" #include "GyotoSpectrum.h" #include "GyotoSpectrometer.h" #include "GyotoConverters.h" #include #include #include #include using namespace Gyoto; using namespace std; typedef void GyotoInitFcn(); void Gyoto::loadPlugin(char const*const name, int nofail) { string dlfile = "libgyoto-" ; dlfile += name ; dlfile += "." ; dlfile += GYOTO_PLUGIN_SFX ; string dlfunc = "__Gyoto"; dlfunc += name ; dlfunc += "Init"; void* handle = NULL; GyotoInitFcn* initfcn = NULL; char * err = NULL; if (debug()) cerr << "DEBUG: loading plug-in: " << name << " from file: " << dlfile << endl; handle = dlopen(dlfile.c_str(), RTLD_LAZY | RTLD_GLOBAL); if (!handle) { string dlpath = GYOTO_PREFIX ; dlpath += "/lib/gyoto/" ; string dlfull = dlpath + dlfile; handle = dlopen(dlfull.c_str(), RTLD_LAZY | RTLD_GLOBAL); if (!handle) { dlfull = dlpath ; dlfull += GYOTO_SOVERS ; dlfull += "/" ; dlfull += dlfile ; handle = dlopen(dlfull.c_str(), RTLD_LAZY | RTLD_GLOBAL); if (!handle && nofail) { if (verbose() >= GYOTO_DEFAULT_VERBOSITY) cerr << "WARNING: unable to load optional plug-in " << dlfile << endl; return; } } } if ( (err=dlerror()) ) throwError(err); if (!handle) throwError((string("Failed to load plug-in ")+dlfile).c_str()); if (debug()) cerr << "DEBUG: calling plug-in init function " << dlfunc << endl; initfcn = (GyotoInitFcn*)dlsym(handle, dlfunc.c_str()); if ( (err=dlerror()) ) throwError(err); (*initfcn)(); } #if defined GYOTO_USE_XERCES void Gyoto::Register::init(char const * cpluglist) { // Clean registers Metric::initRegister(); Astrobj::initRegister(); Spectrum::initRegister(); // This cleans and fills Spectometer::Register_ Spectrometer::initRegister(); // Init units system Units::Init(); // Init built-in plug-ins #ifdef GYOTO_BUILTIN_STDPLUG __GyotostdplugInit(); #endif #ifdef GYOTO_BUILTIN_LORENEPLUG __GyotoloreneInit(); #endif // Load DL plug-ins if (!cpluglist) cpluglist = getenv("GYOTO_PLUGINS"); if (!cpluglist) cpluglist = GYOTO_DEFAULT_PLUGINS; std::string pluglist = cpluglist; if (pluglist.length()) { size_t first=0, last=0; string curplug=""; int nofail=0; while (pluglist.length()) { last=pluglist.find(","); nofail=0; curplug=pluglist.substr(0, last); if (debug()) cerr << "DEBUG: first: " << first << ", last: " << last << ", pluglist: |" << pluglist << "|" << ", curplug: |" << curplug << "|" << endl; if (last <= pluglist.length()) pluglist=pluglist.substr(last+1); else pluglist=""; if (!curplug.compare(0, 7, "nofail:")) { curplug = curplug.substr(7); nofail=1; } Gyoto::loadPlugin(curplug.c_str(), nofail); nofail=0; } } if (debug()) Register::list(); } Register::Entry::Entry(std::string name, Gyoto::SmartPointee::Subcontractor_t* subcontractor, Register::Entry* next) : name_(name), subcontractor_(subcontractor), next_(next) {} Register::Entry::~Entry() { if (next_) delete next_; } Gyoto::SmartPointee::Subcontractor_t* Register::Entry::getSubcontractor(std::string name, int errmode) { # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_EXPR(name); GYOTO_DEBUG_EXPR(errmode); GYOTO_ENDIF_DEBUG # endif if (name_==name) return subcontractor_; if (next_) return next_ -> getSubcontractor(name, errmode); if (errmode) return NULL; throwError ("Unregistered kind: "+name); return NULL; // will never get there, avoid compilation warning } void Gyoto::Register::list() { Register::Entry* entry = NULL; cout << "List of available Metrics:" << endl; for (entry = Metric::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; cout << "List of available Astrobjs:" << endl; for (entry = Astrobj::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; cout << "List of available Spectra:" << endl; for (entry = Spectrum::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; cout << "List of available Spectrometers:" << endl; for (entry = Spectrometer::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; } #endif Gyoto-0.1.0/lib/RotStar3_1.C000066400000000000000000000756611217470755400154170ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // Lorene headers #include "star_rot.h" #include "eos.h" #include "utilitaires.h" #include "graphique.h" #include "nbr_spx.h" #include "unites.h" #include "GyotoUtils.h" #include "GyotoRotStar3_1.h" #include "GyotoError.h" #include "GyotoFactoryMessenger.h" #include #include #include #include #include #include #include using namespace Gyoto; using namespace Gyoto::Metric; RotStar3_1::RotStar3_1() : Generic(GYOTO_COORDKIND_SPHERICAL), filename_(NULL), star_(NULL), integ_kind_(1) { setKind("RotStar3_1"); } RotStar3_1::RotStar3_1(const RotStar3_1& o) : Generic(o), filename_(NULL), star_(NULL), integ_kind_(o.integ_kind_) { setKind("RotStar3_1"); setFileName(o.getFileName()); } RotStar3_1* RotStar3_1::clone() const { return new RotStar3_1(*this); } RotStar3_1::~RotStar3_1() { const Map& mp=star_ -> get_mp(); const Mg3d* mg=mp.get_mg(); const Map* mpp=∓ delete star_; delete mpp; delete mg; delete [] filename_; if (debug()) cout << "RotStar3_1 Destruction" << endl; } void RotStar3_1::setFileName(char const * lorene_res) { if (filename_) { delete[] filename_; filename_=NULL; } if (star_) { const Map& mp=star_ -> get_mp(); const Mg3d* mg=mp.get_mg(); const Map* mpp=∓ delete star_; star_=NULL; delete mpp; delete mg; } filename_ = new char[strlen(lorene_res)+1]; strcpy(filename_,lorene_res); FILE* resfile=fopen(lorene_res,"r"); if (!resfile) throwError(string("No such file or directory: ")+lorene_res); Mg3d* mg = new Mg3d(resfile); Map_et* mps = new Map_et(*mg,resfile); Eos* p_eos = Eos::eos_from_file(resfile); star_ = new Star_rot(*mps,*p_eos,resfile); star_ -> equation_of_state(); star_ -> update_metric(); star_ -> hydro_euler(); tellListeners(); } char const * RotStar3_1::getFileName() const { return filename_; } void RotStar3_1::setIntegKind(int ik) { integ_kind_ = ik; } int RotStar3_1::getIntegKind() const { return integ_kind_; } int RotStar3_1::diff(const double coord[8], double res[8]) const { //4-DIMENSIONAL INTEGRATION //NB: this diff is only called by Generic::RK4 //if (debug()) cout << "In 4D RotStar diff [8]..." << endl; //clock_t time1, time2; //double diftime, clocks = CLOCKS_PER_SEC; //time1 = clock(); double rr=coord[1],r2=rr*rr,th=coord[2],sinth2=sin(th)*sin(th),ph=coord[3]; //LAPSE const Scalar & NNscal=star_ -> get_nn(); double NN=NNscal.val_point(rr,th,ph), N2=NN*NN; double N_r=NNscal.dsdr().val_point(rr,th,ph); double N_th=NNscal.dsdt().val_point(rr,th,ph); //SHIFT (OMEGA) const Scalar & omega_scal=star_ -> get_nphi();//NB: avoid using star_ -> get_beta(), it is very time-consuming double omega=omega_scal.val_point(rr,th,ph), omega2=omega*omega; double omega_r=omega_scal.dsdr().val_point(rr,th,ph); double omega_th=omega_scal.dsdt().val_point(rr,th,ph); //METRIC POTENTIALS const Scalar & A2scal=star_ -> get_a_car(); const Scalar & B2scal=star_ -> get_b_car(); double A2=A2scal.val_point(rr,th,ph), B2=B2scal.val_point(rr,th,ph); double A2_r=A2scal.dsdr().val_point(rr,th,ph), B2_r=B2scal.dsdr().val_point(rr,th,ph); double A2_th=A2scal.dsdt().val_point(rr,th,ph), B2_th=B2scal.dsdt().val_point(rr,th,ph); /* time2 = clock(); diftime = time2 - time1; if (debug()) cout << "Time elapsed in temp 4D diff (in sec)= " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << diftime/clocks << endl;*/ //METRIC COEF double gtt=-1./N2, grr=1./A2, gthth=1./(A2*r2), gpp=1./(B2*r2*sinth2)-omega2/N2, gtp=-omega/N2; double g_ttr=-2.*NN*N_r+B2_r*omega2*r2*sinth2+2.*omega*omega_r*B2*r2*sinth2+2.*rr*B2*omega2*sinth2, g_ttth=-2.*NN*N_th+B2_th*omega2*r2*sinth2+2.*omega*omega_th*B2*r2*sinth2+2.*cos(th)*sin(th)*r2*B2*omega2; double g_rrr=A2_r, g_rrth=A2_th; double g_ththr=r2*A2_r+2.*rr*A2, g_ththth=r2*A2_th; double g_ppr=sinth2*(r2*B2_r+2.*rr*B2), g_ppth=r2*(sinth2*B2_th+2.*cos(th)*sin(th)*B2); double g_tpr=-omega_r*B2*r2*sinth2-omega*B2_r*r2*sinth2-2.*rr*omega*B2*sinth2, g_tpth=-omega_th*B2*r2*sinth2-omega*B2_th*r2*sinth2-2.*cos(th)*sin(th)*omega*B2*r2; //4D CHRISTOFFELS in stationnary axisym spacetime double ch001=1./2.*gtt*g_ttr+1./2.*gtp*g_tpr, ch002=1./2.*gtt*g_ttth+1./2.*gtp*g_tpth, ch031=1./2.*gtt*g_tpr+1./2.*gtp*g_ppr, ch032=1./2.*gtt*g_tpth+1./2.*gtp*g_ppth, ch331=1./2.*gpp*g_ppr+1./2.*gtp*g_tpr, ch332=1./2.*gpp*g_ppth+1./2.*gtp*g_tpth, ch301=1./2.*gpp*g_tpr+1./2.*gtp*g_ttr, ch302=1./2.*gpp*g_tpth+1./2.*gtp*g_ttth, ch122=-1./2.*grr*g_ththr, ch133=-1./2.*grr*g_ppr, ch100=-1./2.*grr*g_ttr, ch111=1./2.*grr*g_rrr, ch112=1./2.*grr*g_rrth, ch103=-1./2.*grr*g_tpr, ch200=-1./2.*gthth*g_ttth, ch211=-1./2.*gthth*g_rrth, ch233=-1./2.*gthth*g_ppth, ch222=1./2.*gthth*g_ththth, ch221=1./2.*gthth*g_ththr, ch203=-1./2.*gthth*g_tpth; //RESULT: Derivatives res[0]=coord[4]; res[1]=coord[5]; res[2]=coord[6]; res[3]=coord[7]; //From the 4D equation of geodesics: res[4]=-2.*ch001*coord[4]*coord[5]-2.*ch002*coord[4]*coord[6]-2.*ch031*coord[7]*coord[5] - 2.*ch032*coord[7]*coord[6];//added 2011-02-27 ch032 term forgotten! to be checked res[5]=-ch111*coord[5]*coord[5]-ch122*coord[6]*coord[6]-ch133*coord[7]*coord[7]-ch100*coord[4]*coord[4]-2.*ch112*coord[5]*coord[6]-2.*ch103*coord[4]*coord[7]; res[6]=-ch211*coord[5]*coord[5]-ch222*coord[6]*coord[6]-ch233*coord[7]*coord[7]-ch200*coord[4]*coord[4]-2.*ch221*coord[5]*coord[6]-2.*ch203*coord[4]*coord[7]; res[7]=-2.*ch301*coord[4]*coord[5]-2.*ch302*coord[4]*coord[6]-2.*ch331*coord[7]*coord[5]-2.*ch332*coord[7]*coord[6]; /* time2 = clock(); diftime = time2 - time1; if (debug()) cout << "TOTAL Time elapsed in 4D diff (in sec)= " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << diftime/clocks << endl;*/ return 0; } int RotStar3_1::diff(const double y[6], double res[6], int) const { //3+1 INTEGRATION //NB: this diff is only called by RotStar::RK4 //NBB: here t=theta, not time! //if (debug()) cout << "In 3+1 D RotStar::diff" << endl; // clock_t time1, time2; //double diftime, clocks = CLOCKS_PER_SEC; //time1 = clock(); //NB: all the computations used here are detailed in my 3+1 notes. //NB: Lorene coordinates are spherical-like //Variables: y=[r,theta,phi,Vr,Vtheta,Vphi] see definitions 3+1 geod paper double rr=y[0], r2=rr*rr, th=y[1], sinth2=sin(th)*sin(th), phi=y[2]; /* Important remark! [actually it is not used because the metric coef are known in function of A, B, N... ; but interesting to keep this in mind] Lorene gcon and gcov function return metric coef expressed in the orthonormal spherical tetrad d/dr, 1/r d/dtheta, 1/(r*sin(theta)) d/dphi There's thus a change of basis to come back to the natural basis of spherical coordinates. */ //LAPSE const Scalar & NNscal=star_ -> get_nn(); double NN=NNscal.val_point(rr,th,phi);//, NN2=NN*NN; if (NN == 0.) throwError("In RotStar3_1.C: NN==0!!"); double Nr=NNscal.dsdr().val_point(rr,th,phi); double Nt=NNscal.dsdt().val_point(rr,th,phi); //SHIFT (OMEGA) const Scalar & omega_scal=star_ -> get_nphi(); double omega=omega_scal.val_point(rr,th,phi); double omega_r=omega_scal.dsdr().val_point(rr,th,phi); double omega_t=omega_scal.dsdt().val_point(rr,th,phi); //METRIC POTENTIALS const Scalar & A2scal=star_ -> get_a_car(); const Scalar & B2scal=star_ -> get_b_car(); double A2=A2scal.val_point(rr,th,phi), B2=B2scal.val_point(rr,th,phi); double A2_r=A2scal.dsdr().val_point(rr,th,phi), B2_r=B2scal.dsdr().val_point(rr,th,phi); double A2_th=A2scal.dsdt().val_point(rr,th,phi),B2_th=B2scal.dsdt().val_point(rr,th,phi); /* time2 = clock(); diftime = time2 - time1; if (debug()) cout << "Time elapsed in 3+1 diff (in sec)= " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << diftime/clocks << endl;*/ //METRIC COEF double grr=1./A2, gtt=1./(A2*r2), gpp=1./(B2*r2*sinth2), g_rrr=A2_r, g_rrt=A2_th, g_ttr=r2*A2_r+2.*rr*A2, g_ttt=r2*A2_th, g_ppr=r2*sinth2*B2_r+2.*rr*B2*sinth2, g_ppt=r2*sinth2*B2_th+2.*sin(th)*cos(th)*r2*B2; /* //Change of basis [Not used] gtt_=1./r2*gtt_;gpp_=1./(r2*sinth2)*gpp_;//natural basis contrav metric g_ttr_=2.*rr*g_tt_+r2*g_ttr;g_ttt_=r2*g_ttt_;g_ppr_=sinth2*(2.*rr*g_pp_+r2*g_ppr_);g_ppt_=r2*(2.*cos(th)*sin(th)*g_pp_+sinth2*g_ppt_);//natural basis derived covar metric (NB: the cov metric ceof that appear here must be in the orthonormal basis) */ //EXTRINSIC CURVATURE double Krp=-1./(2.*NN)*B2*r2*sinth2*omega_r; double Ktp=-1./(2.*NN)*B2*r2*sinth2*omega_t; //3-CHRISTOFFELS double Grrr=1./2.*grr*g_rrr, Grrt=1./2.*grr*g_rrt, Gttr=1./2.*gtt*g_ttr, Gttt=1./2.*gtt*g_ttt, Gppr=1./2.*gpp*g_ppr, Gptp=1./2.*gpp*g_ppt, Grtt=-1./2.*grr*g_ttr, Grpp=-1./2.*grr*g_ppr, Gtrr=-1./2.*gtt*g_rrt, Gtpp=-1./2.*gtt*g_ppt;//these are the only non-0 Christo /* OBSOLETE VERSION */ // //Christoffel terms (xdot^j+beta^j)(xdot^k+beta^k)Gamma^i_jk in geodesic eq.: // double Christo_r=rdot*rdot*Grrr+2.*rdot*thdot*Grrt+thdot*thdot*Grtt+(phidot-omega)*(phidot-omega)*Grpp, // Christo_th=2.*rdot*thdot*Gttr+thdot*thdot*Gttt+rdot*rdot*Gtrr+(phidot-omega)*(phidot-omega)*Gtpp, // Christo_ph=2.*rdot*(phidot-omega)*Gppr+2.*thdot*(phidot-omega)*Gptp; // double kappa=1./NN2*(rdot*Nr+thdot*Nt)-2./NN2*rdot*(phidot-omega)*Krp-2./NN2*thdot*(phidot-omega)*Ktp; // //RESULT: derivatives (see geodesic equation in 3+1) // res[0]=rdot; // res[1]=thdot; // res[2]=phidot; // res[3]=kappa*NN*rdot-NN*grr*Nr+1./NN*(Nr*rdot+Nt*thdot)*rdot+2.*NN*grr*(phidot-omega)*Krp-Christo_r;//-Grtt*thdot*thdot-Grpp*phidot*phidot; // res[4]=kappa*NN*thdot-NN*gtt*Nt+1./NN*(Nr*rdot+Nt*thdot)*thdot+2.*NN*gtt*(phidot-omega)*Ktp-Christo_th;//-2.*Gttr*rdot*thdot-Gtpp*phidot*phidot; // res[5]=kappa*NN*(phidot-omega)+1./NN*(Nr*rdot+Nt*thdot)*(phidot-omega)+2.*rdot*omega_r+2.*thdot*omega_t+2.*NN*gpp*(rdot*Krp+thdot*Ktp)-Christo_ph;//-2.*Gppr*rdot*phidot-2.*Gptp*thdot*phidot; // /* NEW VERSION JULY 2011 */ double Vr = y[3], Vth = y[4], Vph = y[5]; double Christo_r=Vr*Vr*Grrr+2.*Grrt*Vr*Vth+Grtt*Vth*Vth+Grpp*Vph*Vph, Christo_th=Gtrr*Vr*Vr+2.*Gttr*Vr*Vth+Gttt*Vth*Vth+Gtpp*Vph*Vph, Christo_ph=2.*Gppr*Vr*Vph+2.*Gptp*Vth*Vph; //See 3+1 equation of geodesics double prefact=1./NN*Vr*Nr+1./NN*Vth*Nt-2.*Krp*Vr*Vph-2.*Ktp*Vth*Vph; double Vrdot = NN*(Vr*prefact+2.*grr*Krp*Vph-Christo_r)-grr*Nr, Vthdot = NN*(Vth*prefact+2.*gtt*Ktp*Vph-Christo_th)-gtt*Nt, Vphdot = NN*(Vph*prefact+2.*gpp*(Krp*Vr+Ktp*Vth)-Christo_ph) +Vr*omega_r+Vth*omega_t; //NB: dot = wrt coordinate time t res[0]=NN*Vr; //dr/dt res[1]=NN*Vth; //dtheta/dt res[2]=NN*Vph+omega; //dphi/dt res[3]=Vrdot; //dVr/dt res[4]=Vthdot; //dVtheta/dt res[5]=Vphdot; //dVphi/dt /* time2 = clock(); diftime = time2 - time1; if (debug()) cout << "TOTAL Time elapsed in 3+1 diff (in sec)= " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << diftime/clocks << endl;*/ return 0; } int RotStar3_1::myrk4(const double coorin[6], double h, double res[6]) const { //if (debug()) cout << "In RotStar::rk4" << endl; //Here the integration must be 3+1: if (!integ_kind_) throwError("In RotStar3_1::myrk4: Impossible case"); double k1[6], k2[6], k3[6], k4[6], coor_plus_halfk1[6], sixth_k1[6], coor_plus_halfk2[6], third_k2[6], coor_plus_k3[6], third_k3[6], sixth_k4[6]; if(diff(coorin,k1,1)) return 1; for (int i=0;i<6;i++) { k1[i]=h*k1[i]; coor_plus_halfk1[i]=coorin[i]+0.5*k1[i]; sixth_k1[i]=1./6.*k1[i]; } if(diff(coor_plus_halfk1,k2,1)) return 1; for (int i=0;i<6;i++) { k2[i]=h*k2[i]; coor_plus_halfk2[i]=coorin[i]+0.5*k2[i]; third_k2[i]=1./3.*k2[i]; } if(diff(coor_plus_halfk2,k3,1)) return 1; for (int i=0;i<6;i++) { k3[i]=h*k3[i]; coor_plus_k3[i]=coorin[i]+k3[i]; third_k3[i]=1./3.*k3[i]; } if(diff(coor_plus_k3,k4,1)) return 1; for (int i=0;i<6;i++) { k4[i]=h*k4[i]; sixth_k4[i]=1./6.*k4[i]; } for (int i=0;i<6;i++) { res[i]=coorin[i]+sixth_k1[i]+third_k2[i]+third_k3[i]+sixth_k4[i]; } return 0; } //int RotStar3_1::myrk4_adaptive(const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1, int &) const int RotStar3_1::myrk4_adaptive(const double coord[6], double, double normref, double coordnew[6], double cst[2], double& tdot_used, double h0, double& h1, double& hused) const { // if (debug()) cout << "In Rotstar::adaptive [6]" << endl; double delta0[6]; double delta0min=1e-15; double dcoord[6]; double eps=0.0001; double S=0.9; double errmin=1e-6; double h1min=0.001; double h1max=1e6; // double factnorm=2.; double sigh1=1.; /*if (debug()) cout << "RotStar.C: coord in rk="; for (int ii=0;ii<8;ii++) if (debug()) cout << coord[ii] << " " ; if (debug()) cout << endl;*/ diff(coord,dcoord,1); for (int i = 0;i<6;i++) { delta0[i]=delta0min+eps*(fabs(h0*dcoord[i])); //if (debug()) cout << "Rot: delta0[i]=" << delta0[i] << endl; } double hbis=0.5*h0; double coordhalf[6]; double coord2[6]; double delta1[6]; double err; int count=0; // double newnorm; while (1){ count++; //if (debug()) cout << "count in rk Rot= " << count << endl; if (count > 100){ throwError("RotStar: bad rk"); } err=0.; myrk4(coord,h0,coordnew); myrk4(coord,hbis,coordhalf); myrk4(coordhalf,hbis,coord2); double coordnewbis[6], coordhalfbis[6], coord2bis[6], tdot_unused; int normalize=1; /* NB: for the time being (2011-03-11), normalize=1 imposes to update phprime and tdot to insure conservation of cst of motion; In order to insure norm conservation, there is an other flag in Normalize4v: consnorm, to be put to the desired value Caution: be sure it is really needed before putting consnorm to 1, it slows down A LOT the computation */ if (normalize){ Normalize4v(coordnew,coordnewbis,cst,tdot_used); Normalize4v(coordhalf,coordhalfbis,cst,tdot_unused); Normalize4v(coord2,coord2bis,cst,tdot_unused); for (int ii=0;ii<6;ii++){ coordnew[ii]=coordnewbis[ii]; coordhalf[ii]=coordhalfbis[ii]; coord2[ii]=coord2bis[ii]; } }else{ if (fabs(normref)0) throwError("In RotStar3_1.C: impossible to compute timelike norm!"); if (tdot_used<=0.){//NB: default value of tdot_used has correct sign tdot_used=-sqrt(-1./ds2); }else{ tdot_used=sqrt(-1./ds2); } } } for (int i = 0;i<6;i++){ delta1[i]=coord2[i]-coordnew[i]; if (err1) { h0=S*h0*pow(err,-0.25); hbis=0.5*h0; }else{ h1=(err > errmin ? S*h0*pow(err,-0.2) : 4.*h0);//pour éviter les explosions if (h1<0.) sigh1=-1.;//why sigh1 and fabs(h1)? because otherwise if h1<0 (possible here if backwards integration), h1 is < h1min, so h1 is always set to h1min... if (fabs(h1)h1max) h1=sigh1*h1max; hused=h0; break; } } return 0; } int RotStar3_1::myrk4_adaptive(Worldline* line, const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1) const { // if (debug()) cout << "In Rotstar::adaptive [8]" << endl; if (coord[1] < 2.5) {//inside rotating star -> a ameliorer if (debug()) cout << "In RotStar3_1.C: Particle has reached the rotating star. Stopping integration." << endl; return 1; } if (!integ_kind_) { /* To use 4D integration Here, the integration is performed by the most general Generic::myrk4 + Generic::diff functions that only call the christoffels (basic geodesic equation). The function christoffel being defined here in RotStar3_1, it is the 4D-christo computed thanks to 3+1 quantities that are used. */ if (Generic::myrk4_adaptive(line,coord,lastnorm,normref,coordnew,h0,h1)) { return 1; }else{ return 0; } } //Below: 3+1 integration //Variables used: [r,theta,phi,Vr,Vtheta,Vphi] for definition see 3+1 geod paper double rr=coord[1],th=coord[2],ph=coord[3],tdot=coord[4],rdot=coord[5],thdot=coord[6],phdot=coord[7],rprime=rdot/tdot,thprime=thdot/tdot,phprime=phdot/tdot; const Scalar & NNscal=star_ -> get_nn(); double NN=NNscal.val_point(rr,th,ph);//, NN2=NN*NN; if (NN == 0.) throwError("In RotStar3_1.C: NN==0!!"); const Scalar & omega_scal=star_ -> get_nphi(); double omega=omega_scal.val_point(rr,th,ph); double Vr = 1./NN*rprime, Vth=1./NN*thprime, Vph=1./NN*(phprime-omega); double g_tt=gmunu(coord,0,0), g_tp=gmunu(coord,0,3), g_pp=gmunu(coord,3,3); double cst_p_t=g_tt*tdot+g_tp*phdot, cst_p_ph=g_pp*phdot+g_tp*tdot;//Cst of motion because the vectors d/dt and d/dphi are Killing //if (debug()) cout << "Rot: cst= " << cst_p_t << " " << cst_p_ph << endl; double cst[2]={cst_p_t,cst_p_ph}; //cout << "3+1 Cst of motion= " << cst_p_t << " " << cst_p_ph << endl; double coor[6]={rr,th,ph,Vr,Vth,Vph}; double coornew[6]; double hused=1000.; if (tdot<0. && h0>0.) h0*=-1.;//to integrate backwards if tdot<0 double tdot_used=tdot; /*if (tdot<=0.){ tdot_used=-1000.; }else{ tdot_used=1000.; }//tdot_used thus has the correct sign*/ if (myrk4_adaptive(coor,lastnorm,normref,coornew,cst,tdot_used,h0,h1,hused)) return 1; // if (debug()) cout << "tdot_used in rk-8= " << tdot_used << endl; //phdot=coornew[5]*tdot_used;rdot=coornew[3]*tdot_used;thdot=coornew[4]*tdot_used; NN=NNscal.val_point(coornew[0],coornew[1],coornew[2]); omega=omega_scal.val_point(coornew[0],coornew[1],coornew[2]); phdot=(NN*coornew[5]+omega)*tdot_used;rdot=NN*coornew[3]*tdot_used;thdot=NN*coornew[4]*tdot_used; coordnew[0]=coord[0]+hused;coordnew[1]=coornew[0];coordnew[2]=coornew[1];coordnew[3]=coornew[2];coordnew[4]=tdot_used;coordnew[5]=rdot;coordnew[6]=thdot;coordnew[7]=phdot; // if (debug()) cout << "Rot: norm at end rk-8= " << ScalarProd(coordnew,coordnew+4,coordnew+4) << endl; return 0; } void RotStar3_1::Normalize4v(const double coordin[6], double coordout[6], const double cst[2], double& tdot_used) const{ //Here coordin=[r,theta,phi,Vr,Vtheta,Vphi] double posin[4]={0.,coordin[0],coordin[1],coordin[2]};//posin={t,rr,th,ph} with t=anything (g_munu are independent of t), {rr,th,ph}=cf coordin double g_tt=gmunu(posin,0,0), g_rr=gmunu(posin,1,1), g_thth=gmunu(posin,2,2), g_tp=gmunu(posin,0,3), g_pp=gmunu(posin,3,3), cst_p_t=cst[0], cst_p_ph=cst[1]; double phdot,phprime; //double phprime_init=coordin[5],dphpr=0.01; const Scalar & NNscal=star_ -> get_nn(); double NN=NNscal.val_point(coordin[0],coordin[1],coordin[2]);//, NN2=NN*NN; if (NN == 0.) throwError("In RotStar3_1.C: NN==0!!"); const Scalar & omega_scal=star_ -> get_nphi(); double omega=omega_scal.val_point(coordin[0],coordin[1],coordin[2]); double phprime_init=NN*coordin[5]+omega,dphpr=0.01; // Changing phdot and tdot (thus phprime) to insure conservation of cst of motion if (g_tt != 0. && (g_tt*g_pp != g_tp*g_tp)){ phdot=(cst_p_ph - g_tp/g_tt*cst_p_t)/(g_pp-g_tp*g_tp/g_tt); tdot_used=(cst_p_t - g_tp*phdot)/g_tt; phprime=phdot/tdot_used;//cf constants of motion // if (debug()) cout << "tdot use in Normalize= " << tdot_used << endl; }else{ throwError("RotStar3_1.C: special case metric coef=0 to handle in Normalize4v..."); } if (fabs(phprime-phprime_init)>dphpr*fabs(phprime_init)){ if (verbose() >= GYOTO_SEVERE_VERBOSITY) cerr << "WARNING (severe):" << endl << "Too big change in phprime: " << phprime_init << " " << phprime << endl; } /*double fourvel[4]={tdot_used,NN*coordin[3]*tdot_used,NN*coordin[4]*tdot_used,phprime*tdot_used}; //4-velocity with correct value of tdot and phdot cout << "DEBUT AFFICHE" << endl; cout << "Vr= " << coordin[3] << " " << NN << " " << tdot_used << " " << NN*coordin[3]*tdot_used << endl; cout << "fourvel= " ; for (int ii=0;ii<4;ii++) cout << fourvel[ii] << " " ; cout << endl; cout << "-------> tdot= " << tdot_used << endl; double normaffich=ScalarProd(posin,fourvel,fourvel); cout << "cst motion in Normalize= " << normaffich << " " << cst_p_t << " " << cst_p_ph << endl; if (fabs(normaffich)>1000. || normaffich!=normaffich) throwError("testrotstar --"); */ // double rprime=coordin[3], thprime=coordin[4]; double rprime=NN*coordin[3], thprime=NN*coordin[4]; double rprime_new=rprime, thprime_new=thprime; int consnorm=0; if (consnorm){ // Changing rprime and thprime to insure norm conservation double norminit=tdot_used*tdot_used*(g_tt+2.*g_tp*phprime+g_rr*rprime*rprime+g_thth*thprime*thprime+g_pp*phprime*phprime);//ScalarProd(tempvec,tempvec+4,tempvec+4);// double normref; if (fabs(norminit) get_nn(); double NN=NNtemp.val_point(rr,th,ph), N2=NN*NN; const Scalar & omega_scal=star_ -> get_nphi(); double omega=omega_scal.val_point(rr,th,ph); double B2=(star_ -> get_b_car()).val_point(rr,th,ph); double A2=(star_ -> get_a_car()).val_point(rr,th,ph); double g_tt=(B2*r2*sinth2*omega*omega-N2), g_tp=-omega*B2*r2*sinth2, g_rr=A2, g_thth=A2*r2, g_pp=B2*r2*sinth2; //DEBUG!!!! flat metric *************** //g_tt=-1.;g_tp=0.;g_rr=1.;g_thth=r2;g_pp=r2*sinth2; //************************************* if ((mu==0) && (nu==0)) return g_tt; if ((mu==1) && (nu==1)) return g_rr; if ((mu==2) && (nu==2)) return g_thth; if ((mu==3) && (nu==3)) return g_pp; if (((mu==0) && (nu==3)) || ((mu==3) && (nu==0))) return g_tp; return 0.; } //double RotStar3_1::christoffel(const double coord[8], const int alpha, const int mu, // const int nu) const double RotStar3_1::christoffel(const double coord[8], const int alpha, const int mu, const int nu) const { /* The computation of the christo is easy since we know the expression of gmunu as a function of 3+1 quantities, and since Lorene allows to perform derivatives on quantities. So gmunu,sigma is computable. */ //if (debug()) cout << "In RotStar::christo" << endl; //Gyoto::throwError("RotStar3_1::christoffel: Not implemented yet"); //24/05/10: stationary axisymmetric version double rr=coord[1],r2=rr*rr,th=coord[2],sinth2=sin(th)*sin(th),ph=coord[3]; const Scalar & NNscal=star_ -> get_nn(); double NN=NNscal.val_point(rr,th,ph), N2=NN*NN; const Scalar & NNrscal = NNscal.dsdr(); const Scalar & NNthscal = NNscal.dsdt(); double N_r=NNrscal.val_point(rr,th,ph); double N_th=NNthscal.val_point(rr,th,ph); const Scalar & omega_scal=star_ -> get_nphi(); double omega=omega_scal.val_point(rr,th,ph), omega2=omega*omega; double omega_r=omega_scal.dsdr().val_point(rr,th,ph); double omega_th=omega_scal.dsdt().val_point(rr,th,ph); const Scalar & A2scal=star_ -> get_a_car(); const Scalar & B2scal=star_ -> get_b_car(); const Scalar & A2rscal = A2scal.dsdr(); const Scalar & A2thscal = A2scal.dsdt(); const Scalar & B2rscal = B2scal.dsdr(); const Scalar & B2thscal = B2scal.dsdt(); double B2=B2scal.val_point(rr,th,ph); double A2=A2scal.val_point(rr,th,ph); double A2_r=A2rscal.val_point(rr,th,ph); double A2_th=A2thscal.val_point(rr,th,ph); double B2_r=B2rscal.val_point(rr,th,ph); double B2_th=B2thscal.val_point(rr,th,ph); double gtt=-1./N2, grr=1./A2, gthth=1./(A2*r2), gpp=1./(B2*r2*sinth2)-omega2/N2, gtp=-omega/N2; double g_ttr=-2.*NN*N_r+B2_r*omega2*r2*sinth2+2.*omega*omega_r*B2*r2*sinth2+2.*rr*B2*omega2*sinth2, g_ttth=-2.*NN*N_th+B2_th*omega2*r2*sinth2+2.*omega*omega_th*B2*r2*sinth2+2.*cos(th)*sin(th)*r2*B2*omega2; double g_rrr=A2_r, g_rrth=A2_th; double g_ththr=r2*A2_r+2.*rr*A2, g_ththth=r2*A2_th; double g_ppr=sinth2*(r2*B2_r+2.*rr*B2), g_ppth=r2*(sinth2*B2_th+2.*cos(th)*sin(th)*B2); double g_tpr=-omega_r*B2*r2*sinth2-omega*B2_r*r2*sinth2-2.*rr*omega*B2*sinth2, g_tpth=-omega_th*B2*r2*sinth2-omega*B2_th*r2*sinth2-2.*cos(th)*sin(th)*omega*B2*r2; // if (debug()) cout << "at r t p= " << rr << " " << th << " " << ph << endl; //if (debug()) cout << "gthth, g_ppr= " << gthth << " " << g_ppr << endl; //32 non-0 christo if ((alpha==0 && mu==0 && nu==1) || (alpha==0 && mu==1 && nu==0)) return 1./2.*gtt*g_ttr+1./2.*gtp*g_tpr; if ((alpha==0 && mu==0 && nu==2) || (alpha==0 && mu==2 && nu==0)) return 1./2.*gtt*g_ttth+1./2.*gtp*g_tpth; if ((alpha==0 && mu==3 && nu==1) || (alpha==0 && mu==1 && nu==3)) return 1./2.*gtt*g_tpr+1./2.*gtp*g_ppr; if ((alpha==0 && mu==3 && nu==2) || (alpha==0 && mu==2 && nu==3)) return 1./2.*gtt*g_tpth+1./2.*gtp*g_ppth; if ((alpha==3 && mu==3 && nu==1) || (alpha==3 && mu==1 && nu==3)) return 1./2.*gpp*g_ppr+1./2.*gtp*g_tpr; if ((alpha==3 && mu==3 && nu==2) || (alpha==3 && mu==2 && nu==3)) return 1./2.*gpp*g_ppth+1./2.*gtp*g_tpth; if ((alpha==3 && mu==0 && nu==1) || (alpha==3 && mu==1 && nu==0)) return 1./2.*gpp*g_tpr+1./2.*gtp*g_ttr; if ((alpha==3 && mu==0 && nu==2) || (alpha==3 && mu==2 && nu==0)) return 1./2.*gpp*g_tpth+1./2.*gtp*g_ttth; if (alpha==1 && mu==2 && nu==2) return -1./2.*grr*g_ththr; if (alpha==1 && mu==3 && nu==3) return -1./2.*grr*g_ppr; if (alpha==1 && mu==0 && nu==0) return -1./2.*grr*g_ttr; if (alpha==1 && mu==1 && nu==1) return 1./2.*grr*g_rrr; if ((alpha==1 && mu==1 && nu==2) || (alpha==1 && mu==2 && nu==1)) return 1./2.*grr*g_rrth; if ((alpha==1 && mu==0 && nu==3) || (alpha==1 && mu==3 && nu==0)) return -1./2.*grr*g_tpr; if (alpha==2 && mu==0 && nu==0) return -1./2.*gthth*g_ttth; if (alpha==2 && mu==1 && nu==1) return -1./2.*gthth*g_rrth; if (alpha==2 && mu==3 && nu==3) return -1./2.*gthth*g_ppth; if (alpha==2 && mu==2 && nu==2) return 1./2.*gthth*g_ththth; if ((alpha==2 && mu==2 && nu==1) || (alpha==2 && mu==1 && nu==2)) return 1./2.*gthth*g_ththr; if ((alpha==2 && mu==0 && nu==3) || (alpha==2 && mu==3 && nu==0)) return -1./2.*gthth*g_tpth; return 0.;//all other christo are 0 } double RotStar3_1::ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const { //cout << "in RotStar ScalarProd" << endl; if (debug()) cout << "u1,u2 in Scal= " ; for (int ii=0;ii<4;ii++) { if (debug()) cout << u1[ii] << " " << u2[ii] << " "; } if (debug()) cout << endl; double g_tt=gmunu(pos,0,0), g_tp=gmunu(pos,0,3), g_rr=gmunu(pos,1,1), g_thth=gmunu(pos,2,2), g_pp=gmunu(pos,3,3); //if (debug()) //cout << "metrics in rotstar scalar prod= " << g_tt << " " << g_rr << " " << g_thth << " " << g_pp << " " << g_tp << endl; //cout << "norm sub-terms in rotstar scalar prod= " << g_tt*u1[0]*u2[0] << " " < setParameter("File", filename_); fmp -> setParameter("IntegKind", integ_kind_); Generic::fillElement(fmp); } void RotStar3_1::setParameter(string name, string content, string unit){ if (name=="IntegKind") setIntegKind(atoi(content.c_str())); else if (name == "File") setFileName(content.c_str()); else Generic::setParameter(name, content, unit); } void RotStar3_1::setParameters(FactoryMessenger* fmp) { string name="", content="", unit=""; if (fmp) { while (fmp->getNextParameter(&name, &content, &unit)) { if (name == "File") content = fmp -> fullPath( content ); GYOTO_DEBUG << "Setting \"" << name << "\" to \"" << content << "\" (in unit \"" << unit << "\")\n"; setParameter(name, content, unit); } } } #endif Gyoto-0.1.0/lib/Scenery.C000066400000000000000000000467511217470755400151240ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoScenery.h" #include "GyotoPhoton.h" #include "GyotoFactoryMessenger.h" #include #include #include #include #define DEFAULT_TMIN -DBL_MAX #ifdef HAVE_PTHREAD #include #endif #include /* for benchmarking */ using namespace Gyoto; using namespace std; /*Scenery::Scenery() : gg_(NULL), screen_(NULL), obj_(NULL), deltatau_(0.01) {} */ Scenery::Scenery() : gg_(NULL), screen_(NULL), obj_(NULL), delta_(GYOTO_DEFAULT_DELTA), adaptive_(1), quantities_(0), ph_(), tmin_(DEFAULT_TMIN), nthreads_(0), maxiter_(GYOTO_DEFAULT_MAXITER){} Scenery::Scenery(SmartPointer met, SmartPointer screen, SmartPointer obj) : gg_(met), screen_(screen), obj_(obj), delta_(GYOTO_DEFAULT_DELTA), adaptive_(1), quantities_(0), ph_(), tmin_(DEFAULT_TMIN), nthreads_(0), maxiter_(GYOTO_DEFAULT_MAXITER) { if (screen_) screen_->setMetric(gg_); if (obj_) obj_->setMetric(gg_); } Scenery::Scenery(const Scenery& o) : SmartPointee(o), gg_(NULL), screen_(NULL), obj_(NULL), delta_(o.delta_), adaptive_(o.adaptive_), quantities_(o.quantities_), ph_(o.ph_), tmin_(o.tmin_), nthreads_(o.nthreads_), maxiter_(o.maxiter_) { // We have up to 3 _distinct_ clones of the same Metric. // Keep only one. if (o.gg_()) gg_=o.gg_->clone(); if (o.screen_()) { screen_=o.screen_->clone(); screen_->setMetric(gg_); } if (o.obj_()) { obj_=o.obj_->clone(); obj_->setMetric(gg_); } } Scenery * Scenery::clone() const { return new Scenery(*this); } /*Scenery::Scenery(SmartPointer met, SmartPointer screen, SmartPointer obj) : gg_(met), screen_(screen), obj_(obj), deltatau_(0.01) {} */ Scenery::~Scenery() { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "freeing metric\n"; # endif gg_ = NULL; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "freeing screen\n"; # endif screen_ = NULL; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "freeing astrobj\n"; # endif obj_ = NULL; } SmartPointer Scenery::getMetric() { return gg_; } void Scenery::setMetric(SmartPointer met) { gg_ = met; if (!screen_) screen_ = new Screen (); screen_ -> setMetric(gg_); if (obj_) obj_ -> setMetric(gg_); } SmartPointer Scenery::getScreen() { return screen_; } void Scenery::setScreen(SmartPointer screen) { screen_ = screen; if (gg_) screen_ -> setMetric (gg_) ; } SmartPointer Scenery::getAstrobj() { return obj_; } void Scenery::setAstrobj(SmartPointer obj) { obj_ = obj; if (gg_) obj_ -> setMetric (gg_) ; } double Scenery::getDelta() const { return delta_; } double Scenery::getDelta(const string &unit) const { return Units::FromGeometrical(getDelta(), unit, gg_); } void Scenery::setDelta(double d) { delta_ = d; } void Scenery::setDelta(double d, const string &unit) { setDelta(Units::ToGeometrical(d, unit, gg_)); } void Scenery::setNThreads(size_t n) { nthreads_ = n; } size_t Scenery::getNThreads() const { return nthreads_; } typedef struct SceneryThreadWorkerArg { #ifdef HAVE_PTHREAD pthread_mutex_t * mutex; pthread_t * parent; #endif size_t i, j, imin, imax, jmin, jmax; Scenery *sc; Photon * ph; Astrobj::Properties *data; double * impactcoords; } SceneryThreadWorkerArg ; static void * SceneryThreadWorker (void *arg) { /* This is the real ray-tracing loop. It may be called by multiple threads in parallel, launched from ::rayTrace */ SceneryThreadWorkerArg *larg = static_cast(arg); // Each thread needs its own Photon, clone cached Photon // it is assumed to be already initialized with spectrometer et al. Photon * ph = larg -> ph; #ifdef HAVE_PTHREAD if (larg->mutex) { pthread_mutex_lock(larg->mutex); ph = larg -> ph -> clone(); pthread_mutex_unlock(larg->mutex); } #endif // local variables to store our parameters size_t i, j; Astrobj::Properties data; double * impactcoords = NULL; size_t count=0; while (1) { /////// 1- get input and output parameters and update them for next access //// i and j are input, data and impactcoords are where to store //// output. we must get them and increase them so that another //// thread can get the next values while we integrate. #ifdef HAVE_PTHREAD // lock mutex so we can safely read and update i, j et al. if (larg->mutex) pthread_mutex_lock(larg->mutex); #endif // copy i & j i = larg->i; j = larg->j; if (j > larg->jmax || (j==larg->jmax && i>larg->imax)) { // terminate, but first... #ifdef HAVE_PTHREAD // ...unlock mutex so our siblings can access i & j and terminate too if (larg->mutex) pthread_mutex_unlock(larg->mutex); #endif break; } // update i & j ++larg->i; if (larg->i > larg->imax) { ++larg->j; larg->i=larg->imin; } // copy output pointers and update them data = *larg->data; ++(*larg->data); if (larg->impactcoords) { impactcoords = larg->impactcoords; larg->impactcoords+=16; } #ifdef HAVE_PTHREAD // unlock mutex so our siblings can can access i, j et al. and procede if (larg->mutex) pthread_mutex_unlock(larg->mutex); #endif ////// 2- do the actual work. if (i==larg->imin && verbose() >= GYOTO_QUIET_VERBOSITY && !impactcoords) { # ifdef HAVE_PTHREAD if (larg->mutex) pthread_mutex_lock(larg->mutex); # endif cout << "\rj = " << j << " / " << larg->jmax << " " << flush; # ifdef HAVE_PTHREAD if (larg->mutex) pthread_mutex_unlock(larg->mutex); # endif } # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "i = " << i << ", j = " << j << endl; # endif (*larg->sc)(i, j, &data, impactcoords, ph); ++count; } #ifdef HAVE_PTHREAD if (larg->mutex) { delete ph; pthread_mutex_lock(larg->mutex); } GYOTO_MSG << "\nThread terminating after integrating " << count << " photons"; if (larg->mutex) pthread_mutex_unlock(larg->mutex); # endif return NULL; } void Scenery::rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax, Astrobj::Properties *data, double * impactcoords) { /* Ray-trace now is multi-threaded. What it does is - some initialization - launch nthreads_ - 1 thread working on of SceneryThreadWorker - call SceneryThreadWorker itself rather than sleeping - wait for the other threads to be terminated - some housekeeping */ const size_t npix = screen_->getResolution(); imax=(imax<=(npix)?imax:(npix)); jmax=(jmax<=(npix)?jmax:(npix)); screen_->computeBaseVectors(); // Necessary for KS integration, computes relation between // observer's x,y,z coord and KS X,Y,Z coord. Will be used to // compute photon's initial tangent vector. // Note : this is a BUG if this is required, should be done automagically. /// initialize photon once. It will be cloned. SmartPointer spr = screen_->getSpectrometer(); ph_.setSpectrometer(spr); ph_.setTmin(tmin_); ph_.setFreqObs(screen_->getFreqObs()); double coord[8]; screen_ -> getRayCoord(imin,jmin, coord); ph_ . setInitialCondition(gg_, obj_, coord); ph_ . adaptive(adaptive_); ph_ . maxiter(maxiter_); // delta is reset in operator() if (data) setPropertyConverters(data); SceneryThreadWorkerArg larg; larg.sc=this; larg.ph=&ph_; larg.data=data; larg.impactcoords=impactcoords; larg.i=imin; larg.j=jmin; larg.imin=imin; larg.imax=imax; larg.jmin=jmin; larg.jmax=jmax; struct timeval tim; double start, end; gettimeofday(&tim, NULL); start=double(tim.tv_sec)+(double(tim.tv_usec)/1000000.0); #ifdef HAVE_PTHREAD larg.mutex = NULL; pthread_mutex_t mumu = PTHREAD_MUTEX_INITIALIZER; pthread_t * threads = NULL; pthread_t pself = pthread_self(); larg.parent = &pself; if (nthreads_ >= 2) { threads = new pthread_t[nthreads_-1]; larg.mutex = &mumu; for (size_t th=0; th < nthreads_-1; ++th) { if (pthread_create(threads+th, NULL, SceneryThreadWorker, static_cast(&larg)) < 0) throwError("Error creating thread"); } } #endif // Call worker on the parent thread (*SceneryThreadWorker)(static_cast(&larg)); #ifdef HAVE_PTHREAD // Wait for the child threads if (nthreads_>=2) for (size_t th=0; th < nthreads_-1; ++th) pthread_join(threads[th], NULL); #endif gettimeofday(&tim, NULL); end=double(tim.tv_sec)+(double(tim.tv_usec)/1000000.0); GYOTO_MSG << "\nRaytraced "<< (jmax-jmin+1) * (imax-imin+1) << " photons in " << end-start << "s using " << nthreads_ << " thread(s)\n"; } void Scenery::operator() ( size_t i, size_t j, Astrobj::Properties *data, double * impactcoords, Photon *ph ) { double coord[8]; SmartPointer spr = screen_->getSpectrometer(); size_t nbnuobs = spr() ? spr -> getNSamples() : 0; SmartPointer gg = NULL; SmartPointer obj = NULL; if (!ph) { // if Photon was passed, assume it was initiliazed already. Don't // touch its metric and astrobj. Else, update cached photon. Photon // is passed in particular when called in a multi-threaded // environment: it may really need to work on a given copy of the object. ph = &ph_; ph -> setSpectrometer(spr); ph -> setTmin(tmin_); ph -> setFreqObs(screen_->getFreqObs()); ph -> adaptive(adaptive_); ph -> maxiter(maxiter_); obj=obj_; gg=gg_; } // Always reset delta # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "reset delta" << endl; # endif ph -> setDelta(delta_); ph -> adaptive(adaptive_); ph -> maxiter(maxiter_); ph -> setTmin(tmin_); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "init nbnuobs" << endl; # endif if (data) data -> init(nbnuobs); // Initialize requested quantities to 0. or DBL_MAX if (impactcoords) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "impactcoords set" << endl; # endif if(impactcoords[0] != DBL_MAX) { ph -> setInitialCondition(gg, obj, impactcoords+8); ph -> resetTransmission(); obj_ -> processHitQuantities(ph,impactcoords+8,impactcoords,0.,data); } } else { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "impactcoords not set" << endl; # endif screen_ -> getRayCoord(i,j, coord); ph -> setInitialCondition(gg, obj, coord); ph -> hit(data); } } void Scenery::setRequestedQuantities(Gyoto::Quantity_t quant) {quantities_=quant;} void Scenery::setRequestedQuantities(std::string squant) { quantities_=0; char * tk = strtok(const_cast(squant.c_str()), " \t\n"); string tkk="", quant="", unit = ""; size_t first = 0, last = 0; # ifdef HAVE_UDUNITS if (screen_) screen_ -> mapPixUnit(); # endif while (tk != NULL) { tkk = tk; first = tkk.find("["); last = tkk.size() - 1; if (first < last) { unit = tkk.substr(first+1, last-first-1); quant = tkk.substr(0, first); } else { unit=""; quant=tkk; } # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "quant=" << quant << ", unit=" << unit << "." << endl; # endif tk=const_cast(quant.c_str()); if (!strcmp(tk, "Intensity")) { quantities_ |= GYOTO_QUANTITY_INTENSITY; setIntensityConverter(unit); } else if (!strcmp(tk, "EmissionTime")) quantities_ |= GYOTO_QUANTITY_EMISSIONTIME; else if (!strcmp(tk, "MinDistance")) quantities_ |= GYOTO_QUANTITY_MIN_DISTANCE; else if (!strcmp(tk, "FirstDistMin")) quantities_ |= GYOTO_QUANTITY_FIRST_DMIN; else if (!strcmp(tk, "Redshift")) quantities_ |= GYOTO_QUANTITY_REDSHIFT; else if (!strcmp(tk, "ImpactCoords")) quantities_ |= GYOTO_QUANTITY_IMPACTCOORDS; else if (!strcmp(tk, "Spectrum")) { quantities_ |= GYOTO_QUANTITY_SPECTRUM; setSpectrumConverter(unit); } else if (!strcmp(tk, "BinSpectrum")) { quantities_ |= GYOTO_QUANTITY_BINSPECTRUM; setBinSpectrumConverter(unit); } else if (!strcmp(tk, "User1")) quantities_ |= GYOTO_QUANTITY_USER1; else if (!strcmp(tk, "User2")) quantities_ |= GYOTO_QUANTITY_USER2; else if (!strcmp(tk, "User3")) quantities_ |= GYOTO_QUANTITY_USER3; else if (!strcmp(tk, "User4")) quantities_ |= GYOTO_QUANTITY_USER4; else if (!strcmp(tk, "User5")) quantities_ |= GYOTO_QUANTITY_USER5; else throwError("ScenerySubcontractor(): unknown quantity"); tk = strtok(NULL, " \t\n"); } # ifdef HAVE_UDUNITS if (screen_) screen_ -> unmapPixUnit(); # endif # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "("< setIntensityConverter(intensity_converter_); data -> setSpectrumConverter(spectrum_converter_); data -> setBinSpectrumConverter(binspectrum_converter_); # endif } void Scenery::setSpectrumConverter(string unit) { # ifdef HAVE_UDUNITS // default is SI if (unit=="") unit="J.m-2.s-1.sr-1.Hz-1"; spectrum_converter_ = new Units::Converter("J.m-2.s-1.sr-1.Hz-1", unit); # else if (unit!="") GYOTO_WARNING << "Unit ignored, please recompile gyoto with --with-udunits" << endl; # endif } void Scenery::setBinSpectrumConverter(string unit) { # ifdef HAVE_UDUNITS // default is SI if (unit=="") unit="J.m-2.s-1.sr-1"; binspectrum_converter_ = new Units::Converter("J.m-2.s-1.sr-1", unit); # else if (unit!="") GYOTO_WARNING << "Unit ignored, please recompile gyoto with --with-udunits" << endl; # endif } std::string Scenery::getRequestedQuantitiesString() const { string squant = ""; Quantity_t quantities = quantities_?quantities_:(obj_()?obj_->getDefaultQuantities():0); if (quantities & GYOTO_QUANTITY_INTENSITY ) squant+="Intensity "; if (quantities & GYOTO_QUANTITY_EMISSIONTIME) squant+="EmissionTime "; if (quantities & GYOTO_QUANTITY_MIN_DISTANCE) squant+="MinDistance "; if (quantities & GYOTO_QUANTITY_FIRST_DMIN ) squant+="FirstDistMin "; if (quantities & GYOTO_QUANTITY_REDSHIFT ) squant+="Redshift "; if (quantities & GYOTO_QUANTITY_IMPACTCOORDS) squant+="ImpactCoords "; if (quantities & GYOTO_QUANTITY_SPECTRUM ) squant+="Spectrum "; if (quantities & GYOTO_QUANTITY_BINSPECTRUM ) squant+="BinSpectrum "; if (quantities & GYOTO_QUANTITY_USER1 ) squant+="User1 "; if (quantities & GYOTO_QUANTITY_USER2 ) squant+="User2 "; if (quantities & GYOTO_QUANTITY_USER3 ) squant+="User3 "; if (quantities & GYOTO_QUANTITY_USER4 ) squant+="User4 "; if (quantities & GYOTO_QUANTITY_USER5 ) squant+="User5 "; return squant; } size_t Scenery::getScalarQuantitiesCount() const { size_t nquant=0; Quantity_t quantities = quantities_?quantities_:(obj_()?obj_->getDefaultQuantities():0); if (quantities & GYOTO_QUANTITY_INTENSITY ) ++nquant; if (quantities & GYOTO_QUANTITY_EMISSIONTIME) ++nquant; if (quantities & GYOTO_QUANTITY_MIN_DISTANCE) ++nquant; if (quantities & GYOTO_QUANTITY_FIRST_DMIN ) ++nquant; if (quantities & GYOTO_QUANTITY_REDSHIFT ) ++nquant; // SPECTRUM is not a SCALAR, don't add the following: // if (quantities & GYOTO_QUANTITY_SPECTRUM ) ++nquant; // if (quantities & GYOTO_QUANTITY_BINSPECTRUM ) ++nquant; // Idem IMPACTCOORDS: // if (quantities & GYOTO_QUANTITY_IMPACTCOORDS) ++nquant; if (quantities & GYOTO_QUANTITY_USER1 ) ++nquant; if (quantities & GYOTO_QUANTITY_USER2 ) ++nquant; if (quantities & GYOTO_QUANTITY_USER3 ) ++nquant; if (quantities & GYOTO_QUANTITY_USER4 ) ++nquant; if (quantities & GYOTO_QUANTITY_USER5 ) ++nquant; return nquant; } double Scenery::getTmin() const { return tmin_; } double Scenery::getTmin(const string &unit) const { return Units::FromGeometricalTime(getTmin(), unit, gg_); } void Scenery::setTmin(double tmin) { tmin_ = tmin; } void Scenery::setTmin(double tmin, const string &unit) { setTmin(Units::ToGeometricalTime(tmin, unit, gg_)); } void Scenery::adaptive(bool mode) { adaptive_ = mode; } bool Scenery::adaptive() const { return adaptive_; } void Scenery::maxiter(size_t miter) { maxiter_ = miter; } size_t Scenery::maxiter() const { return maxiter_; } #ifdef GYOTO_USE_XERCES void Scenery::fillElement(FactoryMessenger *fmp) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "fmp -> setMetric (gg_) ;" << endl; # endif if (gg_) fmp -> setMetric (gg_) ; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setScreen (screen_) ;" << endl; # endif if (screen_) fmp -> setScreen (screen_) ; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setAstrobj (obj_) ;" << endl; # endif if (obj_) fmp -> setAstrobj (obj_) ; if (delta_ != GYOTO_DEFAULT_DELTA) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setParameter (\"Delta\", "< setParameter ("Delta", delta_); } if (!adaptive()) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setParameter (\"NonAdaptive\") ;" << endl; # endif fmp -> setParameter ("NonAdaptive"); } if (maxiter_ != GYOTO_DEFAULT_MAXITER) fmp -> setParameter("MaxIter", maxiter_); if (getRequestedQuantities()) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setParameter (\"Quantities\", \"" < setParameter("Quantities", getRequestedQuantitiesString()); } if (tmin_ != DEFAULT_TMIN) fmp -> setParameter("MinimumTime", tmin_); if (nthreads_) fmp -> setParameter("NThreads", nthreads_); } SmartPointer Gyoto::Scenery::Subcontractor(FactoryMessenger* fmp) { string name="", content="", unit=""; SmartPointer gg = NULL; SmartPointer scr = NULL; SmartPointer ao = NULL; string squant = ""; gg = fmp->getMetric(); scr= fmp->getScreen(); ao = fmp->getAstrobj(); SmartPointer sc = new Scenery(gg, scr, ao); while (fmp->getNextParameter(&name, &content, &unit)) { char* tc = const_cast(content.c_str()); if (name=="Delta") sc -> setDelta(atof(tc), unit);; if (name=="Quantities") sc -> setRequestedQuantities(tc); if (name=="MinimumTime") sc -> setTmin(atof(tc), unit); if (name=="NThreads") sc -> setNThreads(atoi(tc)); if (name=="MaxIter") sc -> maxiter(atoi(tc)); if (name=="Adaptive") sc -> adaptive(true); if (name=="NonAdaptive") sc -> adaptive(false); } return sc; } #endif Gyoto-0.1.0/lib/Screen.C000066400000000000000000000676731217470755400147410ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoScreen.h" #include "GyotoConverters.h" #include #include #include #include #include using namespace std ; using namespace Gyoto; // Default constructor Screen::Screen() : //tobs_(0.), fov_(M_PI*0.1), tmin_(0.), npix_(1001), tobs_(0.), fov_(M_PI*0.1), npix_(1001), alpha0_(0.), delta0_(0.), anglekind_(0), distance_(1.), dmax_(GYOTO_SCREEN_DMAX), gg_(NULL), spectro_(NULL), freq_obs_(1.) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(dmax_); # endif euler_[0]=euler_[1]=euler_[2]=0.; setProjection(0., 0., 0.); for (int ii=0;ii<4;ii++) { fourvel_[ii]=0.; screen1_[ii]=0.; screen2_[ii]=0.; screen3_[ii]=0.; } } Screen::Screen(const Screen& o) : SmartPointee(o), tobs_(o.tobs_), fov_(o.fov_), npix_(o.npix_), distance_(o.distance_), alpha0_(o.alpha0_), delta0_(o.delta0_), anglekind_(o.anglekind_), dmax_(o.dmax_), gg_(NULL), spectro_(NULL), freq_obs_(o.freq_obs_) { if (o.gg_()) gg_=o.gg_->clone(); if (o.spectro_()) spectro_ = o.spectro_ -> clone(); int i; for (i=0; i<3; ++i) { euler_[i] = o.euler_[i]; ex_[i]=o.ex_[i]; ey_[i]=o.ey_[i]; ez_[i]=o.ez_[i]; } for (int ii=0;ii<4;ii++) { fourvel_[ii]=o.fourvel_[ii]; screen1_[ii]=o.screen1_[ii]; screen2_[ii]=o.screen2_[ii]; screen3_[ii]=o.screen3_[ii]; } } Screen * Screen::clone() const { return new Screen(*this); } Screen::~Screen(){} std::ostream& Screen::print( std::ostream& o) const { o << "distance=" << distance_ << ", " ; o << "paln=" << euler_[0] << ", " ; o << "inclination=" << euler_[1] << ", " ; o << "argument=" << euler_[2] << "." << endl; return o; } /***************Definition of the physical scene**************/ void Screen::setProjection(const double paln, const double incl, const double arg) { euler_[0]=paln; euler_[1]=incl; euler_[2]=arg; computeBaseVectors(); } void Screen::setProjection(const double dist, const double paln, const double incl, const double arg) { distance_=dist; setProjection(paln, incl, arg); } void Screen::setDistance(double dist, const string unit) { setDistance(Units::ToMeters(dist, unit, gg_)); } void Screen::setDistance(double dist) { distance_=dist; computeBaseVectors(); } void Screen::setDmax(double dist) { dmax_ = dist; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(dmax_); # endif } double Screen::getDmax() const { return dmax_; } void Screen::setPALN(double paln, const string &unit) { if ((unit=="") || (unit=="rad")); # ifdef HAVE_UDUNITS else paln = Units::Converter(unit, "rad")(paln); # else else if (unit=="degree" || unit=="°") paln *= GYOTO_DEGRAD; # endif setPALN(paln); } void Screen::setPALN(double paln) { euler_[0]=paln; computeBaseVectors(); } void Screen::setInclination(double incl, const string &unit) { if ((unit=="") || (unit=="rad")); # ifdef HAVE_UDUNITS else incl = Units::Converter(unit, "rad")(incl); # else else if (unit=="degree" || unit=="°") incl *= GYOTO_DEGRAD; # endif setInclination(incl); } void Screen::setInclination(double incl) { euler_[1]=incl; computeBaseVectors(); } void Screen::setArgument(double arg, const string &unit) { if (unit=="" || unit=="rad"); # ifdef HAVE_UDUNITS else arg = Units::Converter(unit, "rad")(arg); # else else if (unit=="degree" || unit=="°") arg *= GYOTO_DEGRAD; # endif setArgument(arg); } void Screen::setArgument(double arg) { euler_[2]=arg; computeBaseVectors(); } void Screen::setFreqObs(double fo, const string &unit) { setFreqObs(Units::ToHerz(fo, unit)); } void Screen::setFreqObs(double fo) { freq_obs_=fo; GYOTO_DEBUG_EXPR(freq_obs_); } double Screen::getFreqObs() const { return freq_obs_; } double Screen::getFreqObs(const string &unit) const { return Units::FromHerz(freq_obs_, unit); } void Screen::setMetric(SmartPointer gg) { gg_ = gg; computeBaseVectors(); } int Screen::getCoordKind() const { return gg_ -> getCoordKind(); } double Screen::getDistance() const { return distance_; } double Screen::getDistance(const std::string& unit) const { return Units::FromMeters(getDistance(), unit, gg_); } double Screen::getPALN() const { return euler_[0]; } double Screen::getPALN(const string &unit) const { double paln = getPALN(); if (unit != "" && unit != "rad" ) { # ifdef HAVE_UDUNITS paln = Units::Converter(unit, "rad")(paln); #else GYOTO_WARNING << "unit ignored, please recompile with --with-udunits\n"; #endif } return paln; } double Screen::getInclination() const { return euler_[1]; } double Screen::getInclination(const string &unit) const { double incl = getInclination(); if (unit != "" && unit != "rad" ) { # ifdef HAVE_UDUNITS incl = Units::Converter(unit, "rad")(incl); #else GYOTO_WARNING << "unit ignored, please recompile with --with-udunits\n"; #endif } return incl; } double Screen::getArgument() const { return euler_[2]; } double Screen::getArgument(const string &unit) const { double arg = getArgument(); if (unit != "" && unit != "rad" ) { # ifdef HAVE_UDUNITS arg = Units::Converter(unit, "rad")(arg); #else GYOTO_WARNING << "unit ignored, please recompile with --with-udunits\n"; #endif } return arg; } SmartPointer Screen::getMetric() const { return gg_; } void Screen::setObserverPos(const double coord[4]) { tobs_ = coord[0] * gg_ -> unitLength() / GYOTO_C; euler_[0]=M_PI;//Par défaut, A CHANGER SI BESOIN //dans le cas standard ex=-ephi et ephi dirige la ligne des noeuds d'où le pi //NB: c'est -pi dans mes notes, donc OK [2pi] //NB : ne décrit que la rotation de la caméra dans le plan x,y int coordkind=gg_ -> getCoordKind(); switch (coordkind) { case GYOTO_COORDKIND_SPHERICAL: distance_=coord[1]* gg_ -> unitLength(); //distance_=coord[1]; DEBUG euler_[1]=M_PI-coord[2]; euler_[2]=-M_PI/2-coord[3]; break; case GYOTO_COORDKIND_CARTESIAN: { double rks=sqrt(coord[1]*coord[1]+coord[2]*coord[2]+coord[3]*coord[3]); double thetaks=acos(coord[3]/rks); double phiks=atan2(coord[2],coord[1]); distance_=rks * gg_ -> unitLength(); euler_[1]=M_PI-thetaks; euler_[2]=-M_PI/2-phiks; } break; default: throwError("Incompatible coordinate kind in Screen::setObserverCoord"); } computeBaseVectors(); } void Screen::setFourVel(const double coord[4]) { for (int ii=0;ii<4;ii++) fourvel_[ii]=coord[ii]; } void Screen::setScreen1(const double coord[4]) { for (int ii=0;ii<4;ii++) screen1_[ii]=coord[ii]; } void Screen::setScreen2(const double coord[4]) { for (int ii=0;ii<4;ii++) screen2_[ii]=coord[ii]; } void Screen::setScreen3(const double coord[4]) { for (int ii=0;ii<4;ii++) screen3_[ii]=coord[ii]; } void Screen::getObserverPos(double coord[]) const { double r0 = distance_ / gg_ -> unitLength(); //remark : Pb here if mass=0 (unitLength=0...) -> pb for flat metric //if (debug()) cout << "distance_ in screen= " << distance_ << endl; //double r0 = distance_ ;DEBUG double theta0 = M_PI-euler_[1]; double phi0 = -M_PI/2-euler_[2]; int coordkind = gg_ -> getCoordKind(); stringstream ss; switch (coordkind) { case GYOTO_COORDKIND_CARTESIAN: coord[0] = tobs_ * GYOTO_C / gg_ -> unitLength(); coord[1] = r0*cos(phi0)*sin(theta0); coord[2] = r0*sin(phi0)*sin(theta0); coord[3] = r0*cos(theta0); break; case GYOTO_COORDKIND_SPHERICAL: coord[0] = tobs_ * GYOTO_C / gg_ -> unitLength(); coord[1] = r0; coord[2] = theta0; coord[3] = phi0; break; default: ss << "Incompatible coordinate kind in Screen::getObserverPos: " << coordkind; throwError(ss.str()); } } void Screen::getFourVel(double fourvel[]) const{ for (int ii=0;ii<4;ii++) fourvel[ii]=fourvel_[ii]; } void Screen::getScreen1(double output[]) const{ for (int ii=0;ii<4;ii++) output[ii]=screen1_[ii]; } void Screen::getScreen2(double output[]) const{ for (int ii=0;ii<4;ii++) output[ii]=screen2_[ii]; } void Screen::getScreen3(double output[]) const{ for (int ii=0;ii<4;ii++) output[ii]=screen3_[ii]; } /* SPECTROMETER */ void Screen::setSpectrometer(SmartPointer spr) { spectro_=spr; } SmartPointer Screen::getSpectrometer() const { return spectro_; } void Screen::getRayCoord(const size_t i, const size_t j, double coord[]) const { const double delta= fov_/double(npix_); double xscr, yscr; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "(i=" << i << ", j=" << j << ", coord)" << endl; # endif if (anglekind_){ /* GYOTO screen labelled by spherical angles a and b (see Fig. in user guide) */ xscr = double(i-1)*fov_/(2.*double(npix_-1)); yscr = double(j-1)*2.*M_PI/double(npix_-1); getRayCoord(xscr, yscr, coord); // NB: there will be also a X->-X transformation needed, // that must be done when plotting the image }else{ /* GYOTO screen labelled by equatorial angles alpha and delta (see Fig. in user guide) */ yscr=delta*(double(j)-double(npix_+1)/2.); xscr=delta*(double(i)-double(npix_+1)/2.); getRayCoord(-xscr, yscr, coord); // transforming X->-X (X being coord along e_1 observer vector) // this is due to the orientation convention of the screen // (cf InitialConditions.pdf) } } void Screen::getRayCoord(double alpha, double delta, double coord[]) const { alpha+=alpha0_; delta+=delta0_; // Screen orientation int i; // dimension : 0, 1, 2 double pos[4]; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "(alpha="< dmax_) { // scale coord[0] -= coord[1] - dmax_; double scale = coord[1] / dmax_; coord[1] = dmax_; alpha *= scale; delta *= scale; } coord[4]=coord[5]=coord[6]=coord[7]=0.;//initializing 4-velocity double spherical_angle_a, spherical_angle_b; if (anglekind_){ /* GYOTO screen labelled by spherical angles a and b (see Fig. in user guide) */ spherical_angle_a = alpha; spherical_angle_b = delta; }else{ /* GYOTO screen labelled by equatorial angles alpha and delta (see Fig. in user guide) Must compute spherical angles a and b from these. */ /* NB: spherical_angles = spherical angles associated with the orthonormal 3-frame of the observer's local rest space */ /* NBB: for spherical_angle_a, the relation comes from the spherical law of cosines of spherical trigonometry, the arcs spherical_angle_a, alpha and delta forming a spherical triangle, with alpha othogonal to delta. NBBB: for spherical_angle_b, the relation also comes from the spherical law of cosine. --> Following transformations are OK even for non-small alpha, delta */ spherical_angle_a = acos(cos(alpha)*cos(delta)); spherical_angle_b = (alpha==0. && delta==0.) ? 0. : atan2(tan(delta),sin(alpha)); } // Move these two angles to [0,pi], [0,2pi] double s1tmp=spherical_angle_a, s2tmp=spherical_angle_b; while (s1tmp>M_PI) s1tmp-=2.*M_PI; while (s1tmp<-M_PI) s1tmp+=2.*M_PI;//then s1 in [-pi,pi] if (s1tmp<0.) { s1tmp=-s1tmp;//then s1 in [0,pi] s2tmp+=M_PI;//thus, same direction } while (s2tmp>=2.*M_PI) s2tmp-=2.*M_PI; while (s2tmp<0.) s2tmp+=2.*M_PI;//then s2 in [0,2pi[ spherical_angle_a=s1tmp; spherical_angle_b=s2tmp; /* Tangent vector of incident photon in observer's local frame vel is thus orthogonal to observer's 4-velocity vel = vel[0]*screen1_+vel[1]*screen2_+vel[2]*screen3_ where screen1,2,3_ is a triad in observer's rest space */ //NB: following minus signs because the photon doesn't leave the screen, but //is heading towards it! double vel[3]={-sin(spherical_angle_a)*cos(spherical_angle_b), -sin(spherical_angle_a)*sin(spherical_angle_b), -cos(spherical_angle_a)}; // 4-vector tangent to photon geodesic if (fourvel_[0]==0.){ /* ---> Observer local frame not given in XML <--- Assume observer static at infinity ("standard Gyoto") Treatment depending on coordinate system */ switch (gg_ -> getCoordKind()) { case GYOTO_COORDKIND_CARTESIAN: { double rr=coord[1]*coord[1]+ coord[2]*coord[2]+ coord[3]*coord[3], rinf=20.; // this rinf is just a very crude test // I take rinf=10*rhor in Sch metric if (rrgmunu(pos,1,1), gthth=gg_->gmunu(pos,2,2), gphph=gg_->gmunu(pos,3,3); coord[5]=-vel[2]/sqrt(grr); double sp=sin(euler_[0]); double cp=cos(euler_[0]); coord[6]=(-sp*vel[0]+cp*vel[1])/sqrt(gthth); coord[7]=( cp*vel[0]+sp*vel[1])/sqrt(gphph); } break; default: throwError("Incompatible coordinate kind in Screen::getRayCoord()"); break; } // 0-component of photon tangent 4-vector found by normalizing gg_ -> nullifyCoord(coord); }else{ /* ---> Observer local frame given in XML <--- Express photon tangent 4-vector in the observer basis Treatment is coordinate independent (except for z-axis check right below) */ if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ if (coord[2]==0. || coord[2]==M_PI) throwError("Please move Screen away from z-axis"); } //Check orthonormal basis double normtol=1e-10; if (fabs(gg_->ScalarProd(coord,fourvel_,fourvel_)+1.)>normtol || fabs(gg_->ScalarProd(coord,screen1_,screen1_)-1.)>normtol || fabs(gg_->ScalarProd(coord,screen2_,screen2_)-1.)>normtol || fabs(gg_->ScalarProd(coord,screen3_,screen3_)-1.)>normtol){ throwError("In Screen:getRayCoord: observer's local" " basis is not properly normalized"); } if (fabs(gg_->ScalarProd(coord,fourvel_,screen1_))>normtol || fabs(gg_->ScalarProd(coord,fourvel_,screen2_))>normtol || fabs(gg_->ScalarProd(coord,fourvel_,screen3_))>normtol || fabs(gg_->ScalarProd(coord,screen1_,screen2_))>normtol || fabs(gg_->ScalarProd(coord,screen1_,screen3_))>normtol || fabs(gg_->ScalarProd(coord,screen2_,screen3_))>normtol) throwError("In Screen:getRayCoord: observer's local" " basis is not orthogonal"); /* Photon tagent 4-vector l defined by: l = p + fourvel_ where p gives the direction of the photon in the observer's rest space (orthogonal to fourvel). Here we choose the particular tangent 4-vector l that satisfies l.fourvel_=-1 Then l = fourvel_ + (orthogonal proj of l onto rest space) = fourvel_ + p and p = vel[0]*screen1_ + vel[1]*screen2_ + vel[2]*screen3_ with p.p = 1, thus l.l = 0 as it should */ coord[4]=vel[0]*screen1_[0] +vel[1]*screen2_[0] +vel[2]*screen3_[0] +fourvel_[0]; coord[5]=vel[0]*screen1_[1] +vel[1]*screen2_[1] +vel[2]*screen3_[1] +fourvel_[1]; coord[6]=vel[0]*screen1_[2] +vel[1]*screen2_[2] +vel[2]*screen3_[2] +fourvel_[2]; coord[7]=vel[0]*screen1_[3] +vel[1]*screen2_[3] +vel[2]*screen3_[3] +fourvel_[3]; if (fabs(gg_->ScalarProd(coord,coord+4,coord+4))>normtol){ throwError("In Screen::getRayCoord: " " tangent 4-vector to photon not properly normalized"); } } } void Screen::computeBaseVectors() { // See http://en.wikipedia.org/wiki/Euler_angles // if (debug()) cout << "In compute base vectore" << endl; double ca, sa; sincos(euler_[0], &sa, &ca); // paln double cb, sb; sincos(euler_[1], &sb, &cb); // inclination double cc, sc; sincos(euler_[2], &sc, &cc); // argument double unit = 1.;//1./distance_; //NB: here x,y,z are KS coordinates ex_[0] = unit*( ca*cc - sa*cb*sc);//component of KS vector eX along observer East direction ex ex_[1] = unit*( sa*cc + ca*cb*sc);//component of KS vector eX along observer North direction ey ex_[2] = unit*( sb*sc);//etc... ey_[0] = unit*(-ca*sc - sa*cb*cc); ey_[1] = unit*(-sa*sc + ca*cb*cc); ey_[2] = unit*( sb*cc); ez_[0] = unit*( sb*sa); ez_[1] = unit*(-sb*ca); ez_[2] = unit*( cb); } void Screen::coordToSky(const double pos[4], double skypos[3]) const { double xyz[3]; coordToXYZ(pos, xyz); double ul = gg_ -> unitLength(); skypos[0]=(xyz[0]*ex_[0]+xyz[1]*ey_[0]+xyz[2]*ez_[0]) * ul; skypos[1]=(xyz[0]*ex_[1]+xyz[1]*ey_[1]+xyz[2]*ez_[1]) * ul; skypos[2]=(xyz[0]*ex_[2]+xyz[1]*ey_[2]+xyz[2]*ez_[2]) * ul; } std::ostream & Screen::printBaseVectors(std::ostream &o) const { o << endl; o << setprecision(3) << setw(8) << ex_[0] << ", " << setprecision(3) << setw(8) << ey_[0] << ", " << setprecision(3) << setw(8) << ez_[0] << endl; o << setprecision(3) << setw(8) << ex_[1] << ", " << setprecision(3) << setw(8) << ey_[1] << ", " << setprecision(3) << setw(8) << ez_[1] << endl; o << setprecision(3) << setw(8) << ex_[2] << ", " << setprecision(3) << setw(8) << ey_[2] << ", " << setprecision(3) << setw(8) << ez_[2] << endl; return o ; } /***************Useful functions**************/ void Screen::coordToXYZ(const double pos[4], double xyz[3]) const { int coordkind = gg_ -> getCoordKind(); switch(coordkind) { case GYOTO_COORDKIND_SPHERICAL: xyz[0] = pos[1]*sin(pos[2])*cos(pos[3]); xyz[1] = pos[1]*sin(pos[2])*sin(pos[3]); xyz[2] = pos[1]*cos(pos[2]); break; case GYOTO_COORDKIND_CARTESIAN: xyz[0] = pos[1]; xyz[1] = pos[2]; xyz[2] = pos[3]; break; default: throwError("Incompatible coordinate kind in Screen::coordToXYZ"); break; } } double Screen::getTime() { return tobs_ ; } double Screen::getTime(const string &unit) { return Units::FromSeconds(getTime(), unit, gg_) ; } void Screen::setTime(double tobs, const string &unit) { # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(tobs); GYOTO_DEBUG_EXPR(unit); # endif setTime(Units::ToSeconds(tobs, unit, gg_)); } void Screen::setTime(double tobs) { tobs_ = tobs; # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(tobs_); # endif } //double Screen::getMinimumTime() { return tmin_; } //void Screen::setMinimumTime(double tmin) { tmin_ = tmin; } double Screen::getFieldOfView() { return fov_; } double Screen::getFieldOfView(string unit) { double fov = getFieldOfView(); if (unit=="" || unit=="rad") ; else if (unit=="geometrical") fov *= distance_ / gg_ -> unitLength(); # ifdef HAVE_UDUNITS else if (Units::areConvertible(unit, "m")) fov = Units::FromMeters(fov*distance_, unit) ; else fov = Units::Converter("rad", unit)(fov); # else else if (unit=="degree") fov /= GYOTO_DEGRAD; else if (unit=="arcmin") fov /= GYOTO_MINRAD; else if (unit=="arcsec") fov /= GYOTO_SECRAD; else if (unit=="milliarcsec") fov /= GYOTO_MASRAD; else if (unit=="microarcsec") fov /= GYOTO_MUASRAD; else { stringstream ss; ss << "Screen::setFieldOfView(): unknown unit: \"" << unit << "\"" << " (you may have more chance compiling gyoto with --with-udunits)"; throwError(ss.str()); } # endif return fov; } void Screen::setFieldOfView(double fov, const string &unit) { if (unit=="" || unit=="rad") ; else if (unit=="geometrical") fov *= gg_ -> unitLength() / distance_ ; # ifdef HAVE_UDUNITS else { Units::Unit from (unit); if (Units::areConvertible(from, "m")) fov = Units::ToMeters(fov, from) / distance_; else fov = Units::Converter(from, "rad")(fov); } # else else if (unit=="degree" || unit=="°") fov *= GYOTO_DEGRAD; else if (unit=="arcmin") fov *= GYOTO_MINRAD; else if (unit=="arcsec" || unit=="as") fov *= GYOTO_SECRAD; else if (unit=="milliarcsec" || unit=="mas") fov *= GYOTO_MASRAD; else if (unit=="microarcsec" || unit=="µas" || unit=="uas") fov *= GYOTO_MUASRAD; else { stringstream ss; ss << "Screen::setFieldOfView(): unknown unit: \"" << unit << "\"" << " (you may have more chance compiling gyoto with --with-udunits)"; throwError(ss.str()); } # endif setFieldOfView(fov); } void Screen::setFieldOfView(double fov) { fov_ = fov; } void Screen::setAlpha0(double alpha) { alpha0_ = alpha; } void Screen::setDelta0(double delta) { delta0_ = delta; } void Screen::setAnglekind(int kind) { anglekind_ = kind; } size_t Screen::getResolution() { return npix_; } void Screen::setResolution(size_t n) { npix_ = n; } #ifdef HAVE_UDUNITS void Gyoto::Screen::mapPixUnit() { Units::Unit radian ("radian"); double delta = fov_/double(npix_); ut_unit * pix = ut_scale(delta, radian); ut_status status = UT_BAD_ARG; status = ut_map_name_to_unit("pixel", UT_ASCII, pix); switch (status) { case UT_SUCCESS: break; case UT_EXISTS: throwError("name \"pixel\" already registered"); break; default: throwError("error initializing \"pixel\" unit"); } status = ut_map_symbol_to_unit("pix", UT_ASCII, pix); switch (status) { case UT_SUCCESS: break; case UT_EXISTS: throwError("symbol \"pix\" already registered"); break; default: throwError("error initializing \"pixel\" unit"); } ut_free(pix); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "\"pix\" unit mapped\n"; # endif } void Gyoto::Screen::unmapPixUnit() { ut_system * sys = Units::getSystem(); if ((ut_unmap_name_to_unit(sys, "pixel", UT_ASCII) != UT_SUCCESS) || (ut_unmap_symbol_to_unit(sys, "pix", UT_ASCII) != UT_SUCCESS)) throwError("Error unmapping \"pixel\" unit"); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "\"pix\" unit unmapped\n"; # endif } #endif #ifdef GYOTO_USE_XERCES void Screen::fillElement(FactoryMessenger *fmp) { FactoryMessenger* child = NULL; if (gg_) fmp -> setMetric (gg_) ; fmp -> setParameter ("Time", tobs_); fmp -> setParameter ("FieldOfView", fov_); fmp -> setParameter ("Alpha0", alpha0_); fmp -> setParameter ("Delta0", delta0_); fmp -> setParameter ("Resolution", npix_); double d = getDistance(); if (gg_() && (gg_->getMass() == 1.)) { d /= gg_->unitLength(); fmp -> setParameter ("Distance", &d, 1, &child); child -> setSelfAttribute("unit", "geometrical"); } else { string unit = "m"; if ( d >= GYOTO_KPC*1e3 ) { d /= (1000.*GYOTO_KPC); unit = "Mpc"; } else if (d >= GYOTO_KPC ) { d /= GYOTO_KPC; unit = "kpc"; } else if (d >= GYOTO_KPC*1e-3 ) { d /= (GYOTO_KPC*1e-3); unit = "pc"; } else if (d >= GYOTO_LIGHT_YEAR) { d /= GYOTO_LIGHT_YEAR; unit = "ly"; } else if (d >= GYOTO_ASTRONOMICAL_UNIT) { d /= GYOTO_ASTRONOMICAL_UNIT; unit = "AU"; } else if (d >= GYOTO_SUN_RADIUS) { d /= GYOTO_SUN_RADIUS; unit = "sunradius"; } else if (d >= 1e3) { d *= 1e-3; unit = "km";} else if (d >= 1.) ;// { d *= 1.; unit = "m";} else if (d >= 1e-2) { d *= 1e2; unit = "cm";} //else ; { d *= 1.; unit = "m";} fmp -> setParameter ("Distance", &d, 1, &child); child -> setSelfAttribute("unit", unit); } if (dmax_ != GYOTO_SCREEN_DMAX) child -> setSelfAttribute("dmax", dmax_); delete child; child = NULL; fmp -> setParameter ("PALN", getPALN()); fmp -> setParameter ("Inclination", getInclination()); fmp -> setParameter ("Argument", getArgument()); if (spectro_) { child = fmp -> makeChild("Spectrometer"); spectro_ -> fillElement(child) ; delete child; child = NULL; } fmp -> setParameter ("FreqObs", freq_obs_); fmp -> setParameter ( anglekind_? "SphericalAngles" : "EquatorialAngles"); } SmartPointer Screen::Subcontractor(FactoryMessenger* fmp) { string name="", content="", unit="", tunit=""; SmartPointer scr = new Screen(); scr -> setMetric(fmp->getMetric()); int tobs_found=0; double tobs_tmp, pos[4] ; char * tc; // Deal with fov later as we need Inclination double fov; string fov_unit; int fov_found=0; double alpha0; int alpha0_found=0; double delta0; int delta0_found=0; int fourvel_found=0, screen1_found=0, screen2_found=0, screen3_found=0; while (fmp->getNextParameter(&name, &content, &unit)) { tc = const_cast(content.c_str()); # ifdef GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_EXPR(name); GYOTO_DEBUG_EXPR(content); GYOTO_DEBUG_EXPR(unit); GYOTO_ENDIF_DEBUG # endif if (name=="Time") {tobs_tmp = atof(tc); tunit=unit; tobs_found=1;} else if (name=="Position") {for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); scr -> setObserverPos (pos); } else if (name=="FourVelocity") { fourvel_found=1; for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); scr -> setFourVel (pos); } else if (name=="ScreenVector1") { screen1_found=1; for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); scr -> setScreen1 (pos); } else if (name=="ScreenVector2") { screen2_found=1; for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); scr -> setScreen2 (pos); } else if (name=="ScreenVector3") { screen3_found=1; for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); scr -> setScreen3 (pos); } else if (name=="Distance") { scr -> setDistance ( atof(tc), unit ); string dmax = fmp -> getAttribute("dmax"); if (dmax != "") scr -> setDmax(atof(dmax.c_str())); } else if (name=="PALN") scr -> setPALN ( atof(tc), unit ); else if (name=="Inclination") scr -> setInclination ( atof(tc), unit ); else if (name=="Argument") scr -> setArgument ( atof(tc), unit ); else if (name=="FieldOfView") { fov = atof(tc); fov_unit=unit; fov_found=1; } else if (name=="Resolution") scr -> setResolution ( atoi(tc) ); else if (name=="Spectrometer") { scr -> setSpectrometer ((Spectrometer::getSubcontractor(fmp->getAttribute("kind")))(fmp->getChild())); } else if (name=="Alpha0"){ alpha0 = atof(tc); alpha0_found=1; } else if (name=="Delta0"){ delta0 = atof(tc); delta0_found=1; } else if (name=="FreqObs") scr -> setFreqObs(atof(tc), unit); else if (name=="SphericalAngles") scr -> setAnglekind(1); else if (name=="EquatorialAngles") scr -> setAnglekind(0); } if (tobs_found) scr -> setTime ( tobs_tmp, tunit ); if (fov_found) scr -> setFieldOfView ( fov, fov_unit ); if (alpha0_found) scr -> setAlpha0(alpha0); if (delta0_found) scr -> setDelta0(delta0); int sum_found=fourvel_found+screen1_found +screen2_found+screen3_found; if (sum_found>0 && sum_found<4) throwError("In Screen::subContractor: either all four, or no " "basis vectors should be given"); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(scr->getDmax()); # endif return scr; } #endif Gyoto-0.1.0/lib/SmartPointer.C000066400000000000000000000031401217470755400161240ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include #include #include Gyoto::SmartPointee::SmartPointee() : refCount (0) { #ifdef HAVE_PTHREAD pthread_mutex_init(&mutex_, NULL); #endif } Gyoto::SmartPointee::SmartPointee(const SmartPointee&) : refCount (0) { #ifdef HAVE_PTHREAD pthread_mutex_init(&mutex_, NULL); #endif } void Gyoto::SmartPointee::incRefCount () { #ifdef HAVE_PTHREAD pthread_mutex_lock(&mutex_); #endif refCount++; #ifdef HAVE_PTHREAD pthread_mutex_unlock(&mutex_); #endif } int Gyoto::SmartPointee::decRefCount () { #ifdef HAVE_PTHREAD pthread_mutex_lock(&mutex_); int n = --refCount; pthread_mutex_unlock(&mutex_); return n; #else return --refCount; #endif } int Gyoto::SmartPointee::getRefCount() { #ifdef HAVE_PTHREAD pthread_mutex_lock(&mutex_); int n = refCount; pthread_mutex_unlock(&mutex_); return n; #else return refCount; #endif } Gyoto-0.1.0/lib/Spectrometer.C000066400000000000000000000120071217470755400161530ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoSpectrometer.h" #include "GyotoUniformSpectrometer.h" #include "GyotoComplexSpectrometer.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoConverters.h" #include "GyotoMetric.h" #include #include #include #include #include #include #include // DBL_MAX using namespace Gyoto; using namespace Gyoto::Spectrometer; using namespace std; #if defined GYOTO_USE_XERCES Register::Entry* Gyoto::Spectrometer::Register_ = NULL; void Spectrometer::initRegister() { if (Gyoto::Spectrometer::Register_) delete Gyoto::Spectrometer::Register_; Gyoto::Spectrometer::Register_ = NULL; // statically fill the register Gyoto::Spectrometer::Register("wave", &(Subcontractor)); Gyoto::Spectrometer::Register("wavelog", &(Subcontractor)); Gyoto::Spectrometer::Register("freq", &(Subcontractor)); Gyoto::Spectrometer::Register("freqlog", &(Subcontractor)); Gyoto::Spectrometer::Register("Complex", &(Subcontractor)); } void Gyoto::Spectrometer::Register(std::string name, Subcontractor_t* scp){ Register::Entry* ne = new Register::Entry(name, (SmartPointee::Subcontractor_t*)scp, Gyoto::Spectrometer::Register_); Gyoto::Spectrometer::Register_ = ne; } Gyoto::Spectrometer::Subcontractor_t* Spectrometer::getSubcontractor(std::string name, int errmode) { if (!Gyoto::Spectrometer::Register_) throwError("No Spectrometer kind registered!"); return (Subcontractor_t*)Gyoto::Spectrometer::Register_ -> getSubcontractor(name, errmode); } void Spectrometer::Generic::setParameters(Gyoto::FactoryMessenger *fmp) { string name="", content="", unit=""; if (fmp) while (fmp->getNextParameter(&name, &content, &unit)) setParameter(name, content, unit); } #endif Generic::Generic() : SmartPointee(), Teller(), kind_(NULL), nsamples_(0), nboundaries_(0), boundaries_(NULL), chanind_(NULL), midpoints_(NULL), widths_(NULL) {} Generic::Generic(kind_t kind) : SmartPointee(), Teller(), kind_(kind), nsamples_(0), nboundaries_(0), boundaries_(NULL), chanind_(NULL), midpoints_(NULL), widths_(NULL) {} Generic::Generic(const Generic& o) : SmartPointee(o), Teller(o), kind_(o.kind_), nsamples_(o.nsamples_), nboundaries_(o.nboundaries_), boundaries_(NULL), chanind_(NULL), midpoints_(NULL), widths_(NULL) { if (o.boundaries_) boundaries_=new double[nboundaries_]; memcpy(boundaries_, o.boundaries_, nboundaries_*sizeof(double)); if (o.widths_) widths_=new double[nsamples_]; memcpy(widths_, o.widths_, nsamples_*sizeof(double)); if (o.midpoints_) midpoints_=new double[nsamples_]; memcpy(midpoints_, o.midpoints_, nsamples_*sizeof(double)); if (o.chanind_) chanind_=new size_t[2*nsamples_]; memcpy(chanind_, o.chanind_, 2*nsamples_*sizeof(size_t)); } Generic::~Generic() { if (boundaries_) delete [] boundaries_; if (widths_) delete [] widths_; if (midpoints_) delete [] midpoints_; if (chanind_) delete [] chanind_; } char const * Generic::getKind() const {return kind_;} void Generic::setKind(char const * k) {kind_=k; tellListeners();} size_t Generic::getNSamples() const { return nsamples_; } size_t Generic::getNBoundaries() const { return nboundaries_; } double const * Generic::getMidpoints() const { return midpoints_; } void Generic::getMidpoints( double data[], std::string unit) { for (size_t i=0; i setSelfAttribute( "kind", getKind() ); } #endif Gyoto-0.1.0/lib/Spectrum.C000066400000000000000000000110611217470755400153000ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoSpectrum.h" #include "GyotoRegister.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include #include using namespace Gyoto; using namespace std; Spectrum::Generic::Generic(const string kind) : kind_(kind) {} Spectrum::Generic * Spectrum::Generic::clone() const { string msg = "Spectrum::clone() called: " "cloning unimplemented for Spectrum kind "; msg += kind_; throwError(msg); return const_cast(this); // avoid warning, we won't get to that point } Spectrum::Generic::~Generic() { GYOTO_DEBUG << endl; } const string Spectrum::Generic::getKind() const { return kind_; } double Spectrum::Generic::integrate(double nu1, double nu2) { double nu; if (nu1>nu2) {nu=nu1; nu1=nu2; nu2=nu;} double Inu1 = operator()(nu1), Inu2=operator()(nu2); double dnux2 = ((nu2-nu1)*2.); double Icur = (Inu2+Inu1)*dnux2*0.25; double Iprev; if (debug()) cerr << "DEBUG: Spectrum::Generic::integrate(): " << "Icur=" << Icur << endl; do { Iprev = Icur; dnux2 *= 0.5; for (nu = nu1 + 0.5*dnux2; nu < nu2; nu += dnux2) { Icur += operator()(nu) * dnux2; } Icur *= 0.5; if (debug()) cerr << "DEBUG: Spectrum::Generic::integrate(): " << "Icur=" << Icur << endl; } while( fabs(Icur-Iprev) > (1e-2 * Icur) ); if (debug()) cerr << "DEBUG: Spectrum::Generic::integrate(): " << "dnu=" << dnux2*0.5 << "=(nu2-nu1)/" << (nu2-nu1)/(dnux2*0.5) << endl; return Icur; } double Spectrum::Generic::integrate(double nu1, double nu2, const Spectrum::Generic * opacity, double dsem) { double nu; if (nu1>nu2) {nu=nu1; nu1=nu2; nu2=nu;} double Inu1 = operator()(nu1, (*opacity)(nu1), dsem), Inu2=operator()(nu2, (*opacity)(nu2), dsem); double dnux2 = ((nu2-nu1)*2.); double Icur = (Inu2+Inu1)*dnux2*0.25; double Iprev; if (debug()) cerr << "DEBUG: Spectrum::Generic::integrate(): " << "Icur=" << Icur << endl; do { Iprev = Icur; dnux2 *= 0.5; for (nu = nu1 + 0.5*dnux2; nu < nu2; nu += dnux2) { Icur += operator()(nu, (*opacity)(nu), dsem) * dnux2; } Icur *= 0.5; if (debug()) cerr << "DEBUG: Spectrum::Generic::integrate(): " << "Icur=" << Icur << endl; } while( fabs(Icur-Iprev) > (1e-2 * Icur) ); if (debug()) cerr << "DEBUG: Spectrum::Generic::integrate(): " << "dnu=" << dnux2*0.5 << "=(nu2-nu1)/" << (nu2-nu1)/(dnux2*0.5) << endl; return Icur; } double Spectrum::Generic::operator()(double nu, double opacity, double ds) const { double thickness; // assume emissivity = opacity if ((thickness=(opacity*ds))) return operator()(nu) * (1. - exp (-thickness)) ; return 0.; } #ifdef GYOTO_USE_XERCES // do nothing... for now void Spectrum::Generic::fillElement(FactoryMessenger *fmp ) const { fmp->setSelfAttribute("kind", kind_); } void Spectrum::Generic::setParameter(std::string, std::string, std::string) {} void Spectrum::Generic::setParameters(FactoryMessenger *fmp) { string name="", content="", unit=""; if (fmp) while (fmp->getNextParameter(&name, &content, &unit)) setParameter(name, content, unit); } Register::Entry* Gyoto::Spectrum::Register_ = NULL; void Gyoto::Spectrum::Register(std::string name, Gyoto::Spectrum::Subcontractor_t* scp) { Register::Entry* ne = new Register::Entry(name, (Gyoto::SmartPointee::Subcontractor_t*)scp, Gyoto::Spectrum::Register_); Gyoto::Spectrum::Register_ = ne; } Spectrum::Subcontractor_t* Spectrum::getSubcontractor(std::string name, int errmode) { if (!Gyoto::Spectrum::Register_) throwError("No Spectrum kind registered!"); return (Spectrum::Subcontractor_t*)Gyoto::Spectrum::Register_ -> getSubcontractor(name, errmode); } void Gyoto::Spectrum::initRegister() { if (Gyoto::Spectrum::Register_) delete Gyoto::Spectrum::Register_; Gyoto::Spectrum::Register_ = NULL; } #endif Gyoto-0.1.0/lib/StandardAstrobj.C000066400000000000000000000110041217470755400165600ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // GYOTO HEADERS #include "GyotoUtils.h" #include "GyotoStandardAstrobj.h" #include "GyotoMetric.h" #include "GyotoPhoton.h" #include "GyotoRegister.h" #include "GyotoFactoryMessenger.h" // SYSTEM HEADERS #include #include #include #include #include #include #include // NAMESPACES using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; Standard::Standard(string kind) : Generic(kind), critical_value_(DBL_MIN), safety_value_(DBL_MAX) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } Standard::Standard() : Generic(), critical_value_(DBL_MIN), safety_value_(DBL_MAX) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } Standard::Standard(double radmax) : Generic(radmax), critical_value_(DBL_MIN), safety_value_(DBL_MAX) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } Standard::Standard(const Standard& orig) : Generic(orig), Functor::Double_constDoubleArray(orig), critical_value_(orig.critical_value_), safety_value_(orig.safety_value_) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } Standard::~Standard() { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } int Standard::Impact(Photon* ph, size_t index, Properties *data){ # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(getKind()); # endif double p1[8], p2[8]; ph->getCoord(index, p1); ph->getCoord(index+1, p2); double tmin, minval; if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ //Allows theta and phi to be in the correct range ph->checkPhiTheta(p1); ph->checkPhiTheta(p2); } double t1 = p1[0], t2=p2[0]; double val1=(*this)(p1), val2=(*this)(p2); if (val1 > critical_value_) { if (val2 > critical_value_) { if ( val1 > safety_value_ && val2 > safety_value_) { if (val1 < val2) { minval = val1; tmin = t1; } else { minval = val2; tmin = t2; } } else minval = ph -> findMin(this, p1[0], p2[0], tmin, critical_value_) ; if (minval>critical_value_) { if (data) { /* EmissionTime */ if (data->time) *data->time=tmin; /* MinDistance */ if ((data->distance) && (*(data->distance)>minval) ) *data->distance=minval; /* FirstMinDist */ if (data->first_dmin) { if (!data->first_dmin_found) { if (*(data->first_dmin)>minval) *(data->first_dmin)=minval; else data->first_dmin_found=1; } } } return 0; } ph -> findValue(this, critical_value_, tmin, t2); } ph -> findValue(this, critical_value_, t2, t1); } else if (val2 > critical_value_) ph -> findValue(this, critical_value_, t1, t2); double cph[8] = { t2 }; ph -> getCoord(&t2, 1, cph+1, cph+2, cph+3, cph+4, cph+5, cph+6, cph+7); double delta=giveDelta(cph); double coh[8]; while (cph[0]>t1){ ph -> getCoord(cph, 1, cph+1, cph+2, cph+3, cph+4, cph+5, cph+6, cph+7); for (int ii=0;ii<4;ii++) coh[ii] = cph[ii]; getVelocity(coh, coh+4); //Next test to insure every point given to process //is inside objetc. Not obvious as the worldline between //t1 and t2 is not necessarily straight (at small r in particular) if ((*this)(coh) setParameter("SafetyValue", safety_value_); Generic::fillElement(fmp); } #endif Gyoto-0.1.0/lib/Star.C000066400000000000000000000100351217470755400144070ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoStar.h" #include "GyotoPhoton.h" #include "GyotoPowerLawSpectrum.h" #include "GyotoBlackBodySpectrum.h" #include "GyotoFactoryMessenger.h" #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; Star::Star() : UniformSphere("Star"), Worldline() { if (debug()) cerr << "DEBUG: in Star::Star()" << endl; } Star::Star(SmartPointer met, double rad, double pos[4], double v[3]) : UniformSphere("Star"), Worldline() { if (debug()) { cerr << "DEBUG: Star Construction " << endl << " POS=[" << pos[0]; for (int i=1; i<4; ++i) cerr << ", " << pos[i]; cerr << "]\n VEL=[" << v[0] ; for (int i=1; i<3; ++i) cerr << ", " << v[i]; cerr << "]\n RADIUS=" << rad << endl; } setMetric(met); setInitCoord(pos, v); setRadius(rad); } Star::Star(const Star& orig) : UniformSphere(orig), Worldline(orig) { GYOTO_DEBUG << endl; gg_ = metric_; // we have two distinct clones of the metric, not good... } Star* Star::clone() const { return new Star(*this); } Star::~Star() { if (debug()) cerr << "DEBUG: Star::~Star()\n"; } string Star::className() const { return string("Star"); } string Star::className_l() const { return string("star"); } SmartPointer Star::getMetric() const { return gg_; } void Star::setMetric(SmartPointer gg) { UniformSphere::setMetric(gg); Worldline::setMetric(gg); } void Star::setInitialCondition(double coord[8]) { if (!metric_) throwError("Please set metric before calling Star::setInitialCondition(double*)"); Worldline::setInitialCondition(metric_, coord, 1); } double Star::getMass() const {return 1. ;} void Star::getVelocity(double const pos[4], double vel[4]) { getCoord(pos, 1, NULL, NULL, NULL, vel, vel+1, vel+2, vel+3); } void Star::getCartesian(double const * const t, size_t const n, double* const x, double*const y, double*const z, double*const xp, double*const yp, double*const zp) { Worldline::getCartesian(t, n, x, y, z, xp, yp, zp); } double Star::getRmax() { // rmax may not be up to date. Assume it's OK if it's non-0 warning: // if line is extended, need to either update rmax or reset it to 0 // if (debug()) cerr << "DEBUG: Star::getRmax(): rmax_set_==" // << rmax_set_ << endl; if (!rmax_set_ && !rmax_) { size_t i; for (i=imin_;i<=imax_;++i) if (x1_[i]>rmax_) rmax_=x1_[i]; rmax_*=3.; } return rmax_; } void Star::unsetRmax() { rmax_set_=0; rmax_=DBL_MAX; } int Star::setParameter(string name, string content, string unit) { if (!UniformSphere::setParameter(name, content, unit)) ; // if found else if (!Worldline ::setParameter(name, content, unit)) ; // do nothing else return 1; return 0; } #ifdef GYOTO_USE_XERCES void Star::fillElement(FactoryMessenger *fmp) const { Worldline::fillElement(fmp); Astrobj::UniformSphere::fillElement(fmp); } void Star::setParameters(FactoryMessenger* fmp) { wait_pos_ = 1; UniformSphere::setParameters(fmp); wait_pos_ = 0; if (init_vel_) { delete[] init_vel_; init_vel_=NULL; throwError("Worldline::setParameters(): " "Velocity was found but not Position"); } } #endif Gyoto-0.1.0/lib/StdPlug.C000066400000000000000000000056351217470755400150720ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // include Metric headers #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" // include Astrobj headers #include "GyotoComplexAstrobj.h" #include "GyotoStar.h" #include "GyotoFixedStar.h" #include "GyotoTorus.h" #include "GyotoThinDisk.h" #include "GyotoPageThorneDisk.h" #include "GyotoThinDiskPL.h" #include "GyotoPolishDoughnut.h" #ifdef GYOTO_USE_CFITSIO #include "GyotoPatternDisk.h" #include "GyotoPatternDiskBB.h" #include "GyotoDynamicalDisk.h" #include "GyotoDisk3D.h" #include "GyotoDisk3D_BB.h" #endif // include Spectrum headers #include "GyotoPowerLawSpectrum.h" #include "GyotoBlackBodySpectrum.h" using namespace Gyoto; extern "C" void __GyotostdplugInit() { #if defined GYOTO_USE_XERCES // Register Metrics Metric::Register("KerrBL", &(Metric::Subcontractor)); Metric::Register("KerrKS", &(Metric::Subcontractor)); // Register Astrobjs Astrobj::Register("Complex", &(Astrobj::Subcontractor)); Astrobj::Register("Star", &(Astrobj::Subcontractor)); Astrobj::Register("FixedStar", &(Astrobj::Subcontractor)); Astrobj::Register("Torus", &(Astrobj::Subcontractor)); Astrobj::Register("ThinDisk", &(Astrobj::Subcontractor)); Astrobj::Register("PageThorneDisk", &(Astrobj::Subcontractor)); Astrobj::Register("ThinDiskPL", &(Astrobj::Subcontractor)); Astrobj::Register("PolishDoughnut", &(Astrobj::Subcontractor)); #ifdef GYOTO_USE_CFITSIO Astrobj::Register("PatternDisk", &(Astrobj::Subcontractor)); Astrobj::Register("PatternDiskBB", &(Astrobj::Subcontractor)); Astrobj::Register("DynamicalDisk", &(Astrobj::Subcontractor)); Astrobj::Register("Disk3D", &(Astrobj::Subcontractor)); Astrobj::Register("Disk3D_BB", &(Astrobj::Subcontractor)); #endif // Register Spectra Spectrum::Register("PowerLaw", &(Spectrum::Subcontractor)); Spectrum::Register("BlackBody", &(Spectrum::Subcontractor)); #endif } Gyoto-0.1.0/lib/ThinDisk.C000066400000000000000000000155031217470755400152200ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoPhoton.h" #include "GyotoThinDisk.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; ThinDisk::ThinDisk(std::string kind) : Generic(kind), rin_(0.), rout_(DBL_MAX), thickness_(1e-3), dir_(1) { GYOTO_DEBUG << "ThinDisk Construction" << endl; } ThinDisk::ThinDisk(const ThinDisk& o) : Generic(o), Functor::Double_constDoubleArray(o), rin_(o.rin_), rout_(o.rout_), thickness_(o.thickness_), dir_(o.dir_) { GYOTO_DEBUG << "ThinDisk Copy" << endl; } ThinDisk* ThinDisk::clone() const { return new ThinDisk(*this); } ThinDisk::~ThinDisk() { GYOTO_DEBUG << "ThinDisk Destruction" << endl; } double ThinDisk::getInnerRadius() const { return rin_; } double ThinDisk::getInnerRadius(string unit) const { return Units::FromGeometrical(getInnerRadius(), unit, gg_); } void ThinDisk::setInnerRadius(double r) { rin_ = r; } void ThinDisk::setInnerRadius(double r, string unit) { setInnerRadius(Units::ToGeometrical(r, unit, gg_)); } double ThinDisk::getOuterRadius() const { return rout_;} double ThinDisk::getOuterRadius(string unit) const { return Units::FromGeometrical(getOuterRadius(), unit, gg_); } void ThinDisk::setOuterRadius(double r) { rout_ = r; } void ThinDisk::setOuterRadius(double r, string unit) { setOuterRadius(Units::ToGeometrical(r, unit, gg_)); } double ThinDisk::getThickness() const { return thickness_;} double ThinDisk::getThickness(string unit) const { return Units::FromGeometrical(getThickness(), unit, gg_); } void ThinDisk::setThickness(double h) { thickness_ = h; } void ThinDisk::setThickness(double h, string unit) { setThickness(Units::ToGeometrical(h, unit, gg_)); } int ThinDisk::getDir() const { return dir_; } void ThinDisk::setDir(int dir) { dir_ = dir; } double ThinDisk::operator()(double const coord[4]) { double theta; switch (gg_ -> getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: theta = coord[2]; theta -= M_PI*0.5; while (theta < -M_PI) theta += 2.*M_PI; while (theta >= M_PI) theta -= 2.*M_PI; return theta; case GYOTO_COORDKIND_CARTESIAN: return coord[3]; default: throwError("ThinDisk::Impact(): unknown COORDKIND"); return 0.; } } double ThinDisk::projectedRadius(double const coord[4]) const { switch (gg_ -> getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: return coord[1]; case GYOTO_COORDKIND_CARTESIAN: return sqrt(coord[1]*coord[1]+coord[2]*coord[2]); default: throwError("ThinDisk::projectedRadius(): unknown COORDKIND"); return 0.; } } double ThinDisk::sphericalPhi(double const coord[4]) const { switch (gg_ -> getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: return coord[3]; case GYOTO_COORDKIND_CARTESIAN: return atan2(coord[2], coord[1]); default: throwError("ThinDisk::sphericalPhi(): unknown COORDKIND"); return 0.; } } void ThinDisk::getVelocity(double const pos[4], double vel[4]) { gg_ -> circularVelocity(pos, vel, dir_); } int ThinDisk::Impact(Photon *ph, size_t index, Astrobj::Properties *data) { double coord_ph_hit[8], coord_obj_hit[8]; double rcross; double coord1[8], coord2[8]; double dt=0.; ph->getCoord(index, coord1); ph->getCoord(index+1, coord2); if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ //Allows theta and phi to be in the correct range ph->checkPhiTheta(coord1); ph->checkPhiTheta(coord2); } if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL && fabs(coord2[2]-coord1[2]) > M_PI) throwError ("ThinDisk::Impact: fishy heuristic"); double h1=operator()(coord1), h2=operator()(coord2); double r1=projectedRadius(coord1), r2=projectedRadius(coord2); if ( r1 > 2.*rout_ && r2 > 2.*rout_) return 0; if ( h1 == h2 && h2 != 0 ) return 0; if ( (h1 > 0.) == (h2 > 0.) && h1 != 0. && h2 != 0. ) return 0; double tlow, thigh; if (h1 < h2) { tlow = coord1[0]; thigh = coord2[0]; } else { tlow = coord2[0]; thigh = coord1[0]; } ph -> findValue(this, 0., tlow, thigh); coord_ph_hit[0]=thigh; ph -> getCoord(coord_ph_hit, 1, coord_ph_hit+1, coord_ph_hit+2, coord_ph_hit+3, coord_ph_hit+4, coord_ph_hit+5, coord_ph_hit+6, coord_ph_hit+7); if ((rcross=projectedRadius(coord_ph_hit)) < rin_ || rcross > rout_) return 0; for (int i=0;i<4;i++) coord_obj_hit[i]=coord_ph_hit[i]; getVelocity(coord_obj_hit, coord_obj_hit+4); if (flag_radtransf_) { double vel[3]; gg_->cartesianVelocity(coord_ph_hit, vel); dt = (vel[2]==0.) ? (coord2[0] - coord1[0]) : sqrt(1.+(vel[0]*vel[0]+vel[1]*vel[1])/(vel[2]*vel[2]))*thickness_; } if (data) { //Store impact time in user1 if (data->user1) *data->user1=coord_ph_hit[0]; if (data->user2) *data->user2=coord_ph_hit[1]; if (data->user3) *data->user3=coord_ph_hit[3]; } processHitQuantities(ph, coord_ph_hit, coord_obj_hit, dt, data); return 1; } int ThinDisk::setParameter(std::string name, std::string content, std::string unit) { char* tc = const_cast(content.c_str()); if (name=="InnerRadius") setInnerRadius (atof(tc), unit); else if (name=="OuterRadius") setOuterRadius (atof(tc), unit); else if (name=="Thickness") setThickness (atof(tc), unit); else if (name=="CounterRotating") setDir (-1); else return Generic::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void ThinDisk::fillElement(FactoryMessenger *fmp) const { GYOTO_DEBUG <<"InnerRadius" << endl; if (rin_!=0.) fmp->setParameter("InnerRadius", rin_); GYOTO_DEBUG <<"OuterRadius" << endl; if (rout_!=DBL_MAX) fmp->setParameter("OuterRadius", rout_); GYOTO_DEBUG <<"Thickness" << endl; if (flag_radtransf_) fmp->setParameter("Thickness", thickness_); GYOTO_DEBUG <<"Dir" << endl; if (dir_==-1) fmp -> setParameter("CounterRotating"); GYOTO_DEBUG <<"Generic" << endl; Generic::fillElement(fmp); GYOTO_DEBUG <<"done" << endl; } #endif Gyoto-0.1.0/lib/ThinDiskPL.C000066400000000000000000000073521217470755400154570ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoPhoton.h" #include "GyotoThinDiskPL.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoKerrBL.h" #include "GyotoKerrKS.h" #include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; ThinDiskPL::ThinDiskPL() : ThinDisk("ThinDiskPL"), PLSlope_(0.), PLRho_(1.), PLRadRef_(1.), spectrumBB_(NULL) { if (debug()) cerr << "DEBUG: ThinDiskPL Construction" << endl; spectrumBB_ = new Spectrum::BlackBody(); } ThinDiskPL::ThinDiskPL(const ThinDiskPL& o) : ThinDisk(o), PLSlope_(o.PLSlope_), PLRho_(o.PLRho_), PLRadRef_(o.PLRadRef_), spectrumBB_(NULL) { if (o.gg_()) gg_=o.gg_->clone(); if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); Generic::gg_=gg_; } ThinDiskPL* ThinDiskPL::clone() const { return new ThinDiskPL(*this); } ThinDiskPL::~ThinDiskPL() { if (debug()) cerr << "DEBUG: ThinDiskPL Destruction" << endl; } double ThinDiskPL::emission(double nu, double, double *, double coord_obj[8]) const{ //cout << "param= " << PLSlope_ << " " << PLRho_ << " " << PLRadRef_ // << " " << getInnerRadius() << " " << getOuterRadius() << endl; double Iem = emissionBB(nu,coord_obj); /* Only BB emission so far, other ways of computing emission from rho can be added */ /*if (flag_radtransf_) throwError("In ThinDiskPL::emission() " "optically thin integration not provided");*/ return Iem; } double ThinDiskPL::emissionBB(double nu, double co[8]) const{ double rcur=projectedRadius(co); double rho_si = PLRho_*pow(rcur/PLRadRef_,PLSlope_); //Assuming: pressure = kappa*(mass density)^gamma, gamma=5/3 (eq of state) // and: pressure = (mass density)*R/Mm*T (Mm = molar mass) double gamma=5./3.; double Mm=6e-4;//Navogadro*Munit/gamma double kappa=3e10;//pressure coef: p = kappa*rho^gamma, rho=mass density double cs2=kappa*gamma*pow(rho_si,gamma-1.); double TT=Mm/GYOTO_GAS_CST*cs2;//Temperature in SI //cout << "TT after rl= " << TT << endl; //cout << "r,rho,T= " << rcross << " " << rho_si << " " << TT << endl; spectrumBB_->setTemperature(TT); return (*spectrumBB_)(nu); } int ThinDiskPL::setParameter(std::string name, std::string content, std::string unit) { if (name=="PLSlope") PLSlope_=atof(content.c_str()); else if (name=="PLRho") PLRho_=atof(content.c_str()); else if (name=="PLRadRef") PLRadRef_=atof(content.c_str()); else if (name=="Rmin") setInnerRadius(atof(content.c_str())); else if (name=="Rmax") setOuterRadius(atof(content.c_str())); else return ThinDisk::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void ThinDiskPL::fillElement(FactoryMessenger *fmp) const { if (PLSlope_) fmp->setParameter("PLSlope", PLSlope_); if (PLRho_) fmp->setParameter("PLRho", PLRho_); if (PLRadRef_) fmp->setParameter("PLRadRef", PLRadRef_); ThinDisk::fillElement(fmp); } #endif Gyoto-0.1.0/lib/Torus.C000066400000000000000000000135261217470755400146220ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoTorus.h" #include "GyotoStandardAstrobj.h" #include "GyotoUtils.h" #include "GyotoBlackBodySpectrum.h" #include "GyotoPowerLawSpectrum.h" #include "GyotoMetric.h" #include "GyotoPhoton.h" #include "GyotoFactoryMessenger.h" #include #include #include #include using namespace Gyoto; using namespace Gyoto::Astrobj; using namespace std; Torus::Torus() : Standard("Torus"), c_(3.5) { critical_value_ = 0.25; // 0.5*0.5 safety_value_ = 0.3; spectrum_ = new Spectrum::BlackBody(1000000.); opacity_ = new Spectrum::PowerLaw(0., 1.); } Torus::Torus(const Torus& o) : Standard(o), c_(o.c_), spectrum_(o.spectrum_()?o.spectrum_->clone():NULL), opacity_(o.opacity_()?o.opacity_->clone():NULL) {} Torus::~Torus() {} Torus* Torus::clone() const { return new Torus(*this); } double Torus::getLargeRadius() const { return c_; } double Torus::getLargeRadius(string unit) const { return Units::FromGeometrical(getLargeRadius(), unit, gg_); } double Torus::getSmallRadius() const { return sqrt(critical_value_); } double Torus::getSmallRadius(string unit) const { return Units::FromGeometrical(getSmallRadius(), unit, gg_); } void Torus::setLargeRadius(double c) { c_ = c; } void Torus::setLargeRadius(double c, string unit) { setLargeRadius(Units::ToGeometrical(c, unit, gg_)); } void Torus::setSmallRadius(double a) { critical_value_ = a*a; safety_value_ = critical_value_ * 1.1; } void Torus::setSmallRadius(double c, string unit) { setSmallRadius(Units::ToGeometrical(c, unit, gg_)); } SmartPointer Torus::getSpectrum() const { return spectrum_; } void Torus::setSpectrum(SmartPointer sp) {spectrum_=sp;} SmartPointer Torus::getOpacity() const { return opacity_; } void Torus::setOpacity(SmartPointer sp) {opacity_=sp;} double Torus::getRmax() { if (!rmax_set_ && rmax_==DBL_MAX) { rmax_ = 3.*(c_+sqrt(critical_value_)); } return rmax_ ; } double Torus::emission(double nu_em, double dsem, double *, double *) const { if (flag_radtransf_) return (*spectrum_)(nu_em, (*opacity_)(nu_em), dsem); return (*spectrum_)(nu_em); } double Torus::transmission(double nuem, double dsem, double*) const { if (!flag_radtransf_) return 0.; double opacity = (*opacity_)(nuem); if (debug()) cerr << "DEBUG: Torus::transmission(nuem="<integrate(nu1, nu2, opacity_(), dsem); return spectrum_->integrate(nu1, nu2); } double Torus::operator()(double const pos[4]) { double drproj, h; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: drproj = pos[1]*sin(pos[2])-c_; h = pos[1]*cos(pos[2]); break; case GYOTO_COORDKIND_CARTESIAN: h = pos[3]; drproj = sqrt(pos[1]*pos[1]+pos[2]*pos[2]); break; default: throwError("Torus::distance(): unknown coordinate system kind"); h=0.,drproj=0.; } return drproj*drproj + h*h; } void Torus::getVelocity(double const pos[4], double vel[4]) { double pos2[4] = {pos[0]}; switch (gg_ -> getCoordKind()) { case GYOTO_COORDKIND_CARTESIAN: pos2[1] = pos[1]; pos2[2] = pos[2]; pos2[3] = 0.; break; case GYOTO_COORDKIND_SPHERICAL: pos2[1] = pos[1] * sin(pos[2]); pos2[2] = M_PI*0.5; pos2[3] = pos[3]; break; default: throwError("Torus::getVelocity(): unknown coordkind"); } gg_ -> circularVelocity(pos2, vel); } int Torus::setParameter(std::string name, std::string content, std::string unit) { if (name=="LargeRadius") setLargeRadius(atof(content.c_str()), unit); else if (name=="SmallRadius") setSmallRadius(atof(content.c_str()), unit); else return Standard::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void Torus::fillElement(FactoryMessenger *fmp) const { FactoryMessenger * childfmp=NULL; fmp -> setMetric (gg_) ; fmp -> setParameter ("LargeRadius", c_); fmp -> setParameter ("SmallRadius", sqrt(critical_value_)); childfmp = fmp -> makeChild ( "Spectrum" ); spectrum_ -> fillElement(childfmp); delete childfmp; childfmp = fmp -> makeChild ( "Opacity" ); opacity_ -> fillElement(childfmp); delete childfmp; Standard::fillElement(fmp); } void Torus::setParameters(FactoryMessenger* fmp) { string name="", content="", unit=""; SmartPointer gg = NULL; SmartPointer sp = NULL; FactoryMessenger * child = NULL; setMetric(fmp->getMetric()); while (fmp->getNextParameter(&name, &content, &unit)) { if (name=="Spectrum") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); setSpectrum( (*Spectrum::getSubcontractor(content))(child) ); delete child; } else if (name=="Opacity") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); setOpacity( (*Spectrum::getSubcontractor(content))(child) ); delete child; } else setParameter(name, content, unit); } } #endif Gyoto-0.1.0/lib/UniformSpectrometer.C000066400000000000000000000146271217470755400175250ustar00rootroot00000000000000/* Copyright 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUniformSpectrometer.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoConverters.h" #include "GyotoMetric.h" #include #include #include #include #include #include #include // DBL_MAX using namespace Gyoto; using namespace Gyoto::Spectrometer; using namespace std; Uniform::Uniform() : Generic(WaveKind) { band_[0]=0.; band_[1]=0.; } Uniform::Uniform(size_t nsamples, double band_min, double band_max, kind_t kind) : Generic(kind) { nsamples_=nsamples; band_[0]=band_min; band_[1]=band_max; if (nsamples && kind) reset_(); } Uniform::Uniform(const Uniform& o) : Generic(o) { band_[0]=o.band_[0]; band_[1]=o.band_[1]; reset_(); } Generic* Uniform::clone() const { return new Uniform(*this); } Uniform::~Uniform() { } void Uniform::reset_() { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif if (boundaries_) delete [] boundaries_; if (chanind_) delete [] chanind_; if (midpoints_) delete [] midpoints_; if (widths_) delete [] widths_; boundaries_ = NULL; chanind_ = NULL; midpoints_ = NULL; widths_ = NULL; GYOTO_DEBUG << endl; if (!nsamples_ || !kind_) return; boundaries_ = new double[nsamples_+1]; chanind_ = new size_t[nsamples_*2]; midpoints_ = new double[nsamples_]; widths_ = new double[nsamples_]; size_t i=0 ; # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG; GYOTO_DEBUG_EXPR(band_); if (band_) GYOTO_DEBUG_ARRAY(band_, 2); GYOTO_DEBUG_EXPR(kind_); GYOTO_ENDIF_DEBUG # endif for (i=0; i<=nsamples_; ++i){ # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "boundaries_[" < setSelfAttribute( "nsamples", nsamples_ ); ostringstream ss; ss << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << band_[0] << " " << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << band_[1]; fmp -> setFullContent(ss.str()); Generic::fillElement(fmp); } void Gyoto::Spectrometer::Uniform::setParameters(FactoryMessenger* fmp) { string skind = fmp -> getSelfAttribute( "kind" ); size_t nsamples = atol( fmp -> getSelfAttribute( "nsamples" ) . c_str () ); string unit = fmp -> getSelfAttribute( "unit" ); string content = fmp -> getFullContent(); char * tc = const_cast(content.c_str()); double band[2]; band[0]=strtod(tc, &tc); band[1]=strtod(tc, &tc); setBand(band, unit, skind); setNSamples(nsamples); } #endif int Spectrometer::Uniform::setParameter(string name, string content, string unit) { double band[2]; char* tc = const_cast(content.c_str()); if (name=="Band") { for (int i=0;i<2;++i) band[i] = strtod(tc, &tc); setBand(band, unit); } else if (name=="Kind") { setKind(content); } else if (name=="NSamples") { setNSamples(atof(tc)); } else return Generic::setParameter(name, content, unit); return 0; } char const * const Uniform::WaveKind = "wave"; char const * const Uniform::WaveLogKind = "wavelog"; char const * const Uniform::FreqKind = "freq"; char const * const Uniform::FreqLogKind = "freqlog"; Gyoto-0.1.0/lib/UniformSphere.C000066400000000000000000000145321217470755400162720ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include "GyotoUniformSphere.h" #include "GyotoPhoton.h" #include "GyotoPowerLawSpectrum.h" #include "GyotoBlackBodySpectrum.h" #include "GyotoFactoryMessenger.h" #include "GyotoConverters.h" #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; UniformSphere::UniformSphere(string kind) : Astrobj::Standard(kind), spectrum_(NULL), opacity_(NULL) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif setRadius(0.); spectrum_ = new Spectrum::BlackBody(); opacity_ = new Spectrum::PowerLaw(0., 1.); } UniformSphere::UniformSphere(string kind, SmartPointer met, double rad) : Astrobj::Standard(kind), radius_(rad), spectrum_(NULL), opacity_(NULL) { critical_value_ = radius_*radius_; safety_value_ = critical_value_*1.1 + 0.1; spectrum_ = new Spectrum::BlackBody(); opacity_ = new Spectrum::PowerLaw(0., 1.); gg_=met; } UniformSphere::UniformSphere(const UniformSphere& orig) : Astrobj::Standard(orig), radius_(orig.radius_), spectrum_(NULL), opacity_(NULL) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif if (orig.spectrum_()) spectrum_=orig.spectrum_->clone(); if (orig.opacity_()) opacity_=orig.opacity_->clone(); } UniformSphere::~UniformSphere() { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif } string UniformSphere::className() const { return string("UniformSphere"); } string UniformSphere::className_l() const { return string("uniformsphere"); } SmartPointer UniformSphere::getSpectrum() const { return spectrum_; } void UniformSphere::setSpectrum(SmartPointer sp) {spectrum_=sp;} SmartPointer UniformSphere::getOpacity() const { return opacity_; } void UniformSphere::setOpacity(SmartPointer sp) {opacity_=sp;} double UniformSphere::operator()(double const coord[4]) { double coord_st[4] = {coord[0]}; double coord_ph[4] = {coord[0]}; double sintheta; getCartesian(coord_st, 1, coord_st+1, coord_st+2, coord_st+3); switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_CARTESIAN: memcpy(coord_ph+1, coord+1, 3*sizeof(double)); break; case GYOTO_COORDKIND_SPHERICAL: coord_ph[1] = coord[1] * (sintheta=sin(coord[2])) * cos(coord[3]); coord_ph[2] = coord[1] * sintheta * sin(coord[3]); coord_ph[3] = coord[1] * cos(coord[2]) ; break; default: throwError("unsupported coordkind"); } double dx = coord_ph[1]-coord_st[1]; double dy = coord_ph[2]-coord_st[2]; double dz = coord_ph[3]-coord_st[3]; return dx*dx + dy*dy + dz*dz; } double UniformSphere::emission(double nu_em, double dsem, double *, double *) const { if (flag_radtransf_) return (*spectrum_)(nu_em, (*opacity_)(nu_em), dsem); return (*spectrum_)(nu_em); } double UniformSphere::transmission(double nuem, double dsem, double*) const { if (!flag_radtransf_) return 0.; double opacity = (*opacity_)(nuem); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "(nuem=" << nuem << ", dsem=" << dsem << "), opacity=" << opacity << endl; # endif if (!opacity) return 1.; return exp(-opacity*dsem); } double UniformSphere::integrateEmission(double nu1, double nu2, double dsem, double *, double *) const { if (flag_radtransf_) return spectrum_->integrate(nu1, nu2, opacity_(), dsem); return spectrum_->integrate(nu1, nu2); } double UniformSphere::getRadius() const { return radius_; } void UniformSphere::setRadius(double r) { radius_=r; critical_value_ = r*r; safety_value_ = critical_value_*1.1+0.1; } double UniformSphere::getRadius(std::string unit) const { return Units::FromGeometrical(getRadius(), unit, gg_); } void UniformSphere::setRadius(double r, std::string unit) { setRadius(Units::ToGeometrical(r, unit, gg_)); } int UniformSphere::setParameter(string name, string content, string unit) { if (name=="Radius") setRadius(atof(content.c_str()), unit); else return Standard::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void UniformSphere::fillElement(FactoryMessenger *fmp) const { FactoryMessenger * childfmp=NULL; fmp -> setMetric (getMetric()) ; fmp -> setParameter ("Radius", getRadius()); childfmp = fmp -> makeChild ( "Spectrum" ); spectrum_ -> fillElement(childfmp); delete childfmp; childfmp = fmp -> makeChild ( "Opacity" ); opacity_ -> fillElement(childfmp); delete childfmp; Astrobj::Generic::fillElement(fmp); } void Gyoto::Astrobj::UniformSphere::setParameters(FactoryMessenger* fmp){ setFlag_radtransf(0); if (!fmp) return; string name="", content="", unit=""; FactoryMessenger * child = NULL; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "setMetric()" << endl; # endif setMetric(fmp->getMetric()); while (fmp->getNextParameter(&name, &content, &unit)) { if (name=="Spectrum") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "setSpectrum()" << endl; # endif setSpectrum((*Spectrum::getSubcontractor(content))(child)); delete child; } else if (name=="Opacity") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "setOpacity()" << endl; # endif setOpacity((*Spectrum::getSubcontractor(content))(child)); setFlag_radtransf(1); delete child; } else { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "setParameter("<. */ #include "GyotoUtils.h" #include "GyotoError.h" #include "GyotoPhoton.h" #include using namespace Gyoto; using namespace std; static int gyoto_debug=GYOTO_DEFAULT_DEBUG_MODE; #if GYOTO_DEFAULT_DEBUG_MODE static int gyoto_verbosity=GYOTO_DEBUG_VERBOSITY; static int gyoto_prev_verbosity=GYOTO_DEBUG_VERBOSITY; #else static int gyoto_verbosity=GYOTO_DEFAULT_VERBOSITY; static int gyoto_prev_verbosity=GYOTO_DEBUG_VERBOSITY; #endif void Gyoto::debug(int mode) { if (mode != gyoto_debug) { if (mode) { gyoto_prev_verbosity=verbose(); verbose(GYOTO_DEBUG_VERBOSITY); } else { verbose(gyoto_prev_verbosity); } gyoto_debug=mode; } } int Gyoto::debug() { return gyoto_debug; } void Gyoto::verbose(int mode) { gyoto_verbosity=mode; } int Gyoto::verbose() { return gyoto_verbosity; } void Gyoto::convert(double * const x, const size_t nelem, const double mass_sun, const double distance_kpc, const string unit) { /// Convert lengths double distance = distance_kpc*GYOTO_KPC; // m double fact = mass_sun * GYOTO_SUN_MASS * GYOTO_G_OVER_C_SQUARE; // m size_t i =0; if (!unit.compare("geometrical")) return ; else if (!unit.compare("m")) ; else if (!unit.compare("km")) fact *= 1e-3 ; else if (!unit.compare("sun radius")) fact *= 1. / GYOTO_SUN_RADIUS; else if (!unit.compare("rad")) fact *= 1. / (distance); else if (!unit.compare("degree")) fact *= 180. / (distance*M_PI); else if (!unit.compare("arcmin")) fact *= 1.08e4 / (distance*M_PI); else if (!unit.compare("arcsec")) fact *= 6.48e5 / (distance*M_PI); else if (!unit.compare("mas")) fact *= 6.48e8 / (distance*M_PI); else if (!unit.compare("uas")) fact *= 6.48e11 / (distance*M_PI); else throwError("Unknown unit."); for (i=0; i. */ #include #include //#include #include #include #include #include #include #include #include #include using namespace std; using namespace Gyoto; Worldline::Worldline() : imin_(1), i0_(0), imax_(0), adaptive_(1), delta_(GYOTO_DEFAULT_DELTA), tmin_(-DBL_MAX), cst_(NULL), cst_n_(0), wait_pos_(0), init_vel_(NULL), maxiter_(GYOTO_DEFAULT_MAXITER) { xAllocate(); } Worldline::Worldline(const size_t sz) : imin_(1), i0_(0), imax_(0), adaptive_(1), delta_(GYOTO_DEFAULT_DELTA), tmin_(-DBL_MAX), cst_(NULL), cst_n_(0), wait_pos_(0), init_vel_(NULL), maxiter_(GYOTO_DEFAULT_MAXITER) { xAllocate(sz); } Worldline::Worldline(const Worldline& orig) : metric_(NULL), x_size_(orig.x_size_), imin_(orig.imin_), i0_(orig.i0_), imax_(orig.imax_), adaptive_(orig.adaptive_), delta_(orig.delta_), tmin_(orig.tmin_), cst_(NULL), cst_n_(orig.cst_n_), wait_pos_(orig.wait_pos_), init_vel_(NULL), maxiter_(orig.maxiter_) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif if (orig.metric_()) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "cloning metric\n"; # endif metric_=orig.metric_->clone(); } xAllocate(x_size_); size_t sz = get_nelements()*sizeof(double); # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "sz="<metric_), // x_size_(orig.x_size_), imin_(orig.imin_), i0_(orig.i0_), imax_(orig.imax_), adaptive_(orig->adaptive_), delta_(orig->delta_), tmin_(orig->tmin_), cst_n_(orig->cst_n_), wait_pos_(orig->wait_pos_), init_vel_(NULL), maxiter_(orig->maxiter_) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif double d1 = orig->x0_[i0], d2 = orig->x0_[i0+dir]; x_size_= size_t(fabs(d1-d2)/step_max)+2; double step = (d2-d1)/double(x_size_-1); xAllocate(x_size_); imin_=0; imax_=x_size_-1; i0_=(dir==1?imin_:imax_); x0_[i0_]=d1; size_t i=i0_; for (i=i0_+dir; i>imin_ && igetCoord(x0_, x_size_, x1_, x2_, x3_, x0dot_, x1dot_, x2dot_, x3dot_); # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG { GYOTO_DEBUG << "(Worldline*, "<cst_, cst_n_*sizeof(double)); } /* if (orig->init_vel_) { init_vel_ = new double [3]; memcpy(init_vel_, orig->init_vel_, 3*sizeof(double)); } */ # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "done\n"; # endif } Worldline::~Worldline(){ # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; # endif if (metric_) metric_ -> unhook(this); delete[] x0_; delete[] x1_; delete[] x2_; delete[] x3_; delete[] x0dot_; delete[] x1dot_; delete[] x2dot_; delete[] x3dot_; if (cst_) delete [] cst_; if (init_vel_) delete[] init_vel_; } void Worldline::xAllocate() {xAllocate(GYOTO_DEFAULT_X_SIZE);} void Worldline::xAllocate(size_t sz) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(sz); # endif x_size_ = sz ; x0_ = new double[x_size_]; x1_ = new double[x_size_]; x2_ = new double[x_size_]; x3_ = new double[x_size_]; x0dot_ = new double[x_size_]; x1dot_ = new double[x_size_]; x2dot_ = new double[x_size_]; x3dot_ = new double[x_size_]; } size_t Worldline::xExpand(int dir) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(dir); # endif double * old; size_t offset=(dir==1)?0:x_size_; size_t retval=(dir==1)?(x_size_-1):x_size_; size_t i; x_size_*=2; old = x0_; //GYOTO_DEBUG<< "In Wl x0_[0]= " << x0_[0] << endl; x0_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x0_[i+offset]=old[i]; delete[] old; //GYOTO_DEBUG<< "In Wl imin= " << imin_ << " " << imax_ << endl; //GYOTO_DEBUG<< " In Wl x0_[offset], old[0]= " << x0_[1024] << " " << old[0] << endl; old = x1_; x1_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x1_[i+offset]=old[i]; delete[] old; old = x2_; x2_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x2_[i+offset]=old[i]; delete[] old; old = x3_; x3_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x3_[i+offset]=old[i]; delete[] old; old = x0dot_; x0dot_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x0dot_[i+offset]=old[i]; delete[] old; old = x1dot_; x1dot_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x1dot_[i+offset]=old[i]; delete[] old; old = x2dot_; x2dot_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x2dot_[i+offset]=old[i]; delete[] old; old = x3dot_; x3dot_ = new double[x_size_]; for (i=imin_;i<=imax_;++i) x3dot_[i+offset]=old[i]; delete[] old; imin_+=offset; i0_+=offset; imax_+=offset; # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG<< ", xsize_=" << x_size_ << ", imin_=" << imin_ << ", i0_=" << i0_ << ", imax_=" << imax_; # endif return retval; } void Worldline::setMetric(SmartPointer gg) { // Unhook from previous metric if (metric_) metric_ -> unhook(this); // Set the Metric metric_=gg; // Hook to new metric if (metric_) metric_ -> hook(this); // Reset integration reInit(); } void Worldline::tell(Gyoto::Hook::Teller* msg) { if (msg != metric_) { throwError("Worldline::tell(): wrong Teller"); } reInit(); } #ifdef GYOTO_USE_XERCES void Worldline::fillElement(FactoryMessenger *fmp) const { if (metric_) fmp -> setMetric (metric_) ; if (imin_ <= imax_) { double coord[8]; getInitialCoord(coord); if (getMass()) { // For massive particule, express initial condition with 3-velocity double vel[3] = {coord[5]/coord[4], coord[6]/coord[4], coord[7]/coord[4]}; fmp -> setParameter ("Position", coord, 4); fmp -> setParameter ("Velocity", vel, 3); } else { // For massless particle, only 4-velocity is meaningfull fmp -> setParameter("InitCoord", coord, 8); } } if (delta_ != GYOTO_DEFAULT_DELTA) { # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setParameter (\"Delta\", "< setParameter ("Delta", delta_); } if (!adaptive_) fmp->setParameter("NonAdaptive"); if (maxiter_ != GYOTO_DEFAULT_MAXITER) fmp -> setParameter("MaxIter", maxiter_); } void Worldline::setParameters(FactoryMessenger* fmp) { if (!fmp) return; string name="", content="", unit=""; wait_pos_ = 1; setMetric(fmp->getMetric()); while (fmp->getNextParameter(&name, &content, &unit)) setParameter(name, content, unit); wait_pos_ = 0; if (init_vel_) { delete[] init_vel_; init_vel_=NULL; throwError("Worldline::setParameters(): " "Velocity was found but not Position"); } } #endif int Worldline::setParameter(std::string name, std::string content, std::string unit) { double coord[8]; char* tc = const_cast(content.c_str()); if (name=="InitialCoordinate" || name=="InitCoord") { for (int i=0;i<8;++i) coord[i] = strtod(tc, &tc); setInitCoord(coord); } else if (name=="Position") { for (int i=0;i<4;++i) coord[i] = strtod(tc, &tc); if (init_vel_) { setInitCoord(coord, init_vel_); delete[] init_vel_; init_vel_=NULL; } else setPosition(coord); wait_pos_ = 0; } else if (name=="Velocity") { for (int i=0;i<3;++i) coord[i] = strtod(tc, &tc); if (wait_pos_) { if (init_vel_) delete [] init_vel_; init_vel_ = new double[3]; memcpy(init_vel_, coord, 3*sizeof(double)); } else setVelocity(coord); } else if (name=="Delta") setDelta(atof(content.c_str()), unit); else if (name=="MaxIter") maxiter_ = atoi(content.c_str()); else if (name=="NonAdaptive") adaptive_ = false; else if (name=="Adaptive") adaptive_ = true; else return 1; return 0; } SmartPointer Worldline::getMetric() const { return metric_; } string Worldline::className() const { return string("Worldline"); } string Worldline::className_l() const { return string("worldline"); } void Worldline::setInitCoord(const double coord[8], int dir) { if (dir==0) dir = getMass() ? 1 : -1; imin_=imax_=i0_=(dir==1?0:x_size_-1); x0_[i0_]=coord[0]; x1_[i0_]=coord[1]; x2_[i0_]=coord[2]; x3_[i0_]=coord[3]; x0dot_[i0_]=coord[4]; x1dot_[i0_]=coord[5]; x2dot_[i0_]=coord[6]; x3dot_[i0_]=coord[7]; reInit(); } void Worldline::setInitCoord(double pos[4], double v[3], int dir) { if (!getMass()) throwError("Worldline::setInitCoord(pos, vel) " "only makes sense for massive particles"); if (!metric_) throwError("Please set metric before calling " "Worldline::setInitCoord(double pos[4], double vel[3])"); double tdot0=metric_->SysPrimeToTdot(pos, v); GYOTO_DEBUG_EXPR(tdot0); double coord[8]={pos[0], pos[1], pos[2], pos[3], tdot0, v[0]*tdot0, v[1]*tdot0, v[2]*tdot0}; GYOTO_DEBUG_ARRAY(coord, 8); setInitCoord(coord, dir); } void Worldline::setInitialCondition(SmartPointer met, const double coord[8], const int dir) { if (met) metric_=met; setInitCoord(coord, dir); } void Worldline::setPosition(double pos[4]) { double vel[] = {0., 0., 0.}; setInitCoord(pos, vel); } void Worldline::setVelocity(double vel[3]) { double coord[8]; getInitialCoord(coord); setInitCoord(coord, vel); } void Worldline::reset() { imin_=imax_=i0_; } void Worldline::reInit() { if (imin_ <= imax_) { reset(); double coord[8]; getInitialCoord(coord); if (metric_) { if ( metric_() -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL && x2_[i0_]==0. ) { if (verbose() >= GYOTO_SEVERE_VERBOSITY) cerr << "SEVERE: Worldline::setMetric(): Kicking particle off z axis\n"; x2_[i0_]=coord[2]=1e-10; } metric_ -> setParticleProperties(this,coord); } } } void Worldline::xFill(double tlim) { //GYOTO_DEBUG<< "In xFill" << endl; int dir, stopcond=0; size_t ind; // Check whether anything needs to be done, // Determine direction, // Allocate memory. if (tlim > x0_[imax_]) { // integrate forward dir = 1; ind = (imax_==x_size_-1)?xExpand(1):imax_; } else if (tlim < x0_[imin_]) { // integrate backward dir = -1; ind = (imin_==0)?xExpand(-1):imin_; } else return ; // nothing to do # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG<< "Integrating worldline " ; # endif // Set up integration double MassPart=getMass(); if (MassPart==1.) { # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG cerr << "of massive particule ....." << endl; GYOTO_ENDIF_DEBUG # endif }else if(MassPart==0.){ # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG cerr << "of 0-mass particule ....." << endl; GYOTO_ENDIF_DEBUG # endif }else{ throwError("In Worldline.C Unrecognized mass."); //GYOTO_DEBUG<< "of unrecognized mass (!!) particule ....." << endl; //equations of geodesics written for a mass=1 star } double coord[8]={x0_[ind], x1_[ind], x2_[ind], x3_[ind], x0dot_[ind], x1dot_[ind], x2dot_[ind], x3dot_[ind]}; SmartPointer state = new IntegState(this, coord, dir*delta_); //delta_ = initial integration step (defaults to 0.01) int mycount=0;// to prevent infinite integration while (!stopcond) { mycount++; ind+=dir; stopcond= state -> nextStep(coord); //if (stopcond && debug()) cout << "stopcond from integrator" << endl; if (mycount==maxiter_) { stopcond=1; Error ( "***WARNING STOP: in Worldline.C unexplained stop !!!" ); } // store particle's trajectory for later use x0_[ind] = coord[0]; x1_[ind] = coord[1]; x2_[ind] = coord[2]; x3_[ind] = coord[3]; x0dot_[ind] = coord[4]; x1dot_[ind] = coord[5]; x2dot_[ind] = coord[6]; x3dot_[ind] = coord[7]; // Check stop condition and whether we need to expand the arrays if (dir==1) { if (coord[0]>tlim) stopcond=1; if ((!stopcond) & (ind==x_size_-1)) { imax_=x_size_-1; ind=xExpand(1); } } else { if (coord[0] getCoordKind(); switch(coordkind) { case GYOTO_COORDKIND_SPHERICAL: for (n=imin_;n<=imax_;++n) { x[n-imin_]=x1_[n]*sin(x2_[n])*cos(x3_[n]); y[n-imin_]=x1_[n]*sin(x2_[n])*sin(x3_[n]); z[n-imin_]=x1_[n]*cos(x2_[n]); } break; case GYOTO_COORDKIND_CARTESIAN: for (n=imin_;n<=imax_;++n) { x[n-imin_]=x1_[n]; y[n-imin_]=x2_[n]; z[n-imin_]=x3_[n]; } break; default: Gyoto::throwError("in Worldline::get_xyz: Incompatible coordinate kind"); } } void Worldline::getCartesian(double const * const dates, size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime, double * const yprime, double * const zprime) { double *x1, *x2, *x3, *x0dot, *x1dot, *x2dot, *x3dot, tauprime; int coordkind = metric_ -> getCoordKind(); size_t di; double rprime, thetaprime, phiprime, costheta, sintheta, cosphi, sinphi, r; x0dot = new double[n_dates]; x1dot = new double[n_dates]; x2dot = new double[n_dates]; x3dot = new double[n_dates]; switch(coordkind) { case GYOTO_COORDKIND_SPHERICAL: x1 = new double[n_dates]; x2 = new double[n_dates]; x3 = new double[n_dates]; break; case GYOTO_COORDKIND_CARTESIAN: x1=x; x2=y; x3=z; break; default: Gyoto::throwError("in Worldline::get_xyz: unknown coordinate kind"); x1=x2=x3=NULL; // fix warning } getCoord(dates, n_dates, x1, x2, x3, x0dot, x1dot, x2dot, x3dot); switch(coordkind) { case GYOTO_COORDKIND_SPHERICAL: for (di=0; digetCoordKind() == GYOTO_COORDKIND_SPHERICAL){ double pos[8]={0.,0.,x2[di],x3[di],0.,0.,x2dot[di],0.}; checkPhiTheta(pos); x2[di]=pos[2];x3[di]=pos[3];x2dot[di]=pos[6]; } continue; } else if (date > x0_[imax_]) { curl=imax_; // current imax_ xFill(date); // integrate, that changes imax_ curh=imax_; // new imax_ if (curl == curh || date > x0_[imax_]) { ss<<"Worldline::getCoord: can't get coordinates for date="<SysPrimeToTdot(pos, vel); if (x1) x1[di] = pos[1]; if (x2) x2[di] = pos[2]; if (x3) x3[di] = pos[3]; if (x0dot) x0dot[di] = tdot; if (x1dot) x1dot[di] = vel[0]*tdot; if (x2dot) x2dot[di] = vel[1]*tdot; if (x3dot) x3dot[di] = vel[2]*tdot; } else { // Photon: don't be so elaborate, we certainly don't need it... yet if (x1) x1[di] = bestl[1]*factl + besth[1]*facth; if (x2) x2[di] = bestl[2]*factl + besth[2]*facth; if (x3) x3[di] = bestl[3]*factl + besth[3]*facth; if (x0dot) x0dot[di] = bestl[4]*factl + besth[4]*facth; if (x1dot) x1dot[di] = bestl[5]*factl + besth[5]*facth; if (x2dot) x2dot[di] = bestl[6]*factl + besth[6]*facth; if (x3dot) x3dot[di] = bestl[7]*factl + besth[7]*facth; } /* For spherical-like coordinates, transforms theta and phi so that theta is in [0,pi] and phi in [0,2pi] This call is due to interpolation above that could lead theta,phi out of their correct ranges. */ if (metric_->getCoordKind() == GYOTO_COORDKIND_SPHERICAL && x2 && x3 && x2dot){ double pos[8]={0.,0.,x2[di],x3[di],0.,0.,x2dot[di],0.}; checkPhiTheta(pos); x2[di]=pos[2];x3[di]=pos[3];x2dot[di]=pos[6]; } } } void Worldline::getCoord(double *x0dest, double *x1dest, double *x2dest, double *x3dest) const { //if (sysco!=sys_) //Gyoto::throwError("At this point, coordinate conversion is not implemented"); size_t ncomp=imax_-imin_+1; memcpy(x0dest, x0_+imin_, sizeof(double)*ncomp); memcpy(x1dest, x1_+imin_, sizeof(double)*ncomp); memcpy(x2dest, x2_+imin_, sizeof(double)*ncomp); memcpy(x3dest, x3_+imin_, sizeof(double)*ncomp); } void Worldline::checkPhiTheta(double coord[8]) const{ switch (metric_ -> getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: { /* Transforms theta and phi in coord so that theta is in [0,pi] and phi in [0,2pi] */ double thetatmp=coord[2], phitmp=coord[3]; while (thetatmp>M_PI) thetatmp-=2.*M_PI; while (thetatmp<-M_PI) thetatmp+=2.*M_PI;//then theta in [-pi,pi] if (thetatmp<0.) { thetatmp*=-1.;//then theta in [0,pi] coord[6]*=-1.; //theta -> -theta then idem for derivative phitmp+=M_PI;//thus, same point x,y,z } while (phitmp>2.*M_PI) phitmp-=2.*M_PI; while (phitmp<0.) phitmp+=2.*M_PI;//then phi in [0,2pi] coord[2]=thetatmp; coord[3]=phitmp; } break; case GYOTO_COORDKIND_CARTESIAN: throwError("Worldline::checkPhiTheta(): should not be called " "with cartesian-like coordinates"); default: throwError("Worldline::checkPhiTheta(): unknown COORDKIND"); } } void Worldline::get_dot(double *x0dest, double *x1dest, double *x2dest, double *x3dest) const { // if (sysco!=sys_) // Gyoto::throwError("At this point, coordinate conversion is not implemented"); size_t ncomp=imax_-imin_+1; memcpy(x0dest, x0dot_+imin_, sizeof(double)*ncomp); memcpy(x1dest, x1dot_+imin_, sizeof(double)*ncomp); memcpy(x2dest, x2dot_+imin_, sizeof(double)*ncomp); memcpy(x3dest, x3dot_+imin_, sizeof(double)*ncomp); } void Worldline::getSkyPos(SmartPointer screen, double *dalpha, double *ddelta, double *dD) const { double pos[4], skypos[3]; size_t i, ncomp=imax_-imin_+1; for (i=0;i coordToSky(pos, skypos); dalpha[i]=skypos[0]; ddelta[i]=skypos[1]; dD[i] =skypos[2]; } } void Worldline::get_prime(double *x1dest, double *x2dest, double *x3dest) const { size_t n; double f; //if (sysco!=sys_) // Gyoto::throwError("At this point, coordinate conversion is not implemented"); for (n=imin_;n<=imax_;++n) { x1dest[n-imin_]=x1dot_[n]*(f=1./x0dot_[n]); x2dest[n-imin_]=x2dot_[n]*f; x3dest[n-imin_]=x3dot_[n]*f; } } void Worldline::save_txyz(char * filename) const { size_t n; int width=15; int prec=12; ofstream fichierxyz(filename); int coordkind = metric_ -> getCoordKind(); switch(coordkind) { case GYOTO_COORDKIND_SPHERICAL: for (n=imin_;n<=imax_;++n) { // GYOTO_DEBUG<< "dans save imin, coord= " << imin_ << " " << x0_[n] << " " << x1_[n] << " " << x2_[n] << " " << x3_[n] << endl; //fichierxyz << setprecision(prec) << setw(width) << x1_[n] << " "; //fichierxyz << setprecision(prec) << setw(width) << x0[n] << " "; fichierxyz << setprecision(prec) << setw(width) << x0_[n] << " ";//saving r distance fichierxyz << setprecision(prec) << setw(width) << x1_[n]*sin(x2_[n])*cos(x3_[n]) << " "; fichierxyz << setprecision(prec) << setw(width) << x1_[n]*sin(x2_[n])*sin(x3_[n]) << " "; fichierxyz << setprecision(prec) << setw(width) << x1_[n]*cos(x2_[n]) << endl; } break; case GYOTO_COORDKIND_CARTESIAN: for (n=imin_;n<=imax_;++n) { //fichierxyz << setprecision(prec) << setw(width) << sqrt(x1[n]*x1[n]+x2_[n]*x2_[n]+x3_[n]*x3_[n]) << " "; fichierxyz << setprecision(prec) << setw(width) << x0_[n] << " "; fichierxyz << setprecision(prec) << setw(width) << x1_[n] << " "; fichierxyz << setprecision(prec) << setw(width) << x2_[n] << " "; fichierxyz << setprecision(prec) << setw(width) << x3_[n] << endl; } break; default: Gyoto::throwError("in Worldline::save_xyz: Incompatible coordinate kind"); } fichierxyz.close(); } void Worldline::save_txyz(char * filename, const double t1, const double mass_sun, const double distance_kpc, const string unit, SmartPointer sc) { xFill(t1); size_t nelem = get_nelements(), n=0; double * t = new double [nelem]; double * x = new double [nelem]; double * y = new double [nelem]; double * z = new double [nelem]; double rad2deg = 180./M_PI; double f=1.; if (getMass()) f /= x0dot_[i0_]; int width=GYOTO_WIDTH; int prec=GYOTO_PREC; ofstream fichierxyz(filename); get_t(t); get_xyz(x, y, z); convert(x, nelem, mass_sun, distance_kpc, unit); convert(y, nelem, mass_sun, distance_kpc, unit); convert(z, nelem, mass_sun, distance_kpc, unit); // HEADER string metkind = metric_->getKind(); fichierxyz << "# Gyoto save file " << endl << "# Start Gyoto parameters" << endl << "# particle_type = \"" << className_l() << "\"" << endl; // if (!metkind.compare("KerrBL")) { // SmartPointer kmet = metric_ ; // fichierxyz << "# metric_type = \"kerr\"" << endl // << "# spin = " << kmet -> getSpin() << endl // << "# mass = " << mass_sun << endl; // } else fichierxyz << "# metric_type = \"" << metkind << "\"" << endl ; fichierxyz << "# t0 = " << x0_[i0_] << endl << "# r0 = " << x1_[i0_] << endl << "# theta0 = " << x2_[i0_] << endl << "# phi0 = " << x3_[i0_] << endl << "# rprime0 = " << x1dot_[i0_]*f << endl << "# thetaprime0 = " << x2dot_[i0_]*f << endl << "# phiprime0 = " << x3dot_[i0_]*f << endl << "# t1 = " << t1 << endl; if (sc) fichierxyz << "# incl = " << sc -> getInclination()*rad2deg << endl << "# paln = " << sc -> getPALN()*rad2deg << endl << "# phase = " << sc -> getArgument()*rad2deg << endl << "# distance = " << distance_kpc << endl; fichierxyz << "# length_unit = \"" << unit << "\"" << endl << "# End Gyoto parameters" << endl << "# Columns are t, x, y, z" << endl; // DATA for (n=0;n<=nelem;++n) { fichierxyz << setprecision(prec) << setw(width) << t[n] << " " << setprecision(prec) << setw(width) << x[n] << " " << setprecision(prec) << setw(width) << y[n] << " " << setprecision(prec) << setw(width) << z[n] << endl ; } delete [] t; delete [] x; delete [] y; delete [] z; } void Worldline::setDelta(const double del) { delta_=del; } void Worldline::setDelta(double d, const string &unit) { setDelta(Units::ToGeometrical(d, unit, metric_)); } double Worldline::getDelta() const { return delta_; } double Worldline::getDelta(const string &unit) const { return Units::FromGeometrical(getDelta(), unit, metric_); } double Worldline::getTmin() const { return tmin_; } void Worldline::setTmin(double tmin) { tmin_ = tmin; } void Worldline::adaptive(bool mode) { adaptive_ = mode; } bool Worldline::adaptive() const { return adaptive_; } void Worldline::maxiter(size_t miter) { maxiter_ = miter; } size_t Worldline::maxiter() const { return maxiter_; } double const * Worldline::getCst() const { return cst_; } void Worldline::setCst(double const * const cst, const size_t n) { if (cst_) delete [] cst_; cst_ = new double[n]; cst_n_ = n; for (size_t ii=0;iiimax_) { cerr << "Indices min curr max= " << imin_ << " " << index << " " << imax_ << endl; throwError("Worldline::getCoord: bad index"); } coord[0] = x0_[index]; coord[1] = x1_[index]; coord[2] = x2_[index]; coord[3] = x3_[index]; coord[4] = x0dot_[index]; coord[5] = x1dot_[index]; coord[6] = x2dot_[index]; coord[7] = x3dot_[index]; } void Worldline::getCartesianPos(size_t index, double dest[4]) const { dest[0] = x0_[index]; int coordkind = metric_ -> getCoordKind(); switch (coordkind) { case GYOTO_COORDKIND_SPHERICAL: dest[1] = x1_[index]*sin(x2_[index])*cos(x3_[index]); dest[2] = x1_[index]*sin(x2_[index])*sin(x3_[index]); dest[3] = x1_[index]*cos(x2_[index]); break; case GYOTO_COORDKIND_CARTESIAN: dest[1] = x1_[index]; dest[2] = x2_[index]; dest[3] = x3_[index]; break; default: Gyoto::throwError("Worldline::getCartesianPos: Incompatible coordinate kind"); } } Gyoto-0.1.0/lib/WorldlineIntegState.C000066400000000000000000000045401217470755400174310ustar00rootroot00000000000000/* Copyright 2011 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoUtils.h" #include #include #include #include #include #include #include using namespace std ; using namespace Gyoto; Worldline::IntegState::IntegState(Worldline * line, const double coord[8], const double delta) : line_(line), gg_(line->getMetric()), delta_(delta), adaptive_(line->adaptive()) { short i; for (i=0;i<8;++i) coord_[i]=coord[i]; norm_=normref_= gg_->ScalarProd(coord,coord+4,coord+4); } int Worldline::IntegState::nextStep(double coord[8]) { int j; double h1; if (adaptive_){ if (gg_ -> myrk4_adaptive(line_,coord_,norm_,normref_,coord,delta_,h1)) return 1; delta_ = h1; }else{ if (gg_ -> myrk4(line_,coord_,delta_,coord)) return 1; } for (j=0;j<8;j++) coord_[j] = coord[j]; norm_=gg_ -> ScalarProd(coord,coord+4,coord+4); double normtol=.001; /* NB: following test done for norm/tdot as tdot can diverge close to horizon (it's the case for NS integration eg where geodesic can come close to horizon) Then just check that norm/tdot does not diverge. */ if (fabs(norm_-normref_)/(coord[4]*coord[4])>normtol) { GYOTO_SEVERE << "in Worldline::IntegState.C: " "norm is drifting" " - with norm/x0dot**2,x1,x2,x3= " << norm_ << " " << coord[1] << " " << coord[2] << " " << coord[3] << " " << endl; } # if GYOTO_DEBUG_ENABLED GYOTO_IF_DEBUG GYOTO_DEBUG_ARRAY(coord,8); GYOTO_DEBUG_EXPR(delta_); GYOTO_ENDIF_DEBUG # endif if (delta_==delta_+1) return 1; // delta == Infinity : stop condition return 0; } Worldline::IntegState::~IntegState() {} Gyoto-0.1.0/lib/gyoto-uninstalled.pc.in000066400000000000000000000011711217470755400200050ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=${prefix} abs_top_srcdir=@abs_top_srcdir@ libdir=${abs_top_srcdir}/lib/.libs includedir=${abs_top_srcdir}/include GYOTO=${abs_top_srcdir}/bin/gyoto GYOTO_PLUGDIR=${exec_prefix}/lib/gyoto/@sovers@ YORICK= Y_INST_HOME= Y_INST_SITE= HOME_LORENE=@HOME_LORENE@ LORENECPPFLAGS=@LORENECPPFLAGS@ LORENELDFLAGS=@LORENELDFLAGS@ Name: Gyoto Description: Relativistic geodesic integration and ray-tracing Version: @VERSION@ URL: http://gyoto.obspm.fr Requires: @pkg_requires@ Conflicts: Libs: -L${libdir} -lgyoto -ldl @pkg_libs@ @PTHREAD_LIBS@ Libs.private: Cflags: -I${includedir} @pkg_cflags@ @PTHREAD_CFLAGS@ Gyoto-0.1.0/lib/gyoto.pc.in000066400000000000000000000011441217470755400154650ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include GYOTO=${exec_prefix}/bin/gyoto GYOTO_PLUGDIR=${libdir}/gyoto/@sovers@ YORICK=@YORICK@ Y_INST_HOME=@Y_INST_HOME@ Y_INST_SITE=@Y_INST_SITE@ HOME_LORENE=@HOME_LORENE@ LORENECPPFLAGS=@LORENECPPFLAGS@ LORENELDFLAGS=@LORENELDFLAGS@ Name: Gyoto Description: Relativistic geodesic integration and ray-tracing Version: @VERSION@ URL: http://gyoto.obspm.fr Requires: @pkg_requires@ Conflicts: Libs: -L${libdir} -lgyoto -ldl @pkg_libs@ @PTHREAD_LIBS@ Libs.private: Cflags: -I${includedir}/Gyoto @pkg_cflags@ @PTHREAD_CFLAGS@ Gyoto-0.1.0/local_settings000066400000000000000000000064701217470755400155710ustar00rootroot00000000000000# Install path: # ------------ # Header wil go to $(PREFIX)/include, libraries to $(PREFIX)/lib, # binaries to $(PREFIX)/tools. PREFIX = /usr/local # C++ compiler: # ------------ #CXX = g++ CXX = g++ # Yorick interpreter: # ------------------ YORICK = yorick # Version of the library: # ---------------------- # This should normally be changed only be the developpers, but can # sometimes be overriden by distributors: SOVERS_MAJOR = 0 SOVERS = $(SOVERS_MAJOR).0.0 # Options for using POSIX threads: # ------------------------------- GYOTO_FLAGS += -DHAVE_PTHREADS ifneq (,$(findstring -DHAVE_PTHREADS,$(GYOTO_FLAGS))) LIB_CXX += -lpthread endif # Options for using Xerces: # ------------------------- # Xerces-c 3 is used to read/write scenery descriptions in XML format. # It is recommended to enable it, required for building the gyoto executable. # # Comment next line to disable Xerces: GYOTO_FLAGS += -DGYOTO_USE_XERCES # Where are Xerces include files: XERCES_INC = -I/opt/local/include # Where is libxercesc.so/.dylib/.a: XERCES_LDFLAGS = -L/opt/local/lib # Options for using cfisio: # ------------------------- # cfitsio is used to save images as fits files. # It is required for building the gyoto executable. # Parts of the library will not be built if GYOTO_USE_CFITSIO is not set. GYOTO_FLAGS += -DGYOTO_USE_CFITSIO CFITSIO_INC = -I/opt/local/include CFITSIO_LDFLAGS = -L/opt/local/lib # ________________________________________________________________ # It shouldn't be necessary to change anything below this line # Options for the C++ compiler # ---------------------------- ifndef CXXFLAGS CXXFLAGS = -g -O2 -pedantic -Wall -W -Wundef -Wshadow -Wcast-qual \ -Wcast-align -Wconversion -Winline \ -Wabi -Woverloaded-virtual -Wno-long-long \ # security hardening, also catches some memory overflows: -Wformat -Wformat-security -Werror=format-security \ -D_FORTIFY_SOURCE=2 \ -fstack-protector --param ssp-buffer-size=4 endif ifneq (,$(findstring -DHAVE_PTHREADS,$(GYOTO_FLAGS))) CXXFLAGS += -pthread endif CXXFLAGS += -fPIC # Path for the include files # -------------------------------------------- GYOTO_INC = $(CFITSIO_INC) ifneq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) GYOTO_INC += $(XERCES_INC) endif # C, C++ library, mathematical library # ------------------------------------- LIB_CXX += -lstdc++ -lm ifneq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) LIB_CXX += -lxerces-c GYOTO_LDFLAGS += $(XERCES_LDFLAGS) endif ifneq (,$(findstring -DGYOTO_USE_CFITSIO,$(GYOTO_FLAGS))) LIB_CXX += -lcfitsio GYOTO_LDFLAGS += $(CFITSIO_LDFLAGS) endif SYS=$(shell uname -s) ifeq ($(SYS),Darwin) DYLIB_SFX=dylib DYLIB_FLAG=-dynamiclib LIBGYOTO_FILE=libgyoto.$(DYLIB_SFX) STLIB_CMD=libtool -static -o PLUG_FLAGS=-flat_namespace -bundle -bundle_loader $(LIBGYOTO_PATH)$(LIBGYOTO_FILE) DYLIB_VAR=DYLD_LIBRARY_PATH else DYLIB_SFX=so DYLIB_FLAG=-shared -Wl,-soname,libgyoto.$(DYLIB_SFX).$(SOVERS_MAJOR) LIBGYOTO_FILE=libgyoto.$(DYLIB_SFX).$(SOVERS) GYOTO_FLAGS += -rdynamic STLIB_CMD=ar qc PLUG_FLAGS=-shared DYLIB_VAR=LD_LIBRARY_PATH endif GYOTO_FLAGS += -DGYOTO_PLUGIN_SFX=\"$(DYLIB_SFX)\" GYOTO_FLAGS += -DGYOTO_PREFIX=\"$(PREFIX)\" GYOTO_FLAGS += -DGYOTO_SOVERS=\"$(SOVERS)\" CPPFLAGS += $(CFITSIO_INC) $(XERCES_INC) LDFLAGS += $(GYOTO_LDFLAGS) LDLIBS = $(LIB_CXX) Gyoto-0.1.0/ltmain.sh000066400000000000000000010520261217470755400144530ustar00rootroot00000000000000 # 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-1.1 # 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-1.1" 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 () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell 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 () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell 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 () { 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 may be replaced by extended shell 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 () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell 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 () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell 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}=\$${1}\${2}" } # func_append may be replaced by extended shell 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}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell 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 func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append 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" = : || func_append 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_append 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) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append 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. func_append 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 func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append 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 func_append 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 func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append 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 func_append 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 func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append 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" || func_append 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" func_append 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 func_append 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" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append 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" func_append 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. func_append 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 "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append 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" && func_append 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) ;; *) func_append 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 func_append 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) func_append compile_command " @OUTPUT@" func_append 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. func_append compile_command " @SYMFILE@" func_append 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 func_append dlfiles " $arg" else func_append 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 "*) ;; *) func_append 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 # func_append 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 func_append 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. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append 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 func_append 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" func_append 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 func_append libobjs " $pic_object" func_append 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 "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append 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. func_append compile_command " $link_static_flag" func_append 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*) func_append compile_command " $arg" func_append 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]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append 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;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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 func_append 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 func_append 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) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append 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 "*) ;; *) func_append 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" func_append arg " $func_quote_for_eval_result" func_append 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" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append 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" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append 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 func_append 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. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append 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 func_append 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" func_append 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 func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append 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 func_append compile_command " $arg" func_append 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\" func_append compile_command " $arg" func_append 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 "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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 "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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 "*) ;; *) func_append 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 func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append 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 "*) ;; * ) func_append 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" func_append 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" func_append 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 "*) ;; *) func_append 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. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append 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 "*) ;; *) func_append 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" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append 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. func_append convenience " $ladir/$objdir/$old_library" func_append 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 "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append 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" func_append newdlprefiles " $dir/$linklib" else func_append 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" && \ func_append 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 func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append 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 func_append 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" func_append 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 "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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:"*) ;; *) func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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 func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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 [\\/]*) func_append 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:"*) ;; *) func_append 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:"*) ;; *) func_append 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:"*) ;; *) func_append 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 [\\/]*) func_append 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 "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append 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 "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append 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 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append 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 "*) ;; *) func_append 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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append 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 func_append 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" func_append 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!" func_append 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. func_append 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" func_append 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 func_append 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 func_append 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" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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 "*) ;; *) func_append 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 "*) ;; *) func_append 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 func_append 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 func_append 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 func_append 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. func_append 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 "*) func_append 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 func_append 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. func_append 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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 func_append 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 func_append 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" func_append 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 func_append 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 func_append 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 "*) ;; *) func_append 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" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append 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\" func_append 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 func_append 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 func_append 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 func_append 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 func_append 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 func_append 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" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append 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" func_append 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]) func_append compile_command " ${wl}-bind_at_load" func_append 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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 func_append 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 func_append 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 func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append 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" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append 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" func_append 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" func_append oldobjs " $gentop/$newobj" ;; *) func_append 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 func_append 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" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append 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" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append 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" func_append 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 func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append 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) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append 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 "*) ;; *) func_append 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 func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append 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 func_append 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 func_append 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 func_append 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 func_append 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 func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append 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 Gyoto-0.1.0/m4/000077500000000000000000000000001217470755400131455ustar00rootroot00000000000000Gyoto-0.1.0/m4/ax_append_compile_flags.m4000066400000000000000000000055111217470755400202340ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) # # DESCRIPTION # # For every FLAG1, FLAG2 it is checked whether the compiler works with the # flag. If it does, the flag is added FLAGS-VARIABLE # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. During the check the flag is always added to the # current language's flags. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: This macro depends on the AX_APPEND_FLAG and # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with # AX_APPEND_LINK_FLAGS. # # LICENSE # # Copyright (c) 2011 Maarten Bosmans # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 3 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AC_REQUIRE([AX_CHECK_COMPILE_FLAG]) AC_REQUIRE([AX_APPEND_FLAG]) for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) done ])dnl AX_APPEND_COMPILE_FLAGS Gyoto-0.1.0/m4/ax_append_flag.m4000066400000000000000000000053041217470755400163410ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_APPEND_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl AS_VAR_SET_IF(FLAGS, [case " AS_VAR_GET(FLAGS) " in *" $1 "*) AC_RUN_LOG([: FLAGS already contains $1]) ;; *) AC_RUN_LOG([: FLAGS="$FLAGS $1"]) AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"]) ;; esac], [AS_VAR_SET(FLAGS,["$1"])]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG Gyoto-0.1.0/m4/ax_check_compile_flag.m4000066400000000000000000000062511217470755400176610ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS Gyoto-0.1.0/m4/ax_pthread.m4000066400000000000000000000303661217470755400155360ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 18 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) AC_MSG_RESULT($ax_pthread_ok) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case ${host_os} in solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($ax_pthread_ok) if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $attr; return attr /* ; */])], [attr_name=$attr; break], []) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case ${host_os} in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; osf* | hpux*) flag="-D_REENTRANT";; solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], ax_cv_PTHREAD_PRIO_INHERIT, [ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD Gyoto-0.1.0/m4/libtool.m4000066400000000000000000010575421217470755400150710ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # 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 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. m4_define([_LT_COPYING], [dnl # 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. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; 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-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # 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 ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl 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 _LT_CC_BASENAME([$compiler]) # 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 _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# 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' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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' _LT_CONFIG_STATUS_DECLARATIONS 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 lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); 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 lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); 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 _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [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. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### 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 _LT_PROG_LTMAIN # 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) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # 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 ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl 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* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl 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* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [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" >&AS_MESSAGE_LOG_FD $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 >&AS_MESSAGE_LOG_FD # 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 >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [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" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $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 >&AS_MESSAGE_LOG_FD 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 >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) 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 ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_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 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="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}" _LT_TAGVAR(module_expsym_cmds, $1)="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}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$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}" _LT_TAGVAR(archive_expsym_cmds, $1)="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 _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # 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' 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*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ 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" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. 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|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) 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 AC_TRY_EVAL(ac_compile); 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" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # 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 _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # 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\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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 ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] 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 AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; 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" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $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* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) 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 AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [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]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) 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" AC_MSG_RESULT([yes]) 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" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ 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}' m4_if([$1], [],[ 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`' m4_if([$1], [],[ 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 ;; 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 | 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 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) 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 AC_MSG_RESULT([$dynamic_linker]) 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 _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[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]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [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 dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" 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]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) 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 AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [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 &1 /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 ;; 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 | 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 ]) 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 _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [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]) 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 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [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 ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # 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 AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && 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@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_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@&t@_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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && 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" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD 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 ]) 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 AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) 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 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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_TAGVAR(lt_prog_compiler_pic, $1)=-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_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_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 _LT_TAGVAR(export_symbols_cmds, $1)='$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 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # 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'. _LT_TAGVAR(exclude_expsyms, $1)=['_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. dnl Note also adjust exclude_expsyms for C++ above. 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*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$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)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+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 _LT_TAGVAR(archive_cmds, $1)='$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... _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(export_symbols_cmds, $1)='$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 _LT_TAGVAR(export_symbols_cmds, $1)='$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. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${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 _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(always_export_symbols, $1)=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. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$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)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='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, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=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. _LT_TAGVAR(archive_cmds, $1)='$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. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$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*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # 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) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$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. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=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. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) 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. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [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]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$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);}' _LT_TAG_COMPILER # 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 _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## 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_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$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. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # 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 _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) 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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_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 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= 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. _LT_TAGVAR(archive_cmds, $1)='$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 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=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. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${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 _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= 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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(always_export_symbols, $1)=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. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=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. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='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, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='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, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$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... _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=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 _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=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 _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$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*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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++ _LT_TAGVAR(archive_cmds, $1)='$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. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | 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. _LT_TAGVAR(archive_cmds, $1)='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' _LT_TAGVAR(archive_expsym_cmds, $1)='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"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$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."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='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`"' _LT_TAGVAR(old_archive_cmds, $1)='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' _LT_TAGVAR(archive_cmds, $1)='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' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${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++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # 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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=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. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=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. _LT_TAGVAR(archive_cmds, $1)='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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # 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 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$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' ;; *) _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # 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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=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. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$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. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) 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_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf 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). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) 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 ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _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 dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${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 "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [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. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; 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 _LT_TAGVAR(postdeps,$1)='-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 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 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_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$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... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC 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_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## 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_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## 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_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # 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 AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # 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 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 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=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # 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}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # 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 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [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 ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#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 ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS Gyoto-0.1.0/m4/ltoptions.m4000066400000000000000000000300731217470755400154450ustar00rootroot00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # 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 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [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], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [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], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) Gyoto-0.1.0/m4/ltsugar.m4000066400000000000000000000104241217470755400150710ustar00rootroot00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) Gyoto-0.1.0/m4/ltversion.m4000066400000000000000000000012621217470755400154350ustar00rootroot00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Gyoto-0.1.0/m4/lt~obsolete.m4000066400000000000000000000137561217470755400157750ustar00rootroot00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) Gyoto-0.1.0/m4/pkg.m4000066400000000000000000000130231217470755400141670ustar00rootroot00000000000000# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES Gyoto-0.1.0/missing000077500000000000000000000241521217470755400142300ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: Gyoto-0.1.0/yorick/000077500000000000000000000000001217470755400141255ustar00rootroot00000000000000Gyoto-0.1.0/yorick/Makefile.in000066400000000000000000000111611217470755400161720ustar00rootroot00000000000000# these values filled in by yorick -batch make.i Y_MAKEDIR= Y_EXE= Y_EXE_PKGS= Y_EXE_HOME= Y_EXE_SITE= Y_HOME_PKG= # ----------------------------------------------------- optimization flags # options for make command line, e.g.- make COPT=-g TGT=exe COPT=$(COPT_DEFAULT) -L../lib -I../include TGT=$(DEFAULT_TGT) # ------------------------------------------------ macros for this package #include ../local_settings CPPFLAGS=@CPPFLAGS@ XERCESLDFLAGS=@XERCESLDFLAGS@ XERCESCPPFLAGS=@XERCESCPPFLAGS@ UDUNITS_CPPFLAGS=@UDUNITS_CPPFLAGS@ UDUNITS_LDFLAGS=@UDUNITS_LDFLAGS@ DYLIB_VAR=@DYLIB_VAR@ PTHREAD_CFLAGS= @PTHREAD_CFLAGS@ PTHREAD_LIBS= @PTHREAD_LIBS@ YGYOTO_C = $(shell ls *.C) GYOTO_C = $(shell ls ../lib/*.C) GYOTO_OBJ = $(GYOTO_C:.C=.o) GYOTO_H = $(shell ls ../include/*.h) PKG_NAME=gyoto PKG_I=gyoto.i OBJS=gyoto_utils.o gyoto_Metric.o gyoto_Photon.o \ gyoto_Scenery.o gyoto_Screen.o gyoto_Idx.o gyoto_Spectrum.o \ gyoto_Astrobj.o gyoto_ThinDisk.o \ gyoto_Spectrometer.o gyoto_SpectroComplex.o gyoto_SpectroUniform.o # gyoto_KerrBL.o gyoto_KerrKS.o gyoto_Star.o gyoto_FixedStar.o gyoto_PolishDoughnut.o gyoto_ThinInfiniteDiskBL.o gyoto_ThinInfiniteDiskKS.o # change to give the executable a name other than yorick PKG_EXENAME=yorick # PKG_DEPLIBS=-Lsomedir -lsomelib for dependencies of this package PKG_DEPLIBS=-L../lib/.libs -lgyoto $(XERCESLDFLAGS) $(PTHREAD_LIBS) # set compiler (or rarely loader) flags specific to this package PKG_CFLAGS= -I../include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) $(PTHREAD_CFLAGS) PKG_LDFLAGS= $(PTHREAD_CFLAGS) # list of additional package names you want in PKG_EXENAME # (typically Y_EXE_PKGS should be first here) EXTRA_PKGS=$(Y_EXE_PKGS) # list of additional files for clean PKG_CLEAN= # autoload file for this package, if any PKG_I_START= # non-pkg.i include files for this package, if any PKG_I_EXTRA=gyoto_constants.i gyotoy.i gyoto_namespace.i # -------------------------------- standard targets and rules (in Makepkg) # set macros Makepkg uses in target and dependency names # DLL_TARGETS, LIB_TARGETS, EXE_TARGETS # are any additional targets (defined below) prerequisite to # the plug-in library, archive library, and executable, respectively PKG_I_DEPS=$(PKG_I) Y_DISTMAKE=distmake include $(Y_MAKEDIR)/Make.cfg include $(Y_MAKEDIR)/Makepkg include $(Y_MAKEDIR)/Make$(TGT) # override macros Makepkg sets for rules and other macros # Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable) Y_HOME=$(Y_EXE_HOME) Y_SITE=$(Y_EXE_SITE) # Actual install directories set with ./configure --with-yorick-* prefix=@prefix@ exec_prefix=@exec_prefix@ DEST_Y_HOME=$(DESTDIR)@Y_INST_HOME@ DEST_Y_SITE=$(DESTDIR)@Y_INST_SITE@ # ------------begin C++ source hacks # must use C++ to load yorick with this C++ package # this assumes make default CXX macro points to C++ compiler CXXFLAGS=$(CFLAGS) $(GYOTO_FLAGS) LD_DLL=$(CXX) $(LDFLAGS) $(PLUG_SHARED) LD_EXE=$(CXX) $(LDFLAGS) $(PLUG_EXPORT) # C++ has no standard file extension, supply default make rule(s) .C.o: $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< # --------------end C++ source hacks # simple example: #myfunc.o: myapi.h # more complex example (also consider using PKG_CFLAGS above): #myfunc.o: myapi.h myfunc.c # $(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c DEST_PKG_INSTALLED_DIR=$(DEST_Y_SITE)/packages/installed all: gyoto_std.so gyoto_std.so: stdplug/gyoto_std.so cp stdplug/gyoto_std.so ./ stdplug/gyoto_std.so: stdplug/*.C cd stdplug; $(MAKE) gyoto.so: gyoto.i $(OBJS) check-dll: $(PKG_DLL) check.i unset GYOTO_PLUGINS && \ $(DYLIB_VAR)=../lib/.libs:$$$(DYLIB_VAR) \ GYOTO_CHECK_NODISPLAY=true \ $(Y_EXE) -i check.i install:: cd stdplug; make install $(YNSTALL) ygyoto.h ygyoto_supplier.C $(DEST_Y_SITE)/include $(YNSTALL) gyotoy.xml $(DEST_Y_SITE)/glade $(YNSTALL) gyotoy.png $(DEST_Y_SITE)/data $(YNSTALL) gyotoy $(DEST_Y_SITE)/bin -ln $(DEST_Y_SITE)/bin/gyotoy $(DESTDIR)$(prefix)/bin/ $(YNSTALL) gyotoy.1 $(DESTDIR)$(prefix)/share/man/man1 $(YNSTALL) gyoto.info $(DEST_PKG_INSTALLED_DIR) uninstall:: cd stdplug; make uninstall rm -f $(DEST_Y_SITE)/include/ygyoto* rm -f $(DEST_Y_SITE)/glade/gyotoy.xml rm -f $(DEST_Y_HOME)/bin/gyotoy rm -f $(DESTDIR)$(exec_prefix)/bin/gyotoy rm -f $(DESTDIR)$(prefix)/share/man/man1/gyotoy.1 -rm -f $(DEST_PKG_INSTALLED_DIR)/gyoto.info clean:: cd stdplug; yorick -batch make.i; make clean rm -f gyoto_std.so example-patterndisk.fits.gz example-patterndisk.xml distclean:: cd stdplug; yorick -batch make.i; make distclean %: ; .PHONY: standalone test-cppprog test-standalone test test-plugin check # -------------------------------------------------------- end of Makefile Gyoto-0.1.0/yorick/Orbite.i000066400000000000000000000077731217470755400155410ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // This file is a port from tools/Orbite.C rev. 66 #include "gyoto.i" width=15; prec=12; mm=1; // BH mass, still unsused aa=0.995; radius=1; gg=gyoto_KerrBL(spin=aa,mass=mm); //gg_gen=gyoto_AnalyticMetric_new(mm); //To be changed : gen=0;// 1=use generic metric, 0=use Kerr name="StarOrbitXYZ.dat";// name of the saving file tstop=-2000.;//integration stops when t=tstop // initial conditions : //***CI Kerr Equatorial*** ri=10.790954422036;//at apo ; cf Eric Eq. 5.57 et CondInitKerrEquat.nb r2=ri*ri; a2=aa*aa; thetai=pi/2.; sinu=sin(thetai); cosi=cos(thetai); sinu2=sinu*sinu; cosi2=cosi*cosi; sigma=r2+a2*cosi2; phii=0.; tobs=1000;//observation time (chosen) robs=100;//observer distance ttrav=robs;//approximate photon travel time ti=tobs-4.*ttrav; //cf Levin & Perez-Giz 2008 Ph Rv D 77, 1003005, Fig. 15 bottom right EE=.921103; LL=2.; QQ=0.;//equatorial plane //cf LevinPerez Eq. A7 lambda=1.-2*mm*ri/sigma; xi=2.*mm*aa*ri*sinu2/sigma; gamma = sinu2*(r2+a2+2.*mm*a2*ri*sinu2/sigma); fact=1./(gamma*lambda+xi*xi); phipointi=lambda*fact*LL+xi*fact*EE; tpointi=-xi*fact*LL+gamma*fact*EE; write, format= "phipointi %e tpointi %e\n", phipointi, tpointi; //cf MTW 33.31d : thetapoint2=(QQ-LL*LL/(tan(thetai)*tan(thetai))+a2*(EE*EE-1.)*cosi2)/(sigma*sigma); //cout << "thetapoint2= " << thetapoint2 << endl; if (-thetapoint2 < 1e-10) thetapoint2=0;// if thetapoint2 slightly < 0... if (thetapoint2 < 0.) error , "thetapoint2 < 0 !!! aborting..."; thetapointi=sqrt(thetapoint2); //cout << "thetapoint " << thetapointi << endl; pthetai=sigma*thetapointi; //cout << "pthetai= " << pthetai << endl; posi=[ti,ri,thetai,phii]; //cout << "ri thi phi " << setprecision(prec) << ri << " " << thetai << " " << phii << endl; if (!gen) { gtt = gg(posi, 1, 1); grr = gg(posi, 2, 2); gthth = gg(posi, 3, 3); gphph = gg(posi, 4, 4); gtph = gg(posi, 1, 4); }else{ gtt =gg_gen(posi, 1, 1); grr =gg_gen(posi, 2, 2); gthth =gg_gen(posi, 3, 3); gphph =gg_gen(posi, 4, 4); gtph =gg_gen(posi, 1, 4); } rpoint2=(-1.-gtt*tpointi*tpointi-2.*gtph*tpointi*phipointi-gthth*thetapointi*thetapointi-gphph*phipointi*phipointi)/grr; if (-rpoint2 < 1e-10) rpoint2=0;// if rpoint2 slightly < 0... //cout << "rpoint2 " << rpoint2 << endl; if (rpoint2 < 0.) error, "rpoint2 < 0 !!! aborting..."; rpointi=sqrt(rpoint2); Bigdelta=r2-2.*mm*ri+a2; //cout << "Bigdelta" << Bigdelta << endl; pri=sigma/Bigdelta*rpointi; //cout << "pri= " << pri << endl; cst=[1.,EE,LL,QQ];//4 Kerr cst of motion µ, E, L, Q pti=-EE; pphii=LL; yinit=[ti,ri,thetai,phii,pti,pri,pthetai,pphii]; if (gen) init=[ti, ri, thetai, phii, tpointi, rpointi, thetapointi, phipointi];\ else init = gg (get_coord = yinit, cst); write,"\n"; write, format="phidot= %e tdot= %e\n", init(8), init(5); write,"\n"; write,"dans Orbit.i yinit= "+pr1(yinit); write,"dans Orbit.i init= "+pr1(init); t0=init(1); r0=init(2); theta0=init(3); phi0=init(4); tdot0=init(5); rdot0=init(6); thetadot0=init(7); phidot0=init(8); v= [rdot0/tdot0, thetadot0/tdot0, phidot0/tdot0]; if (gen) st=gyoto_Star(metric=gg_gen,radius=radius,initcoord=init,v) ;\ else st=gyoto_Star(metric=gg, radius=radius, initcoord=init, v) ; gyoto_Star_xFill,st,tstop; gyoto_Star_get_coord,st,t,r; gyoto_Star_get_xyz, st, x, y, z; f=open(name, "w"); write, f, format="%15.12g %15.12g %15.12g %15.12g\n", r, x, y, z; close, f; Gyoto-0.1.0/yorick/README000066400000000000000000000032401217470755400150040ustar00rootroot00000000000000 Gyoto for Yorick This is a Yorick plug-in giving access to the Gyoto library. It comes with a (GTK) graphical interface. 1- Prerequisites (see details below): _____________________________________ Yorick ______ For direct access to Gyoto, only Yorick is required. Yorick comes precompiled with many distributions of linux and is present in the Macports. You can also find binaries and source code at http://yorick.sourceforge.net/ Yorick >= 2.2 is needed. For the graphical user interface Gyotoy, you'll need a few additional pieces. First of all, I seriously doubt it will run under MS Windows, but please report any news on that front. Yutils ______ A collection of utilities for Yorick, distributed as yorick-yutils in many Linux distributions. Actually, only pyk.i is used in Gyotoy (so far). Either get yutils > 1.4.0 from e.g. http://www.maumae.net/yorick/packages/src/ or fetch pyk.i from the CVS browser at http://yorick.cvs.sourceforge.net/viewvc/*checkout*/yorick/yorick-yutils/pyk.i Yorick-GY _________ The graphical interface gyotoy needs an additional Yorick plug-in, plus the Gtk 3 library. Check README.gyotoy. 2- Building ___________ Building the Gyoto plug-in is done the standard way: ./configure make You can check the package by running make check or by trying out the graphical interface, if you have installed all the dependencies: ./gyotoy.i 3- Installing _____________ make install 4- Running __________ Read gyoto.i and check.i for using Gyoto from within Yorick. The graphical interface, Gyotoy, can be run with yorick -i gyotoy.i If everything goes well, ./gyotoy should do, too. 5 June 2013, Thibaut Paumard.Gyoto-0.1.0/yorick/README.gyotoy000066400000000000000000000021321217470755400163340ustar00rootroot00000000000000Running gyotoy ______________ Gyotoy is a small graphical user interface (a.k.a. "a toy", or GUI) to vizualize a single geodesic (a star orbit or a photon trajectory) in a metric. It currently supports any metric with a spherical-like coordinate system: KerrBL spin can be set directly, and any GYOTO Metric can be loaded from an XML description file. The hard work is done by the Yorick GYOTO plug-in. In addition, the Yorick gy plug-in is needed, as well as the Gtk 3 GObject Instrospection files. For now, you will need to compile gy from source: git clone git://github.com/paumard/yorick-gy.git cd yorick-gy yorick -batch make.i make make install The GObject Introspection files for Gtk 3 may have been packaged for your platform. Under Mac OS X using macports, try: sudo port install gtk3 Under a Debian or derivative GNU/Linux system: sudo apt-get install gir1.2-gtk-3.0 If you get an error message in the lines of "Glib: no schemas installed on the system", set the environment variable XDG_DATA_DIRS in your shell (for instance in $HOME/.profile): export XDG_DATA_DIRS=/opt/local/share Gyoto-0.1.0/yorick/RayTracing.i000066400000000000000000000174571217470755400163600ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // Yorick port of ../tools/RayTracing.C rev. 66 #include "gyoto.i" /* This program aims at computing the null geodesics of photons from an observation screen to an astrophysical object (star orbit, fixed star or disk). The final result is a list of illuminated pixels. */ //****CHOOSE COORDINATES*** ChooseCoord="BL"; //"BL", "KS" or "Kerr" //************************* //******************************************** // Definition of Metric and Observer position* //******************************************** //Metric definition : mm=1; //BH mass aa=0.7; //BH spin write, "\n"; write, format="BH spin= %g\n", aa; //Kerr metric construction if (ChooseCoord=="BL") gg=gyoto_KerrBL(spin=aa,mass=mm) ; \ else if (ChooseCoord=="KS") gg=gyoto_KerrKS(spin=aa,mass=mm) ; //Observer position : // Observer Boyer Lindquist (BL) coord : r0=100.;//100; /* 100 = star orbit ; 45 = disk*/ theta0=1.22;//0.785;//1.22; //0.05;//1.309;//75 deg //pi/4.;//pi/2.;//x axis //75 deg = 1.309 rad ; 70 deg = 1.22 rad //45 deg = 0.785 rad /* 0.05 = star orbit ; 1.309 = 75 deg = disk */ phi0=0;//0.; /* 0. = star orbit ; pi/4. = disk */ tobs0=1000.; delta_t=0.;//31.;//change delta_t if you wan't to make a movie... write, format="Observing time delta_t= %g\n", delta_t; tobs=tobs0+delta_t;//observation time t0=tobs;//for time-reversed integration, initial time for photon (not for star if ray-tracing a star...) prec=8;width=15;fmts="%"+pr1(width)+"."+pr1(prec)+"g"; //format string pos=array(double,8); // Corresponding observer Kerr-Schild space and time coord (cf Hameury, Marck, Pelat 93): psi0=phi0-0.5*aa/sqrt(mm*mm-aa*aa)*log(abs((1+(r0-mm)/(sqrt(mm*mm-aa*aa)))/(1-(r0-mm)/(sqrt(mm*mm-aa*aa))))); x0=(r0*cos(psi0)-aa*sin(psi0))*sin(theta0); y0=(r0*sin(psi0)+aa*cos(psi0))*sin(theta0); z0=r0*cos(theta0); T0=1000.; if (ChooseCoord=="BL" || ChooseCoord=="Kerr") pos(1:4)=[t0, r0, theta0, phi0];\ else if (ChooseCoord=="KS") pos(1:4)=[T0, x0, y0, z0]; write, format="%s\n", "setting pos: "+pr1(pos); screen=gyoto_Screen(metric=gg, observerpos=pos); //****************** // Object creation * //****************** { // variables defined below are local in the C++ code, // THIS DOES NOT WORK IN YORICK !!! // everything is global //OBJECT == STAR ORBIT //CI = ISCO in equatorial plane Z1=1.+(1.-aa*aa/(mm*mm))^(1./3.)*((1.+aa/mm)^(1./3.)+(1.-aa/mm)^(1./3.)); Z2=sqrt(3.*aa*aa/(mm*mm)+Z1*Z1);//cf Bardeen 1972 2.21 risco=mm*(3.+Z2-sqrt((3.-Z1)*(3.+Z1+2.*Z2)));//ISCO thetai=1.5708; phii=0.; rhor=mm+sqrt(mm*mm-aa*aa);//event horizon radius=0.5;//0.5;//0.4;//1.2;//NB : cf Trippe et al 2007 ("IR polarized flare") , R_hotspot < 0.3 * R_S = 0.6 ri=risco+radius;// so that the point of the star closest to the BH is on the ISCO : the entire star must not be closer than ISCO to be able to orbit. //pay attention to the fact that changing the radius of the star thus changes its trajectory write, format="risco= "+fmts+"\n", risco; write, format="rhor= "+fmts+"\n", rhor; write, format="star radius= "+fmts+"\n", radius; write, format="ri +/- rstar= "+fmts+" "+fmts+"\n", ri-radius, ri+radius; ttravel=r0;//approximate photon travel time (r0=c*tobs=tobs) ti=tobs0-4.*ttravel; pri=0.;//BL canonical momentum p_r pthetai=0.;//BL canonical momentum p_theta yinit=[ti,ri,thetai,phii,ti,pri,pthetai]; //cf Bardeen 1972 2.12-2.15: //these equations assume that the particule mass is 1. if (aa==1.) { E=(ri+sqrt(mm*ri)-mm)/(ri^(3./4.)*sqrt(ri^(1./2.)+2.*sqrt(mm))); L=(mm*(ri^(3./2.)+sqrt(mm)*ri+mm*sqrt(ri)-mm^(3./2.)))/(ri^(3./4.)*sqrt(ri^(1./2.)+2.*sqrt(mm))); }else{ E=(ri^(3./2.)-2*mm*sqrt(ri)+aa*sqrt(mm))/(ri^(3./4.)*sqrt(ri^(3./2.)-3.*mm*sqrt(ri)+2.*aa*sqrt(mm))); L=(sqrt(mm)*(ri*ri-2.*aa*sqrt(mm)*sqrt(ri)+aa*aa))/(ri^(3./4.)*sqrt(ri^(3./2.)-3.*mm*sqrt(ri)+2.*aa*sqrt(mm))); } Q=0.; cst=[1.,E,L,Q];//1. = star mass, not used in MakeCoord write,format="dans main E,L= "+fmts+" "+fmts+"\n", cst(2), cst(3); //Proper time step, number of proper time steps //double delta=0.1; niter=230;//chosen so that the orbit is computed for [ti;tobs] init=gg(get_coord = yinit, cst); t0=init(1); r0=init(2); theta0=init(3); //cout << "theta0 dans rt.C : " << theta0 << endl; phi0=init(4); tdot0=init(5); rdot0=init(6); thetadot0=init(7); phidot0=init(8); //cout << "coord init dans rt.C " << t0 << " " << r0 << " " << theta0 << " " << phi0 << " " << tdot0 << " " << rdot0 << " " << thetadot0 << " " << phidot0 << endl; //Kerr coordinates : (cf article null hypersurface Eric) tdot0_Kerr=tdot0+rdot0/((r0*r0+aa*aa)/(2.*mm*r0)-1.); phidot0_Kerr=phidot0+aa*rdot0/(r0*r0-2.*mm*r0+aa*aa); v= [rdot0/tdot0, thetadot0/tdot0, phidot0/tdot0]; pos=[t0, r0,theta0,phi0]; "gg:"; gyoto_Metric_g(gg, pos, ChooseCoord); "radius: "+pr1(radius); "pos: "+pr1(pos); "v: "+ pr1(v); "ChooseCoord: "+ ChooseCoord; if (ChooseCoord=="BL") orbit = gyoto_Star(metric=gg, radius=radius, initcoord=pos, v) ; \ else { v_Kerr= [rdot0/tdot0_Kerr, thetadot0/tdot0_Kerr, phidot0_Kerr/tdot0_Kerr]; pos_Kerr=[t0,r0,theta0,phi0]; //cout << endl; //cout << "pos init star= " << t0 << " " << r0 << " " << theta0 << " " << phi0 << endl; //cout << endl; orbit = gyoto_Star(metric=gg, radius=radius, initcoord=pos_Kerr, v_Kerr) ; } //OBJECT == FIXED STAR //NB : theta_ein=sqrt(4.*M*dLS/(dL*dS)) // if (ChooseCoord=="BL") { // StarPos=[10.,pi/2.,pi]; //BL star (fixed) space coord // } else if (ChooseCoord=="KS") { // StarPos=[-10.,0.,0.];//KS star (fixed) space coord // } //FixedS = gyoto_FixedStar(position=StarPos,radius=radius,metric=gyotoKerrBL()); //OBJECT == DISK // ThinDisk = gyoto_ThinInfiniteDisk_new(gg,ChooseCoord); } //*************************** // Null geodesic integration* //*************************** //Proper time step, number of proper time steps deltatau=.01;//1.; pixels = open("pix.dat", "w");//illuminated pixels on screen N=1001;//501;//1023;//501;//3001;//number of pixels in each direction //angular pixel step : //double delta=pi/(double(N));//all sky view : fov = pi //warning : vel[3] in Metric::getRayCoord is not defined everywhere. //double delta=pi/(4.*double(N));//limited view : fov = pi/4. for DISK delta=pi/(10.*double(N));//limited view : fov = pi/10. for ORBIT ph=gyoto_Photon_new(); coordout=ChooseCoord; for (i=368;i<=368;i++) { //i=251 with a=0.9 integration doesn't progress write, "\n"; write, "******************\n"; write, format= "i = %d\n", i; write, "******************\n"; write, "\n"; xscr=delta*(i-(N+1)/2.); for (j=474;j<=474;j++) { //j=315 with a=0.9 integration doesn't progress yscr=delta*(j-(N+1)/2.); coord=screen(raycoord=[-xscr, yscr]); //1. Init cond : gyoto_Photon_setInitialCondition,ph, gg, orbit, coord; //2. delta : gyoto_Photon_setDelta,ph,deltatau; //3. hit : if (gyoto_Photon_hit(ph, 0.)) write, pixels, format="%15i %15d %15.12g\n", i, j, gyoto_Star_get_redshift(orbit)^3; //4. save : //gyoto_Photon_save_xyz(ph,"xyz.dat"); } } close, pixels; Gyoto-0.1.0/yorick/check-disk3d.i000066400000000000000000000056741217470755400165470ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "gyoto.i" gyoto_debug, 0; #include "gyoto_std.i" if (get_env("GYOTO_CHECK_NODISPLAY")) nodisplay = 1; emissquant=array(double, 1, 2, 10 ,10); emissquant(,1,,1:3)=100.; emissquant(,2,,4:10)=100.; velocity=array(1., 3, 2, 10, 10); metric = gyoto_KerrBL(mass=4e6*GYOTO_SUN_MASS); write, format="%s", "Creating Disk3D..."; pd = gyoto_Disk3D(copyemissquant=emissquant, copyvelocity=velocity, rin=3, rout=28, zmin=1., zmax=10., phimin=0., phimax=2.*pi, repeatphi=8, metric=metric); write, format="%s\n", " done."; write, format="%s\n", "Printing Disk3D:"; pd; write, format="%s\n", " done."; screen = gyoto_Screen(metric=metric, resolution=64, time=1000.*metric.unitlength/GYOTO_C, distance=100.*metric.unitlength, fov=30./100., inclination=110./180.*pi, paln=pi); write, format="%s", "Attaching Disk3D to scenery..."; sc = gyoto_Scenery(metric=metric, screen=screen, astrobj=pd); write, format="%s\n", " done."; write, format="%s", "Saving data to fits file..."; pd, fitswrite="!check-disk3d.fits.gz"; write, format="%s\n", " done."; write, format="%s", "Saving scenery to XML file..."; sc, xmlwrite="check-disk3d.xml"; write, format="%s\n", " done."; write, format="%s", "Reading back scenery..."; sc2 = gyoto_Scenery("check-disk3d.xml"); write, format="%s\n", " done."; write, format="%s", "Removing temporary files..."; remove, "check-disk3d.xml"; remove, "check-disk3d.fits.gz"; write, format="%s\n", " done."; write, format="%s", "Getting Disk3D..."; pd2 = sc2.astrobj; write, format="%s\n", " done."; write, format="%s", "Comparing emissquant array..."; if (anyof(emissquant != pd2.copyemissquant)) error, "CHECK FAILED"; write, format="%s\n", " done."; write, format="%s", "Comparing velocity array..."; if (anyof(velocity != pd2.copyvelocity)) error, "CHECK FAILED"; write, format="%s\n", " done."; /*write, format="%s", "Performing raytracing...\n"; im = sc(); write, format="%s\n", "done."; if (!nodisplay) { write, format="%s", "Displaying image..."; window, style="nobox.gs"; pli, im; write, format="%s\n", " done."; pause, 1000; if (batch()) winkill; } */ if (batch()) quit; Gyoto-0.1.0/yorick/check-metric.i000066400000000000000000000037101217470755400166360ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "gyoto.i" #include "gyoto_std.i" aa=0.995; write, format="%s", "Checking gyoto_KerrBL: "; gg=gyoto_KerrBL(spin=aa); write, format="%s\n","done.\n"; // initial conditions : ri=10.791; thetai=1.5708; phii=0.; ti=0.; pri=0.;//canonical momentum pthetai=0.; cst=[1,0.921103,2.,0.];//4 Kerr cst of motion mu, E, L, Q yinit=[ti,ri,thetai,phii,-cst(2),pri,pthetai,cst(3)]; write, format="%s", "Checking makecoord: "; coord=gg(makecoord=yinit, cst); if (abs((coord-[0,10.791,1.5708,0,1.12641,0,0,0.0187701]))(max)<1e-6) write, format="%s\n","done."; else error, "PREVIOUS CHECK FAILED"; write, format="%s\n", "Creating metric using gyoto_Kerr(spin=0.7)"; gg=gyoto_KerrBL(spin=0.7); if (gyoto_KerrBL(gg, spin=)!=0.7) error, "CHECK FAILED"; write, format="%s\n","done."; write, format="%s", "Setting spin... "; gg, spin=0.9; write, format="%s\n", "done."; write, format="%s", "Getting spin... "; if (gg.spin!=0.9) error, "CHECK FAILED"; write, format="%s\n", "done."; //write, format="%s", "Pointer to this Metric object: gg()=="; gg(); write, format="%s\n", "Printing object. \"gg\" yields: "; gg; // Free memory for testing with valgrind gg=[]; aa=[]; ri=[]; thetai=[]; phii=[]; ti=[]; pri=[]; pthetai=[]; cst=[]; yinit=[]; write, format="\n%s\n", "ALL TESTS PASSED"; Gyoto-0.1.0/yorick/check-patterndisk.i000066400000000000000000000057571217470755400177200ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "gyoto.i" #include "gyoto_std.i" if (get_env("GYOTO_CHECK_NODISPLAY")) nodisplay = 1; opacity=array(double, 1, 2, 10); opacity(,1,1::2)=100.; opacity(,2,2::2)=100.; intensity=opacity*0.+1.; metric = gyoto_KerrBL(mass=4e6*GYOTO_SUN_MASS); write, format="%s", "Creating PatternDisk..."; pd = gyoto_PatternDisk(copyintensity=intensity, copyopacity=opacity, innerradius=3, outerradius=28, repeatphi=8, metric=metric, rmax=50); write, format="%s\n", " done."; write, format="%s\n", "Printing PatternDisk:"; pd; write, format="%s\n", " done."; screen = gyoto_Screen(metric=metric, resolution=64, time=1000.*metric.unitlength/GYOTO_C, distance=100.*metric.unitlength, fov=30./100., inclination=110./180.*pi, paln=pi); write, format="%s", "Attaching PatternDisk to scenery..."; sc = gyoto_Scenery(metric=metric, screen=screen, astrobj=pd); write, format="%s\n", " done."; if (gyoto_haveXerces()) { write, format="%s", "Saving data to fits file..."; pd, fitswrite="!check-patterndisk.fits.gz"; write, format="%s\n", " done."; write, format="%s", "Saving scenery to XML file..."; sc, xmlwrite="check-patterndisk.xml"; write, format="%s\n", " done."; write, format="%s", "Reading back scenery..."; sc2 = gyoto_Scenery("check-patterndisk.xml"); write, format="%s\n", " done."; write, format="%s", "Removing temporary files..."; remove, "check-patterndisk.xml"; remove, "check-patterndisk.fits.gz"; write, format="%s\n", " done."; } else { write, format="%s", "Cloning..."; sc2 = sc.clone; write, format="%s\n", " done."; } write, format="%s", "Getting PatternDisk..."; pd2 = sc2.astrobj; write, format="%s\n", " done."; write, format="%s", "Comparing intensity array..."; if (anyof(intensity != pd2.copyintensity)) error, "CHECK FAILED"; write, format="%s\n", " done."; write, format="%s", "Comparing opacity array..."; if (anyof(opacity != pd2.copyopacity)) error, "CHECK FAILED"; write, format="%s\n", " done."; write, format="%s", "Performing raytracing...\n"; im = sc(); write, format="%s\n", "done."; if (!nodisplay) { write, format="%s", "Displaying image..."; window, style="nobox.gs"; pli, im; write, format="%s\n", " done."; pause, 1000; if (batch()) winkill; } Gyoto-0.1.0/yorick/check-photon-BL.i000066400000000000000000000101431217470755400171530ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "gyoto.i" #include "gyoto_std.i" aa=0.; gg=gyoto_KerrBL(spin=aa); gg2=gg.clone; write, format="%s", "Creating Photon: "; ph = gyoto_Photon(); if (ph()) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; write, format="%s", "Attaching metric: "; ph,metric=gg; if (ph()) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; // initial conditions : ri=6; thetai=pi/2.; phii=0.; ttravel=r0; ti=0.; pri=0.;//canonical momentum pthetai=0.; yinit=[ti, ri, thetai, phii, ti, pri, pthetai]; cst=[1,0.921103,2.,0.];//4 Kerr cst of motion a, E, L, Q write, format="%s", "Checking gyoto_Kerr_MakeCoord: "; coord=gg(makecoord=yinit, cst); coord; //if (abs((coord-[0,10.791,1.5708,0,1.12641,0,0,0.0187701]))(max)<1e-6) if (abs((coord-[0,6,1.5708,0,1.38165,0,0,0.0555556]))(max)<1e-5) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; pos=coord(:4); v= coord(6:)/coord(5); write, format="%s", "Checking gyoto_Star: "; st=gyoto_Star(metric=gg, radius=1., initcoord=pos, v); write, format="%s\n","done.\n"; write, format="%s\n", "Trying gyoto_Star_xFill"; st,xfill=770.; "done"; //Computing position of star at a given proper time : //time=212.4034;//proper time //write, format="%s\n", "Checking gyoto_Star_position: "; //pos=gyoto_Part_position(st,time); //pos; //if (abs(pos-[10.5718661339679, 1.57079398752261, 59.5795847453848])(max)<1e-5) // write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; // Ray tracing write, format="%s", "Checking gyoto_Metric_setObserverPos: "; screen=gyoto_Screen(metric=gg, observerpos=[1000., 100., 0.05, 0.]); write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Metric_setSpin: "; gg,spin=0.; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Star(): "; orbit=gyoto_Star(metric=gg, radius=2, initcoord=[600, 6, 1.57, 0], [0, 0, 0.068041381745]) write, format="%s\n","done.\n"; N=21; delta=pi/(10.*N); screen, fov=pi/10., resolution=21; i=15; j=9; xscr=delta*(i-(N+1)/2.); yscr=delta*(j-(N+1)/2.); write, format="%s", "Checking gyoto_Photon_setInitialCondition: "; ph2=gyoto_Photon(metric=gg, astrobj=orbit); ph1=gyoto_Photon(metric=gg, astrobj=orbit); ph1, initcoord=screen, -xscr, yscr; ph2, initcoord=screen, i, j; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Photon(delta=1): "; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Photon(is_hit=1): "; if( ph1(is_hit=1) && ph2(is_hit=1)) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; "_________________________"; hitmap2=hitmap1=hitmap=array(0, N, N); ph=gyoto_Photon(metric=gg, astrobj=orbit); for (i=1; i<=N; i++) { write , format="*** Column %i ***\n", i; xscr=delta*(i-(N+1)/2.); for (j=1; j<=N; j++) { yscr=delta*(j-(N+1)/2.); ph, initcoord=screen, -xscr, yscr; ph, tmin=0.; ph1, initcoord=screen, -xscr, yscr; ph2, initcoord=screen, i, j; ph, delta=1.; hitmap(i,j)=ph(is_hit=1); } } ph2=[]; // Check that changing spin can be done on attached metric ph1, metric=ph1.metric; ph1, xfill=0.; txyz=ph1.get_txyz; plg, txyz(2,), txyz(1,); ph2=ph1.clone; gg2=gg.clone; write, format="%s", "Mutating metric spin... "; gg, spin=0.5; write, format="%s\n", "done."; gg2, spin=0.5; ph2, metric=gg2; ph1=ph2=[]; // CLONES AND HOOKS "_________________________"; ph=[]; st=[]; orbit=[]; screen=[]; gg=[]; write, format= "%s\n"," ALL TESTS PASSED"; Gyoto-0.1.0/yorick/check-polish-doughnut.i000066400000000000000000000056141217470755400205110ustar00rootroot00000000000000#include "gyoto.i" #include "gyoto_std.i" write, format="%s", "Creating default PolishDoughnut... "; pd = gyoto_PolishDoughnut(); write, format="%s\n", "done."; write, format="%s\n", "Printing object:"; write, format="%s\n", "-----------------------------"; pd; write, format="%s\n", "-----------------------------"; // write, format="%s", "Setting lambda to 2... "; // pd, lambda=2; // write, format="%s\n", "done."; // write, format = "%s", "Checking value of lambda... "; // if (pd(get_lambda=1)==2) write, format="%s\n", "done."; \ // else error, "CHECK FAILED!"; write, format= "%s" , "Instanciating Kerr metric... "; gg = gyoto_KerrBL(); write, format= "%s\n", "done."; write, format= "%s" , "Attaching metric to doughnut... "; pd, metric=gg; write, format= "%s\n", "done."; write, format= "%s" , "Checking attached metric... "; if (pd.metric()==gg()) write, format="%s\n", "done."; \ else error, "CHECK FAILED!"; write, format="%s\n", "Printing object:"; write, format="%s\n", "-----------------------------"; pd; write, format="%s\n", "-----------------------------"; write, format="%s", "Creating PolishDoughnut from file... "; pd = gyoto_Scenery("../doc/examples/example-polish-doughnut.xml").astrobj; write, format="%s\n", "done."; write, format="%s\n", "Printing object:"; write, format="%s\n", "-----------------------------"; pd; write, format="%s\n", "-----------------------------"; write, format="%s", "Reading PolishDoughnut scenery... "; sc = gyoto_Scenery("../doc/examples/example-polish-doughnut.xml") ; write, format="%s\n", "done."; write, format="%s", "Setting spectro... "; noop, sc.screen(spectro= gyoto_SpectroUniform(kind="freqlog", nsamples=20, band=[-6, 8], unit="eV") ); noop, sc.astrobj(opticallythin=1); write, format="%s\n", "done."; write, format="%s", "Ray-tracing scenery... "; img = sc(,,"Spectrum")(,,avg); write, format="%s\n", "done."; write, format="%s", "Displaying image... "; fma; pli, img; write, format="%s\n", "done."; pause, 1000; write, format="%s", "Integrating one spectrum with radiative transfer...\n"; s1 = sc(10, 15, "Spectrum[J.m-2.s-1.sr-1.Hz-1]"); write, format="%s\n", "done."; midpoints = sc.screen.spectro.midpoints; widths = sc.screen.spectro.widths; fma; logxy, 1, 1; plg, (s1*widths), midpoints; xytitles, "Frequency [Hz]"; write, format="%s", "Integrating one bin spectrum with radiative transfer...\n"; s2 = sc(10, 15, "BinSpectrum[J.m-2.s-1.sr-1]"); write, format="%s\n", "done."; channels = sc.screen.spectro.channels; widths = sc.screen.spectro.widths; s22=array(double,numberof(s2)*2); s22(::2)=s2; s22(2::2)=s2; chan2=array(double,numberof(s2)*2); chan2(::2)=channels(1,); chan2(2::2)=channels(2,); plg, s22, chan2; if (batch()) { pause, 1000; winkill,0; } write, format= "%s\n"," POLISHDOUGHNUT TESTS PASSED"; Gyoto-0.1.0/yorick/check-scenery.i000066400000000000000000000130441217470755400170240ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "gyoto.i" #include "gyoto_std.i" // From yutils, for tic() and tac() #include "util_fr.i" if (get_env("GYOTO_CHECK_NODISPLAY")) window = pause = fma = winkill = pli = plg = noop; write, format="%s", "New scenery... "; sc=gyoto_Scenery(); write, format="%s\n", "done."; write, format="%s\n", "Printing this Scenery:"; sc; write, format="%s %i\n", "Pointer to this Scenery:", sc(get_pointer=1); write, format="%s", "New scenery, setting only \"time\"... "; sc2=gyoto_Scenery(screen=gyoto_Screen(time=1)); write, format="%s\n", "done."; write, format="%s\n", "Printing this Scenery:"; sc2; write, format="%s %i\n", "Pointer to this Scenery:", sc2(get_pointer=1); write, format="%s", "Attaching metric to scenery... "; sc, metric=gyoto_KerrBL(); write, format="%s\n", "done."; write, format="%s\n", "Printing this Scenery:"; sc; write, format="%s", "Pointer to this Scenery: "; write, format="%i\n", sc(get_pointer=1); write, format="%s", "Creating star... "; ao=gyoto_Star(metric=sc.metric, radius=0.5, initcoord=[0,6,pi/2.,0], [0,1e-3,0]); write, format="%s\n", "done."; write, format="%s", "Attaching astrobj to scenery... "; sc, astrobj=ao; write, format="%s\n", "done."; write, format="%s", "Retrieving astrobj... "; ao2=sc.astrobj; write, format="%s\n", "done."; write, format="%s", "Setting time... "; noop,sc.screen(time=10000); write, format="%s\n", "done."; write, format="%s %e\n", "Checking time:", (time=sc.screen.time); if (time!=10000) error, "CHECK FAILED"; // write, format="%s", "Setting tmin... "; // rien=sc(screen=)(tmin=-10000); // write, format="%s\n", "done."; // write, format="%s %e\n", "Checking tmin:", (tmin=sc(screen=)(get_tmin=1)); // if (tmin!=-10000) error, "CHECK FAILED"; // write, format="%s", "Setting dtau... "; // sc, dtau=0.1; // write, format="%s\n", "done."; // write, format="%s %e\n", "Checking dtau:", (dtau=sc(get_dtau=1)); // if (dtau!=0.1) error, "CHECK FAILED"; write, format="%s", "Setting field-of-view... "; noop,sc.screen(fov=pi/4.); write, format="%s\n", "done."; write, format="%s %e\n", "Checking field-of-view:", (fov=sc.screen.fov); if (fov!=pi/4) error, "CHECK FAILED"; write, format="%s", "Setting resolution... "; noop,sc.screen(resolution=16); write, format="%s\n", "done."; write, format="%s %i\n", "Checking resolution:", (res=sc.screen.resolution); if (res!=16) error, "CHECK FAILED"; write, format="%s", "Setting inclination... "; noop,sc.screen(inclination=pi/3.); write, format="%s\n", "done."; write, format="%s %e\n", "Checking inclination:", (incl=sc.screen.inclination); if (incl!=pi/3) error, "CHECK FAILED"; if (gyoto_haveXerces()) { write, format="%s", "Writing XML description... "; sc,xmlwrite="test.xml"; write, format="%s\n", "done."; remove, "test.xml"; write , format="%s", "Reading Scenery from XML description... "; sc3=gyoto_Scenery("../doc/examples/example-moving-star.xml"); } else { write , format="%s", "No Xerces, creating scenery from scratch... "; gg = gyoto_KerrBL(); spectro = gyoto_Spectrometer(kind="wave", nsamples=1, band=[2e-6, 2.4e-6]); scr = gyoto_Screen(metric=gg, observerpos=[1000., 100., 0.78, 0. ], time=1000., resolution=128, spectro=spectro); ao = gyoto_Star(metric=gg, radius=2, rmax=50, initcoord=[600,9,1.5707999999999999741,0],[0., 0., 0.037037]) sc3=gyoto_Scenery(metric=gyoto_KerrBL(), screen=scr, astrobj=ao, tmin=0.); } noop, sc3.screen(resolution=32); noop, sc3.astrobj(radius=2); write, format="%s\n" , "done."; write, format="%s", "Ray-tracing on 1 thread (sc())... \n"; sc3, nthreads=1; tic; im1 = sc3(,,"Intensity"); // raytrace tac(); pli, im1; pause, 1000; write, format="%s\n" , "done."; write, format="%s", "Ray-tracing on 2 threads (sc())... \n"; sc3, nthreads=2; tic; im1 = sc3(,,"Intensity"); // raytrace tac(); window,1; pli, im1; pause, 1000; write, format="%s\n" , "done."; write, format="%s", "Ray-tracing on 2 threads (gyoto_Scenery_rayTrace())... \n"; sc3, nthreads=2, quantities="Intensity"; //tic; im1 = gyoto_Scenery_rayTrace(sc3); window,2; pli, im1; pause, 1000; //tac(); write, format="%s\n" , "done."; write, format="%s", "Ray-tracing on 1 thread... \n"; sc3, nthreads=1; tic; im1 = gyoto_Scenery_rayTrace(sc3); tac(); write, format="%s\n" , "done."; /* write, format="%s", "Ray-tracing on adaptive grid... "; data = gyoto_Scenery_adaptive_raytrace(sc3, 4); fma; pli, data(,,3), cmax=100; write, format="%s\n" , "done."; */ write, format="%s", "Cloning..."; sc4=sc3.clone; write, format="%s\n", "DONE."; write, format="%s\n", "Printing clone:"; sc4; ph = gyoto_Photon(initcoord=sc3, 6, 19); ph.is_hit; if (batch()) { // Free memory for easier checking with valgrind data=[]; sc4=[]; sc3=[]; sc2=[]; sc=[]; ao=ao2=[]; pause, 1000; winkill; } Gyoto-0.1.0/yorick/check-star.i000066400000000000000000000055511217470755400163310ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "gyoto.i" #include "gyoto_std.i" if (get_env("GYOTO_CHECK_NODISPLAY")) nodisplay = 1; write, format="%s\n", "Attempting star construction:"; st=gyoto_Star(); write, format="%s", "Printing star:"; st; write, format="%s", "Cloning..."; st2=st.clone; write, format="%s\n", "DONE."; write, format="%s", "Printing clone:"; st2; write, format="%s", "Gyoto::Star pointer is at address: "; st(); write, format="%s", "Setting radius... "; st, radius=0.5; write, format= "%s\n", "done."; write, format="%s", "Getting radius... "; if (st.radius!=0.5) error, "CHECK FAILED"; write, format= "%s\n", "done."; write, format="%s", "Setting metric... "; st, metric=gyoto_KerrBL(spin=0.); write, format= "%s\n", "done."; write, format="%s", "Changing metric spin... "; noop, st.metric(spin=0.7); if (st.metric.spin!=0.7) error, "CHECK FAILED"; gg=st.metric; gg, spin=0.995; if (st.metric.spin!=0.995) error, "CHECK FAILED"; write, format= "%s\n", "done."; write, format="%s", "Setting initial condition... "; st, initcoord=[0, 10.791, 1.5708, 0], [0, 0, 0.0166637]; write, format="%s\n", "done."; write, format="%s", "Computing orbit... "; st, xfill=800; write, format="%s\n", "done."; write, format="%s", "Instanciating Screen... "; screen=gyoto_Screen(metric=st.metric); write, format="%s\n", "done."; write, format="%s", "Retrieving projected orbit... "; data=st(get_skypos=screen); write, format="%s\n", "done."; write, format="%s\n", "Printing Star object:"; st; if (!nodisplay) { write, format="%s\n", "Check it out (pausing for 1s)!"; plg,data(,2), data(,1); pause, 1000; winkill; } write, format="%s", "All in one call... "; data2=gyoto_Star(radius=0.5, metric=gyoto_KerrBL(spin=0.995), initcoord=[0, 10.791, 1.5708, 0], [0, 0, 0.0166637], xfill=800 )( get_skypos=(screen2=gyoto_Screen(metric=gyoto_KerrBL(spin=0.995))) ); write, format="%s\n", "done."; if (!nodisplay) { write, format="%s\n", "Check it out (pausing for 1s)!"; plg,data2(,2), data2(,1); pause, 1000; winkill; } // Free memroy to check with valgrind; //data=[]; //st=[]; write, format="\n%s\n", "ALL TESTS PASSED"; Gyoto-0.1.0/yorick/check.i000066400000000000000000000112401217470755400153520ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ // NODISPLAY implies batch mode if (get_env("GYOTO_CHECK_NODISPLAY")) { batch, 1; __xytitles=xytitles; __fma=fma; __winkill=winkill; __pli=pli; __plg=plg; xytitles = fma = winkill = pli = plg = noop; } #include "gyoto.i" #include "gyoto_std.i" aa=0.995; write, format="%s", "Checking gyoto_Kerr_new: "; gg=gyoto_KerrBL(spin=aa); write, format="%s\n","done.\n"; // initial conditions : ri=10.791; thetai=1.5708; phii=0.; ti=0.; pri=0.;//canonical momentum pthetai=0.; cst=[1,0.921103,2.,0.];//4 Kerr cst of motion mu, E, L, Q yinit=[ti,ri,thetai,phii,-cst(2),pri,pthetai,cst(3)]; write, format="%s", "Checking gyoto_Kerr_MakeCoord: "; coord=gg(makecoord= yinit, cst); if (abs((coord-[0,10.791,1.5708,0,1.12641,0,0,0.0187701]))(max)<1e-6) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; pos=coord(:4); v= coord(6:)/coord(5); write, format="%s", "Checking gyoto_Star(): "; st=gyoto_Star(metric=gg, radius=1., initcoord=pos, v); write, format="%s\n","done.\n"; write, format="%s\n", "Trying gyoto_Star_xFill"; st,xfill=770.; //Computing position of star at a given proper time : //time=212.4034;//proper time //write, format="%s\n", "Checking gyoto_Star_position: "; //pos=gyoto_Part_position(st,time); //pos; //if (abs(pos-[10.5718661339679, 1.57079398752261, 59.5795847453848])(max)<1e-5) // write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; txyz=st.get_txyz; dates=txyz(,1); x=txyz(,2); y=txyz(,3); coords=st.get_coord; primes=st.get_prime; write, format="%s", "Checking gg(prime2tdot= pos, vel): "; N=dimsof(coords)(2); tdotbis=array(double,N); for (n=1; n<= N; ++n) tdotbis(n)=gg (prime2tdot=coords(n,1:4), primes(n,)); tdot=coords(,5); if (max (abs( (tdot-tdotbis)/tdot ) ) < 1e-4) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; write, format="%s", "Checking gg(position): "; norm=array(double, N); for (n=1; n<= N; ++n) { g = gg (coords(n,)); qvel=coords(n,5:); norm(n)=sum(g*qvel(,-)*qvel(-,)); } if (max(abs(norm+1)) < 1e-4) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; // Ray tracing write, format="%s", "Checking gyoto_Screen(observerpos=...): "; screen=gyoto_Screen(metric=gg, observerpos=[1000., 100., 0.05, 0.]); write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Metric(spin=): "; gg, spin=0.; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Star(): "; orbit=gyoto_Star(metric=gg, radius=2, initcoord=[600, 6, 1.57, 0], [0, 0, 0.068041381745]) write, format="%s\n","done.\n"; N=51; delta=pi/(10.*N); write, format="%s", "Checking gyoto_Photon(): "; ph=gyoto_Photon(); write, format="%s\n","done.\n"; i=35; j=19; xscr=delta*(i-(N+1)/2.); yscr=delta*(j-(N+1)/2.); write, format="%s", "Checking gyoto_Photon_setInitialCondition: "; ph, metric=gg, astrobj=orbit, initcoord=screen, -xscr, yscr; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Photon_setDelta: "; ph, delta=1.; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Photon_hit: "; if(ph(is_hit=1)) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; "_________________________"; hitmap=array(0, N, N); ph, tmin=0.; for (i=1; i<=N; i++) { write , format="*** Column %i ***\n", i; xscr=delta*(i-(N+1)/2.); for (j=1; j<=N; j++) { yscr=delta*(j-(N+1)/2.); ph, metric=gg, astrobj=orbit, initcoord=screen, -xscr, yscr; // gyoto_Photon_setDelta, ph, 1.; hitmap(i,j)=ph(is_hit=1); } } "_________________________"; screen=[]; ph=[]; st=[]; orbit=[]; gg=[]; write, format= "%s\n"," ALL TESTS PASSED"; #include "check-metric.i" #include "check-photon-BL.i" #include "check-star.i" #include "check-scenery.i" #include "check-patterndisk.i" #include "check-polish-doughnut.i" write, format="\n\n%s\n%s\n%s\n", " ********************************************", " * ALL TESTS PASSED *", " ********************************************"; if (anyof(get_argv() == "check.i")) quit; //if (batch()) quit; Gyoto-0.1.0/yorick/config.log000066400000000000000000000347471217470755400161140ustar00rootroot00000000000000 ## ---------------------- ## ## Running config.status. ## ## ---------------------- ## This file was extended by gyoto config.status 0.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status on b-wing config.status:1133: creating Makefile config.status:1119: error: cannot find input file: `bin/Makefile.in' ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-unknown-linux-gnu ac_cv_c_compiler_gnu=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_dlopen=no ac_cv_func_floor=yes ac_cv_func_getcwd=yes ac_cv_func_pow=yes ac_cv_func_shl_load=no ac_cv_func_sqrt=yes ac_cv_func_strdup=yes ac_cv_func_strtod=yes ac_cv_header_dlfcn_h=yes ac_cv_header_float_h=yes ac_cv_header_inttypes_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_unistd_h=yes ac_cv_host=x86_64-unknown-linux-gnu ac_cv_lib_dl_dlopen=yes ac_cv_lib_dld_shl_load=no ac_cv_lib_error_at_line=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=mawk ac_cv_prog_CPP='gcc -E' ac_cv_prog_CXXCPP='g++ -E' ac_cv_prog_YORICK=yorick 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=no 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_dlopen=dlopen lt_cv_dlopen_libs=-ldl lt_cv_dlopen_self=yes lt_cv_dlopen_self_static=no 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=1572864 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AR='ar' AUTOCONF='${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf' AUTOHEADER='${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader' AUTOMAKE='${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11' AWK='mawk' CC='gcc' CCDEPMODE='depmode=gcc3' CFITSIOCPPFLAGS='' CFITSIOLDFLAGS=' -lcfitsio' CFLAGS='-g -O2' CPP='gcc -E' CPPFLAGS='' CXX='g++' CXXCPP='g++ -E' CXXDEPMODE='depmode=gcc3' CXXFLAGS='-g -O2' CYGPATH_W='echo' DEFS='-DHAVE_CONFIG_H' DEPDIR='.deps' DLLTOOL='false' DSYMUTIL='' DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/bin/grep -E' EXEEXT='' FGREP='/bin/grep -F' GREP='/bin/grep' 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='-ldl ' LIBTOOL='$(SHELL) $(top_builddir)/libtool' LIPO='' LN_S='ln -s' LTLIBOBJS='' MAKEINFO='${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo' MANIFEST_TOOL=':' MKDIR_P='/bin/mkdir -p' NM='/usr/bin/nm -B' NMEDIT='' OBJDUMP='objdump' OBJEXT='o' OTOOL64='' OTOOL='' PACKAGE='gyoto' PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' PACKAGE_NAME='gyoto' PACKAGE_STRING='gyoto 0.0.4' PACKAGE_TARNAME='gyoto' PACKAGE_URL='' PACKAGE_VERSION='0.0.4' PATH_SEPARATOR=':' POW_LIB='' RANLIB='ranlib' SED='/bin/sed' SET_MAKE='' SHELL='/bin/bash' STRIP='strip' VERSION='0.0.4' XERCESCPPFLAGS='' XERCESLDFLAGS=' -lxerces-c' YORICK='yorick' 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' install_sh='${SHELL} /home/thibaut/git/Gyoto/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}' plugin_sfx='so' prefix='/usr/local' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sovers='0.0.0' sysconfdir='${prefix}/etc' target_alias='' use_cfitsio='-DGYOTO_USE_CFITSIO' use_xerces='-DGYOTO_USE_XERCES' configure: exit 1 ## ---------------------- ## ## Running config.status. ## ## ---------------------- ## This file was extended by gyoto config.status 0.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status on b-wing config.status:1133: creating Makefile config.status:1119: error: cannot find input file: `bin/Makefile.in' ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-unknown-linux-gnu ac_cv_c_compiler_gnu=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_dlopen=no ac_cv_func_floor=yes ac_cv_func_getcwd=yes ac_cv_func_pow=yes ac_cv_func_shl_load=no ac_cv_func_sqrt=yes ac_cv_func_strdup=yes ac_cv_func_strtod=yes ac_cv_header_dlfcn_h=yes ac_cv_header_float_h=yes ac_cv_header_inttypes_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_unistd_h=yes ac_cv_host=x86_64-unknown-linux-gnu ac_cv_lib_dl_dlopen=yes ac_cv_lib_dld_shl_load=no ac_cv_lib_error_at_line=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=mawk ac_cv_prog_CPP='gcc -E' ac_cv_prog_CXXCPP='g++ -E' ac_cv_prog_YORICK=yorick 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=no 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_dlopen=dlopen lt_cv_dlopen_libs=-ldl lt_cv_dlopen_self=yes lt_cv_dlopen_self_static=no 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=1572864 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AR='ar' AUTOCONF='${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf' AUTOHEADER='${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader' AUTOMAKE='${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11' AWK='mawk' CC='gcc' CCDEPMODE='depmode=gcc3' CFITSIOCPPFLAGS='' CFITSIOLDFLAGS=' -lcfitsio' CFLAGS='-g -O2' CPP='gcc -E' CPPFLAGS='' CXX='g++' CXXCPP='g++ -E' CXXDEPMODE='depmode=gcc3' CXXFLAGS='-g -O2' CYGPATH_W='echo' DEFS='-DHAVE_CONFIG_H' DEPDIR='.deps' DLLTOOL='false' DSYMUTIL='' DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/bin/grep -E' EXEEXT='' FGREP='/bin/grep -F' GREP='/bin/grep' 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='-ldl ' LIBTOOL='$(SHELL) $(top_builddir)/libtool' LIPO='' LN_S='ln -s' LTLIBOBJS='' MAKEINFO='${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo' MANIFEST_TOOL=':' MKDIR_P='/bin/mkdir -p' NM='/usr/bin/nm -B' NMEDIT='' OBJDUMP='objdump' OBJEXT='o' OTOOL64='' OTOOL='' PACKAGE='gyoto' PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' PACKAGE_NAME='gyoto' PACKAGE_STRING='gyoto 0.0.4' PACKAGE_TARNAME='gyoto' PACKAGE_URL='' PACKAGE_VERSION='0.0.4' PATH_SEPARATOR=':' POW_LIB='' RANLIB='ranlib' SED='/bin/sed' SET_MAKE='' SHELL='/bin/bash' STRIP='strip' SUBDIRS='lib bin doc yorick' VERSION='0.0.4' XERCESCPPFLAGS='' XERCESLDFLAGS=' -lxerces-c' YORICK='yorick' 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' install_sh='${SHELL} /home/thibaut/git/Gyoto/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}' plugin_sfx='so' prefix='/usr/local' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sovers='0.0.0' sysconfdir='${prefix}/etc' target_alias='' use_cfitsio='-DGYOTO_USE_CFITSIO' use_xerces='-DGYOTO_USE_XERCES' configure: exit 1 Gyoto-0.1.0/yorick/config.status000077500000000000000000002122131217470755400166430ustar00rootroot00000000000000#! /bin/bash # Generated by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=${CONFIG_SHELL-/bin/bash} export SHELL ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by gyoto $as_me 0.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " # Files that config.status was made for. config_files=" Makefile bin/Makefile doc/Makefile lib/Makefile yorick/Makefile" config_headers=" config.h" config_commands=" depfiles libtool" ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." ac_cs_config="" ac_cs_version="\ gyoto config.status 0.0.4 configured by ./configure, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='/home/thibaut/git/Gyoto' srcdir='.' INSTALL='/usr/bin/install -c' MKDIR_P='/bin/mkdir -p' AWK='mawk' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi if $ac_cs_recheck; then set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion shift $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 CONFIG_SHELL='/bin/bash' export CONFIG_SHELL exec "$@" fi 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 # # 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/bash' 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='1572864' 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.7 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib ' sys_lib_dlsearch_path_spec='/lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 ' hardcode_action='immediate' enable_dlopen='yes' enable_dlopen_self='yes' enable_dlopen_self_static='no' 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.7 /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../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.7/../../..' predep_objects_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbeginS.o' postdep_objects_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../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.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../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.7/../../..' 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='gyoto' VERSION='0.0.4' 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" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "yorick/Makefile") CONFIG_FILES="$CONFIG_FILES yorick/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && S["am__EXEEXT_FALSE"]="" S["am__EXEEXT_TRUE"]="#" S["LTLIBOBJS"]="" S["sovers"]="0.0.0" S["plugin_sfx"]="so" S["CFITSIOCPPFLAGS"]="" S["CFITSIOLDFLAGS"]=" -lcfitsio" S["use_cfitsio"]="-DGYOTO_USE_CFITSIO" S["XERCESCPPFLAGS"]="" S["XERCESLDFLAGS"]=" -lxerces-c" S["use_xerces"]="-DGYOTO_USE_XERCES" S["POW_LIB"]="" S["LIBOBJS"]="" S["YORICK"]="yorick" 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__untar"]="$${TAR-tar} xf -" S["am__tar"]="$${TAR-tar} chof - \"$$tardir\"" S["AMTAR"]="$${TAR-tar}" S["am__leading_dot"]="." S["SET_MAKE"]="" S["AWK"]="mawk" S["mkdir_p"]="/bin/mkdir -p" S["MKDIR_P"]="/bin/mkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["STRIP"]="strip" S["install_sh"]="${SHELL} /home/thibaut/git/Gyoto/install-sh" S["MAKEINFO"]="${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo" S["AUTOHEADER"]="${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader" S["AUTOMAKE"]="${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11" S["AUTOCONF"]="${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf" S["ACLOCAL"]="${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11" S["VERSION"]="0.0.4" S["PACKAGE"]="gyoto" S["CYGPATH_W"]="echo" S["am__isrc"]="" S["INSTALL_DATA"]="${INSTALL} -m 644" S["INSTALL_SCRIPT"]="${INSTALL}" S["INSTALL_PROGRAM"]="${INSTALL}" S["target_alias"]="" S["host_alias"]="" S["build_alias"]="" S["LIBS"]="-ldl " S["ECHO_T"]="" S["ECHO_N"]="-n" S["ECHO_C"]="" S["DEFS"]="-DHAVE_CONFIG_H" S["mandir"]="${datarootdir}/man" S["localedir"]="${datarootdir}/locale" S["libdir"]="${exec_prefix}/lib" S["psdir"]="${docdir}" S["pdfdir"]="${docdir}" S["dvidir"]="${docdir}" S["htmldir"]="${docdir}" S["infodir"]="${datarootdir}/info" S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}" S["oldincludedir"]="/usr/include" S["includedir"]="${prefix}/include" S["localstatedir"]="${prefix}/var" S["sharedstatedir"]="${prefix}/com" S["sysconfdir"]="${prefix}/etc" S["datadir"]="${datarootdir}" S["datarootdir"]="${prefix}/share" S["libexecdir"]="${exec_prefix}/libexec" S["sbindir"]="${exec_prefix}/sbin" S["bindir"]="${exec_prefix}/bin" S["program_transform_name"]="s,x,x," S["prefix"]="/usr/local" S["exec_prefix"]="${prefix}" S["PACKAGE_URL"]="" S["PACKAGE_BUGREPORT"]="gyoto@sympa.obspm.fr" S["PACKAGE_STRING"]="gyoto 0.0.4" S["PACKAGE_VERSION"]="0.0.4" S["PACKAGE_TARNAME"]="gyoto" S["PACKAGE_NAME"]="gyoto" S["PATH_SEPARATOR"]=":" S["SHELL"]="/bin/bash" _ACAWK cat >>"$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { line = $ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ac_datarootdir_hack=' s&@datadir@&${datarootdir}&g s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g s&@infodir@&${datarootdir}/info&g s&@localedir@&${datarootdir}/locale&g s&@mandir@&${datarootdir}/man&g s&\${datarootdir}&${prefix}/share&g' ;; esac ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// } :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # 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 as_fn_exit 0 Gyoto-0.1.0/yorick/configure.old000077500000000000000000000001161217470755400166070ustar00rootroot00000000000000#!/bin/sh set -e yorick -batch make.i cd stdplug; yorick -batch make.i exit 0 Gyoto-0.1.0/yorick/custom.i000066400000000000000000000004221217470755400156070ustar00rootroot00000000000000plug_dir,_(["./", "./stdplug/"], plug_dir()); set_path, "stdplug:"+get_path(); //#include "check.i" /* This should be the final line in your custom.i file-- it implements the default command line processing (see help for process_argv). */ command_line= process_argv(); Gyoto-0.1.0/yorick/gyoto.i000066400000000000000000001361571217470755400154550ustar00rootroot00000000000000plug_in, "gyoto"; /* Copyright 2011-2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "graphk.i" extern gyoto_haveXerces; /* DOCUMENT have_xerces = gyoto_haveXerces() Tell whether GYOTO was compiled with Xerces support (XML i/o) OUTPUT: HAVE_XERCES=1 if compiled with Xerces, else 0. */ extern __gyoto_setErrorHandler; /* xDOCUMENT __gyoto_setErrorHandler Must be called once to attach the GYOTO error handler to Yorick's one */ __gyoto_setErrorHandler; extern gyoto_loadPlugin; /* DOCUMENT gyoto_loadPlugin, plugin[, plugin2[, plugin3]] [, nofail=1] Load Gyoto plug-ins. INPUTS: gyoto_loadPlugins() accepts an aribtrary number of positional arguments, each a string or string array naming individual Gyoto plugins. For instance, all of the following attempt to load the plug-ins, stdplug, lorene and myplug: gyoto_loadPlugin, "stdplug", "lorene", myplug" gyoto_loadPlugin, ["stdplug", "lorene", myplug"] gyoto_loadPlugin, "stdplug", ["lorene", myplug"] KEYWORDS: nofail= if set and true, failure to load a plug-in will not trigger an error. It applies to _all_ plug-ins in the list. EXAMPLE: gyoto_loadPlugin, "stdplug" gyoto_loadPlugin, "lorene", nofail=1 */ extern __gyoto_initRegister; /* xDOCUMENT __gyoto_initRegister Must be called once to initialize the GYOTO plug-in register */ __gyoto_initRegister; extern __gyoto_exportSupplier; /* xDOCUMENT __gyoto_exportSupplier To be called by client plug-ins like gyoto_std.i */ require, "pl3d.i"; #include "gyoto_constants.i" local gyoto; /* DOCUMENT GYOTO -- General relativtY Orbit Tracer of Observatoire de paris GYOTO is a Yorick plug-in, based on an eponym C++ library, which allows computing geodesics in curved space-time. The two main uses are: -- computing the orbits of stars around relativistic objects; -- producing ray-traced images of compact objects and their surrondings. CONCEPTS AND SYNTAX =================== The Yorick plug-in implementation is object-oriented, reflecting that of the underlying C++ library. For the most part, it adheres to the Yorick uses, but some details can be surprising to a Yorick user. Creating a GYOTO object ----------------------- To create a GYOTO object, one calls one of the object creators: for instance gg = gyoto_KerrBL() ; results in GG being an opaque object containing a GYOTO Metric (a Kerr Metric in this case, using the Boyer-Lindquist coordinate system). The creators accept a filename as positional argument (see FILE FORMAT below): gg = gyoto_KerrBL( "my_KerrBL_descritpion.xml" ); GYOTO OBJECTS BEHAVE LIKE FUNCTIONS ----------------------------------- Once a GYOTO object has been created, it can be accessed in an object-like fashion (the object then ressembles a Yorick function) or through the same function which was used to create it. For instance, to change the spin parameter of the GG Metric above, the two following are exactly synonymous: gg, spin=0.8 ; gyoto_KerrBL, gg, spin=0.8; Beware: in the second form, the positional parameter GG must be given before any keyword parameter. This is one of the few points were the GYOTO syntax does not fully adheres the Yorick uses. MEMBERS ------- All the GYOTO objects have properties called "members" such as the spin of a Kerr metric. Members can be set or retrieved using the correspinding keywords, either upon object instanciation or at any later point in time: gg = gyoto_KerrBL( spin=0.995, mass=4e6 ) ; gg, spin=0.5; spin_param = gg(spin=); // or spin_param = gg.spin Note how giving a member keyword without any value, as in the last example above, allows _retrieving_ the previously set value. The alternative dot notation is semantically equivalent but slightly slower. When setting member, it is also possible to call the object as a function. In that case, the return value will be the object itself, allowing to call it again as a function: spin_val = gg(spin=0.5)(spin=) or spin_val = gg(spin=0.5).spin Although the above example is trivial, this is useful in some complex situations: Getting the resolution in a Screen attached to a Scenery: res_val = scenery(screen=)(resolution=); res_val = scenery.screen.resolution; // more elegant but slower Setting resolution: noop, scenery.screen(resolution=res_val); (The noop above is not mandatory but avoid spurious display). Some member keywords accept more than one parameter, separated by comas. This is the first exception GYOTO makes to the Yorick syntax. For example, for setting the initial position and velocity of a star, one can use: st = gyoto_Star( initcoord=pos,vel ); Only one such keyword can be set at any time because it would be exceedingly difficult to parse them otherwise. COPYING vs. CLONING ------------------- Be careful that GYOTO objects behave like pointers: if you make a copy of an object, any change in one of the instances will affect both. For instance: gg2 = gg; gg2, spin=0.5; In the above, the spin parameter of GG will be the same as that of GG2 (0.5). In fact, in memory, GG and GG2 point to the same C++ object. This is on purpose: this way, if you affect a Metric to a Photon and a Star, then change the spin of the Metric, the change will be reflected in all of the objects linked with this Metric: gg = gyoto_KerrBL(); st = gyoto_Star( metric=gg ); ph = gyoto_Photon( metric=gg ); gg, spin=0.5; In the above, the spin change affect the Photon and the Star as well. If what you want is a detached copy of a Gyoto object, you can get it with the CLONE method. Following the above example: gg_copy = gg; // This is copying: gg2 and gg are the same // object gg_clone = gg(clone=); // This is cloning: gg3 is a detached gg_clone = gg.clone // copy gg_copy, spin=0.2; gg_clone, spin=0.7; gg.spin; // the spin in gg is the same as in gg_copy, not // gg_clone. METHODS ------- Some keywords are "subroutine-like" methods in that they can have side-effects, but do not return a specific value. One notable example is the XMLWRITE keyword which most objects accept for dumping a description of themselves to an XML file: gg, xmlwrite="filename.xml"; Other methods keywords are function-like: they usually take one or several parameter and return a value. Only one value-retruning keyword can be set at a time (be it a function-like method or member keyword set for retrieving a value, such as "spin="): coor = gg(makecoord=yinit, cst); txyz = star(get_cartesian=dates); Some objects have a default methods that is called when no keyword is present. This is the case for metrics, which return the metric coefficients at a specific location, and of sceneries, which perform ray-tracing: coefficient = gg(coordinates, mu, nu); image = scenery(); GYOTO OBJECT TYPES ================== gyoto_Metric: the general relativity metric in which objects move... Notable sub-classes: gyoto_KerrBL, gyoto_KerrKS gyoto_Photon: massless particules used for ray-tracing gyoto_Astrobj: astrophysical objects. Notable sub-classes: gyoto_Star, gyoto_FixedStar, gyoto_PolishDoughnut, gyoto_ThinInfiniteDisk gyoto_Screen: the camera for ray-tracing gyoto_Spectrometer: the spectral capabilites of a gyoto_Screen (also found in gyoto_Photon) gyoto_Spectrum: a spectrum, only used in gyoto_Star so far gyoto_Scenery: relationship between all of the above FILE FORMAT =========== Most objects can be described in XML format. That's what you see when you print an object. You can also read/write an object from/to and XML file: sc = gyoto_Scenery( "description.xml" ); print, sc; sc, xmlwrite="backup.xml"; GYOTOY ====== GYOTO comes with a little GUI program: gyotoy. It allows interactively selecting the initial conditions for displaying the trajectory of a star or of a photon around a Kerr black-hole. EXAMPLES ======== Compute and display the orbit of a star: data = gyoto_Star(radius=0.5, metric=(gg=gyoto_KerrBL(spin=0.995)), initcoord=[0, 10.791, 1.5708, 0], [0, 0, 0.0166637], xfill=800 )( get_skypos=gyoto_Screen(metric=gg) ); plg, data(,2), data(,1); Ray-trace a scenery (orbiting star near a Kerr black-hole): sc = gyoto_Scenery( metric=(gg=gyoto_KerrBL()), screen=gyoto_Screen(metric=gg, observerpos=[1000, 100., 0.15, 0.], fov=pi/10., resolution=128), astrobj=gyoto_Star(metric=gg, radius=0.5, initcoord=[600, 9, pi/2, 0], [0, 0, 0.037037]) ) pli, sc(,,"Intensity"); Trace the trajectory of a photon in the secondary image of the above: ph = gyoto_Photon(initcoord=sc,77,45, xfill=870.623); txyz = ph.get_txyz; plg, txyz(,3), txyz(,2); limits, square=1; SEE ALSO: gyoto_Metric, gyoto_Astrobj, gyoto_Photon, gyoto_Screen, gyoto_Scenery, gyoto_Spectrum, gyoto_Spectrometer utilities: gyotoy, gyoto_plg3, gyoto_debug, gyoto_plgsky, gyoto_plmksky, gyoto_pltsky, gyoto_reticle, gyoto_orient3, gyoto_convert */ //////// SCENERY extern gyoto_Scenery; /* DOCUMENT scenery = gyoto_Scenery([filename,] [members=values ...]) Create GYOTO Scenery object or scenery, [members=values] Set GYOTO Scenery member or res = scenery(member=) or res = scenery.member Get GYOTO Scenery member or scenery, xmlwrite=filename Save Scenery description to XML or data = scenery([ irange, jrange [, quantities ]]) Ray-trace scenery PURPOSE: Create and use GYOTO Scenery objects. A GYOTO Scenery is used to render an image by relativistic ray-tracing. A GYOTO Scenery contains references to: - a GYOTO Metric ("the stage"); - a GYOTO Astrobj ("the actors"); - a GYOTO Screen ("the camera"). See GYOTO for basic concepts and syntax. MEMBERS: metric= see gyoto_Metric(): what "straight" means for light travel; screen= see gyoto_Screen(), it specifies where the obseerver is located and the obseerving time; astrobj= see gyoto_Astrobj(): where the light comes from; delta= a double scalar, the initial integration step for the Photons laucnched during ray-tracing; adaptive= whether integration uses adaptive step maxiter= maximum number of iterations in integration (per Photon) quantities= an array of strings giving the names of physical quantities that should be retrieved during ray-tracing. Beware that not all Astrobj kinds support all of those quantities. The order in which the quantities are listed when setting this member is not relevant, the following are equivalent: data = scenery(quantities=["EmissionTime", "Intensity"])(); and data = scenery(quantities=["Intensity", "EmissionTime"])(); Setting quantities here is not mandatory as the third positional argument used for ray-tracing permits to override it in an ordered fashion. Recognized quantities: "Intensity": apparent intensity of the Astrobj; "EmissionTime": time at which each photonreaching the screen was emitted; "MinDistance": minimum distance ever reached between each photon (whether comingfrom the object or not) and the Astrobj); "FirstDistMin": First local minimum in the Astrobj/Photon distance; "Redshift": ; "ImpactR", "ImpactX", "ImpactY" and "ImpactZ": R (specrical), X, Y and Z (Cartsesian) coordinates at which a photon was emitted by the Astrobj; "Spectrum": Inu spectrum of the Astrobj on this pixel, the spectrometer is specified in the Screen object; "BinSpectrum": spectrum of the Astrobj on this pixel (the spectrometer is specified in the Screen object), as would be detected by a real spectrometer: the value in each spectral channel is the integral of Inu over the spectral channel; "User1" to "User5": other specific scalar quantities an Astrobj may be able to compute, refer to the documentation for the Astrobj kind of your choice. nthreads=number of parallel threads to use in gyoto_Scenery_rayTrace. This has no effect when ray-tracing using the "data = scenery()" syntax below. RAY-TRACING: Ray-traced data is retrieved calling the object like a function with no keyword: data = scenery (); or data = scenery (irange, jrange, quant ) IRANGE and JRANGE are either scalars (i, j) or ranges in the usual form min:max:step. QUANT is an array of Yorick strings where each element selects one quantity to retrieve (see the QUANTITIES member above). QUANT may be void to use the quantities already set in the Scenery or the default for the Astrobj. If specifyng QUANT, DATA will be a MxNxP double array, where P=numberof(QUANT) and DATA(,,i) will contain the value of the quantity specifeid by QUANT(i). QUANTITIES may also be a scalar to retrieve a single quantity. The "Spectrum" quantity is a bit peculiar since it take more than one plane in data. SEE ALSO: gyoto_Metric, gyoto_Screen, gyoto_Astrobj, gyoto_Photon, gyoto_Spectrometer, gyoto_Scenery_rayTrace */ extern gyoto_Scenery_rayTrace /* DOCUMENT res = gyoto_Scenery_rayTrace(scenery, imin, imax, jmin, jmax, impactcoords) if IMPACTCOORDS is an unadorned, nil variable it is output. If it is an expression or non-nil, it is input. */ func _gyoto_Scenery_adaptive_raytrace(sco, respmax, &computed) { /* xDOCUMENT data = gyoto_Scenery_adaptive_raytrace(scenery, pmax, [computed]) BROKEN Ray-trace a GYOTO Scenery on an adaptive grid. For certain kinds of objects (in particular, Stars), this routine is much faster than the equivalent: data = scenery(resolution=3^pmax, raytrace=1); It is NOT guaranteed that the two methods yield the same result. The minimum distance between photon and object is first computed on a coarse grid which is then refined as required. SEE ALSO: gyoto_Scenery */ write, format="%s\n", "WARNING: gyoto_Scenery_adaptive_raytrace() is under development"; sc = sco(clone=); // don't modify calling object DBL_MAX=1e100; screen = sc(screen=); respmax=long(respmax); resp=1; resmax=3^respmax; step=long(3^(respmax-resp)); first=step/2+1; data=array(double, resmax, resmax, 6); quantities = ["Intensity", "EmissionTime", "MinDistance", "ImpactX", "ImpactY", "ImpactZ"]; screen, resolution=resmax; data(first::step, first::step, ) = sc(first::step, first::step, quantities); computed=array(long,resmax,resmax); nb=9; for (resp=2, res=3; resp<=respmax; ++resp) { // largest distance to neighbour dsub=data(first::step, first::step,); ind=where(dsub>=DBL_MAX); if (numberof(ind)) dsub(ind)=DBL_MAX; delta = array(double, res, res); d1=(dsub(dif,,4:6)^2)(,,sum); d2=(dsub(,dif,4:6)^2)(,,sum); delta(2:-1,2:-1)=[d1(:-1,2:-1), d1(2:,2:-1), d2(2:-1,:-1), d2(2:-1,2:)](,,max); delta(1,2:-1)=[d1(1,2:-1), d2(1,:-1), d2(1,2:)](,max); delta(0,2:-1)=[d1(0,2:-1), d2(0,:-1), d2(0,2:)](,max); delta(2:-1,1)=[d2(2:-1,1), d1(:-1,1), d1(2:,1)](,max); delta(2:-1,0)=[d2(2:-1,0), d1(:-1,0), d1(2:,0)](,max); delta(0,0)=[d1(0,0), d2(0,0)](max); delta(1,1)=[d1(1,1), d2(1,1)](max); delta(0,1)=[d1(0,1), d2(0,1)](max); delta(1,0)=[d1(1,0), d2(1,0)](max); // ! BEWARE : res is updated here res*=3; refine=array(int, res, res); refine(1::3, 1::3) = refine(2::3, 1::3) = refine(3::3, 1::3) = refine(1::3, 2::3) = refine(2::3, 2::3) = refine(3::3, 2::3) = refine(1::3, 3::3) = refine(2::3, 3::3) = refine(3::3, 3::3) = (dsub(,,3)<4*delta) | (dsub(,,3)<2); nstep=long(3^(respmax-resp)); nfirst=first-nstep; data(nfirst ::step,nfirst ::step,)= data(first ::step,nfirst ::step,)= data(first+nstep::step,nfirst ::step,)= data(nfirst ::step,first ::step,)= data(first+nstep::step,first ::step,)= data(nfirst ::step,first+nstep::step,)= data(first ::step,first+nstep::step,)= data(first+nstep::step,first+nstep::step,)= dsub; step=nstep; first=nfirst; for (i=1; i<=res; ++i) { ibis=(i-1)*step+first; ind=where(refine(i,) & !computed(ibis,first::step)); nb+=numberof(ind); if (numberof(ind)) { indbis=(ind-1)*step+first; data(ibis,indbis,)=sc(ibis, indbis, quantities); computed(ibis, indbis)=resp; } } } nb; return data; } // PHOTON CLASS extern gyoto_Photon; /* DOCUMENT photon = gyoto_Photon([filename], [members=values]) photon, member=values value = photon(member=) or value = photon.member value = photon(function_method=params) photon, subroutine_method=params PURPOSE: Instanciate and use a single GYOTO photon. Photons are mass-less particles following light-like geodesics of a metric. For basic concepts, see GYOTO. For ray-tracing, gyoto_Scenery() is more appropriate. MEMBERS: Members can be set with the syntax "photon, member=value" and retrieved with the syntax "value=photon(member=)" or "value=photon.member": metric= a GYOTO Metric (see gyoto_Metric), initcoord=scenery,x,y also sets the metric. astrobj=a GYOTO Astrobj (see gyoto_Astroj), the target of ray-tracing. initcoord= the initial coordinates (4-position & 4 velocity). There are many ways to specify this: initcoord=COORD8 directly give the 8 coordinates; initcoord=POS4,VEL4 as above, with a coma in-between; initcoord=POS4,VEL3 this time only 3 coordinates are given for the velocity vector. The light-ray will be tangent to this 3-vector. initcoord=SCREEN,DALPHA,DDELTA SCREEN is a gyoto_Screen, DALPHA and DDELTA specify the direction this photon comes from when it reaches the screen. DALPHA and DDELTA are in radians and must be floating-point values. initcoord=SCREEN,I,J As above, but I and J are integers specifying the pixel of the arrival SCREEN which the photon hits. initcoord=SCENERY,DALPHA,DDELTA initcoord=SCENERY,I,J As above, but specify a gyoto_Scenery instead of a gyoto_Screen. The Metric and Astrobj of the Senery will also be attached to the Photon. Those last ways of specifying the initial conditions are very useful to get the trajectory of a specific photon in a ray-traced scenery. spectro= a gyoto_Spectrometer delta= integration step (initial in case of adaptive, the default) adaptive= whether integration uses adaptive step maxiter= maximum number of iterations in integration SUBROUTINE-LIKE METHODS: Several of these keywords can by specified whenever creating or accessing the object. xfill=TLIM Integrate the geodesic from the time specified with INITCOORD to tlim (the integrated geodesic remains stored in the PHOTON); save_txyz=FILENAME Dump the integrated geodesic in cartesian coordinates in ASCII file FILENAME. xmlwrite=filename as usual, save an XML description of this photon; setparameter=name[,value] set any low-level parameter. Name and value are strings. FUNCTION-LIKE METHODS: The object PHOTON will return a value when called as a function with the following keywords set: is_hit= Return 1 if this photon hits the Astrobj get_txyz= Return the geodesic in Cartesian coordinates: data = photon(xfill=tlim, get_txyz=) data will be a Nx4 double array where data(i,) contains the 4-position in Cartesian coordinates of the photon for all the dates computed by the integrator between INITCOORD[0] and TLIM. get_coord= Return the geodesic in Metric coordinatess: same as above, but in the prefered coordinate system for this metric, which may be Cartesian or spherical. get_coord=dates Same as above, but for the dates specified in double array DATES. get_cartesian=dates Get the 3-position and 3-velocity of the Photon in Cartesian coordinates for the specified dates. SEE ALSO: gyoto, gyoto_Metric, gyoto_Screen, gyoto_Scenery, gyoto_Astrobj */ /// METRIC extern gyoto_Metric; /* DOCUMENT gg = gyoto_Metric( filename, [members=values] ) gg, members=values retval = gg(member=) or retval = gg.member; retval = gg(function_method=par1, par2...) gg, xmlwrite=filename coef = gg(coordinates, mu, nu) PURPOSE: Create and manipulate GYOTO Metric objects INTRODUCTION: See GYOTO for basic concepts. The GYOTO plug-in for Yorick introduces "Metric" objects (see GYOTO for an introduction). Such objects are created used for instance the gyoto_KerrBL() function. Any kind of metric (even if not explicitely exposed in this plug-in) can be loaded from an XML file using the FILENAME parameter. This XML file can by any GYOTO file containing a Metric section: the top-level can be a Metric, a Scenery, an Astrobj or whatever which contains a reference to a Metric. When printed, a Metric displays an XML description of itself, which can be dumped to a file using the XMLWRITE keyword. Most GYOTO functions which accept a Metric as a parameter accept any kind of Metric. There are nevertheless specific functionsAstrobjs which make sense only in the framework of a specific kind of Metric, notably gyoto_KerrBL. This is the case for gyoto_PolishDoughnut for instance. MEMBER KEYWORDS: mass=, unitlength=, kind= All the Metric kinds have a mass that can be set and retrieved using the mass keyword: gg, mass=value; value = gg(mass=); Setting the mass gives the scale of the black hole in physical units. The unit length can be retrieve using the unitlength keyword: len = gg(unitlength=) where LEN is in meters if MASS was set in kilograms. Finally, the kind of the metric (e.g. "KerrBL") can be queried: kind_string = gg(kind=) METHODS Without any keywords, the metric can output its coefficient at 4-position POSITION: coefs = gg(position, mu, nu); where mu and nu are indices or ranges (1-4, 1 is for time). coefs = gg(position) returns the 16 metric coefficients at position. Additional function-like or subroutine like methods: coord=gg(prime2tdot=pos, vel): COORD is the 8-vector where COORD[1-4]==POS and COORD[5-8] is the 4-velocity corresponding to the 3-velocity VEL; vel4 =gg(nullifycoord=pos, vel) Return nullified (photon) coord tangent to vel at pos. prod = gg(scalarprod=pos, u1, u2) Return (4-dimensional) scalar product. vels = gg(circularvelocity=coords [, dir]) On input, COORDS is an array of doubles yielding 4-position vectors: x0=coords(1,..), x1=coords(2, ..), x3=coords(3, ..), x4=coords(4, ..). The return value VELS has the same dimensionality as coords(1:4, ..). It contains the circular velocity (on te equatorial plane, so COORDS is projected) corresponding to each position specified by coords. If the optional parameter DIR is -1, VELS corresponds to the counter-rotating circular velocity. SET KEYWORDS: List of set-like keywords ("set" is never specified). Specific Metric kinds may recognize more: mass=new_mass gyoto_Metric_setMass, gg, new_mass SEE ALSO: gyoto, gyoto_KerrBL, gyoto_KerrKS */ extern gyoto_Astrobj; /* DOCUMENT ao = gyoto_Astrobj( filename ); ao, member1=val1, member2=val2...; val = ao(member=) or val = ao.member ao, xmlwrite=filename Generic class for describing an astronomical object (a star, an accretion disk...) in the context of GYOTO. See "help, gyoto" for an introduction. Several specific kinds of objects can be created using the functions listed in "SEE ALSO". Any kind of Astrobj can be loaded from an XML file using gyoto_Astrobj. This XML file can be any GYOTO file containing an Astrobj section (for instance, a Scenery file). When printed, an astrobj displays an XML description of itself. This description can be saved to disk using the XMLWRITE method keyword. MEMBER KEYWORDS All the kinds of Astrobjs share a few members that can be accessed with the following keywords. To set the member, use "ao, member=value". To retrieve the current value of the member, use "retval = ao(member=)" or "retval = ao.member". rmax: for optimization, tell the Scenery that this object does not extend over RMAX from the center of the coordinate system (RMAX is expressed in geometrical units). opticallythin: whether or not to compute radiative transfer through the object for optically thin objects. kind: read only. ao(kind=) return a string containing the kind of this object (e.g. "Star", "PolishDoughnut"). METHOD KEYWORDS Astrobj objects can also provide function-like or subroutine-like methods. All of them support the following (subroutine-like): xmlwite="filename.xml" dump a description of the object to an XML file. setparameter="name","content" generic method to set a parameter in an Astrobj object, even if is has not been explicitely exposed in the Yorick plug-in. For instance, if st is a gyoto_Star object, the two following commands yield the same result, although the former is faster than the latter: st, radius=1.0; st, setparameter="Radius","1.0"; The list of values that "name" can take is (or should be) documented in the doxygen documentation for the specific class. See Gyoto::Astrobj::Generic::setParameter(). EXAMPLES: The following implement specific objects, most require gyoto_std.i: gyoto_Star A spherical object moving along a geodesic gyoto_FixedStar A spherical object of constant coordinates gyoto_Torus A simple torus (solid, Keplerian rotation) gyoto_ThinDisk A geometrically thin disk gyoto_PatternDisk As above, emission numerically provided gyoto_Disk3D Thick disk, emission numerically provided It is also possible to instanciate an astrobj by kind name even if this kind is not explicitly implemented in the yorick plug-in: gyoto_Astrobj("PageThorneDisk") A geometrically thin, optically thick disk with Page & Thorne 1974 emission SEE ALSO: gyoto */ extern gyoto_ThinDisk; /* DOCUMENT ao = gyoto_ThinDisk( filename ); ao, member1=val1, member2=val2...; val = ao(member=) or val = ao.member ao, xmlwrite=filename A more specific version of the gyoto_Astrobj function. A very crude Astrobj can be instanciated using gyoto_ThinDisk. More elaborate derived classes also exist. gyoto_ThinDisk accepts a few keywords in addition to those processed by gyoto_Astrobj. MEMBER KEYWORDS innerradius: inner radius of the disk. outer radius: outer radius of the disk. dir: 1 if corotating (relative to the coordinate system), -1 if coounter rotating. SEE ALSO: gyoto, gyoto_Astrobj There is one derived classe in gyoto_std.i: gyoto_PatternDisk As above, emission numerically provided try also gyoto_Astrobj("PageThorneDisk") */ extern gyoto_Screen; /* DOCUMENT screen = gyoto_Screen([keyword=value ...]) or gyoto_Screen, screen, [keyword=value] or screen, [keyword=value] Set GYOTO Screen member or res = gyoto_Screen(screen, get_keyword=1) or res = screen(get_keyword=1) Get GYOTO Screen member PURPOSE: Create and use GYOTO Screen objects. A GYOTO Screen is in essence the virtual camera used for ray-tracing a GYOTO Scenery. It contains informations such as the resolution of the output images and the location of the camera relative to the Metric. A Screen is usually created using the gyoto_Screen function. It's members are then set or queried using various member keywords (see KEYWORDS below, "help, gyoto"). A description of the Screen can be written to an XML file using the xmlwrite= keyword. INPUT: SCREEN: an opaque object referencing a GYOTO Screen instance. In the first form, SCENERY is instanciated with any member set accordingly to the KEYWORD=VALUE pairs. In the four other forms, SCREEN must have been instanciated by a previous call to gyoto_Screen(). OUTPUT: SCREEN: in the first form, a new GYOTO Screen object is returned (actually an opaque Yorick object referencing a GYOTO object). RES: in the last two forms, the Screen object is queried thanks to a keyword starting with "get_" and the call returns the corresponding value. KEYWORDS: Member keywords are used to set the value of a member (screen, member=value) or to retrieve the value of a memeber (value=screen(member=) or value=screen.member): metric, time, tmin, fov (field-of-view), resolution (N pixels on each side), distance (meters), inclination, paln (position angle of the line of nodes), argument, pojection (=[incl, paln, arg]), observerpos (alternative way to set time, dist, incl, and arg by giving the position of the camera. Here, dist is in geometrical units), spectro (see gyoto_Spectrometer); Screens provide two function-like methods and the usual subroutine-like method xmlwrite: skycoord = [x0, x1, x2, x3] returns screen (=sky) coordinates d_alpha, d_delta, d_dist raycoord = [d_alpha, d_delta] returns 8-coordinate vector (position-velocity) of photon hitting screen with arrival direction d_alpha, d_delta. xmlwrite = filename to export screen to XML. SEE ALSO: gyoto, gyoto_Metric, gyoto_Scenery, gyoto_Astrobj, gyoto_Spectrometer */ extern gyoto_Spectrum; /* DOCUMENT sp = gyoto_Spectrum([filename, ][members=values] or sp, method=parameters or value = sp(method=parameters) or Inu = sp(frequency) or I_nu1_nu2 = sp(integrate=channels) A gyoto object with the usual gyoto syntax representing the spectrum of a source. So far, it can be attached only to a Star. The specificity of a spectrum is that it can be used as a function to retrieve the intensity of an object at a given wavelength. METHODS: operator(): Without any keyword, SP is used as a function to evaluate Inu at a given FREQUENCY: Inu = sp(frequency) FREQUENCY may be an array if any shape, Inu will be conformable. FREQUENCY is in Hz. integrate=channels CHANNELS must be a 1-dimensional array of N doubles (N>=2). The returned value will be an array of doubles with N-1 elements: I_nu1_nu2 = sp(integrate=channels) I_nu1_nu2(i) is the integral of Inu from frequency nu1 to frequency nu2. This is the same than the BinSpectrum quantity in a Scenery. GENERIC MEMBERS: kind= (read-only) GENERIC SUBROUTINE-LIKE METHODS xmlwrite=filename (as usual) GENERIC FUNCTION-LIKE METHODS clone= (as usual) SEE ALSO: gyoto, gyoto_Star */ extern gyoto_debug; /* DOCUMENT gyoto_debug, 1/0 Turn GYOTO debug output on/off. SEE ALSO: gyoto */ extern gyoto_verbose; /* DOCUMENT gyoto_verbose, level or level = gyoto_verbose() Set/get Gyoto verbosity level SEE ALSO: gyoto */ extern gyoto_Spectrometer; /* DOCUMENT spectro = gyoto_Spectrometer([filename],[members=values]) or spectro, xmlwrite=filename or var = spectro( channels= | midpoints= | widths= | nsamples= | kind= | clone= ) The spectrometric capabilities of a GYOTO Screen or Photon. The spectrometer attached to a Screen in a Scenery determines the frequencies for which the Quantities Spectrum and BinSpectrum are computed when ray-tracing. For basics, see GYOTO. In the first form, if FILENAME is specified, a new Spectrometer is instanciated from XML file FILENAME. FILENAME can also name a Spectrometer Kind, such as "Complex" or "wave". KEYWORDS: unit= a string, affects methods called together: channels_in_microns=spectro(channels=, unit="microm") METHODS: xmlwrite=filename, write XML desription of this spectrometer to hard drive. E.g. spectro, wmlwrite="file.xml" The following keywords allow retrieving information on the spectrometer. They don't take a value but return one with this syntax: retval=spectro(keyword=) kind= returns the Spectrometer kind name, e.g. "wave", "freq" or "Complex". nsamples= returns the number of spectral channels. channels= return an array(double, NSAMPLES, 2) yielding the edges of each spectral channel in UNIT (default: Hz) midpoints= returns an array(double, NSAMPLES) yielding the central frequency of each spectral channel in UNIT (default: Hz). widths= returns the width of each spectral channel in UNIT (default: Hz). clone= returns a deep copy of this Spectrometer. SEE ALSO: gyoto, gyoto_Screen, gyoto_Scenery, gyoto_SpectroUniform, gyoto_SpetroComplex */ extern gyoto_SpectroUniform; extern _gyoto_SpectroUniform_register_as_Spectro; /* DOCUMENT spectro = gyoto_SpectroUniform([members=values]) or spectro, keywords=values or retval = spectro( keyword= ) gyoto_SpectroUniform() is a more specific implementation of gyoto_Spectrometer(). It allows creating an Spectrometer::Uniform object which models a spectrometer where NSAMPLES spectral channels are unifromly spaced in wavelength, frequency, or log10 thereof. gyoto_SpectroUniform has a superset of the functionalities of gyoto_Spectrometer. MEMBERS: Members can be set with "spectro, member=value" and retrieved with "value = spectro(member=)" or "value=spectro.member". kind= a string, one of "none", "wave", "freq", "wavelog", "freqlog". KIND affects how BAND below is interpreted and how CHANNELS and MIDPOINTS are returned. Since these four "kinds" are actually based on the same code, it is possible to convert a Spetrcometer between them. nsamples= a long, the number of spectral channels in this spectrometer; band= a pair of doubles, the lower and upper boundaries of the spectral band covered by this spectrometer. The default unit in which BAND is expressed depends on KIND: KIND UNIT freq Hz freqlog log10(Hz) wave m wavelog log10(m) Keyword UNIT can be set to use a different unit than the default. For kinds freqlog and wavelog, log10(unit) is used. METHODS: The following methods from gyoto_Spectrometer are implemented: xmlwrite, clone, channels, midpoints, widths. SEE ALSO: gyoto_Spectrometer, gyoto_SpectroComplex */ _gyoto_SpectroUniform_register_as_Spectro; extern gyoto_SpectroComplex; extern _gyoto_SpCplx_register_as_Spectrometer; /* DOCUMENT spectro = gyoto_SpectroComplex([members=values]) or spectro, keywords=values or retval = spectro( keyword= ) or subspectro = spectro(index) gyoto_SpectroComplex() is a more specific implementation of gyoto_Spectrometer(). It allows creating an Spectrometer::Complex object which models a spectrometer made of several simpler Spectrometer objects (sub-spectrometers). gyoto_SpectroComplex has a superset of the functionalities of gyoto_Spectrometer. A single sub-spectrometer can be retrieved by its INDEX. INDEX is 1-based, as is customary in Yorick. EXAMPLE: sp1 = gyoto_SpectroUniform(kind="wave", nsamples=10, unit="microm", band=[1, 2]); sp2 = gyoto_SpectroUniform(kind="freqlog", nsamples=10, unit="eV", band=[10, 20]); sp = gyoto_SpectroComplex(append=sp1)(append=sp2); sp1bis = sp(1); sp2bis = sp(2); METHODS: The following methods from gyoto_Spectrometer are implemented: xmlwrite, clone, channels, midpoints, widths. In addition, gyoto_SpectroComplex accepts the following methods: append=subspectro add new sub-spectrometer remove=index remove sub-spectrometer INDEX SEE ALSO: gyoto_Spectrometer, gyoto_SpectroUniform */ _gyoto_SpCplx_register_as_Spectrometer; func gyoto_plg3(x,y,z, keywords=) { /* DOCUMENT gyoto_plg3, x, y, z Plot (plg) a graph in 3D using the API provided by pl3d.i SEE ALSO: pl3d.i, set3_object, gyoto_plgsky */ if (_draw3) { xyz= _nxt(x); keywords= _nxt(x); get3_xy, xyz, x, y; plgk, y, x, keywords=keywords; return; } set3_object, gyoto_plg3, _lst(transpose([x,y,z]), keywords); } func gyoto_plmk3(x,y,z, keywords=) { /* DOCUMENT gyoto_plmk3, x, y, z Plot (plg) a graph in 3D using the API provided by pl3d.i SEE ALSO: pl3d.i, set3_object, gyoto_plgsky */ if (_draw3) { xyz= _nxt(x); keywords= _nxt(x); get3_xy, xyz, x, y; plmkk, y, x, keywords=keywords; return; } set3_object, gyoto_plmk3, _lst(transpose([x,y,z]), keywords); } func gyoto_plgsky(alpha,delta, keywords=) { /* DOCUMENT gyoto_plgsky, alpha, delta Plot (plg) data on the plane of the sky using the pl3d.i API. Not all transforamations are allowed (basically orient3 and rot3). SEE ALSO: gyoto_pltsky, gyoto_plmksky, gyoto_reticle, gyoto_plg3 */ if (_draw3) { list=alpha; alpha= _nxt(list); delta= _nxt(list); keywords= _nxt(list); scale= _getscl3()(1); plgk, delta*scale, -alpha*scale, keywords=keywords; return; } set3_object, gyoto_plgsky, _lst(alpha, delta, keywords); } func gyoto_plmksky(alpha,delta, keywords=) { /* DOCUMENT gyoto_plmksky, alpha, delta Plot (plmk) data on the plane of the sky using the pl3d.i API. Not all transforamations are allowed (basically orient3 and rot3). SEE ALSO: gyoto_pltsky, gyoto_plgsky, gyoto_reticle */ if (_draw3) { list=alpha; alpha= _nxt(list); delta= _nxt(list); keywords= _nxt(list); scale= _getscl3()(1); plmkk, delta*scale, -alpha*scale, keywords=keywords; return; } set3_object, gyoto_plmksky, _lst(alpha,delta, keywords); } func gyoto_pltsky(text, alpha, delta, keywords=) { /* DOCUMENT gyoto_plgsky, text, alpha, delta, justify Write text (plt) on the plane of the sky using the pl3d.i API. Not all transforamations are allowed (basically orient3 and rot3). SEE ALSO: gyoto_plgsky, gyoto_plmksky, gyoto_reticle */ if (_draw3) { list=text; text = _nxt(list); alpha = _nxt(list); delta = _nxt(list); keywords= _nxt(list); scale= _getscl3()(1); if (is_void(keywords)) keywords=GraphK(); keywords.tosys=&long(1); pltk, text, -alpha*scale, delta*scale, keywords=keywords; return; } set3_object, gyoto_pltsky, _lst(text, alpha,delta, keywords); } func gyoto_reticle(alphamax, deltamax, alphamin, deltamin, set=) { /* DOCUMENT gyoto_reticle, alphamax [, deltamax, alphamin, deltamin] Draw alpha and delta axes on the plane of the sky using the pl3d.i API. Not all transforamations are allowed (basically orient3 and rot3). SEE ALSO: gyoto_plgsky, gyoto_plmksky, gyoto_pltsky */ if (is_void(deltamax)) deltamax = alphamax; if (is_void(alphamin)) alphamin = -alphamax; if (is_void(deltamin)) deltamin = -deltamax; gyoto_plgsky,[alphamin, alphamax], [0,0]; gyoto_plgsky,[0,0],[deltamin, deltamax]; // Compute tick length len=max(alphamax-alphamin,deltamax-deltamin); _3ticks, alphamin, alphamax, _3nmajor; for (i=1; i<=numberof(xminor); ++i) gyoto_plgsky, xminor(i)(-:1:2), [-len*_3lminor, 0]; for (i=1; i<=numberof(xmajor); ++i) { gyoto_plgsky, xmajor(i)(-:1:2), [-len*_3lmajor, 0]; gyoto_pltsky, xlabel(i), xmajor(i), -len*_3lmajor, keywords=GraphK(justify=&string("CT")); } _3ticks, deltamin, deltamax, _3nmajor; for (i=1; i<=numberof(xminor); ++i) gyoto_plgsky, [len*_3lminor, 0], xminor(i)(-:1:2); for (i=1; i<=numberof(xmajor); ++i) { gyoto_plgsky, [len*_3lmajor, 0], xmajor(i)(-:1:2); gyoto_pltsky, xlabel(i), len*_3lmajor, xmajor(i), keywords=GraphK(justify=&string("RH")); } } func gyoto_orient3(incl, paln, phase) { /* DOCUMENT gyoto_orient3, incl, paln, phase Call orient3 and rot3 after having converted the 3 (more or less) standard astronomical angles (expressed in degrees) into the corresponding ones in the pl3d.i API. SEE ALSO: orient3, rot3 */ local deg2rad; deg2rad=pi/180.; // orient3,phase*deg2rad,incl*deg2rad-pi/2.; // rot3,,,paln*deg2rad+pi/2.; // restore3, []; // Reset orientation to something normal orient3, 0, 0; rot3, , pi, ; rot3, -pi/2,,; // start from here rot3, , ,-phase*deg2rad; rot3, -incl*deg2rad, , ; rot3, , ,-paln *deg2rad; } func gyoto_convert(&x, mass, distance, unit) { /* DOCUMENT gyoto_convert, x, mass, distance, unit or x_unit = gyoto_convert(x, mass, distance, unit) INPUT: X: value in geometrical units MASS: mass defining geometrical units in solar masses DISTANCE: distance to observer in kiloparsecs UNIT: unit to convert to. One of "geometric", "m", "km", "sun radius", "arcsec", "mas" (milliarcseconds), "uas" (microarcseconds) OUTPUT: X (in the first form) or X_UNIT: the converted value. SEE ALSO: */ m_sun = 1.98843e30; // kg G = 6.67428e-11; // Gravitational constant, SI = m^3 * kg^-1 * s-2 c = 299792458.; // m/s r_sun = 6.955e8; // m kpc = 3.08568025e19; // m GMsunoC2 = G*m_sun/c^2; unit_d = GMsunoC2 * mass; // m if (unit=="geometrical") x_unit=x; else if (unit=="m") x_unit=x* unit_d; else if (unit=="km") x_unit=x*(unit_d*1e-3); else if (unit=="sun radius") x_unit=x*(unit_d/r_sun); else if (unit=="rad") x_unit=x*(unit_d/(distance*kpc)); else if (unit=="degree") x_unit=x*(unit_d/(distance*kpc*pi)*180); else if (unit=="arcmin") x_unit=x*(unit_d/(distance*kpc*pi)*1.08e4); else if (unit=="arcsec") x_unit=x*(unit_d/(distance*kpc*pi)*6.48e5); else if (unit=="mas") x_unit=x*(unit_d/(distance*kpc*pi)*6.48e8); else if (unit=="uas") x_unit=x*(unit_d/(distance*kpc*pi)*6.48e11); /* need double checking else if (unit=="s") x_unit=x*(unit_d/c); else if (unit=="min") x_unit=x*(unit_d/(c*60.)); else if (unit=="hour") x_unit=x*(unit_d/(c*3600.)); else if (unit=="day") x_unit=x*(unit_d/(c*86400.)); else if (unit=="month") x_unit=x*(unit_d/(c*2629743.8)); else if (unit=="year") x_unit=x*(unit_d/(c*31556926)); */ else error, "unknown unit "+unit; if (am_subroutine()) eq_nocopy, x, x_unit; else return x_unit; } extern is_gyoto_Photon; extern is_gyoto_Astrobj; extern is_gyoto_Metric; extern is_gyoto_Spectrometer; extern is_gyoto_Spectrum; extern is_gyoto_Screen; extern is_gyoto_Scenery; /* DOCUMENT bool = is_gyoto_BASE(arg) BOOL is 1 if arg is a gyoto_BASE where base is Metric, Astrobj, Spectrum, Spectrometer, Scenery, Screen... SEE ALSO: gyoto */ extern gyoto_dontcatchSIGFPE; extern gyoto_dontcatchSIGSEGV; extern gyoto_listRegister; /* DOCUMENT gyoto_listRegister List the register of known Astrobj, Metric, Spectrum and Spectrometer kinds. SEE ALSO: gyoto */ if (is_func(use)) { include, "gyoto_namespace.i", 1; } else { gyoto_namespace=noop; } include, "gyoto_std.i", 2; Gyoto-0.1.0/yorick/gyoto.info.in000066400000000000000000000014041217470755400165470ustar00rootroot00000000000000Package: gyoto Kind: plugin Version: @VERSION@ Revision: 1 Description: the General relativitY Orbit Tracer of Observatoire de Paris License: GPL-3+ Author: Thibaut Paumard Maintainer: Thibaut Paumard OS: architecture independant Depends: yorick(>=2.2), yutils(>=1.3.0) Source: https://github.com/gyoto/Gyoto/archive/%v.tar.gz Source-MD5: Source-Directory: DocFiles: README AUTHORS COPYING Homepage: http://gyoto.obspm.fr/ DescDetail: << Gyoto aims at providing a framework for computing orbits and ray-traced images in General relativity. It consists in a library (libgyoto), utility programs, and a plug-in for Yorick. << DescUsage: << See check.i for a test suite. Type "yorick -i check.i" in a terminal to run it. << DescPort: << << Gyoto-0.1.0/yorick/gyoto_AnalyticMetric.C000066400000000000000000000022551217470755400203660ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include #include "yapi.h" using namespace Gyoto; extern "C" { // ANALYTICMETRIC CLASS // Constructor void Y_gyoto_AnalyticMetric_new(int n) { double mm=1.0; if (n>1) y_error("gyoto_Kerr_new takes at most 1 arguments"); if (n==1) mm=ygets_d(0); SmartPointer *gg = ypush_Metric(); try { *gg = new AnalyticMetric(mm); } YGYOTO_STD_CATCH ; // strcpy(obj->type,"AnalyticMetric"); } } Gyoto-0.1.0/yorick/gyoto_Astrobj.C000066400000000000000000000113311217470755400170550ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include "yapi.h" #include "pstdlib.h" #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #endif #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; static char ygyoto_Astrobj_names[YGYOTO_TYPE_LEN][YGYOTO_MAX_REGISTERED] ={{0}}; static ygyoto_Astrobj_eval_worker_t *ygyoto_Astrobj_evals[YGYOTO_MAX_REGISTERED] ={0}; static int ygyoto_Astrobj_count=0; YGYOTO_YUSEROBJ(Astrobj, Astrobj::Generic) YGYOTO_BASE_CONSTRUCTOR(Astrobj) extern "C" { void gyoto_Astrobj_eval(void *obj, int argc) { GYOTO_DEBUG << endl; // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { ypush_long((long)((gyoto_Astrobj*)obj)->smptr()); return; } // Try calling kind-specific worker int n=0; SmartPointer * OBJ = &(((gyoto_Astrobj*)obj)->smptr); const string kind = (*OBJ)->getKind(); while (n((*OBJ)())) base = THINDISK; static char const * knames_thindisk[]={"unit", YGYOTO_THINDISK_GENERIC_KW, 0}; static char const * knames_generic[]={"unit", YGYOTO_ASTROBJ_GENERIC_KW, 0}; static long kglobs[YGYOTO_ASTROBJ_BASE_MAX_KW_N+2]; static int kiargs[YGYOTO_ASTROBJ_BASE_MAX_KW_N+1]; char ** knames=NULL; ygyoto_Astrobj_generic_eval_t * worker; // ThinDisk switch (base) { case GENERIC: knames=const_cast(knames_generic); worker = &ygyoto_Astrobj_generic_eval; break; case THINDISK: knames = const_cast(knames_thindisk); worker = &ygyoto_ThinDisk_generic_eval; break; default: y_error("BUG: unkown base type"); } yarg_kw_init(knames, kglobs, kiargs); while (iarg>=1) { iarg = yarg_kw(iarg, kglobs, kiargs); if (iarg>=1) { if (parg<4) piargs[parg++]=iarg--; else y_error("gyoto_Astrobj takes at most 4 positional arguments"); } } char * unit=NULL; int k =-1; /* UNIT */ YGYOTO_WORKER_SET_UNIT; (*worker)(OBJ, kiargs+k+1, piargs, rvset, paUsed, unit); } } void ygyoto_Astrobj_register(char const*const name, ygyoto_Astrobj_eval_worker_t* on_eval){ int n; if (ygyoto_Astrobj_count==YGYOTO_MAX_REGISTERED) y_error("Too many Astrobjs registered"); for (n=0; n*OBJ, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit) { int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; if (debug()) for (int i=0; i. */ #include "ygyoto_idx.h" #include "yapi.h" using namespace YGyoto; int YGyoto::Idx::isNuller() {return _is_nuller;} long YGyoto::Idx::getNElements() {return _nel;} long YGyoto::Idx::current() { if (_is_list) return _idx[_cur]; return _cur; } double YGyoto::Idx::getDVal() {return _is_double?_dval:_range[0];} int YGyoto::Idx::isDouble() {return _is_double;} int YGyoto::Idx::isFirst() {return _is_first;} int YGyoto::Idx::isLast() { if (_is_range) return _cur+_range[2] > _range[1]; if (_is_scalar) return 1; if (_is_list) return _cur >= _nel; return 0; } long YGyoto::Idx::first() { _is_first=1; if (_is_range) return _cur=_range[0]; if (_is_scalar) return _cur=_range[0]; if (_is_list) return _idx[_cur=0]; return 0; } int YGyoto::Idx::valid() { if (_is_range) return _cur<=_range[1]; if (_is_scalar) return _cur==_range[0]; if (_is_list) return _cur<_nel; return 0; } long YGyoto::Idx::next() { _is_first=0; if (_is_range) return _cur+=_range[2]; if (_is_scalar) return ++_cur; if (_is_list && (++_cur)<_nel) return _idx[_cur]; return 0; } YGyoto::Idx::Idx(int iarg, int res) : _is_nuller(0), _is_range(0), _is_list(0), _is_scalar(0), _is_double(0) { int flags = yget_range(iarg, _range), ndims=0; if (flags) { _is_range=1; if (flags>=Y_MAX_DFLT) { flags-=Y_MAX_DFLT; _range[1]=res; } if (flags>=Y_MIN_DFLT) { flags-=Y_MIN_DFLT; _range[0]=1; } if (flags==Y_NULLER) { _is_nuller=1; flags=0; _nel=0; } if (flags>1) y_error("unsupported range syntax"); if (_range[0]<=0) _range[0]+=res; if (_range[1]<=0) _range[1]+=res; if (_range[0]>res || _range[1]>res) y_error("max index too large"); _nel=(_range[1]-_range[0]+_range[2])/_range[2]; return; } if (yarg_rank(iarg) > 0) { _is_list=1; _nel=1; _idx = ygeta_l(iarg, &_nel, 0); return; } if (yarg_number(iarg)==1) { _is_scalar=1; long val=ygets_l(iarg); if (val>res) y_error("max index too large"); if (val<=0) val+=res; _range[0]=_range[1]=val; _range[2]=1; _nel=1; return; } if (yarg_number(iarg)==2) { _is_scalar=1; _is_double=1; _dval=ygets_d(iarg); return; } if (iarg<0 || yarg_nil(iarg)) { _is_range=1; _range[0]=1; _range[1]=res; _range[2]=1; _nel=res; return; } y_error("unsupported range syntax"); } int YGyoto::Idx::getNDims() { if (_is_range) return 1; if (_is_list) return 1; if (_is_scalar) return 0; } Gyoto-0.1.0/yorick/gyoto_Metric.C000066400000000000000000000150141217470755400166760ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include "ygyoto_idx.h" #include "yapi.h" #include "pstdlib.h" #ifdef GYOTO_USE_XERCES #include #endif #include #include using namespace std; using namespace Gyoto; using namespace YGyoto; // Needed by the YGYOTO_WORKER_* macros YGYOTO_YUSEROBJ(Metric, Metric::Generic) YGYOTO_BASE_CONSTRUCTOR(Metric) static char ygyoto_Metric_names[YGYOTO_TYPE_LEN][YGYOTO_MAX_REGISTERED] ={{0}}; static ygyoto_Metric_eval_worker_t *ygyoto_Metric_evals[YGYOTO_MAX_REGISTERED] ={0}; static int ygyoto_Metric_count=0; extern "C" { void gyoto_Metric_eval(void *obj, int argc) { SmartPointer *OBJ_ = &((gyoto_Metric*)obj)->smptr; // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { ypush_long( (long) (*OBJ_)() ); return; } // Try calling kind-specific worker int n=0; const string kind = (*OBJ_)->getKind(); while (n*OBJ, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit) { int k=-1, iarg=-1; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; long ntot, dims[Y_DIMSIZE]; /* METHODS */ if ((iarg=kiargs[++k])>=0) { // get_tdot if (debug()) cerr << "In get_tdot" << endl; if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); double * pos=ygeta_d(iarg,&ntot,0); if (ntot!=4) y_error("POS must have 4 elements"); double * vel=ygeta_d(piargs[0],&ntot,0); if (ntot!=3) y_error("VEL must have 3 elements"); ypush_double((*OBJ)->SysPrimeToTdot(pos, vel)); } if ((iarg=kiargs[++k])>=0) { // nullifycoord if (debug()) cerr << "In nullifycoord" << endl; if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); double * pos=ygeta_d(iarg,&ntot,0); if (ntot!=4) y_error("POS must have 4 elements"); double * vel=ygeta_d(piargs[0],&ntot,0); if (ntot!=3) y_error("VEL must have 3 elements"); long dims[]= {1, 8}; double *coord = ypush_d(dims); for (int i=0; i<4; ++i) coord[i]=pos[i]; for (int i=0; i<3; ++i) coord[i+5]=vel[i]; (*OBJ)->nullifyCoord(coord); } // kind if ((iarg=kiargs[++k])>=0) { if ((*rvset)++) y_error(rmsg); if (!yarg_nil(iarg)) y_error("KIND is readonly"); char ** kind = ypush_q(0); *kind = p_strcpy((*OBJ)->getKind().c_str()); } YGYOTO_WORKER_SETPARAMETER; // ScalarProd if ((iarg=kiargs[++k])>=0) { if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); long ntot=0; long dims[Y_DIMSIZE]; double * pos = ygeta_d(iarg, &ntot, dims); if (!dims[0] || dims[1]<4) y_error("scalarprod: pos must be at least 4 elements long"); double * u1 = ygeta_d(piargs[0], &ntot, dims); if (!dims[0] || dims[1]<4) y_error("scalarprod: u1 must be at least 4 elements long"); double * u2 = ygeta_d(piargs[1], &ntot, dims); if (!dims[0] || dims[1]<4) y_error("scalarprod: u2 must be at least 4 elements long"); ypush_double((*OBJ)->ScalarProd(pos, u1, u2)); } YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Mass); // Unit length if ((iarg=kiargs[++k])>=0) { // unitLength() if ((*rvset)++) y_error(rmsg); if (!yarg_nil(iarg)) y_error("UNITLENGTH is readonly"); ypush_double((*OBJ)->unitLength(unit?unit:"")); } // circularvelocity if ((iarg=kiargs[++k])>=0) { if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); long ntot=0; long dims[Y_DIMSIZE]; double * coords = ygeta_d(iarg, &ntot, dims); if (!dims[0] || dims[1]<4) y_error("syntax: circularvelocity=array(double, 4 ...)"); long dir =1; if (piargs[0] >= 0) dir = ygets_l(piargs[0]) >= 0 ? 1 : -1; long d1 = dims[1]; long npoints=ntot/d1; dims[1]=4; double * vels = ypush_d(dims); for (long i=0; icircularVelocity(coords, vels, dir); } YGYOTO_WORKER_XMLWRITE; YGYOTO_WORKER_CLONE(Metric); if (*rvset || *paUsed || piargs[0]<0 || !yarg_number(piargs[0])) return; //else /* GET G MU NU */ if (debug()) cerr << "DEBUG: gyoto_Metric_generic_eval: getting gmunu\n"; double *x = ygeta_d(piargs[0], &ntot, NULL); if (ntot<4) y_error("X must have at least four elements"); Idx i_idx (piargs[1], 4); if (i_idx.isNuller()) return; Idx j_idx (piargs[2], 4); if (j_idx.isNuller()) return; long ni=i_idx.getNElements(); long nj=j_idx.getNElements(); long nelem=ni*nj; dims[0]=i_idx.getNDims()+j_idx.getNDims(); size_t offset=0; if (i_idx.getNDims()) dims[++offset]=ni; if (j_idx.getNDims()) dims[++offset]=nj; double * data=ypush_d(dims); size_t i, j; for ( j=j_idx.first() ; j_idx.valid() ; j=j_idx.next() ) for ( i=i_idx.first() ; i_idx.valid() ; i=i_idx.next() ) *(data++) = (*OBJ)->gmunu(x, i-1, j-1); } Gyoto-0.1.0/yorick/gyoto_Photon.C000066400000000000000000000226741217470755400167340ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "GyotoPhoton.h" #include "GyotoFactory.h" #include "GyotoDefs.h" #include "ygyoto.h" #include "yapi.h" #include "pstdlib.h" #define OBJ ph using namespace Gyoto; using namespace std; #define YGYOTO_PHOTON_GENERIC_KW "unit", "metric", "initcoord", "astrobj", \ "spectro", "tmin", "delta", "adaptive", "maxiter", "setparameter", \ "reset", "xfill", "save_txyz", "xmlwrite", "is_hit", \ "get_txyz", "get_coord", "get_cartesian", "clone" #define YGYOTO_PHOTON_GENERIC_KW_N 19 void ygyoto_Photon_generic_eval(Gyoto::SmartPointer* ph, int *kiargs, int *piargs, int *rvset, int *paUsed) { if (debug()) cerr << "\nDEBUG: In ygyoto_Photon_generic_eval: "; int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; char * unit = NULL; YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_OBJECT(Metric); /* INITCOORD */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (debug()) cerr << "initcoord="; if (yarg_nil(iarg)) { // Getting initcoord if (debug()) cerr << " get_initcoord=1" << endl; if ((*rvset)++) y_error(rmsg); long dims[]= {1, 8}; double *coord = ypush_d(dims); (*ph)->getInitialCoord(coord); } else { // Setting initcoord long ptot=1; double coord[8]; if (yarg_number(iarg)) { // initcoord=coord or initcoord=pos, vel double *pos=ygeta_d(iarg, &ptot, 0); if (ptot!=4 && ptot !=8) y_error("POS should have either 4 or 8 elements."); for (int ii=0; iigetMetric()) y_error("METRIC should have been set already"); (*ph)->getMetric()->nullifyCoord(coord); } else y_error("VEL should have 3 or 4 elements"); } } else { SmartPointer sc = NULL; if (yarg_Scenery(iarg)) { // initcoord=scenery,i,j or senery,da,dd SmartPointer *scenery = yget_Scenery(iarg); (*ph) -> setMetric((*scenery)->getMetric()); (*ph) -> setAstrobj((*scenery)->getAstrobj()); sc = (*scenery)->getScreen(); } else sc = *yget_Screen(iarg); //initcoord=screen,i,j or screen, da, dd if (yarg_number(piargs[0]+*rvset)==2) { double da = ygets_d(piargs[0]+*rvset); double dd = ygets_d(piargs[1]+*rvset); if (debug()) cerr << "screen, dalpha="<setInitCoord(coord) ; if (debug()) cerr << "]" << endl; } if (debug()) cerr << "... " << endl; } YGYOTO_WORKER_GETSET_OBJECT(Astrobj); YGYOTO_WORKER_GETSET_OBJECT(Spectrometer); YGYOTO_WORKER_GETSET_DOUBLE(Tmin); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Delta); YGYOTO_WORKER_GETSET_LONG2(adaptive); YGYOTO_WORKER_GETSET_LONG2( maxiter ); YGYOTO_WORKER_SETPARAMETER; YGYOTO_WORKER_RUN( reset() ); YGYOTO_WORKER_RUN( xFill(ygets_d(iarg)) ); // save_txyz=filename, t1, mass_sun, distance_kpc, unit, screen if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (debug()) cerr << " save_txyz="; int myarg=0; if (debug()) cerr << "save_txyz="; char* filename = ygets_q(iarg); double t1 = 0.;//ygets_d(piargs[0]+*rvset); double mass_sun = 1.;//ygets_d(piargs[1]+*rvset); double distance_kpc = 1.;//ygets_d(piargs[2]+*rvset); string unit = "geometrical";//ygets_q(piargs[3]+*rvset); SmartPointer* sc = NULL; //yget_Screen(piargs[4]+*rvset); if (yarg_number(piargs[myarg]+*rvset)) { t1= ygets_d(piargs[myarg++]+*rvset); if (yarg_number(piargs[myarg]+*rvset)) { mass_sun= ygets_d(piargs[myarg++]+*rvset); if (yarg_number(piargs[myarg]+*rvset)) { distance_kpc= ygets_d(piargs[myarg++]+*rvset); } } } if (yarg_string(piargs[myarg]+*rvset)) unit = ygets_q(piargs[myarg++]+*rvset); if (yarg_Screen(piargs[myarg]+*rvset)) sc = yget_Screen(piargs[myarg++]+*rvset); (*ph) -> save_txyz ( filename, t1, mass_sun, distance_kpc, unit, (sc?*sc:SmartPointer(NULL)) ); if (debug()) cerr << filename << endl ; } YGYOTO_WORKER_XMLWRITE; // FUNCTION-LIKE // /* IS_HIT= */ if ((iarg=kiargs[++k])>=0) { // is_hit=whatever if (debug()) cerr << " is_hit=" << endl; if ((*rvset)++) y_error(rmsg); Astrobj::Properties junk; ypush_int((*ph)->hit(&junk)); } /* GET_TXYZ */ if ((iarg=kiargs[++k])>=0) { // get_txyz= if (debug()) cerr << " get_txyz=1" << endl; if ((*rvset)++) y_error(rmsg); int nel =(*ph)->get_nelements(); long dims[] = {2, nel, 4}; double * data=ypush_d(dims); (*ph)->get_t(data); (*ph)->get_xyz(data+nel, data+2*nel, data+3*nel); } /* GET_COORD */ if ((iarg=kiargs[++k])>=0) { if (debug()) cerr << " get_coord=dates" << endl; if ((*rvset)++) y_error(rmsg); // Two cases : get_coord=1 or get_coord=dates. // We will recognize the first case if the parameter is the // integer scalar 1, any other type or value is a date // specification. int argt = 1;yarg_number(iarg); long ntot[1] = {1}; long dims[Y_DIMSIZE] = {0}; double * dates = NULL; if (!yarg_nil(iarg)) { argt = yarg_number(iarg); dates=ygeta_d(iarg, ntot, dims); } else { dates = ypush_d(dims); dates[0]=1.; } if (debug()) cerr << "DEBUG: gyoto_Photon(get_coord=array(" << (yarg_number(iarg)==1?"long":"double") << ", " << *ntot << ") (rank=" << dims[0] << ", dates[0]=" << dates[0] << ")" << endl; if (dims[0] == 0 && argt == 1 && dates[0] == 1) { if(debug()) cerr << "DEBUG: retrieving all already computed coordinates" << endl; int nel =(*ph)->get_nelements(); long ddims[] = {2, nel, 8}; double * data = ypush_d(ddims); (*ph)->getCoord(data, data+nel, data+2*nel, data+3*nel); (*ph)->get_dot(data+4*nel, data+5*nel, data+6*nel, data+7*nel); } else { if(debug()) cerr << "DEBUG: retrieving coordinates for specified date(s)"<< endl; if (dims[0] > Y_DIMSIZE-2) y_errorn("gyoto_Star(get_coord=dates): DATES must have at most %ld " "dimensions", Y_DIMSIZE-2); dims[0] += 1; dims[dims[0]] = 7; double * data = ypush_d(dims); size_t nel = *ntot; (*ph) -> getCoord(dates, nel, data, data+ nel,data+2* nel,data+3* nel, data+4* nel, data+5* nel, data+6* nel); } } if ((iarg=kiargs[++k])>=0) { // get_cartesian if (debug()) cerr << " get_cartesian=dates" << endl; if ((*rvset)++) y_error(rmsg); long ntot[1] = {1}; long dims[Y_DIMSIZE]; double* dates = ygeta_d(iarg, ntot, dims); if (dims[0] > Y_DIMSIZE-2) y_errorn("gyoto_Star(get_cartesian=dates): DATES must have at most %ld " "dimensions", Y_DIMSIZE-2); dims[0] += 1; dims[dims[0]] = 6; double * data = ypush_d(dims); size_t nel = *ntot; (*ph) -> getCartesian(dates, nel, data, data + nel, data + 2*nel, data + 3*nel, data + 4*nel, data + 5*nel); } YGYOTO_WORKER_CLONE(Photon); if (debug()) cerr << endl; } YGYOTO_YUSEROBJ(Photon, Photon) extern "C" { void gyoto_Photon_eval(void *obj, int argc) { // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { ypush_long((long)((gyoto_Photon*)obj)->smptr()); return; } SmartPointer *ph = &(((gyoto_Photon*)obj)->smptr); static char const * knames[]={ YGYOTO_PHOTON_GENERIC_KW, 0 }; static long kglobs[YGYOTO_PHOTON_GENERIC_KW_N+1]; int kiargs[YGYOTO_PHOTON_GENERIC_KW_N]; int piargs[]={-1,-1,-1,-1,-1}; // push default return value: the photon itsef *ypush_Photon() = *ph; yarg_kw_init(const_cast(knames), kglobs, kiargs); int iarg=argc, parg=0; while (iarg>=1) { iarg = yarg_kw(iarg, kglobs, kiargs); if (iarg>=1) { if (parg<5) piargs[parg++]=iarg--; else y_error("gyoto_Photon takes at most 5 positional arguments"); } } int rvset[1]={0}, paUsed[1]={0}; ygyoto_Photon_generic_eval(ph, kiargs, piargs, rvset, paUsed); } // Generic constructor/accessor void Y_gyoto_Photon(int argc) { YGYOTO_CONSTRUCTOR_INIT1(Photon, Photon, Photon); gyoto_Photon_eval(OBJ, argc); } } Gyoto-0.1.0/yorick/gyoto_Scenery.C000066400000000000000000000431011217470755400170610ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #ifdef GYOTO_USE_XERCES #include #endif #include #include #include "yapi.h" #include "pstdlib.h" #include "ygyoto.h" #include #include #include "ygyoto_idx.h" #ifdef HAVE_PTHREAD #include #endif using namespace std; using namespace Gyoto; using namespace YGyoto; typedef struct ySceneryThreadWorkerArg { #ifdef HAVE_PTHREAD pthread_mutex_t * mutex; pthread_t * parent; #endif Idx *i_idx, *j_idx; Scenery *sc; Photon * ph; Astrobj::Properties *data; double * impactcoords; size_t res; } ySceneryThreadWorkerArg ; static void * ySceneryThreadWorker (void *arg) { /* This is the real ray-tracing loop. It may be called by multiple threads in parallel, launched from ::rayTrace */ ySceneryThreadWorkerArg *larg = static_cast(arg); // Each thread needs its own Photon, clone cached Photon // it is assumed to be already initialized with spectrometer et al. Photon * ph = larg -> ph; #ifdef HAVE_PTHREAD if (larg->mutex) { GYOTO_DEBUG << "locking mutex\n"; pthread_mutex_lock(larg->mutex); GYOTO_DEBUG << "mutex locked\n"; ph = larg -> ph -> clone(); GYOTO_DEBUG << "unlocking mutex\n"; pthread_mutex_unlock(larg->mutex); GYOTO_DEBUG << "mutex unlocked\n"; } #endif // local variables to store our parameters size_t i, j; Astrobj::Properties data; double * impactcoords = NULL; size_t count=0; while (1) { /////// 1- get input and output parameters and update them for next access //// i and j are input, data and impactcoords are where to store //// output. we must get them and increase them so that another //// thread can get the next values while we integrate. #ifdef HAVE_PTHREAD // lock mutex so we can safely read and update i, j et al. if (larg->mutex) pthread_mutex_lock(larg->mutex); #endif // copy i & j i = larg->i_idx->current(); j = larg->j_idx->current(); // check whether there remains something to compute if (!larg->j_idx->valid() || (larg->j_idx->isLast() && !larg->i_idx->valid())) { // terminate, but first... #ifdef HAVE_PTHREAD // ...unlock mutex so our siblings can access i & j and terminate too if (larg->mutex) pthread_mutex_unlock(larg->mutex); #endif break; } // print some info if (larg->i_idx->isFirst() && verbose() >= GYOTO_QUIET_VERBOSITY && !impactcoords) { cout << "\rRay-tracing scenery: j = " << j << flush ; } # if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "i = " << i << ", j = " << j << endl; # endif // update i & j larg->i_idx->next(); if (!larg->i_idx->valid()) { larg->j_idx->next(); larg->i_idx->first(); } // copy output pointers and update them data = *larg->data; ++(*larg->data); if (larg->impactcoords) impactcoords=larg->impactcoords+((j-1)*larg->res+i-1)*16; #ifdef HAVE_PTHREAD // unlock mutex so our siblings can can access i, j et al. and procede if (larg->mutex) pthread_mutex_unlock(larg->mutex); #endif ////// 2- do the actual work. (*larg->sc)(i, j, &data, impactcoords, ph); ++count; } #ifdef HAVE_PTHREAD if (larg->mutex) { delete ph; pthread_mutex_lock(larg->mutex); } GYOTO_MSG << "\nThread terminating after integrating " << count << " photons"; if (larg->mutex) pthread_mutex_unlock(larg->mutex); # endif return NULL; } YGYOTO_YUSEROBJ(Scenery, Scenery) extern "C" { void Y_gyoto_Scenery(int); void gyoto_Scenery_eval(void *obj, int argc) { SmartPointer *OBJ_ = &(((gyoto_Scenery*)obj)->smptr); double * impactcoords = NULL; bool precompute = 0; static char const *knames[] = { "get_pointer", "unit", "metric", "screen", "astrobj", "delta", "tmin", "quantities", "adaptive", "maxiter=", "xmlwrite", "clone", "impactcoords", "nthreads", 0 }; YGYOTO_WORKER_INIT1(Scenery, Scenery, knames, 14) // Get pointer if (yarg_true(kiargs[++k])) { if ((*rvset)++) y_error("Only one return value possible"); ypush_long((long)((*OBJ)())); } YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_OBJECT(Metric); YGYOTO_WORKER_GETSET_OBJECT(Screen); YGYOTO_WORKER_GETSET_OBJECT(Astrobj); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Delta); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Tmin); /* QUANTITIES */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { // quantities= : Getting if ((*rvset)++) y_error("Only one return value possible"); Quantity_t quant = (*OBJ)->getRequestedQuantities(); size_t nk = (*OBJ)->getScalarQuantitiesCount(); long rquant = nk>1?1:0; long dims[2] = { rquant, nk }; ystring_t *squant = ypush_q(dims); size_t k = 0; char *tk = strtok(const_cast((*OBJ)->getRequestedQuantitiesString().c_str()), " \n\t"); while (tk!=NULL) { if (k>=nk) y_error("BUG: too many tokens in quantity list"); squant[k++] = p_strcpy(tk); tk = strtok(NULL, " \n\t"); } }else { // quantities=["Q1", "Q2"...]: Setting long k, nk; ystring_t * squant = ygeta_q(iarg, &nk, NULL); string quants = squant[0]; for (k=1; k setRequestedQuantities(quants); } } YGYOTO_WORKER_GETSET_LONG2( adaptive ); YGYOTO_WORKER_GETSET_LONG2( maxiter ); YGYOTO_WORKER_XMLWRITE; YGYOTO_WORKER_CLONE(Scenery); /* IMPACTCOORDS */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { // impactcoords= : Getting precompute = 1; } else { // impaccoords=double(16,res,res): Setting long ntot; long dims[Y_DIMSIZE]; size_t res=(*OBJ)->getScreen()->getResolution(); impactcoords = ygeta_d(iarg, &ntot, dims); if (dims[0] != 3 || dims[1] != 16 || dims[2] != res || dims[3] != res) y_error("dimsof(impactcoords) != [3,16,res,res]"); } } YGYOTO_WORKER_GETSET_LONG(NThreads); // Get ray-traced image if there is a supplementary positional argument if ( !*rvset && // has a return value already been set? (((argc>0 && argc<=3 && piargs[argc-1]>=0) || (piargs[1]>=0)) // positional argument? || precompute || impactcoords) ) { size_t res=(*OBJ)->getScreen()->getResolution(); if ((*rvset)++) y_error("Only one return value possible"); if ((*paUsed)++) y_error("Only one keyword may use positional arguments"); GYOTO_DEBUG << "rank: " << yarg_rank(piargs[0]) << endl; SmartPointer spr = (*OBJ)->getScreen()->getSpectrometer(); size_t nbnuobs = spr()? spr->getNSamples() : 0; Idx i_idx (piargs[0], res); if (i_idx.isNuller()) return; Idx j_idx (piargs[1], res); if (j_idx.isNuller()) return; long ni=i_idx.getNElements(); long nj=j_idx.getNElements(); long nelem=ni*nj; long nk = 0; int rquant = 0; ystring_t * squant = NULL; if (piargs[2] < 0 || yarg_nil(piargs[2])) { Quantity_t quant = (*OBJ)->getRequestedQuantities(); nk = (*OBJ)->getScalarQuantitiesCount(); if (quant & GYOTO_QUANTITY_SPECTRUM) nk += 1; if (quant & GYOTO_QUANTITY_BINSPECTRUM) nk += 1; rquant = nk>1?1:0; long dims[2] = { 1, nk }; squant = ypush_q(dims); size_t k = 0; char *tk = strtok(const_cast((*OBJ)->getRequestedQuantitiesString().c_str()), " \n\t"); while (tk!=NULL) { if (k>=nk) y_error("BUG: too many tokens in quantity list"); squant[k++] = p_strcpy(tk); tk = strtok(NULL, " \n\t"); } } else { GYOTO_DEBUG << "quantities provided online"<=1)||has_sp||has_bsp))); GYOTO_DEBUG << "i_idx.getNDims()=" << i_idx.getNDims() << ", j_idx.getNDims()" << j_idx.getNDims() << ", precompute ? 1 : (((rquant>=1)||has_sp||has_bsp))" << (precompute ? 1 : (((rquant>=1)||has_sp||has_bsp))) <=1)||has_sp||has_bsp) ) dims[++offset]=nk; GYOTO_DEBUG << "precompute=" << precompute << ", nk=" << nk << ", nbnuobs="< screen = (*OBJ) -> getScreen(); # ifdef HAVE_UDUNITS if (data) (*OBJ)->setPropertyConverters(&prop); screen->mapPixUnit(); if (intu != "") prop.setIntensityConverter(intu); if (spu != "") prop.setSpectrumConverter(spu); if (bspu != "") prop.setBinSpectrumConverter(bspu); screen->unmapPixUnit(); # endif size_t i, j; if (precompute) prop.impactcoords=data; else { for ( k=0; kgetMetric(), (*OBJ)->getAstrobj(), screen, i_idx.getDVal(), j_idx.getDVal()); ph.adaptive((*OBJ)->adaptive()); ph.hit(&prop); } else { screen -> computeBaseVectors(); double coord[8]; screen -> getRayCoord(size_t(i_idx.first()), size_t(j_idx.first()), coord); Photon ph((*OBJ)->getMetric(), (*OBJ)->getAstrobj(), coord); ph.setSpectrometer(screen->getSpectrometer()); ph.setFreqObs(screen->getFreqObs()); ph.adaptive((*OBJ)->adaptive()); ySceneryThreadWorkerArg larg; larg.sc=(*OBJ); larg.ph=&ph; larg.data=∝ larg.impactcoords=impactcoords; larg.i_idx=&i_idx; larg.j_idx=&j_idx; larg.res=res; # ifdef HAVE_PTHREAD larg.mutex = NULL; pthread_mutex_t mumu = PTHREAD_MUTEX_INITIALIZER; pthread_t * threads = NULL; pthread_t pself = pthread_self(); larg.parent = &pself; size_t nthreads = (*OBJ) -> getNThreads(); if (nthreads >= 2) { threads = new pthread_t[nthreads-1]; larg.mutex = &mumu; for (size_t th=0; th < nthreads-1; ++th) { if (pthread_create(threads+th, NULL, ySceneryThreadWorker, static_cast(&larg)) < 0) y_error("Error creating thread"); } } # endif // Call worker on the parent thread (*ySceneryThreadWorker)(static_cast(&larg)); # ifdef HAVE_PTHREAD // Wait for the child threads if (nthreads>=2) for (size_t th=0; th < nthreads-1; ++th) pthread_join(threads[th], NULL); # endif if (impactcoords==NULL) GYOTO_MSG << endl; } } } // Constructor void Y_gyoto_Scenery(int argc) { YGYOTO_CONSTRUCTOR_INIT1(Scenery, Scenery, Scenery); gyoto_Scenery_eval(OBJ, argc); } void Y_gyoto_Scenery_rayTrace(int argc) { size_t imin=1, imax=-1, jmin=1, jmax=-1; if (argc<1) y_error("gyoto_Scenery_rayTrace takes at least 1 argument"); gyoto_Scenery * s_obj=(gyoto_Scenery*)yget_obj(argc-1, &gyoto_Scenery_obj); Scenery * scenery = s_obj->smptr; if (argc>=2 && !yarg_nil(argc-2)) imin=ygets_l(argc-2); if (argc>=3 && !yarg_nil(argc-3)) imax=ygets_l(argc-3); if (argc>=4 && !yarg_nil(argc-4)) jmin=ygets_l(argc-4); if (argc>=5 && !yarg_nil(argc-5)) jmax=ygets_l(argc-5); size_t res; try {res=scenery->getScreen()->getResolution();} YGYOTO_STD_CATCH; double * impactcoords = NULL; int ipctout = 0; if (argc>=6) { int iarg = argc-6; long ref = yget_ref(iarg); long dims[Y_DIMSIZE] = {3, 16, res, res}; if (ref >= 0 && yarg_nil(iarg)) { impactcoords = ypush_d(dims); yput_global(ref, 0); ipctout = 1; } else { long ntot = 0; impactcoords = ygeta_d(iarg, &ntot, dims); if (dims[0]!=3 || dims[1]!=16 || dims[2]!=res || dims[3]!=res) y_error("Wrong dims for impactcoords"); } } size_t nbnuobs=0, nbdata; Quantity_t quantities; try { quantities = scenery -> getRequestedQuantities(); if (quantities & (GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_BINSPECTRUM)) { SmartPointer spr=scenery->getScreen()->getSpectrometer(); if (!spr) throwError("Spectral quantity requested but " "no spectrometer specified!"); nbnuobs = spr -> getNSamples(); } nbdata= scenery->getScalarQuantitiesCount(); } YGYOTO_STD_CATCH; long dims[4]={(nbdata+nbnuobs) > 1 ? 3 : 2, res, res, nbdata+nbnuobs}; double * vect=ypush_d(dims); Astrobj::Properties data; size_t curquant=0; size_t offset=res*res; if (ipctout) data.impactcoords = impactcoords; if (quantities & GYOTO_QUANTITY_INTENSITY) data.intensity=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_EMISSIONTIME) data.time=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_MIN_DISTANCE) data.distance=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_FIRST_DMIN) data.first_dmin=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_REDSHIFT) data.redshift=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_USER1) data.user1=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_USER2) data.user2=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_USER3) data.user3=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_USER4) data.user4=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_USER5) data.user5=vect+offset*(curquant++); if (quantities & GYOTO_QUANTITY_SPECTRUM) { data.spectrum=vect+offset*(curquant++); data.offset=offset; } if (quantities & GYOTO_QUANTITY_BINSPECTRUM) { data.binspectrum=vect+offset*(curquant++); data.offset=offset; } data.intensity=vect; try {scenery -> rayTrace(imin, imax, jmin, jmax, &data, ipctout?NULL:impactcoords);} YGYOTO_STD_CATCH; } } Gyoto-0.1.0/yorick/gyoto_Screen.C000066400000000000000000000067071217470755400167030ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include #include #ifdef GYOTO_USE_XERCES #include #endif #include using namespace std; using namespace Gyoto; YGYOTO_YUSEROBJ(Screen, Screen) extern "C" { void gyoto_Screen_eval(void *obj, int argc) { SmartPointer *OBJ_ = &((gyoto_Screen*)obj)->smptr; static char const * knames[]={ "unit", "metric", "time","fov","resolution", "distance", "dmax", "inclination", "paln", "argument", "freqobs", "projection", "observerpos", "fourvel", "screen1", "screen2", "screen3", "spectro", "skycoord", "raycoord", "xmlwrite", "clone", 0 }; YGYOTO_WORKER_INIT1(Screen, Screen, knames, 22) YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_OBJECT(Metric); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Time); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(FieldOfView); YGYOTO_WORKER_GETSET_LONG(Resolution); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Distance); YGYOTO_WORKER_GETSET_DOUBLE(Dmax); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Inclination); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(PALN); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Argument); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(FreqObs); /* PROJECTION */ if ((iarg=kiargs[++k])>=0) { // Set Projection iarg+=*rvset; long ntot; double *proj=ygeta_d(iarg, &ntot, NULL); switch (ntot) { case 4: (*OBJ)->setProjection(proj[0], proj[1], proj[2], proj[3]); break; case 3: (*OBJ)->setProjection(proj[0], proj[1], proj[2]); break; } } YGYOTO_WORKER_GETSET4(ObserverPos); YGYOTO_WORKER_GETSET4(FourVel); YGYOTO_WORKER_GETSET4(Screen1); YGYOTO_WORKER_GETSET4(Screen2); YGYOTO_WORKER_GETSET4(Screen3); YGYOTO_WORKER_GETSET_OBJECT(Spectrometer); ///// METHODS ////// /* SKYCOORD METHOD */ if ((iarg=kiargs[++k])>=0) { // skycoord if ((*rvset)++) y_error(rmsg); long ntot=1; double *pos=ygeta_d(iarg, &ntot, NULL); if (ntot<4) y_error("POS argument should have at lest 4 elements"); long dims[] = {1, 3}; double * skypos=ypush_d(dims); (*OBJ)->coordToXYZ(pos, skypos); } /* RAYCOORD METHOD */ if ((iarg=kiargs[++k])>=0) { // raycoord if ((*rvset)++) y_error(rmsg); long ntot=1; double *pos=ygeta_d(iarg, &ntot, NULL); if (ntot<2) y_error("X_Y argument should have at lest 4 elements"); long dims[] = {1,8}; yarg_drop(1); double * coord=ypush_d(dims); (*OBJ)->getRayCoord(pos[0], pos[1], coord); } YGYOTO_WORKER_XMLWRITE; YGYOTO_WORKER_CLONE(Screen); } } extern "C" { void Y_gyoto_Screen(int argc) { YGYOTO_CONSTRUCTOR_INIT1(Screen, Screen, Screen); gyoto_Screen_eval(OBJ, argc); } } Gyoto-0.1.0/yorick/gyoto_SpectroComplex.C000066400000000000000000000047471217470755400204350ustar00rootroot00000000000000/* Copyright 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include "ygyoto.h" #include "yapi.h" #include using namespace std; using namespace Gyoto; using namespace Gyoto::Spectrometer; namespace YGyoto { ygyoto_Spectrometer_eval_worker_t SpCplxEval; } // on_eval worker void YGyoto::SpCplxEval(SmartPointer *OBJ_, int argc) { static char const * knames[]={ "unit", "append", "remove", "cardinal", \ YGYOTO_SPECTROMETER_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Spectrometer, Complex, knames, YGYOTO_SPECTROMETER_GENERIC_KW_N+4); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_RUN( append(*yget_Spectrometer(iarg)) ); YGYOTO_WORKER_RUN( remove(ygets_l(iarg)) ); /* cardinal */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if ((*rvset)++) y_error(rmsg); GYOTO_DEBUG << "get cardinal" << endl; ypush_long((*OBJ)->getCardinal()); } YGYOTO_WORKER_CALL_GENERIC(Spectrometer); if (!(*paUsed) && (iarg=piargs[0])>=0 && !yarg_nil(iarg)) { iarg+=*rvset; if ((*rvset)++) y_error(rmsg); ++(*paUsed); size_t cardinal=(*OBJ) -> getCardinal(); long item = ygets_l(iarg); if (item > cardinal) y_error("index overreach array bounds"); if (item <= 0) { item += cardinal; if (item <= 0) y_error("index overreach array bounds"); } *ypush_Spectrometer() = (*(*OBJ))[item-1]; } GYOTO_DEBUG << "done\n"; } extern "C" { void Y__gyoto_SpCplx_register_as_Spectrometer(int argc){ ygyoto_Spectrometer_register(Complex::Kind,&YGyoto::SpCplxEval); } void Y_gyoto_SpectroComplex(int argc) { YGYOTO_CONSTRUCTOR_INIT(Spectrometer, Complex); if ((*OBJ)->getKind() != Complex::Kind) y_error("Expecting Spectrometer of kind Complex"); YGyoto::SpCplxEval(OBJ, argc); } } Gyoto-0.1.0/yorick/gyoto_SpectroUniform.C000066400000000000000000000113571217470755400204400ustar00rootroot00000000000000/* Copyright 2011-2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include "ygyoto.h" #include "GyotoUniformSpectrometer.h" #include "yapi.h" #include "pstdlib.h" #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #endif using namespace std; using namespace Gyoto; using namespace Gyoto::Spectrometer; #define OBJ sp namespace YGyoto { void SpectroUniformYEval(SmartPointer*sp, int argc); } using namespace YGyoto; void YGyoto::SpectroUniformYEval(Gyoto::SmartPointer*sp_, int argc) { static char const * knames[]={ "unit", "kind", "nsamples", "band", "setparameter", "xmlwrite", "clone", "channels", "midpoints", "widths", 0 }; YGYOTO_WORKER_INIT(Spectrometer, Uniform, knames, 10); YGYOTO_WORKER_SET_UNIT; /* SPECTRO_KIND */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { // get spectro kind if ((*rvset)++) y_error(rmsg); *ypush_q(0) = p_strcpy((*sp) -> getKind() ); } else { // set spectro kind (*sp) -> setKind(std::string(ygets_q(iarg))); } } YGYOTO_WORKER_GETSET_LONG(NSamples); /* BAND */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; double * boundaries = NULL; if (yarg_nil(iarg)) { // get spectro band if ((*rvset)++) y_error(rmsg); long dims[Y_DIMSIZE] = {1, 2}; boundaries=ypush_d(dims); boundaries[0] = (*sp) -> getBand()[0]; boundaries[1] = (*sp) -> getBand()[1]; } else { // set spectro band long ntot; boundaries = ygeta_d(iarg, &ntot, NULL); if (ntot != 2) y_error("BAND must have 2 elements"); (*sp) -> setBand(boundaries, unit?unit:""); } } YGYOTO_WORKER_SETPARAMETER; #undef OBJ #define OBJ sp_ YGYOTO_WORKER_XMLWRITE; #undef OBJ #define OBJ sp YGYOTO_WORKER_CLONE(Spectrometer); /* GET SPECTRO CHANNELS */ if ((iarg=kiargs[++k])>=0) { if (!yarg_nil(iarg)) y_error("CHANNELS is readonly"); if ((*rvset)++) y_error(rmsg); size_t nsamples = (*sp) -> getNSamples(); if (nsamples) { long dims[] = {2, 2, nsamples}; double converted[(*sp)->getNBoundaries()]; (*sp) -> getChannelBoundaries(converted, unit?unit:""); GYOTO_DEBUG_ARRAY(converted, (*sp)->getNBoundaries()); size_t const * const chanind = (*sp) -> getChannelIndices(); GYOTO_DEBUG_ARRAY(chanind, 2*nsamples); double * ychannels = ypush_d(dims); for (size_t i=0; i<2*nsamples; ++i) { ychannels[i] = converted[chanind[i]]; GYOTO_DEBUG << "ychannels["<< i << "]=" << ychannels[i] << endl; } } else ypush_nil(); } /* GET SPECTRO MIDPOINTS */ if ((iarg=kiargs[++k])>=0) { if (!yarg_nil(iarg)) y_error("MIDPOINTS is readonly"); if ((*rvset)++) y_error(rmsg); size_t nsamples = (*sp) -> getNSamples(); if (nsamples) { long dims[] = {1, nsamples}; double * ychannels = ypush_d(dims); (*sp)->getMidpoints(ychannels, unit?unit:""); } else ypush_nil(); } /* GET SPECTRO WIDTHS */ if ((iarg=kiargs[++k])>=0) { if (!yarg_nil(iarg)) y_error("WIDTHS is readonly"); if ((*rvset)++) y_error(rmsg); size_t nsamples = (*sp) -> getNSamples(); if (nsamples) { long dims[] = {1, nsamples}; double * ywidths = ypush_d(dims); (*sp)->getWidths(ywidths, unit?unit:""); } else ypush_nil(); } } extern "C" { void Y__gyoto_SpectroUniform_register_as_Spectro(int argc){ ygyoto_Spectrometer_register(Uniform::WaveKind, &YGyoto::SpectroUniformYEval); ygyoto_Spectrometer_register(Uniform::WaveLogKind, &YGyoto::SpectroUniformYEval); ygyoto_Spectrometer_register(Uniform::FreqKind, &YGyoto::SpectroUniformYEval); ygyoto_Spectrometer_register(Uniform::FreqLogKind, &YGyoto::SpectroUniformYEval); } void Y_gyoto_SpectroUniform(int argc) { YGYOTO_CONSTRUCTOR_INIT(Spectrometer, Uniform); kind_t kind=(*sp)->getKind(); if (kind != Uniform::WaveKind && kind != Uniform::WaveLogKind && kind != Uniform::FreqKind && kind != Uniform::FreqLogKind) y_error("Expecting Spectrometer of kind Uniform"); YGyoto::SpectroUniformYEval(OBJ, argc); } } Gyoto-0.1.0/yorick/gyoto_Spectrometer.C000066400000000000000000000121541217470755400201310ustar00rootroot00000000000000/* Copyright 2011-2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include "ygyoto.h" #include "yapi.h" #include "pstdlib.h" #ifdef GYOTO_USE_XERCES #include "GyotoFactory.h" #endif using namespace std; using namespace Gyoto; using namespace Gyoto::Spectrometer; static char const * ygyoto_Spectrometer_names[YGYOTO_MAX_REGISTERED] ={0}; static ygyoto_Spectrometer_eval_worker_t *ygyoto_Spectrometer_evals[YGYOTO_MAX_REGISTERED] ={0}; static int ygyoto_Spectrometer_count=0; YGYOTO_YUSEROBJ(Spectrometer, Spectrometer::Generic) YGYOTO_BASE_CONSTRUCTOR(Spectrometer) extern "C" { void gyoto_Spectrometer_eval(void *obj, int argc) { SmartPointer *OBJ_ = &(((gyoto_Spectrometer*)obj)->smptr); // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { ypush_long( (long) (*OBJ_)() ); return; } // Try calling kind-specific worker int n=0; char const * const kind = (*OBJ_)->getKind(); while (n*OBJ, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit) { int k=-1, iarg=-1; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; long ntot, dims[Y_DIMSIZE]; /* METHODS */ // kind if ((iarg=kiargs[++k])>=0) { if ((*rvset)++) y_error(rmsg); if (!yarg_nil(iarg)) y_error("KIND is readonly"); char ** kind = ypush_q(0); *kind = p_strcpy((*OBJ)->getKind()); } // Process SET keywords // Save to file YGYOTO_WORKER_XMLWRITE; /* CLONE */ YGYOTO_WORKER_CLONE(Spectrometer); // get members // /* NSAMPLES */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) ypush_long((*OBJ)->getNSamples()); else y_error("NSAMPLES is readonly"); } /* SETPARAMETER */ YGYOTO_WORKER_SETPARAMETER; /* GET SPECTRO CHANNELS */ if ((iarg=kiargs[++k])>=0) { if (!yarg_nil(iarg)) y_error("CHANNELS is readonly"); if ((*rvset)++) y_error(rmsg); size_t nsamples = (*OBJ) -> getNSamples(); if (nsamples) { long dims[] = {2, 2, nsamples}; double converted[(*OBJ)->getNBoundaries()]; (*OBJ) -> getChannelBoundaries(converted, unit?unit:""); GYOTO_DEBUG_ARRAY(converted, (*OBJ)->getNBoundaries()); size_t const * const chanind = (*OBJ) -> getChannelIndices(); GYOTO_DEBUG_ARRAY(chanind, 2*nsamples); double * ychannels = ypush_d(dims); for (size_t i=0; i<2*nsamples; ++i) { ychannels[i] = converted[chanind[i]]; GYOTO_DEBUG << "ychannels["<< i << "]=" << ychannels[i] << endl; } } else ypush_nil(); } /* GET SPECTRO MIDPOINTS */ if ((iarg=kiargs[++k])>=0) { if (!yarg_nil(iarg)) y_error("MIDPOINTS is readonly"); if ((*rvset)++) y_error(rmsg); size_t nsamples = (*OBJ) -> getNSamples(); if (nsamples) { long dims[] = {1, nsamples}; double * ychannels = ypush_d(dims); (*OBJ)->getMidpoints(ychannels, unit?unit:""); } else ypush_nil(); } /* GET SPECTRO WIDTHS */ if ((iarg=kiargs[++k])>=0) { if (!yarg_nil(iarg)) y_error("WIDTHS is readonly"); if ((*rvset)++) y_error(rmsg); size_t nsamples = (*OBJ) -> getNSamples(); if (nsamples) { long dims[] = {1, nsamples}; double * ywidths = ypush_d(dims); (*OBJ)->getWidths(ywidths, unit?unit:""); } else ypush_nil(); } } Gyoto-0.1.0/yorick/gyoto_Spectrum.C000066400000000000000000000104401217470755400172530ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include "yapi.h" #include "pstdlib.h" #ifdef GYOTO_USE_XERCES #include #endif #include using namespace std; using namespace Gyoto; using namespace Gyoto::Spectrum; static char ygyoto_Spectrum_names[YGYOTO_TYPE_LEN][YGYOTO_MAX_REGISTERED] ={{0}}; static ygyoto_Spectrum_eval_worker_t *ygyoto_Spectrum_evals[YGYOTO_MAX_REGISTERED] ={0}; static int ygyoto_Spectrum_count=0; YGYOTO_YUSEROBJ(Spectrum, Spectrum::Generic) YGYOTO_BASE_CONSTRUCTOR(Spectrum) extern "C" { void gyoto_Spectrum_eval(void *obj, int argc) { // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { ypush_long((long)((gyoto_Spectrum*)obj)->smptr()); return; } // Try calling kind-specific worker int n=0; SmartPointer * OBJ_ = &(((gyoto_Spectrum*)obj)->smptr); const string kind = (*OBJ_)->getKind(); while (n*OBJ, int *kiargs, int *piargs, int *rvset, int *paUsed, char* unit) { int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; if (debug()) for (int i=0; i=2 elements"); --dims[1]; --ntot; double * Inu1nu2 = ypush_d(dims); for (long i=0; i < ntot; ++i) Inu1nu2[i] = (*OBJ)->integrate(freqs[i], freqs[i+1]); } // GET SPECTRUM VALUE FOR WAVELENGTHS if (*rvset || *paUsed || (iarg=piargs[0]) < 0 || !yarg_number(iarg)) return; if (debug()) cerr<<"DEBUG: gyoto_Spectrum_generic_eval evaluating Spectrum " "at frequency\n"; long ntot, dims[Y_DIMSIZE]; double * freqs = ygeta_d(iarg, &ntot, dims); double * Inu = ypush_d(dims); for (long i=0; i < ntot; ++i) Inu[i] = (**OBJ)(freqs[i]); if (debug()) cerr << "DEBUG: out of Spectrum_generic_eval"<< endl; } Gyoto-0.1.0/yorick/gyoto_ThinDisk.C000066400000000000000000000102431217470755400171670ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include "ygyoto.h" #include "yapi.h" using namespace Gyoto; using namespace Gyoto::Astrobj; #include using namespace std; // on_eval worker void ygyoto_ThinDisk_eval(Gyoto::SmartPointer* ao_, int argc) { int rvset[1]={0}, paUsed[1]={0}; if (!ao_) { // Constructor mode ao_ = ypush_Astrobj(); *ao_ = new ThinDisk(); } else *ypush_Astrobj()=*ao_; static char const * knames[]={ "unit", YGYOTO_THINDISK_GENERIC_KW, 0 }; static long kglobs[YGYOTO_THINDISK_GENERIC_KW_N+6]; int kiargs[YGYOTO_THINDISK_GENERIC_KW_N+5]; int piargs[]={-1,-1,-1,-1}; yarg_kw_init(const_cast(knames), kglobs, kiargs); int iarg=argc, parg=0; while (iarg>=1) { iarg = yarg_kw(iarg, kglobs, kiargs); if (iarg>=1) { if (parg<4) piargs[parg++]=iarg--; else y_error("gyoto_Astrobj takes at most 4 positional arguments"); } } int k=-1; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; char * unit = NULL; /* UNIT */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; GYOTO_DEBUG << "get unit" << endl; unit = ygets_q(iarg); } // Call generic ThinDisk worker ygyoto_ThinDisk_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed, unit); } void ygyoto_ThinDisk_generic_eval(Gyoto::SmartPointer*ao_, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit) { SmartPointer *ao = (SmartPointer *)ao_; int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; if (debug()) for (int i=0; isetInnerRadius(ygets_d(iarg), unit?unit:"") ; } /* OUTERRADIUS */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); ypush_double((*ao)->getOuterRadius(unit?unit:"")); } else (*ao)->setOuterRadius(ygets_d(iarg), unit?unit:"") ; } /* THICKNESS */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); ypush_double((*ao)->getThickness(unit?unit:"")); } else (*ao)->setThickness(ygets_d(iarg), unit?unit:"") ; } /* DIR */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); ypush_long((*ao)->getDir()); } else (*ao)->setDir(ygets_l(iarg)) ; } GYOTO_DEBUG << "calling ygyoto_Astrobj_generic_eval\n"; ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed, unit); if (debug()) cerr << "DEBUG: out of ThinDisk_generic_eval"<< endl; } extern "C" { void Y__gyoto_ThinDisk_register_as_Astrobj(){ ygyoto_Astrobj_register("ThinDisk",&ygyoto_ThinDisk_eval); } // Generic constructor/accessor void Y_gyoto_ThinDisk(int argc) { SmartPointer *ao = NULL; if (yarg_Astrobj(argc-1)) { ao = yget_Astrobj(--argc); if ((*ao)->getKind().compare("ThinDisk")) y_error("Expecting Astrobj of kind Star"); } ygyoto_ThinDisk_eval(ao, argc); } } Gyoto-0.1.0/yorick/gyoto_constants.i000066400000000000000000000017661217470755400175460ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ extern GYOTO_C, GYOTO_G, GYOTO_G_OVER_C_SQUARE, GYOTO_SUN_MASS, GYOTO_SUN_RADIUS, GYOTO_KPC; GYOTO_C = 299792458. GYOTO_G = 6.67428e-11 GYOTO_G_OVER_C_SQUARE = 7.426138e-28 GYOTO_SUN_MASS = 1.98843e30 GYOTO_SUN_RADIUS = 6.955e8 GYOTO_KPC = 3.08568025e19 Gyoto-0.1.0/yorick/gyoto_namespace.i000066400000000000000000000031711217470755400174560ustar00rootroot00000000000000gyoto=save( haveXerces=gyoto_haveXerces, loadPlugin=gyoto_loadPlugin, Scenery=gyoto_Scenery, Scenery_rayTrace=gyoto_Scenery_rayTrace, Photon=gyoto_Photon, Metric=gyoto_Metric, Astrobj=gyoto_Astrobj, ThinDisk=gyoto_ThinDisk, Screen=gyoto_Screen, Spectrum=gyoto_Spectrum, debug=gyoto_debug, verbose=gyoto_verbose, Spectrometer=gyoto_Spectrometer, SpectroUniform=gyoto_SpectroUniform, SpectroComplex=gyoto_SpectroComplex, dontcatchSIGFPE=gyoto_dontcatchSIGFPE, dontcatchSIGSEGV=gyoto_dontcatchSIGSEGV, listRegister=gyoto_listRegister, is_Photon=is_gyoto_Photon, is_Astrobj=is_gyoto_Astrobj, is_Metric=is_gyoto_Metric, is_Spectrometer=is_gyoto_Spectrometer, is_Spectrum=is_gyoto_Spectrum, is_Screen=is_gyoto_Screen, is_Scenery=is_gyoto_Scenery, C=GYOTO_C, G=GYOTO_G, G_OVER_C_SQUARE=GYOTO_G_OVER_C_SQUARE, SUN_MASS=GYOTO_SUN_MASS, SUN_RADIUS=GYOTO_SUN_RADIUS, KPC=GYOTO_KPC ); func gyoto_namespace(args) { /* DOCUMENT gyoto_namespace, shortname=longname; If this version of yorick supports oxy object, the same as: save, gyoto, shortname=longname else, noop. SEE ALSO: oxy, save, restore */ extern gyoto; keynames=args(-); for (i=1; i<=numberof(keynames); ++i) { save, gyoto, keynames(i), args(keynames(i)) ; } } wrap_args, gyoto_namespace; Gyoto-0.1.0/yorick/gyoto_utils.C000066400000000000000000000123001217470755400166060ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include #include #include #include #include "ygyoto.h" using namespace std; static YGyotoSupplier_t *YGyotoGlobalSupplier = NULL; void ygyotoErrorHandler (const Gyoto::Error e) { y_error(e); } extern "C" { void Y_gyoto_dontcatchSIGFPE(int argc) { signal(SIGFPE, SIG_DFL); } void Y_gyoto_dontcatchSIGSEGV(int argc) { signal(SIGSEGV, SIG_DFL); } void Y_gyoto_debug(int argc) { ypush_long(Gyoto::debug()); if (argc && !yarg_nil(argc)) Gyoto::debug(ygets_l(1)); } void Y_gyoto_verbose(int argc) { ypush_long(Gyoto::verbose()); if (argc && !yarg_nil(argc)) Gyoto::verbose(ygets_l(1)); } void Y_gyoto_loadPlugin(int argc) { // Step 1: determine whether nofail is set (to true) int nofail=0; static char const * knames[2] = { "nofail", 0 }; static long kglobs[2]; int kiargs[1]; yarg_kw_init(const_cast(knames), kglobs, kiargs); int iarg=argc-1; while (iarg>=0) { iarg = yarg_kw(iarg, kglobs, kiargs); iarg--; } if (kiargs[0]>=0) {// nofail= present nofail=yarg_true(kiargs[0]); } // Step 2: load plug-ins long ntot=0; long dims[Y_DIMSIZE]; ystring_t * plugins = 0; for (int iarg=argc-1; iarg>=0; iarg--) { if (kiargs[0]<0 ||(iarg!=kiargs[0] && iarg!=kiargs[0]+1)) { plugins = ygeta_q(iarg, &ntot, dims); for (long i=0; i yget_Metric = &yget_Metric; YGyotoGlobalSupplier -> ypush_Metric = &ypush_Metric; YGyotoGlobalSupplier -> yarg_Metric = &yarg_Metric; YGyotoGlobalSupplier -> ygyoto_Metric_register = &ygyoto_Metric_register; YGyotoGlobalSupplier -> ygyoto_Metric_generic_eval = &ygyoto_Metric_generic_eval; // Plug Astrobj ABI YGyotoGlobalSupplier -> yget_Astrobj = &yget_Astrobj; YGyotoGlobalSupplier -> ypush_Astrobj = &ypush_Astrobj; YGyotoGlobalSupplier -> yarg_Astrobj = &yarg_Astrobj; YGyotoGlobalSupplier -> ygyoto_Astrobj_register = &ygyoto_Astrobj_register; YGyotoGlobalSupplier -> ygyoto_Astrobj_generic_eval = &ygyoto_Astrobj_generic_eval; YGyotoGlobalSupplier -> ygyoto_ThinDisk_generic_eval = &ygyoto_ThinDisk_generic_eval; // Plug Spectrum ABI YGyotoGlobalSupplier -> yget_Spectrum = &yget_Spectrum; YGyotoGlobalSupplier -> ypush_Spectrum = &ypush_Spectrum; YGyotoGlobalSupplier -> yarg_Spectrum = &yarg_Spectrum; YGyotoGlobalSupplier -> ygyoto_Spectrum_register = &ygyoto_Spectrum_register; YGyotoGlobalSupplier -> ygyoto_Spectrum_generic_eval = &ygyoto_Spectrum_generic_eval; // Plug Screen ABI YGyotoGlobalSupplier -> yget_Screen = &yget_Screen; YGyotoGlobalSupplier -> ypush_Screen = &ypush_Screen; YGyotoGlobalSupplier -> yarg_Screen = &yarg_Screen; // Plug Scenery ABI YGyotoGlobalSupplier -> yget_Scenery = &yget_Scenery; YGyotoGlobalSupplier -> ypush_Scenery = &ypush_Scenery; YGyotoGlobalSupplier -> yarg_Scenery = &yarg_Scenery; // Plug Spectrometer ABI YGyotoGlobalSupplier -> yget_Spectrometer = &yget_Spectrometer; YGyotoGlobalSupplier -> ypush_Spectrometer = &ypush_Spectrometer; YGyotoGlobalSupplier -> yarg_Spectrometer = &yarg_Spectrometer; YGyotoGlobalSupplier -> ygyoto_Spectrometer_register = &ygyoto_Spectrometer_register; YGyotoGlobalSupplier -> ygyoto_Spectrometer_generic_eval = &ygyoto_Spectrometer_generic_eval; } ypush_long(long(YGyotoGlobalSupplier)); } void Y___gyoto_setErrorHandler(int argc) { Gyoto::Error::setHandler(&ygyotoErrorHandler); } } Gyoto-0.1.0/yorick/gyotoy000077500000000000000000000000601217470755400154010ustar00rootroot00000000000000#!/bin/sh set -e yorick -i gyotoy.i $@ exit 0 Gyoto-0.1.0/yorick/gyotoy.1000066400000000000000000000033121217470755400155400ustar00rootroot00000000000000.\" Process this file with .\" groff -man -Tascii foo.1 .\" .TH GYOTOY 1 "AUGUST 2011" Science "User Manuals" .SH NAME Gyotoy \- visualize one geodesic in Kerr metric .SH SYNOPSIS gyotoy [\fIinput.xml\fR] .SH DESCRIPTION Gyoto is a framework for computing geodesics in curved space-times. The \fBgyotoy\fR utility program uses this framework to compute and display a single geodesic (the trajectory of a massive or mass-less particle) in Kerr metric. \fBgyotoy\fR takes as optional argument a scenery description in XML format (\fIinput.xml\fR). This scenery must contain a Astrobj section of kind Star. Alternatively, a default scenery is loaded. The user can then interactively select initial parameters and redraw the geodesic as many time as needed. the Projection parameters allow rotating the view and various menu entries are rather self-explanatory. Entries in the File menu allow saving the display as an image file, saving the parameters as an XML description, or saving the geodesic's coordinates in an ASCII file. \fBgyotoy\fR is only a small utility to visualise a single geodesic. It can also be invoked from the \fByorick\fR(1) prompt for building more complex graphics and for scripting. Have a look at the gyoto.i and gyotoy.i files in \fByorick\fR's Y_SITE directory. A companion program, \fBgyoto\fR(1), can be used to compute an entire Gyoto scenery using relativistic ray-tracing. .SH ENVIRONMENT .IP GYOTO_PLUGINS The "Star" object in Gyoto is part of the standard plug-in. If the GYOTO_PLUGINS environment variable is set, it must contain at least "stdplug" for \fBgyotoy\fR to run properly. .SH AUTHOR Thibaut Paumard wrote this manual. .SH "SEE ALSO" .BR gyoto (1), .BR yorick (1) Gyoto-0.1.0/yorick/gyotoy.i000066400000000000000000000716331217470755400156430ustar00rootroot00000000000000#!/usr/bin/env yorick -i /* Copyright 2007 F. Rigaut Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ /* gyotoy.i main function to call the pygtk GUI to gyotoy. syntax: yorick -i gyotoy.i */ require, "gyoto.i"; require, "gyoto_std.i"; require, "pl3d.i"; // gy_gtk needs to be included after defining gy_gtk_before_init // require, "gy_gtk.i"; func __gyotoy_before_init { noop, gy.GLib.set_prgname("Gyotoy"); noop, gy.GLib.set_application_name("Gyotoy"); } GYOTOY_VERSION = "0.2"; extern _gyotoy_running; extern _gyotoy_reticle; extern _gyotoy_wstyle; extern _gyotoy_stand_alone; extern _gyotoy_particle_is_massless; extern _gyotoy_metric; extern _gyotoy_particle; extern _gyotoy_t1; extern _gyotoy_delta; extern _gyotoy_adaptive; extern _gyotoy_initcoord; extern _gyotoy_mass; extern _gyotoy_distance; extern _gyotoy_unit; extern _gyotoy_txyz; extern _gyotoy_particle_to_load; extern _gyotoy_inhibit_redraw; extern _gyotoy_metric_file; extern _gyotoy_nsteps; /* DOCUMENT extern _gyotoy_*; Some variable holding state information for use inside gyotoy. _running: true if GTK interface is running; _reticle: true if reticle should be displayed; .yid: Yorick window ID of the Gyotoy plot area; _wstyle: window style (normally "nobox.gs"); _gyotoy.filename: name of the last file read (careful: can be the py file itself) _gyotoy_stand_alone: true if the user is not supposed to ever see the Yorick prompt. _gyotoy_particle_is_massless: true for a photon. _gyoto_metric: the actual metric object. SEE ALSO: gyotoy */ if (is_void(_gyotoy_nsteps)) _gyotoy_nsteps=100 ; func gyotoy_adaptive(mode, void) { extern _gyotoy_adaptive; if (!is_numerical(mode)) mode = !mode.get_active(); _gyotoy_adaptive=mode; if (mode) _gyotoy_particle, setparameter="Adaptive"; else _gyotoy_particle, setparameter="NonAdaptive"; } func gyotoy_reset(void){ extern _gyotoy_running; extern _gyotoy_reticle; extern _gyotoy_wstyle; extern _gyotoy_stand_alone; extern _gyotoy_particle_is_massless; extern _gyotoy_metric; extern _gyotoy_particle; extern _gyotoy_t0; extern _gyotoy_t1; extern _gyotoy_initcoord; extern _gyotoy_mass; extern _gyotoy_distance; extern _gyotoy_unit; extern _gyotoy_txyz; extern _gyotoy_particle_to_load; _gyotoy_particle_is_massless=0; _gyotoy_metric=gyoto_KerrBL(spin=0.995); _gyotoy_initcoord=[0.,10.791,pi/2,0.,0.,0.,0.016664]; _gyotoy_t1=3000.; _gyotoy_t0=0.; _gyotoy_delta=0.01; _gyotoy_particle=gyoto_Star(metric=_gyotoy_metric, initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7), delta=_gyotoy_delta); gyotoy_adaptive,1; _gyotoy_particle, xfill=_gyotoy_t1; _gyotoy_txyz=_gyotoy_particle(get_txyz=1); _gyotoy_mass=4e6; _gyotoy_distance=8.; _gyotoy_unit="geometrical"; } gyotoy_reset; func gyotoy_set_unit(unit, data) { extern _gyotoy_unit; if (!is_string(unit)) { if (!unit.get_active()) return; unit=gy.Gtk.Buildable(unit).get_name(); } _gyotoy_unit=unit; gyotoy_redraw; } func gyotoy_set_t1(t1, void) { extern _gyotoy_txyz, _gyotoy_t1; if (!is_numerical(t1)) t1 = t1.get_value(); /* if ( (_gyotoy_t1 > _gyotoy_t0 && t1<_gyotoy_t1) || (_gyotoy_t1 < _gyotoy_t0 && t1>_gyotoy_t1) ) _gyotoy_particle, reset=;*/ _gyotoy_t1=t1; if (catch(0x08)) return; // avoid breaking in case of v>c // _gyotoy_txyz=_gyotoy_particle(xfill=t1, get_txyz=1); gyotoy_compute_and_draw; } func gyotoy_set_distance(dist, void) { extern _gyotoy_distance; if (!is_numerical(dist)) dist = dist.get_value(); _gyotoy_distance=dist; gyotoy_redraw; } func gyotoy_set_KerrBL_metric(spin, void) { extern _gyotoy_metric, _gyotoy_particle, _gyotoy_txyz; if (!is_numerical(spin)) spin = spin.get_value(); _gyotoy_metric = gyoto_KerrBL ( spin = spin ); if (_gyotoy_inhibit_redraw) return; //if (catch(0x08)) return; // avoid breaking in case of v>c _gyotoy_particle,metric=_gyotoy_metric, initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7); gyotoy_compute_and_draw; } func gyotoy_set_metric(fname, void) { extern _gyotoy_metric, _gyotoy_particle, _gyotoy_txyz, _gyotoy_metric_file; if (catch(0x08)) { // avoid breaking in case bad file gyotoy_warning, "Unable to load metric. Is this a GYOTO XML description file?"; return; } if (is_void(structof(fname))) fname = gy.Gtk.FileChooser(fname).get_filename(); if (is_string(fname)) metric=gyoto_Metric(fname); if (typeof(metric)!="gyoto_Metric") gyotoy_warning, "Failed to set metric"; _gyotoy_metric=metric; _gyotoy_metric_file=fname; if (catch(0x08)) { // avoid breaking in case of v>c or other problem gyotoy_warning, "metric loaded but orbit computation failed"; return; } _gyotoy_particle,metric=_gyotoy_metric, initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7); gyotoy_compute_and_draw; } func gyotoy_set_initcoord(t0, r0, theta0, phi0, rprime0, thetaprime0, phiprime0) { extern _gyotoy_initcoord, _gyotoy_txyz, _gyotoy_inhibit_redraw; if (!is_numerical(t0)) { r0 = _gyotoy.builder.get_object("r0").get_value(); theta0 = _gyotoy.builder.get_object("theta0").get_value(); phi0 = _gyotoy.builder.get_object("phi0").get_value(); t0 = _gyotoy.builder.get_object("t0").get_value(); rprime0 = _gyotoy.builder.get_object("rprime0").get_value(); thetaprime0 = _gyotoy.builder.get_object("thetaprime0").get_value(); phiprime0 = _gyotoy.builder.get_object("phiprime0").get_value(); } _gyotoy_initcoord=[t0, r0, theta0, phi0, rprime0, thetaprime0, phiprime0]; _gyotoy_t0=t0; if (catch(0x08)) return; // avoid breaking in case of v>c _gyotoy_particle, initcoord=_gyotoy_initcoord(1:4),_gyotoy_initcoord(5:7); if (_gyotoy_inhibit_redraw) return; gyotoy_compute_and_draw; } func gyotoy_redraw(void){ /* DOCUMENT gyotoy_redraw Redraws the Gyotoy plot: - convert to UNIT; - erase the plot; - if requested, draws the reticle; - plot the orbit (which triggers drawing the 3d cage). SEE ALSO: gyoto_Kerr_orbit, gyoto_convert, gyoto_reticle, gyoto_plg3 */ // [a, e, l, q]; // delta; long(niter); // Purpose of the "if": gyoto_Kerr_orbit will return 0 if v>c extern _gyotoy_txyz, _gyotoy_inhibit_redraw; if (_gyotoy_inhibit_redraw) return; if (numberof(_gyotoy_txyz)>1) { t=_gyotoy_txyz(,1); n0=abs(t-_gyotoy_t0)(mnx); n1=abs(t-_gyotoy_t1)(mnx); if (n1>n0) ++n1; else --n1; if (n1<1) n1=1; if (n1>numberof(t)) n1=numberof(t); if (n1=t0) t = _gyotoy_txyz(0,1); else t = _gyotoy_txyz(1,1); dt = (_gyotoy_t1-t0)/_gyotoy_nsteps; if (dt==0) { gyotoy_warning, "t0 and t1 too close."; --_gyotoy_redrawing; return; } if ( ((t-t0)/(_gyotoy_t1-t0)) >=1 ){ gyotoy_set_play_image, "gtk-media-play"; gyotoy_set_fraction, (t-t0)/(_gyotoy_t1-t0); gyotoy_redraw; --_gyotoy_redrawing; return; } gyotoy_set_fraction, (t-t0)/(_gyotoy_t1-t0); gyotoy_set_play_image, "gtk-media-pause"; dir = sign(_gyotoy_t1-t0); for ( ; ((dir == 1 && t<=_gyotoy_t1+dt) || (dir ==-1 && t>=_gyotoy_t1+dt) ) && !_gyotoy_cancel; t+=dt) { _gyotoy_txyz=_gyotoy_particle(xfill=t, get_txyz=1); if ( ( (dir== 1) && _gyotoy_txyz(0,1) < t) || ( (dir==-1) && _gyotoy_txyz(1,1) > t) ) t = _gyotoy_t1+2*dt; gyotoy_redraw; //gy_gtk_step_once; frac=(t-t0)/(_gyotoy_t1-t0); if (frac>1.) frac=1; gyotoy_set_fraction, frac; while (gy.Gtk.events_pending ()) noop, gy.Gtk.main_iteration (); } gyotoy_set_play_image, "gtk-media-play"; frac=(t-t0)/(_gyotoy_t1-t0); if (frac>1.) frac=1; gyotoy_set_fraction, frac; gyotoy_redraw; --_gyotoy_redrawing; if (_gyotoy_cancel==2) gyotoy_rewind; } func gyotoy_set_play_image(name) { noop, _gyotoy.builder.get_object("play_image"). set_from_stock(name, gy.Gtk.IconSize.button); } func gyotoy_rewind(wdg, data) { extern _gyotoy_cancel; if (_gyotoy_redrawing) { _gyotoy_cancel=2; return; } _gyotoy_particle, reset=; gyotoy_set_fraction, 0; } func gyotoy_set_fraction(frac) { noop, _gyotoy.builder.get_object("progressbar").set_fraction(frac); } func gyotoy_set_delta(delta, void) { extern _gyotoy_delta; if (!is_numerical(delta)) delta = delta.get_value(); _gyotoy_delta=delta; _gyotoy_particle, delta=delta; } func gyotoy_inhibit_redraw(mode, data) { extern _gyotoy_inhibit_redraw, _gyotoy_cancel; if (!structof(mode)) mode=mode.get_active(); _gyotoy_inhibit_redraw=mode; if (mode &&_gyotoy_redrawing) _gyotoy_cancel=1; } func gyotoy_play_pause(wdg, data) { noop, _gyotoy.builder.get_object("inhibit_button").set_active(0); gyotoy_compute_and_draw; } func gyotoy_export(filename, data) { /* DOCUMENT gyotoy_export, filename Save current plot or Gyotoy data to file. The plot is exported using the standard Yorick functions if filename ends in ".pdf", ".png", ".eps", ".ps", ".jpeg", ".jpg", or ".jfif". The data are exported to an ASCII file if filename ends in ".dat" or ".txt". The GTK interface needs to be running for this to happen. Use gyotoy_save_data for the same result if the interface is not running. SEE ALSO: gyotoy_import, gyotoy_save_data */ // If filename is not a string, assume open button has been clicked if (!is_string(filename)) { Gtk = gy.require("Gtk", "3.0"); chooser = Gtk.FileChooserDialog(); noop, chooser.add_button(Gtk.STOCK_OPEN, Gtk.ResponseType.ok); noop, chooser.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.cancel); fcfc = Gtk.FileChooser(chooser); noop, fcfc.set_action(Gtk.FileChooserAction.save); noop, fcfc.set_do_overwrite_confirmation(1); filter = Gtk.FileFilter(); noop, filter.add_pattern("*"); noop, filter.set_name("All Files"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[tT][xX][tT]"); noop, filter.add_pattern("*.[dD][aA][tT]"); noop, filter.add_pattern("*.[pP][dD][fF]"); noop, filter.add_pattern("*.[eE][pP][sS]"); noop, filter.add_pattern("*.[jJ][pP][eE][gG]"); noop, filter.add_pattern("*.[jJ][pP][gG]"); noop, filter.add_pattern("*.[jJ][fF][iI][fF]"); noop, filter.add_pattern("*.[pP][nN][gG]"); noop, filter.set_name("All supported files"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[dD][aA][tT]"); noop, filter.add_pattern("*.[tT][xX][tT]"); noop, filter.set_name("Data Files"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[xX][mM][lL]"); noop, filter.set_name("XML description files"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[pP][dD][fF]"); noop, filter.set_name("PDF documents"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[eE][pP][sS]"); noop, filter.set_name("EPS documents"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[jJ][pP][eE][gG]"); noop, filter.add_pattern("*.[jJ][pP][gG]"); noop, filter.add_pattern("*.[jJ][fF][iI][fF]"); noop, filter.set_name("JPEG images"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[pP][nN][gG]"); noop, filter.set_name("PNG images"); noop, fcfc.add_filter(filter); res = chooser.run(); noop, chooser.hide(); if (res == Gtk.ResponseType.OK) { filename=fcfc.get_filename(); noop, chooser.destroy(); } else { noop, chooser.destroy(); return; } } window, _gyotoy.yid; require,"pathfun.i"; ext=pathsplit(filename,delim=".")(0); if (strglob("*.pdf", filename, case=0)) pdf, filename; else if (strglob("*.png", filename, case=0)) png, filename; else if (strglob("*.eps", filename, case=0)) eps, filename; else if (strglob("*.ps", filename, case=0)) ps, filename; else if (strglob("*.jpeg",filename, case=0)) jpeg,filename; else if (strglob("*.jpg", filename, case=0)) jpeg,filename; else if (strglob("*.jfif",filename, case=0)) jpeg,filename; else if (strglob("*.dat", filename, case=0)) gyotoy_save_data(filename); else if (strglob("*.txt", filename, case=0)) gyotoy_save_data(filename); else if (strglob("*.xml", filename, case=0)) _gyotoy_particle, xmlwrite=filename; else pyk,"warning('Unknown file type for "+filename+"')"; } func gyotoy_import(filename, data) { extern _gyotoy, _gyotoy_inhibit_redraw; // If filename is not a string, assume open button has been clicked if (!is_string(filename)) { Gtk = gy.require("Gtk", "3.0"); chooser = Gtk.FileChooserDialog(); noop, chooser.add_button(Gtk.STOCK_OPEN, Gtk.ResponseType.ok); noop, chooser.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.cancel); fcfc = Gtk.FileChooser(chooser); noop, fcfc.set_action(Gtk.FileChooserAction.open); noop, fcfc.set_do_overwrite_confirmation(1); /* buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK)); */ filter = Gtk.FileFilter(); noop, filter.add_pattern("*"); noop, filter.set_name("All Files"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[dD][aA][tT]"); noop, filter.add_pattern("*.[tT][xX][tT]"); noop, filter.set_name("Data Files"); noop, fcfc.add_filter(filter); filter = Gtk.FileFilter(); noop, filter.add_pattern("*.[xX][mM][lL]"); noop, filter.set_name("XML description files"); noop, fcfc.add_filter(filter); res = chooser.run(); noop, chooser.hide(); if (res == Gtk.ResponseType.OK) { filename=fcfc.get_filename(); noop, chooser.destroy(); } else { noop, chooser.destroy(); return; } } // XML file: if (strpart(filename,-3:0)==".xml") { local rad2deg; rad2deg=180./pi; _gyotoy, filename=filename; gyotoy_set_particle, gyoto_Astrobj(filename); return; } // Non-xml file if(! (file = open(filename,"r",1))) { gyotoy_warning, "Could not open file "+filename+" for reading"; return; } /* if (!strmatch(rdline(file),"# Gyotoy save file")) { gyotoy_warning, filename+" is not a Gyotoy save file"; return; }*/ rdr=_gyotoy_inhibit_redraw; _gyotoy_inhibit_redraw=1; while ((line=rdline(file)) && !strmatch(line,"# Start Gyoto parameters")) {} if (!line) { gyotoy_warning, filename+" is not a Gyoto save file"; return; } while (!strmatch((line=rdline(file)),"# End Gyoto parameters")) { key=""; value=""; sread,line, format="# %s = %s", key, value; if (key=="metric_file") gyotoy_set_metric, strpart(value, 2:-1); ok=pyk("set_parameter('"+key+"',"+value+")"); } _gyotoy_inhibit_redraw=rdr; gyotoy_compute_and_draw; //pyk,"compute_orbit('rien')"; } func gyotoy_print(truc) {print,truc;} func gyotoy_set_mass(mass, void) { extern _gyotoy_mass; if (!is_numerical(mass)) mass = mass.get_value(); _gyotoy_mass=mass; gyotoy_redraw; } func gyotoy_set_particle_type(type, void) { extern _gyotoy_particle_is_massless, _gyotoy_particle, _gyotoy_metric; extern _gyotoy_txyz; if (!is_string(type)) { if (!type.get_active()) return; type = gy.Gtk.Buildable(type).get_name(); } _gyotoy_particle_is_massless = (type=="photon"); if (type=="photon") { _gyotoy_particle_is_massless = 1; _gyotoy_particle = gyoto_Photon(); } else { _gyotoy_particle_is_massless = 0; _gyotoy_particle = gyoto_Star(); } if (catch(0x08)) return; // avoid breaking in case of v>c _gyotoy_particle,metric=_gyotoy_metric, initcoord=_gyotoy_initcoord(1:4),_gyotoy_initcoord(5:7); _gyotoy_particle, delta=_gyotoy_delta; gyotoy_adaptive, _gyotoy_adaptive; gyotoy_compute_and_draw; } func gyotoy_save_data(filename) { /* DOCUMENT gyotoy_save_data,filename Save parameters and orbit to text file. SEE ALSO: */ extern _gyotoy_metric; t=_gyotoy_txyz(,1); x=_gyotoy_txyz(,2); y=_gyotoy_txyz(,3); z=_gyotoy_txyz(,4); gyoto_convert, x, _gyotoy_mass, _gyotoy_distance, _gyotoy_unit; gyoto_convert, y, _gyotoy_mass, _gyotoy_distance, _gyotoy_unit; gyoto_convert, z, _gyotoy_mass, _gyotoy_distance, _gyotoy_unit; ptype = (_gyotoy_particle_is_massless?"photon":"star"); mtype = (_gyotoy_metric(kind=)=="KerrBL")?"kerrbl":"file"; spin=(_gyotoy_metric(kind=)=="KerrBL")?_gyotoy_metric(spin=):2; if (f=open(filename,"w",1)) { write, f, format="# %s\n", "Gyoto save file"; write, f, format="# %s\n", "Start Gyoto parameters"; write, f, format="# %13s = \"%s\"\n", "particle_type", ptype; write, f, format="# %13s = \"%s\"\n", "metric_type", mtype; if (mtype=="kerrbl") write, f, format="# %13s = %14.12f\n", "spin", spin; else write, f, format="# %13s = \"%s\"\n", "metric_file", _gyotoy_metric_file; write, f, format="# %13s = %14.12f\n", ["mass", "t0", "r0", "theta0", "phi0", "rprime0", "thetaprime0", "phiprime0", "t1", "delta"], _([_gyotoy_mass], _gyotoy_initcoord, _gyotoy_t1, _gyotoy_delta); write, f, format="# %13s = %d\n", ["adaptive", "nsteps"], [_gyotoy_adaptive, _gyotoy_nsteps]; write, f, format="# %13s = \"%s\"\n", "length_unit", _gyotoy_unit; write, f, format="# %s\n", "End Gyoto parameters"; write, f, format= "# %s\n", "Columns are t, x, y, z"; write, f, format="%14.12f %14.12f %14.12f %14.12f\n", t, x, y, z; close,f; } else error, "Could not create file "+filename; } /************** CALLBACKS ****************/ func gyotoy_about(wdg, udata) { Gtk=gy.require("Gtk", "3.0"); dialog = Gtk.AboutDialog(); noop, dialog.set_program_name("Gyotoy"); noop, dialog.set_version(GYOTOY_VERSION); noop, dialog.set_logo(icon); noop, dialog.set_copyright("Copyright © 20011-2013 Frédéric Vincent & Thibaut Paumard"); noop, dialog.set_license_type(Gtk.License.gpl_3_0); noop, dialog.run(); noop, dialog.destroy(); } func _gyotoy_orient3(wdg, data) { incl = _gyotoy.builder.get_object("incl").get_value(); paln = _gyotoy.builder.get_object("paln").get_value(); phase = _gyotoy.builder.get_object("phase").get_value(); gyoto_orient3, incl, paln, phase; //draw3,1; } func _gyotoy_metric_type(wdg, data) { type_id = wdg.get_active(); if (type_id == 0) type = "kerrbl"; else if (type_id == 1) type = "file"; if (type=="file") { noop, _gyotoy.builder.get_object("spin").set_sensitive(0); noop, _gyotoy.builder.get_object("spin").set_visible(0); noop, _gyotoy.builder.get_object("spin_label").set_visible(0); noop, _gyotoy.builder.get_object("metric_file").set_sensitive(1); noop, _gyotoy.builder.get_object("metric_file_label").set_visible(1); noop, _gyotoy.builder.get_object("metric_file").set_visible(1); // TO PORT //_gyotoy.metric_file_set_cb(_gyotoy.builder.get_object("metric_file")); } else if (type=="kerrbl") { noop, _gyotoy.builder.get_object("spin").set_visible(1); noop, _gyotoy.builder.get_object("spin").set_sensitive(1); noop, _gyotoy.builder.get_object("spin_label").set_visible(1); noop, _gyotoy.builder.get_object("metric_file").set_sensitive(0); noop, _gyotoy.builder.get_object("metric_file_label").set_visible(0); noop, _gyotoy.builder.get_object("metric_file").set_visible(0); gyotoy_set_KerrBL_metric, _gyotoy.builder.get_object("spin"); } else { error, "Unknown metric type"; } } func _gyotoy_gnomon(wdg, data) { gnomon; } func _gyotoy_cage(wdg, data) { cage3; } func _gyotoy_unlimit(wdg, data) { limits; } extern _pyk_proc, _gyotoy_stand_alone; if (is_void(_gyotoy.yid)) _gyotoy,yid=0; gyotoy_args=get_argv(); if (is_void(GYOTOY_NO_AUTO) & numberof(gyotoy_args)>=3 && anyof(basename(gyotoy_args(3))==["gyotoy.i","gyotoy"])) { _gyotoy_stand_alone=1; if (numberof(gyotoy_args)>3) { gyotoy_args=gyotoy_args(4:); ind=where(strgrep("^-",gyotoy_args)(2,)==-1); if (numberof(ind)) _gyotoy, filename=gyotoy_args(ind(1)); if (numberof(ind)JD}LqIY28y"_^^+(^9?r,,cѾ]wr |*z v["Né_?sjs5`ڔy85g1h`ڽcvUxѵk[:ʊ+;i`) IÉΉVdK~hG;v\1dDoy.ҶμLQ$U2e#_} T7"-51+' q7 #spQ~ӕ j_:7e[> %E_뀐bۘ"NE$ #yدvS]'_wi,_*8`uxԾ"}Nfܻ)h(+y㸖-8SpOiJH-1 { \gQ,6B(uS&aTW+ (2] z~:}c x`EڗV:p.h,@#@$`߅PnF+y!Gifm;lZr7:נHބ ׇALL 붿+"cuB "`ʆ~1`xG#,>~vc@ I0k_/P ^[`2ן+j4j !! JBa@HB=wm˘ y\lЮc*)I''`U]EEi !"95a#z\K 0>3T;Rsuj.M&%@{,\4Ct֑B6g+ǜ*x|L%bˮsVέ|0cj/B^xLl8lUf9XE8Z@4Pd+  zl::Ţ$xZ4$?p/ 8{hS^g?i[gGU}J+/Ŧ ;)/$7{}>9-Je,Z2k\N+-]_'M#_{vO=lt@TӮ`ENJ_Q/]N0%nOT{9bB-bDlvM `Qaȱs--.c؟~2ቴCV~EŠ0aX&YO~زǚ T6&tn=r<ER 7VcYҌrCߖX~`"$΂ɪYxT'xeTW{)pHƹ5sU).g5,&Ϫb߶c3g ֳOW^Z_\Z;IH\ڒ]ǟg ښ;n WkyOjG9oүس.%dG1 Z >ɀj`ii_ x:CT^.R*"tܖ#cY˹Ad>ͣR<7oX0oS,PQ"ͻ_ P:D0D;}  ?f(!۹S?%i;'o /ibOy2>W10#N ONk^U<'(@P,~SxۉKͯ 33IzaZcNej55M2?ؤgA@כJt)ӕEdZ[:ʲRnDSE$H.Wedz{ ܝZ̗IHcl;L%\׏>T,"#SZZ"cukGƱ ?>=;Ɉc=‘YȞ/_  z.b߶ÿ/3XI@P7%"{C,Ӓ1[iRNchW_g̟pi)#D êiD ~ՆW^ ]q)v8l63^mӅX}UIu= {TP~pt1穥}qX_0r29v$PH+::GX(t7`b?7HjXf*9r<WqE}&4MjC8 N4hnbrU rZ7RrBx%mb}/׮B@`v(.%Ϛ׍YOItL4C:Ctntd)TNA ^ yYJGMʃs[)wM+%Esk[. n2&5Z&^^rWC`1Q:JMǥ2)1,&|/{wf95(# pj<ʶk%zɛʀ `c[(^{jg)ԅhOc/ {b1P_ĩ'$DMd\Յ];  =Ǥ&<#{o4(-*bx) rr p. }:7Sج zkY('טM.`TX4tI8e8e=͆0i6RQ|b BT1?UшOU)cKذ~Ϙk IӭE}:l(vۼziE4;F}/b 01w;G<&Wp` i %a⧍VwKrewb#l65&E]3;g~BIɉt:Pu:BWPl(:N'̞?[_{5`m׈7_bZYٳfM=lNp4<,,ӂsJzs#aG`@)IYizAtlH;& ~*J.NX,i0vf EMjˏqgP^^C%=qq$Il13Hɥ5H 7%$ NO~F&۾8u*fMєثbZf0⪩IS~RԮSr R?z~TNV(z̊B   Y'~9xՋ3;1g>&zxi]ӫžy7(*,Q@{nk0\3 d>^{iE=OyPsM\|(N_`+uݚ0U5zֈon|)SVo6kNv|p>$? !}'}ҮcszLуݙk̛gcYȍT$} :.(Jf;M.l4 YS|۷o)ڴKdJ&=[9+sx?kƀ4H+ǯhq:Z4 W䪙*5pM^ޡSh>$u+sQ4@~֌lC5^`#5RU⁛f7>";TC$^OeɺF/@puW> _>+&:"^ϿFzkp@!SSaj//Kj!9ii R3HHa_-!hfifi(IwR3"!IENDB`Gyoto-0.1.0/yorick/gyotoy.xcf000066400000000000000000000267071217470755400161750ustar00rootroot00000000000000gimp xcf fileJJB*B*@G gimp-commentCreated with GIMPgimp-image-grid(style solid) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) ,JJgyotoy_screenshot.png     |JJJJN<<<<<<<<<<<<<<<<<< ư%ԯ*Ӿ׼y$"sɵ#Ӣ    tn   I Ǿ˰G = ˹gJ?No˺ح G}ӭl.2vN3+.Iଦ MzҊP}?   pۦ VRq? 謞J  Қ fe ͝ 檿 ԅij\ͪЏy viíϹi}  7jƿOŶTȽB)/ҏ䰦gB|[Tqz䶹 ްy?9b|B Şn ϤnJEb7NR9zs ט9yBҤ Kƹ\os+ЩF|zɝ uüz/Н{+Oölռ]֘ zή TiӰa " ZttӲj\"   R_5ljeza]RTPeSqIGt֤uEWn} B}Zj͹ƶ &Tbz? s1PŲO ]÷˨G \a. Z̰ͷƣ [5RJ VRyosiVC$ K_\3͏S+Gfvge`ҽ)7 Ի{+η/튷ӱ|F -DZ ̙Sv-= "7;7;7;7;7;5:;=<<<<<<<<<<<<<<<<<< Ϲ%賆(ʞx#!qԻ"  qo   H ȞݷF ; ۾hH>NqƲ꭫ G|k-3vL3*-H L|Q@   o򧞕 WRp? K 暐 ga  ϖ Շѽ_Д{whҹºǞk򍵁 6lζQ׼VǼC(0љhC\Uq}Ƈ |@8bC ֦qߨlHDb8NS9}u 9|C I]sv+G}աsɾ~0ۀ+PϿlʳ` }Vj軕b "[vu齕l̼_"  Sμ`5یgͲ}caUVQgSuKIwשּׂĭwCWqCϷ[m &Ve~? w0RN aƵH _f/ ]޿ī٭ ]5SϷưL XU~uxmXF& N`\4U+Kj{khbφ*6 ΀+0H - U|/? "9;9;9;9;9;6:;=v<v<v<v<v<v<v<v<v<v<v<v<v<v<v<v<v<v<v %xgy}Ơ^YͿ  ZTѴ  7h ັ|ǰ5 -tc ݺ{gN70;Ss­ 5pcS#&t~u[9&"5iά :ql]m=ta/  Tŧ A=V0  6  g L{K  匤udɰǺzFr^XNj~|Qlb (gQozg;kx?Ǽ1#j|xqqkrn}bԱrP1oaE>W`d`üϓ^/td)Kbc2 SɰP52Hz(9p>*_cX z)]1Ӹ  5EfVXsocݺ4b^mԶx U{_k #ttk_e :QͼsGwy ]}c@NrHc w o CWWڻqPfE}d}=pF'hLj_IG>va> ;M=oV66ZX1@Sc2`DQu fgi ?J_pvo. Xi|#=gd9 G{5 EKxc"  Dto D'=~h7 A>|n^VYcnxzgPA3 9FD&r>6M[NMHc 'x _#lya4 ! z >tyzyt\"- (;';(;(;(;':r;===================&                                <<<<<;<=69 52Z.i6-X$M+eҢԡnCC"A#E06953]/l6,Z%N+gqCF"C%G06|o c)o'e %vD "dP' B:iwM‚SC2/w306C0bbbb%%JJBlur     ?JJ,JJ*,p,==================&                                <<<<<;<===================&                                <<<<<;<===================&                                <<<<<;<===================%뒩ʲuiotϽr³ кˢӡ 钩ɹע 啼̢آ³­ءĴռԎ˼ ڦ۽ ߦ ´ ɹ씰Ľι޲Ὢӿݰ⽩ƾՔ զަ ʷסռע헵٭οˣץ׭ؼ禾ɷޮ»ğ պοڽ ðн۽ȵĺô ޸Ĺޞ򒪳³ ٪} 뒭øϹ ï䔰 ե³ ļ˾۽ǰ ڽ|® r|rϽxrn{| n|<|<|<|<|<|{:r;=6C06C06C06ӤؼӥݹؑΩ|ɟԺBqnnhnnnrx0bbbbz%%JJ Background     >-OJJ-g-JJ----cccc%%Gyoto-0.1.0/yorick/gyotoy.xml000066400000000000000000002403141217470755400162050ustar00rootroot00000000000000 99 0.01 0.01 1 0.01 1000000 8 1 10 -360 360 120 1 10 1 1e+20 4000000 1000 100000 KerrBL kerrbl From XML file file 1 10000000 100 10 100 -360 360 -180 1 10 True False 975 600 True False True False False True False _Fichier True True False gtk-open False True False True True gtk-save-as False True False True True True False gtk-quit False True False True True False True False _Affichage True True False False True False Toggle gnomon True False True False Toggle cage True False True False Toggle reticle True False True False Reset 2D limits True False True False Length unit True True False False True False Geometrical unit True True False True False Meter True geometrical False True False Kilometer True geometrical False True False Solar radius True geometrical False True False Arc second True geometrical False True False Milliarcsecond True geometrical False True False Microarcsecond True geometrical False True False Aid_e True True False gtk-about False True False True True False True 0 True True True 475 True True False True False True True True in True False True False 26 2 True True True Integrate from t0 to t1 Geometrical units Integrate from t0 to t1 Geometrical units 40 20 False False t1_adjustment 17 1 2 25 26 True False True Integrate from t0 to t1 Geometrical units Integrate from t0 to t1 Geometrical units t₁ 25 26 True False Integration parameters 2 24 25 True False True Incination of the equatorial plane Degrees Incination of the equatorial plane Degrees Inclination 20 21 True False True Position angle of the line of nodes Degrees Position angle of the line of nodes Degrees PALN 19 20 True False True Argument of the x axis Degrees Argument of the x axis Degrees Phase 21 22 True True True Incination of the equatorial plane Degrees Incination of the equatorial plane Degrees 22 20 False False incl_adjustment 17 1 2 20 21 True True True Position angle of the line of nodes Degrees Position angle of the line of nodes Degrees 22 20 False False paln_adjustment 0.050000000000000003 17 1 2 19 20 True True True Argument of the x axis Degrees Argument of the x axis Degrees 22 20 False False phase_adjustment 17 1 2 21 22 True False Projection 2 18 19 True True True Radians per geometrical units Radians per geometrical units 20 20 False False phiprime0_adjustment 17 1 2 16 17 True False True Radians per geometrical units Radians per geometrical units dφ/dt 16 17 True True True Radians per geometrical units Radians per geometrical units 20 20 False False thetaprime0_adjustment 17 1 2 15 16 True True True Relative to light speed Relative to light speed 20 20 False False rprime0_adjustment 17 1 2 14 15 True True True Date for initial condition Geometrical units Date for initial condition Geometrical units 40 20 False False t0_adjustment 17 1 2 13 14 True True True Radians Radians 20 20 False False phi0_adjustment 17 1 2 12 13 True True True Radians Radians 20 20 False False theta0_adjustment 17 1 2 11 12 True True True Initial distance from center Geometrical units Initial distance from center Geometrical units 20 20 False False r0_adjustment 17 1 2 10 11 True False True Radians per geometrical units Radians per geometrical units dθ/dt 10 15 16 True False True Relative to light speed Relative to light speed dr/dt 14 15 True False True Date for initial condition Geometrical units Date for initial condition Geometrical units t₀ 13 14 True False True Radians Radians φ₀ 12 13 True False True Radians Radians θ₀ 11 12 True False True Initial distance from center Geometrical units Initial distance from center Geometrical units r₀ 10 11 True False Initial conditions 2 9 10 True False True Spin parameter For Kerr metric only Spin parameter For Kerr metric only Spin param. 6 7 True True True Spin parameter For Kerr metric only Spin parameter For Kerr metric only 20 20 0.14000000059604645 False False spin_adjustment 17 True 1 2 6 7 True False True Type of metric Type of metric Type 12 4 5 True False True Type of metric Type of metric metric_type_liststore 0 0 1 2 4 5 True False Metric parameters 2 3 4 True False 2 23 24 True False 2 17 18 True False 2 8 9 True False True Compact object mass for scaling geometrical unit Solar masses Compact object mass for scaling geometrical unit Solar masses Mass 7 8 True True True Compact object mass for scaling geometrical unit Solar masses Compact object mass for scaling geometrical unit Solar masses False False mass_adjustment 17 1 2 7 8 True False True Distance from observer Kiloparsecs Distance from observer Kiloparsecs Distance 22 23 True True True Distance from observer Kiloparsecs Distance from observer Kiloparsecs False False distance_adjustment 17 1 2 22 23 False 2 2 3 True False Particle type 2 True False True Star False True True False True Compute massive-particle orbit (Timelike geodesic) Compute massive-particle orbit (Timelike geodesic) False 0 True True True True 0 Photon False True True False True Compute massless particle trajectory (Null geodesic) Compute massless particle trajectory (Null geodesic) False 0 True star True True 1 2 1 2 False False True True Gyoto XML file containing metric Any kind of Gyoto XML as long as a metric is included Gyoto XML file containing metric Any kind of Gyoto XML as long as a metric is included vertical 1 2 5 6 False True True Gyoto XML file containing metric Any kind of Gyoto XML as long as a metric is included Gyoto XML file containing metric Any kind of Gyoto XML as long as a metric is included File 5 6 True True True True 1 True False True False True True True 0 True False Integration step in proper time Geometrical units Initial if step is adaptive 5 δ False True 1 True True Integration step in proper time Geometrical units Initial if step is adaptive 6 delta_adjustment 4 True False True 2 False True True True Push-in for non-adaptive δ False none True False gtk-zoom-100 False True 3 True False Split t0 to t1 integration in N frames 5 N. frames False True 4 True True Split t0 to t1 integration in N frames 4 nsteps_adjustment True False True 5 False True True True Pause and reset integration False none True False Pause and reset integration gtk-goto-first False True 6 False True True True Integrate / pause integration False none True False gtk-media-play False True 7 False True True True Push-in to inhibit redraw upon parameter changes False none True False gtk-media-stop False True 8 False False 2 -360 360 -120 1 10 -4 4 0.01 0.10000000000000001 -10 10 0.016664000000000002 0.01 0.10000000000000001 1000000 10.789999999999999 1 10 -10 10 0.01 0.10000000000000001 1 0.995 0.01 0.10000000000000001 -1000000 1000000 1 10 -10000000000 10000000000 3000 1 10 4 1.5707963267948966 0.01 0.10000000000000001 -10 10 0.01 0.10000000000000001 Gyoto-0.1.0/yorick/mk-movie-fork-raytracing.i000077500000000000000000000057271217470755400211410ustar00rootroot00000000000000#!/usr/bin/env yorick /* This script examplifies how to make a movie using Gyoto and LibAV. There is an unconspicuous bug in Gyoto by which mutlithreaded ray-tracing corrupts the process memory (presumably some block is freed in one thread whereas it is still used by the main thread). We seem to work around this bug by performing the ray-tracing of each image in a separate (multi-threaded) yorick process. Therefore, this script is mutli-process (main process writes movie file, subprocesses compute images), and the Gyoto subprocesses are multi-threaded. Required packages: gyoto (gyoto_Scenery) https://github.com/gyoto/Gyoto yorick-av (av_*) https://github.com/paumard/yorick-av yorick-svipc (ftok, fork, s?m_*) https://github.com/mdcb/yp-svipc yutils (tic, tac) https://github.com/frigaut/yorick-yutils */ #include "svipc.i" #include "gyoto.i" #include "libav.i" //// PARAMETERS ifile="../doc/examples/example-moving-star.xml"; ofile="test.ogg"; vcodec="libtheora"; resolution=64; t0=1000.; nframes=1000; dt=1.; //gyoto_verbose,0; //// END PARAMETERS tic; // Initialize time counter file_i=current_include(); ppid=getpid(); shmid = ftok(file_i, proj=ppid); semid = ftok(file_i, proj=ppid+1); sem_init, semid, nums=2; shm_init, shmid, slots=1; // Semaphores are used in this script to lock the shared memory // segment. Gyoto write to shared memory and gives 0. FFmpeg reads // from shared memory and gives 1. Initially, FFmpeg gives 1 (nothing // to read) and takes 0 (waiting for frame). // Reading palette using plain Yorick requires an X11 window window; pli, array(double, 2,2); palette, query=1, r,g,b; rgb= transpose([r,g,b]); top=numberof(r)-1; winkill; // Reading and initializing scenery sc=gyoto_Scenery(ifile); ut = sc(metric=)(unitlength=)/GYOTO_C; sc,quantities="Intensity"; sc,nthreads=2; noop, sc(screen=)(time=t0*ut); noop, sc(screen=)(resolution=resolution); // Specific to star astrobj: precompute orbit ao = sc(astrobj=); if (ao(kind=)=="Star") noop, ao(xfill=0.); sem_give, semid, 1; // Give 1: Gyoto may write to shared memory. encoder=av_create(ofile, vcodec=vcodec); for (n=1, t=t0; n<=nframes; ++n, t+=dt) { if (fork()) { sem_take, semid, 0; // Is there something to read now? im = shm_read(shmid, "image"); if (n==1) cmax=max(im); frame = rgb(,bytscl(im(,0:1:-1), cmax=cmax, top=top)+1); sem_give, semid, 1; // Reading done, Gyoto may write again. write, format="Writting frame nr %d to movie file\n", n; av_write, encoder, frame; } else { write, format="Ray-tracing frame nr %d, time=%e\n", n, t; noop, sc(screen=)(time=t*ut); im = gyoto_Scenery_rayTrace(sc); sem_take, semid, 1; // May we write now? shm_write, shmid, "image", &im; sem_give, semid, 0; // Image ready to be read. quit; } } av_close, encoder; sem_cleanup, semid; shm_cleanup, shmid; write, format="\nRay-traced %d frames in %g seconds\n", nframes, tac(); Gyoto-0.1.0/yorick/mk-movie.i000077500000000000000000000030221217470755400160230ustar00rootroot00000000000000#!/usr/bin/env yorick /* This script examplifies how to make a movie using Gyoto and LibAV. As of writing there is a bug in Gyoto which makes this script occasionaly fail with a segmentation fault or message such as yorick(20187,0x7fff706cdcc0) malloc: *** error for object 0x10038d0c8: incorrect checksum for freed object - object was probably modified after being freed. mk-movie-fork-raytracing.i tries to work around this bug by insulating each call to gyoto_Scenery_rayTrace in its own process. Required packages: gyoto (gyoto_Scenery) yorick-av (av_*) yutils (tic, tac) */ #include "gyoto.i" #include "pnm.i" #include "libav.i" ifile="../doc/examples/example-moving-star.xml"; ofile="test.ogg"; resolution=64; nthreads=2; //gyoto_verbose,0; tic; t0=1000.; nframes=2000; dt=1.; sc=gyoto_Scenery(ifile); ut = sc(metric=)(unitlength=)/GYOTO_C; sc,quantities="Intensity"; sc,nthreads=nthreads; noop, sc(screen=)(time=t0*ut); noop, sc(screen=)(resolution=resolution); encoder=av_create(ofile); window; pli, array(double, 2,2); palette, query=1, r,g,b; rgb= transpose([r,g,b]); top=numberof(r)-1; winkill; for (n=1, t=t0; n<=nframes; ++n, t+=dt) { write, format="\nRay-tracing frame nr %d, observing time=%e\n", n, t; noop, sc(screen=)(time=t*ut); im = gyoto_Scenery_rayTrace(sc); if (n==1) cmax=max(im); frame = rgb(,bytscl(im(,0:1:-1), cmax=cmax, top=top)+1); av_write, encoder, frame; } av_close, encoder; write, format="\nRay-traced %d frames in %g seconds\n", nframes, tac(); Gyoto-0.1.0/yorick/stdplug/000077500000000000000000000000001217470755400156075ustar00rootroot00000000000000Gyoto-0.1.0/yorick/stdplug/Makefile.in000066400000000000000000000073111217470755400176560ustar00rootroot00000000000000# these values filled in by yorick -batch make.i Y_MAKEDIR= Y_EXE= Y_EXE_PKGS= Y_EXE_HOME= Y_EXE_SITE= Y_HOME_PKG= # ----------------------------------------------------- optimization flags # options for make command line, e.g.- make COPT=-g TGT=exe COPT=$(COPT_DEFAULT) -L../../lib -I../../include TGT=$(DEFAULT_TGT) # ------------------------------------------------ macros for this package CPPFLAGS=@CPPFLAGS@ XERCESLDFLAGS=@XERCESLDFLAGS@ XERCESCPPFLAGS=@XERCESCPPFLAGS@ CFITSIOLDFLAGS=@CFITSIOLDFLAGS@ CFITSIOCPPFLAGS=@CFITSIOCPPFLAGS@ UDUNITS_CPPFLAGS=@UDUNITS_CPPFLAGS@ UDUNITS_LDFLAGS=@UDUNITS_LDFLAGS@ DYLIB_VAR=@DYLIB_VAR@ PTHREAD_CFLAGS= @PTHREAD_CFLAGS@ PTHREAD_LIBS= @PTHREAD_LIBS@ SYS=@SYS@ plugin_sfx=@plugin_sfx@ YGYOTO_C = $(shell ls ../*.C) GYOTO_C = $(shell ls ../../lib/*.C) GYOTO_OBJ = $(GYOTO_C:.C=.o) GYOTO_H = $(shell ls ../../include/*.h) PKG_NAME=gyoto_std PKG_I=gyoto_std.i OBJS = StdPlug.o gyoto_KerrBL.o gyoto_KerrKS.o \ gyoto_Star.o gyoto_FixedStar.o \ gyoto_Torus.o gyoto_PatternDisk.o \ gyoto_Disk3D.o gyoto_PolishDoughnut.o\ gyoto_PowerLawSpectrum.o gyoto_BlackBodySpectrum.o # change to give the executable a name other than yorick PKG_EXENAME=yorick # PKG_DEPLIBS=-Lsomedir -lsomelib for dependencies of this package PKG_DEPLIBS=-L../../lib/.libs -lgyoto $(PTHREADS_LIBS) ifeq ($(SYS),Darwin) PKG_DEPLIBS+=-bundle_loader ../../lib/.libs/libgyoto-stdplug.$(plugin_sfx) \ -flat_namespace -bundle_loader ../gyoto.so $(LIB_CXX) endif # set compiler (or rarely loader) flags specific to this package PKG_CFLAGS= -I../../include -I.. $(XERCESCPPFLAGS) $(CFITSIOCPPFLAGS) $(UDUNITS_CPPFLAGS) $(PTHREAD_CFLAGS) PKG_LDFLAGS= $(PTHREAD_CFLAGS) # list of additional package names you want in PKG_EXENAME # (typically Y_EXE_PKGS should be first here) EXTRA_PKGS=$(Y_EXE_PKGS) # list of additional files for clean PKG_CLEAN= # autoload file for this package, if any PKG_I_START= # non-pkg.i include files for this package, if any PKG_I_EXTRA= # -------------------------------- standard targets and rules (in Makepkg) # set macros Makepkg uses in target and dependency names # DLL_TARGETS, LIB_TARGETS, EXE_TARGETS # are any additional targets (defined below) prerequisite to # the plugin library, archive library, and executable, respectively PKG_I_DEPS=$(PKG_I) Y_DISTMAKE=distmake include $(Y_MAKEDIR)/Make.cfg include $(Y_MAKEDIR)/Makepkg include $(Y_MAKEDIR)/Make$(TGT) # override macros Makepkg sets for rules and other macros # Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable) Y_HOME=$(Y_EXE_HOME) Y_SITE=$(Y_EXE_SITE) # Actual install directories set with ./configure --with-yorick-* prefix=@prefix@ exec_prefix=@exec_prefix@ DEST_Y_HOME=$(DESTDIR)@Y_INST_HOME@ DEST_Y_SITE=$(DESTDIR)@Y_INST_SITE@ # ------------begin C++ source hacks # must use C++ to load yorick with this C++ package # this assumes make default CXX macro points to C++ compiler CXXFLAGS=$(CFLAGS) $(GYOTO_FLAGS) -DYGYOTO_LOCAL_SUPPLIER=GyotoStdPlugSupplier LD_DLL=$(CXX) $(LDFLAGS) $(PLUG_SHARED) LD_EXE=$(CXX) $(LDFLAGS) $(PLUG_EXPORT) # C++ has no standard file extension, supply default make rule(s) .C.o: $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< # --------------end C++ source hacks # simple example: #myfunc.o: myapi.h # more complex example (also consider using PKG_CFLAGS above): #myfunc.o: myapi.h myfunc.c # $(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c StdPlug.o: ../ygyoto_supplier.C ../ygyoto.h $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< ../../lib/libgyoto.a: $(GYOTO_C) $(GYOTO_H) make -C ../lib gyoto_std.so: $(OBJS) .PHONY: standalone test-cppprog test-standalone test test-plugin check # -------------------------------------------------------- end of Makefile Gyoto-0.1.0/yorick/stdplug/gyoto_BlackBodySpectrum.C000066400000000000000000000035321217470755400225140ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include "yapi.h" #include #include "GyotoFactory.h" #include "GyotoBlackBodySpectrum.h" namespace YGyoto { namespace Spectrum { ygyoto_Spectrum_eval_worker_t BlackBodyYEval; } } using namespace Gyoto; using namespace YGyoto; using namespace Gyoto::Spectrum; using namespace YGyoto::Spectrum; using namespace std; void YGyoto::Spectrum::BlackBodyYEval(SmartPointer * OBJ_, int argc) { static char const * knames[]={ "unit", "temperature", "scaling", YGYOTO_SPECTRUM_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Spectrum, BlackBody, knames, YGYOTO_SPECTRUM_GENERIC_KW_N+3); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE(Temperature); YGYOTO_WORKER_GETSET_DOUBLE(Scaling); YGYOTO_WORKER_CALL_GENERIC(Spectrum); } extern "C" { void Y_gyoto_BlackBodySpectrum(int argc) { YGYOTO_CONSTRUCTOR_INIT(Spectrum, BlackBody); if ((*OBJ)->getKind().compare("BlackBody")) y_error("Expecting Spectrum of kind BlackBody"); BlackBodyYEval(OBJ, argc); } void Y__gyoto_BlackBodySpectrum_register_as_Metric(){ ygyoto_Spectrum_register("BlackBody",&BlackBodyYEval); } } Gyoto-0.1.0/yorick/stdplug/gyoto_Disk3D.C000066400000000000000000000075121217470755400202220ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include #include "../ygyoto.h" #include "yapi.h" using namespace Gyoto; using namespace Gyoto::Astrobj; #include using namespace std; #define OBJ ao // on_eval worker void ygyoto_Disk3D_eval(SmartPointer *ao_, int argc) { static char const * knames[]={ "unit", "fitsread", "repeatphi", "nu0", "dnu", "rin", "rout", "zmin", "zmax", "phimin", "phimax", "copyemissquant", "copyvelocity", "fitswrite", YGYOTO_ASTROBJ_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Astrobj, Disk3D, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+14); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_RUN( fitsRead(ygets_q(iarg)) ); YGYOTO_WORKER_GETSET_LONG2(repeatPhi); YGYOTO_WORKER_GETSET_DOUBLE2(nu0); YGYOTO_WORKER_GETSET_DOUBLE2(dnu); YGYOTO_WORKER_GETSET_DOUBLE2(rin); YGYOTO_WORKER_GETSET_DOUBLE2(rout); YGYOTO_WORKER_GETSET_DOUBLE2(zmin); YGYOTO_WORKER_GETSET_DOUBLE2(zmax); YGYOTO_WORKER_GETSET_DOUBLE2(phimin); YGYOTO_WORKER_GETSET_DOUBLE2(phimax); /* EMISSQUANT */ if ((iarg=kiargs[++k])>=0) { GYOTO_DEBUG << "copyemissquant=\n"; iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[4]; (*ao) -> getEmissquantNaxes(ddims); long dims[] = {4, ddims[0], ddims[1], ddims[2], ddims[3]}; double * out = ypush_d(dims); memcpy(out, (*ao)->getEmissquant(), dims[1]*dims[2]*dims[3]*dims[4]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); if (dims[0]==0 && ntot && *in==0) (*ao) -> copyEmissquant(NULL, 0); else if (dims[0]==4) { size_t ddims[] = {dims[1], dims[2], dims[3], dims[4]}; (*ao)->copyEmissquant(in, ddims); } else y_error("COPYEMISSQUANT must be nil, 0, or array(double, nnu, nphi, nz, nr"); } } /* VELOCITY */ if ((iarg=kiargs[++k])>=0) { GYOTO_DEBUG << "copyvelocity=\n"; iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[4]; (*ao) -> getEmissquantNaxes(ddims); long dims[] = {4, 3, ddims[1], ddims[2], ddims[3]}; double * out = ypush_d(dims); memcpy(out, (*ao)->getVelocity(), 3*dims[2]*dims[3]*dims[4]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); if (dims[0]==0 && ntot && *in==0) (*ao) -> copyVelocity(NULL, 0); else if (dims[0]==4 && dims[1]==3) { size_t ddims[] = {dims[2], dims[3], dims[4]}; (*ao)->copyVelocity(in, ddims); } else y_error("COPYVELOCITY must be nil, 0, or array(double, 3, nphi, nz, nr"); } } YGYOTO_WORKER_RUN( fitsWrite(ygets_q(iarg)) ); YGYOTO_WORKER_CALL_GENERIC(Astrobj); } extern "C" { void Y__gyoto_Disk3D_register_as_Astrobj(){ ygyoto_Astrobj_register("Disk3D",&ygyoto_Disk3D_eval); } // Generic constructor/accessor void Y_gyoto_Disk3D(int argc) { YGYOTO_CONSTRUCTOR_INIT(Astrobj, Disk3D); if ((*ao)->getKind().compare("Disk3D")) y_error("Expecting Astrobj of kind Disk3D"); ygyoto_Disk3D_eval(ao, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_FixedStar.C000066400000000000000000000033401217470755400210250ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include "../ygyoto.h" #include "yapi.h" using namespace Gyoto; #include using namespace std; using namespace Gyoto::Astrobj; #define OBJ ao // on_eval worker void ygyoto_FixedStar_eval(SmartPointer* ao_, int argc) { static char const * knames[]={ "unit", "radius", "position", YGYOTO_ASTROBJ_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Astrobj, FixedStar, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+3); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Radius); YGYOTO_WORKER_GETSET_VECTOR(Pos, 3); YGYOTO_WORKER_CALL_GENERIC(Astrobj); } extern "C" { void Y__gyoto_FixedStar_register_as_Astrobj(){ ygyoto_Astrobj_register("FixedStar",&ygyoto_FixedStar_eval); } // Generic constructor/accessor void Y_gyoto_FixedStar(int argc) { YGYOTO_CONSTRUCTOR_INIT(Astrobj, FixedStar); if ((*ao)->getKind().compare("FixedStar")) y_error("Expecting Astrobj of kind Star"); ygyoto_FixedStar_eval(ao, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_KerrBL.C000066400000000000000000000042361217470755400202620ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include "ygyoto.h" #include "yapi.h" #include using namespace std; using namespace Gyoto; using namespace Gyoto::Metric; void ygyoto_KerrBL_eval(SmartPointer *OBJ_, int argc) { static char const * knames[]={ "unit", "spin", "makecoord", \ YGYOTO_METRIC_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Metric, KerrBL, knames, YGYOTO_METRIC_GENERIC_KW_N+3); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE(Spin); if (kiargs[++k]>=0) { // makecoord if (debug()) cerr << "DEBUG: In ygyoto_KerrBL_eval(): get_coord" << endl; if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); long dims[]={1,8}; long ntot=1; double * coord_=ygeta_d(kiargs[k],&ntot,0); if (ntot<7) y_error("YINIT should have >= 7 elements"); double * cst_=ygeta_d(piargs[0],&ntot,0); if (ntot!=4) y_error("CST should have 4 elements"); yarg_drop(1); double * coord=ypush_d(dims); # ifdef GYOTO_DEBUG_ENABLED GYOTO_DEBUG_EXPR(OBJ); # endif (*OBJ)->MakeCoord(coord_,cst_,coord); } YGYOTO_WORKER_CALL_GENERIC(Metric); } extern "C" { void Y__gyoto_KerrBL_register_as_Metric(){ ygyoto_Metric_register("KerrBL",&ygyoto_KerrBL_eval); } void Y_gyoto_KerrBL(int argc) { YGYOTO_CONSTRUCTOR_INIT(Metric, KerrBL); if ((*OBJ)->getKind() != "KerrBL") y_error("Expecting Metric of kind KerrBL"); ygyoto_KerrBL_eval(OBJ, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_KerrKS.C000066400000000000000000000030771217470755400203040ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include "ygyoto.h" #include "yapi.h" #include using namespace std; using namespace Gyoto; using namespace Gyoto::Metric; #define OBJ gg void ygyoto_KerrKS_eval(SmartPointer *gg_, int argc) { static char const * knames[]={ "unit", "spin", YGYOTO_METRIC_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Metric, KerrKS, knames, YGYOTO_METRIC_GENERIC_KW_N+2); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE(Spin); YGYOTO_WORKER_CALL_GENERIC(Metric); } extern "C" { void Y__gyoto_KerrKS_register_as_Metric(){ ygyoto_Metric_register("KerrKS",&ygyoto_KerrKS_eval); } void Y_gyoto_KerrKS(int argc) { YGYOTO_CONSTRUCTOR_INIT(Metric, KerrKS); if ((*OBJ)->getKind() != "KerrKS") y_error("Expecting Metric of kind KerrKS"); ygyoto_KerrKS_eval(gg, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_PatternDisk.C000066400000000000000000000124051217470755400213660ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include "../ygyoto.h" #include "yapi.h" #include using namespace Gyoto; using namespace Gyoto::Astrobj; #include using namespace std; // on_eval worker void ygyoto_PatternDisk_eval(SmartPointer *OBJ_, int argc) { static char const * knames[]={ "unit", "fitsread", "patternvelocity", "repeatphi", "nu0", "dnu", "phimin", "phimax", "copyintensity", "copyopacity", "copyvelocity", "copygridradius", "fitswrite", YGYOTO_THINDISK_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Astrobj, PatternDisk, knames, YGYOTO_THINDISK_GENERIC_KW_N+13); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_RUN( fitsRead(ygets_q(iarg)) ); YGYOTO_WORKER_GETSET_DOUBLE(PatternVelocity); YGYOTO_WORKER_GETSET_LONG2(repeatPhi); YGYOTO_WORKER_GETSET_DOUBLE2(nu0); YGYOTO_WORKER_GETSET_DOUBLE2(dnu); YGYOTO_WORKER_GETSET_DOUBLE2(phimin); YGYOTO_WORKER_GETSET_DOUBLE2(phimax); /* INTENSITY */ if ((iarg=kiargs[++k])>=0) { GYOTO_DEBUG << "copyintensity=\n"; iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[3]; (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {3, ddims[0], ddims[1], ddims[2]}; double * out = ypush_d(dims); memcpy(out, (*OBJ)->getIntensity(), dims[1]*dims[2]*dims[3]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyIntensity(NULL, 0); else if (dims[0]==3) { size_t ddims[] = {dims[1], dims[2], dims[3]}; (*OBJ)->copyIntensity(in, ddims); } else y_error("COPYINTENSITY must be nil, 0, or array(double, nnu, nphi, nr"); } } /* OPACITY */ if ((iarg=kiargs[++k])>=0) { GYOTO_DEBUG << "copyopacity=\n"; iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[3]; (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {3, ddims[0], ddims[1], ddims[2]}; double * out = ypush_d(dims); memcpy(out, (*OBJ)->getOpacity(), dims[1]*dims[2]*dims[3]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyOpacity(NULL, 0); else if (dims[0]==3) { size_t ddims[] = {dims[1], dims[2], dims[3]}; (*OBJ)->copyOpacity(in, ddims); } else y_error("COPYOPACITY must be nil, 0, or array(double, nnu, nphi, nr"); } } if ((iarg=kiargs[++k])>=0) { GYOTO_DEBUG << "copyvelocity=\n"; iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[3]; (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {3, 2, ddims[1], ddims[2]}; double * out = ypush_d(dims); memcpy(out, (*OBJ)->getVelocity(), 2*dims[2]*dims[3]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyVelocity(NULL, 0); else if (dims[0]==3 && dims[1]==2) { size_t ddims[] = {dims[2], dims[3]}; (*OBJ)->copyVelocity(in, ddims); } else y_error("COPYVELOCITY must be nil, 0, or array(double, 2, nphi, nr"); } } /* GRIDRADIUS */ if ((iarg=kiargs[++k])>=0) { GYOTO_DEBUG << "copygridradius=\n"; iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); double const * const radius = (*OBJ)->getGridRadius(); if (radius) { size_t ddims[3]; (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {1, ddims[2]}; double * out = ypush_d(dims); memcpy(out, radius, ddims[2]*sizeof(double)); } else ypush_long(0); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyGridRadius(NULL, 0); else if (dims[0]==1) (*OBJ) -> copyGridRadius(in, ntot); else y_error("COPYGRIDRADIUS must be nil, 0, or array(double, nr"); } } YGYOTO_WORKER_RUN( fitsWrite(ygets_q(iarg)) ); YGYOTO_WORKER_CALL_GENERIC(ThinDisk); } extern "C" { void Y__gyoto_PatternDisk_register_as_Astrobj(){ ygyoto_Astrobj_register("PatternDisk",&ygyoto_PatternDisk_eval); } // Generic constructor/accessor void Y_gyoto_PatternDisk(int argc) { YGYOTO_CONSTRUCTOR_INIT(Astrobj, PatternDisk); if ((*OBJ)->getKind().compare("PatternDisk")) y_error("Expecting Astrobj of kind PatternDisk"); ygyoto_PatternDisk_eval(OBJ, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_PolishDoughnut.C000066400000000000000000000045031217470755400221120ustar00rootroot00000000000000/* Copyright (c) 2012-2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "../ygyoto.h" #include "yapi.h" #include #ifdef GYOTO_USE_XERCES #include #endif #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; // on_eval worker void ygyoto_PolishDoughnut_eval(SmartPointer* OBJ_, int argc) { static char const * knames[]={ "unit", "lambda", "tempratio", "centraldensity", "centraltempovervirial", "beta", "spectraloversampling", "l0", "Wsurface", "Wcentre", "rcusp", "rcentre", YGYOTO_ASTROBJ_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Astrobj, PolishDoughnut, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+12); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE(Lambda); YGYOTO_WORKER_GETSET_DOUBLE(TemperatureRatio); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(CentralDensity); YGYOTO_WORKER_GETSET_DOUBLE(CentralTempOverVirial); YGYOTO_WORKER_GETSET_DOUBLE(Beta); YGYOTO_WORKER_GETSET_LONG(SpectralOversampling); YGYOTO_WORKER_GET_DOUBLE(getL0); YGYOTO_WORKER_GET_DOUBLE(getWsurface); YGYOTO_WORKER_GET_DOUBLE(getWcentre); YGYOTO_WORKER_GET_DOUBLE(getRcusp); YGYOTO_WORKER_GET_DOUBLE(getRcentre); YGYOTO_WORKER_CALL_GENERIC(Astrobj); } extern "C" { void Y__gyoto_PolishDoughnut_register_as_Astrobj(){ ygyoto_Astrobj_register("PolishDoughnut",&ygyoto_PolishDoughnut_eval); } // Generic constructor/accessor void Y_gyoto_PolishDoughnut(int argc) { YGYOTO_CONSTRUCTOR_INIT(Astrobj, PolishDoughnut); if ((*OBJ)->getKind()!="PolishDoughnut") y_error("Expecting Astrobj of kind PolishDoughnut"); ygyoto_PolishDoughnut_eval(OBJ, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_PowerLawSpectrum.C000066400000000000000000000035151217470755400224230ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "ygyoto.h" #include "yapi.h" #include #include "GyotoFactory.h" #include "GyotoPowerLawSpectrum.h" namespace YGyoto { namespace Spectrum { ygyoto_Spectrum_eval_worker_t PowerLawYEval; } } using namespace Gyoto; using namespace YGyoto; using namespace Gyoto::Spectrum; using namespace YGyoto::Spectrum; using namespace std; void YGyoto::Spectrum::PowerLawYEval(SmartPointer * OBJ_, int argc) { static char const * knames[]={ "unit", "constant", "exponent", YGYOTO_SPECTRUM_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Spectrum, PowerLaw, knames, YGYOTO_SPECTRUM_GENERIC_KW_N+3); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE(Constant); YGYOTO_WORKER_GETSET_DOUBLE(Exponent); YGYOTO_WORKER_CALL_GENERIC(Spectrum); } extern "C" { void Y_gyoto_PowerLawSpectrum(int argc) { YGYOTO_CONSTRUCTOR_INIT(Spectrum, PowerLaw); if ((*OBJ)->getKind().compare("PowerLaw")) y_error("Expecting Spectrum of kind PowerLaw"); PowerLawYEval(OBJ, argc); } void Y__gyoto_PowerLawSpectrum_register_as_Metric(){ ygyoto_Spectrum_register("PowerLaw",&PowerLawYEval); } } Gyoto-0.1.0/yorick/stdplug/gyoto_Star.C000066400000000000000000000154061217470755400200530ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include "../ygyoto.h" #include "yapi.h" #include #ifdef GYOTO_USE_XERCES #include #endif #include #include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; #define OBJ ao // on_eval worker void ygyoto_Star_eval(SmartPointer* ao_, int argc) { GYOTO_DEBUG << endl; // Define keywords static char const * knames[]={ "unit", "radius", "metric", "initcoord", "spectrum", "opacity", "delta", "adaptive", "maxiter", "reset", "xfill", YGYOTO_ASTROBJ_GENERIC_KW, "get_skypos", "get_txyz", "get_prime", "get_coord", "get_cartesian", 0 }; YGYOTO_WORKER_INIT(Astrobj, Star, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+16); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Radius); YGYOTO_WORKER_GETSET_OBJECT(Metric); /* INITCOORD */ if ((iarg=kiargs[++k])>=0) { //initcoord iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); long dims[]= {1, 8}; double *coord = ypush_d(dims); (*ao)->getInitialCoord(coord); } else { long ptot=1, vtot=1; double *pos=ygeta_d(iarg, &ptot, 0); if (ptot<4) y_error("POS should have at least 4 elements"); int n; double coord[8]; for (n=0; n<4; ++n) coord[n]=pos[n]; double *v=NULL, tdot0; if (yarg_number(piargs[0]+*rvset)) { if ((*paUsed)++) y_error(pmsg); v=ygeta_d(piargs[0]+*rvset, &vtot, 0); if (vtot!=3) y_error("V should have 3 elements"); if (!(*ao)->getMetric()) y_error("Please set metric before setting initial condition"); tdot0=(*ao)->getMetric()->SysPrimeToTdot(pos, v); coord[4]=tdot0; for (n=0; n<3; ++n) coord[5+n]=v[n]*tdot0; } else if (ptot==8) { for (n=4; n<8; ++n) coord[n]=pos[n]; } else if (ptot==7) { v=pos+4; tdot0=(*ao)->getMetric()->SysPrimeToTdot(pos, v); coord[4]=tdot0; for (n=0; n<3; ++n) coord[5+n]=v[n]*tdot0; } else y_error("Not enough information to set initial condition"); (*ao)->setInitialCondition(coord); } } YGYOTO_WORKER_GETSET_OBJECT(Spectrum); #define ypush_Opacity ypush_Spectrum #define yget_Opacity yget_Spectrum YGYOTO_WORKER_GETSET_OBJECT(Opacity); #undef ypush_Opacity #undef yget_Opacity YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Delta); YGYOTO_WORKER_GETSET_LONG2(adaptive); YGYOTO_WORKER_GETSET_LONG2( maxiter ); YGYOTO_WORKER_RUN( reset() ); YGYOTO_WORKER_RUN( xFill(ygets_d(iarg+*rvset)) ); YGYOTO_WORKER_CALL_GENERIC(Astrobj); k += YGYOTO_ASTROBJ_GENERIC_KW_N; // SPECIFIC GET KEYWORDS if ((iarg=kiargs[++k])>=0) { // get skypos if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); if (!yarg_Screen(iarg)) y_error("Expecting gyoto_Screen argument"); SmartPointer *screen = yget_Screen(iarg); int nel =(*ao)->get_nelements(); long dims[] = {2, nel, 3}; double * data=ypush_d(dims); (*ao)->getSkyPos(*screen, data, data+nel, data+2*nel); } if ((iarg=kiargs[++k])>=0) { // get_txyz if ((*rvset)++) y_error(rmsg); int nel =(*ao)->get_nelements(); long dims[] = {2, nel, 4}; double * data=ypush_d(dims); (*ao)->get_t(data); (*ao)->get_xyz(data+nel, data+2*nel, data+3*nel); } if ((iarg=kiargs[++k])>=0) { // get_prime if ((*rvset)++) y_error(rmsg); int nel =(*ao)->get_nelements(); long dims[] = {2, nel, 3}; double * data=ypush_d(dims); (*ao)->get_prime(data, data+nel, data+2*nel); } if ((iarg=kiargs[++k])>=0) { // get_coord if ((*rvset)++) y_error(rmsg); // Two cases : get_coord=1 or get_coord=dates. // We will recognize the first case if the parameter is the // integer scalar 1, any other type or value is a date // specification. int argt = yarg_number(iarg); long ntot[1] = {1}; long dims[Y_DIMSIZE]; double* dates = NULL; double dummy[]= {1.}; if (yarg_nil(iarg)) { // void is same as 1 in this context argt=1; *ntot=1; dims[0]=0; dates=dummy; } else dates = ygeta_d(iarg, ntot, dims); if (debug()) cerr << "DEBUG: gyoto_Star(get_coord=array(" << (argt==1?"long":"double") << ", " << *ntot << ") (rank=" << dims[0] << ", dates[0]=" << dates[0] << ")" << endl; if (dims[0] == 0 && argt == 1 && dates[0] == 1) { if(debug()) cerr << "DEBUG: retrieving all already computed coordinates" << endl; int nel =(*ao)->get_nelements(); long ddims[] = {2, nel, 8}; double * data = ypush_d(ddims); (*ao)->getCoord(data, data+nel, data+2*nel, data+3*nel); (*ao)->get_dot(data+4*nel, data+5*nel, data+6*nel, data+7*nel); } else { if(debug()) cerr << "DEBUG: retrieving coordinates for specified date(s)"<< endl; if (dims[0] > Y_DIMSIZE-2) y_errorn("gyoto_Star(get_coord=dates): DATES must have at most %ld " "dimensions", Y_DIMSIZE-2); dims[0] += 1; dims[dims[0]] = 7; double * data = ypush_d(dims); size_t nel = *ntot; (*ao) -> getCoord(dates, nel, data, data+ nel,data+2* nel,data+3* nel, data+4* nel, data+5* nel, data+6* nel); } } if ((iarg=kiargs[++k])>=0) { // get_cartesian if ((*rvset)++) y_error(rmsg); long ntot[1] = {1}; long dims[Y_DIMSIZE]; double* dates = ygeta_d(iarg, ntot, dims); if(debug()) cerr << "DEBUG: gyoto_Star(get_cartesian=dates)"<< endl; if (dims[0] > Y_DIMSIZE-2) y_errorn("gyoto_Star(get_cartesian=dates): DATES must have at most %ld " "dimensions", Y_DIMSIZE-2); dims[0] += 1; dims[dims[0]] = 6; double * data = ypush_d(dims); size_t nel = *ntot; (*ao) -> getCartesian(dates, nel, data, data + nel, data + 2*nel, data + 3*nel, data + 4*nel, data + 5*nel); } } extern "C" { void Y__gyoto_Star_register_as_Astrobj(){ ygyoto_Astrobj_register("Star",&ygyoto_Star_eval); } // Generic constructor/accessor void Y_gyoto_Star(int argc) { GYOTO_DEBUG << endl; YGYOTO_CONSTRUCTOR_INIT(Astrobj, Star); if ((*ao)->getKind().compare("Star")) y_error("Expecting Astrobj of kind Star"); ygyoto_Star_eval(ao, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_Torus.C000066400000000000000000000036401217470755400202530ustar00rootroot00000000000000/* Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #include "../ygyoto.h" #include "yapi.h" using namespace Gyoto; using namespace Gyoto::Astrobj; #include using namespace std; // on_eval worker void ygyoto_Torus_eval(SmartPointer* OBJ_, int argc) { static char const * knames[]={ "unit", "largeradius", "smallradius", "spectrum", "opacity", YGYOTO_ASTROBJ_GENERIC_KW, 0 }; YGYOTO_WORKER_INIT(Astrobj, Torus, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+5); YGYOTO_WORKER_SET_UNIT; YGYOTO_WORKER_GETSET_DOUBLE_UNIT(LargeRadius); YGYOTO_WORKER_GETSET_DOUBLE_UNIT(SmallRadius); YGYOTO_WORKER_GETSET_OBJECT(Spectrum); # define ypush_Opacity ypush_Spectrum # define yget_Opacity yget_Spectrum YGYOTO_WORKER_GETSET_OBJECT(Opacity); # undef ypush_Opacity # undef yget_Opacity YGYOTO_WORKER_CALL_GENERIC(Astrobj); } extern "C" { void Y__gyoto_Torus_register_as_Astrobj(){ ygyoto_Astrobj_register("Torus",&ygyoto_Torus_eval); } // Generic constructor/accessor void Y_gyoto_Torus(int argc) { YGYOTO_CONSTRUCTOR_INIT(Astrobj, Torus); if ((*OBJ)->getKind().compare("Torus")) y_error("Expecting Astrobj of kind Torus"); ygyoto_Torus_eval(OBJ, argc); } } Gyoto-0.1.0/yorick/stdplug/gyoto_std.i000066400000000000000000000431441217470755400200020ustar00rootroot00000000000000require, "gyoto.i"; gyoto_loadPlugin, "stdplug"; plug_in, "gyoto_std"; /* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ extern __set_GyotoStdPlugSupplier; /* xxDOCUMENT __set_GyotoStdPlugSupplier Retrieve the functions from gyoto.so. Using a plug-in from another plu-gin is not easy. */ __set_GyotoStdPlugSupplier, __gyoto_exportSupplier(); extern _gyoto_KerrBL_register_as_Metric; _gyoto_KerrBL_register_as_Metric; extern _gyoto_KerrKS_register_as_Metric; _gyoto_KerrKS_register_as_Metric; /* xDOCUMENT _gyoto_KerrBL_register_as_Metric should be called once so that gg(get_spin=1...) works. */ extern gyoto_KerrBL; extern gyoto_KerrKS; /* DOCUMENT gg = gyoto_KerrBL([filename,][members=values]) or gg = gyoto_KerrKS([filename,][members=values]) or gg, members=values or value = gg(member=) or coord = gg(makecoord=yinit, cst) // KerrBL only or coefs = gg(position, mu, nu) PURPOSE Instanciate and use a GYOTO KerrBL (for Kerr Boyer-Lindquist) or Kerr (for Kerr Kerr-Schild) Metric. For basics, first read "help, gyoto" and "help, gyoto_Metric". SPECIFIC MEMBER In addition to the generic Metric members, KerrBL and KerrKS metrics have a spin that can be set and retrieved as follows: gg, spin=value; value = gg(spin=) SPECIFIC METHOD In addition to the generic methods provided by gyoto_Metric, KerrBL metrics provide the following: coord=gg(get_coord=yinit, cst) get 8-coordinate (4-position & 4-velocity) COORD corresponding to the 6 coordinate (4-position & 2 momenta) YINIT and the 3 motion constants in CST. SEE ALSO: gyoto, gyoto_Metric */ gyoto_namespace, KerrKS=gyoto_KerrKS; gyoto_namespace, KerrBL=gyoto_KerrBL; /////////// STAR extern _gyoto_Star_register_as_Astrobj; _gyoto_Star_register_as_Astrobj /* xDOCUMENT _gyoto_Star_register_as_Astrobj To be called exactly once ins gyoto_Star.i */ extern gyoto_Star; /* DOCUMENT st = gyoto_Star([filename, ][members=values]) or st, [members=values] or value = st(member=) or st, xfill=tlim; or data = st(function_method=parameters) PURPOSE: Create and manipulate GYOTO Star objects. Stars are a specific kind of Gyoto Astrobj which move in the metric following time-like geodesics and are sort of spherical (although what "spherical" means is coordinate-system-dependent and purely geometrical). There are two uses for GYOTO Stars: - for computing the trajectory of a massive particle in the metric; - as the light source for ray-tracing. For basic concepts, see gyoto and gyoto_Astrobj. MEMBERS: In addition to the generic members described in gyoto_Astrobj, Stars have the following members (which can be set with "st, member=value" and retrieved with "value=st(member=)"): radius= the radius of the sperical star, in geometrical units; metric= the metric of which the Stars follows the geodesics; initcoord=[x0, x1, x2, x3], [dx1/dx0, dx2/dx0, dx3/dx0] or initcoord=[x0, x1, x2, x3, dx1/dx0, dx2/dx0, dx3/dx0] or initcoord=[x0, x1, x2, x3, x0dot, x1dot, x2dot, x3dot] initial position of velocity, requires metric to have been set previously; delta= integration step (initial if adaptive). adaptive= whether the integration uses adaptive step. maxiter= maximum number of iterations in integration. METHODS In addition to the generic Astrobj methods, stars provide the following: Subroutine-like (st, subroutine_keyword=parameters): reset=anything (e.g.: st, reset=; ) Forget the result of a previous integration (see XFILL below). xfill=tlim The orbit is computed between x0 (in INITCOORD) and tlim. XFILL requires INITIALCOOORD to have been set. It is not guaranteed that any of the computed dates is actually tlim, merely that the orbit is computed a least from T0 to TLIM. The result of the integretation is cached inside the star object and can be retrieved with the various get_* methods below. Beware that changing a parameter in the metric will ne be taken into account in the retrieved results. To start again the integration, do one of the following: st, metric=new_metric; st, initcoord=conditions; st, reset=; setparameter=name,string_value Function-like (retval=st(function_method=parameters)): The following return the position of the star for all the dates that where evaluated by the integrated when XFILL, above, was called, in various coordinate systems: get_skypos=screen Retrieve RA, Dec and depth data = st(get_skypos=screen); da=data(,1), dd=data(,2), dD=data(,3); SCREEN is a gyoto_Screen; da, dd and dD are the offsets from the center of the Metric in RA, Dec and along the line-of-sight. get_txyz=anything Retrieve Cartesian coordinates data = st(get_txyz=); t=data(,1), x=data(,2), y=data(,3), z=data(,4); ANYTHING can be anything, including nil. get_coord= Retrieve 8-coordinates (in Metric-prefered coord system) data = st(get_coord=); data(i, )=[t_i, x1_i, x2_i, x3_i, x0dot_i, x1dot_i, x2dot_i, x3dot_i] get_prime= Retrieve 3-velocity coordinates (in Metric-prefered coord system) data = st(get_prime=); data(i, )=[x1dot_i/x0dot_i, x2dot_i/x0dot_i, x3dot_i/x0dot_i] The following retrieve coordinates for specific dates. There is some interpolation involved which is done rather precisely. DATES is a scalar double or an array of doubles of any shape. All the output sub-arrays DATA(..,i) are conformable with DATES: get_coord=dates Retrieve 7 coordinates: data = star (get_coord=dates); STAR is a Star and DATES is an array of double with N elements. DATA will be an array of Nx7 elements where each of the 7 subarrays DATA(,i) is conformable with DATES. In the following, i is the index in the usual physical notation (X0 = time): X0 = DATES for i in {1, 2, 3}, Xi = DATA(..,i); for i in {0, 1, 2, 3} Xidot = DATA(..,i+4). get_cartesian=dates Retrieve 6-coordinates: data = star (get_cartesian=dates); STAR is a Star and DATES is an array of double with N elements. DATA will be an array of Nx6 elements where each of the 7 subarrays DATA(,i) is conformable with DATES. X = DATA(..,1); Y = DATA(..,2); Z = DATA(..,3); dX/dt = DATA(..,4); dY/dt = DATA(..,5); dZ/dt = DATA(..,6); EXAMPLE: data = gyoto_Star(get_txyz=1, initialpos=pos, v, xfill=tlim, metric=gyoto_KerrBL(spin=a)); SEE ALSO: gyoto_Metric, gyoto_Kerr */ gyoto_namespace, Star=gyoto_Star; ///////// FIXEDSTAR extern _gyoto_FixedStar_register_as_Astrobj; _gyoto_FixedStar_register_as_Astrobj; extern gyoto_FixedStar; /* DOCUMENT fs = gyoto_FixedStar([filename, ][members=values]) fs, members=values; retval = fs(member=) fs, xmlwrite=filename; A GYOTO astrophysicla object: a non-moving, coordinate-spherical blob. See GYOTO for basic concepts. This star is fixed in the coordinate system with 3D position POS3D, for any time. The time coordinate is missing in POS3D. RADIUS is the stars radius. MEMBER KEYWORDS: Members can be set with "fs, member=val" or retrieved with "relval=fs(member=)" where member is one of: metric= any GYOTO Metric object position= 3D position of the star radius= radius of the star, in geometrical units In addition, the standard gyoto_Astrobj members and methods are supported. SEE ALSO: gyoto, gyoto_Astrobj, gyoto_Metric */ gyoto_namespace, FixedStar=gyoto_FixedStar; //// TORUS extern _gyoto_Torus_register_as_Astrobj; _gyoto_Torus_register_as_Astrobj; extern gyoto_Torus; /* DOCUMENT torus = gyoto_Torus([filename, ][members=values]); torus, members=values; or value = torus(member=); or torus, xmlwrite=filename A simple Torus for use with GYOTO. See "help, gyoto" for basics. The Torus is in solid rotation at the circular velocity along the circle of diameter LARGERADIUS. SMALLRADIUS is the radius of a vertical cross-section. Torus emission is set using SPECTRUM and OPACITY. MEMBERS: largeradius, smallradius, spectrum, opacity SEE ALSO: gyoto, gyoto_Astrobj, gyoto_Star, gyoto_Spectrum */ gyoto_namespace, Torus=gyoto_Torus; //// PATTERNDISK extern _gyoto_PatternDisk_register_as_Astrobj; _gyoto_PatternDisk_register_as_Astrobj; extern gyoto_PatternDisk; /* DOCUMENT disk = gyotoPatternDisk(...) disk, member=value... This is a subkind of gyoto_ThinDisk. The disk is "painted" with a pattern, hence the name. The grid for the pattern is set by three numbers: NPHI (number of grid points in the azimuthal direction), REPEATPHI if the pattern must be repeated several times in the azimuthal direction (i.e. if the angular periodicity of the pattern is a fraction of 2*pi), and NR (number of grid points in the radial direction). The disk extends from INNERRADIUS to OUTERRADIUS (see gyoto_ThinDisk) with a regular spacing along the radial direction, unless RADIUS is specified. The pattern is specified by the surface brightness EMISSION==Jnu at NNU frequencies going from NU0 to NU0*DNU*(NNU-1). The cube EMISSION is an array(double, NNU, NPHI, NR). An optional OPACITY cube with the same dimensions as EMISSION can be provided. This allows using PatternDisk for any solid object confined in the equatorial plane and orbiting the central object in circular motion. By default, the fluid is supposed to be corotating at the local circular velocity, but the fluid velocity field can be specified with VELOCITY==array(double, 2, NPHI, NR). VELOCITY(1,..)==dphi/dt; VELOCITY(2,..)==dr/dt. The fluid VELOCITY field must not be mistaken by the apparent pattern velocity. The pattern is is solid (apparent) rotation at angular velocity PATTERNVELOCITY. KEYWORDS: fitsread="filename.fits" read pattern from FITS file. fitswrite="filename.fits" write pattern to FITS file. patternvelocity=double(value) set (or get) pattern angular velocity. repeatphi=N the pattern angular periodicity is 2*pi/N. nu0= first frequency (Hz) dnu= frequencty spacing (Hz) copyintensity=EMISSION * if EMISSION is nil, retrieve the surface brightness cube; * if EMISSION==0, free the cube; * if EMISSION is an array of NNU x NPHI x NR doubles, attach (copy) this array into DISK as the surface brightness cube. If this cube doesn't have the same dimensions as the previously set one, the velocity and radius arrays will also be freed (as they have inconsistent dimensions). copyopacity=OPACITY same as above for the opacity cube. copyvelocity=VELOCITY same as COPYINTENSITY but to attach the fluid velocity field, a 2 x NPHI x NR array where VELOCITY(1,..)==dphi/dt and VELOCITY(2,..)==dr/dt. copygridradius=RADIUS same as above, but RADIUS is a NR element vector specifying the R coordinate of the grid points. If RADIUS is not attached (if set, it can be detached with copygridradius=0), the grid points are regularly spaced between INNERRADIUS and OUTERRADIUS (see gyoto_ThinDisk). SEE ALSO: gyoto_Astrobj, gyoto_ThinDisk */ gyoto_namespace, PatternDisk=gyoto_PatternDisk; //// DISK3D extern _gyoto_Disk3D_register_as_Astrobj; _gyoto_Disk3D_register_as_Astrobj; extern gyoto_Disk3D; /* DOCUMENT disk = gyoto_Disk3D(...) disk, member=value... Geometrically thick disk. The grid for the pattern is set by 4 numbers: NPHI (number of grid points in the azimuthal direction), REPEATPHI if the pattern must be repeated several times in the azimuthal direction (i.e. if the angular periodicity of the pattern is a fraction of 2*pi), NZ (number of grid points in the vertical direction), and NR (number of grid points in the radial direction). The disk extends from RIN to ROUT with a regular spacing along all directions. The pattern is specified by the surface brightness which can be computed from EMISSQUANT which is typically the temperature at NNU frequencies going from NU0 to NU0*DNU*(NNU-1). The cube EMISSQUANT is an array(double, NNU, NPHI, NZ, NR). The fluid velocity field must be specified with VELOCITY==array(double, 3, NPHI, NZ, NR). VELOCITY(1,..)==dphi/dt; VELOCITY(2,..)==dz/dt; VELOCITY(3,..)==dr/dt. KEYWORDS: fitsread="filename.fits" read pattern from FITS file. fitswrite="filename.fits" write pattern to FITS file. repeatphi=N the pattern angular periodicity is 2*pi/N. nu0= first frequency (Hz) dnu= frequencty spacing (Hz) rin= inner radius rout= outer radius zmin= smallest z value (if >=0 then the disk is assumed to be symmetric by z->-z transformation) zmax= biggest z value copyemissquant=EMISSQUANT * if EMISSQUANT is nil, retrieve the cube; * if EMISSQUANT==0, free the cube; * if EMISSQUANT is an array of NNU x NPHI x NZ x NR doubles, attach (copy) this array into DISK. If this cube doesn't have the same dimensions as the previously set one, the velocity array will also be freed (as it has inconsistent dimensions). copyvelocity=VELOCITY same as COPYEMISSQUANT but to attach the fluid velocity field, a 3 x NPHI x NZ x NR array where VELOCITY(1,..)==dphi/dt, VELOCITY(2,..)==dz/dt and VELOCITY(3,..)==dr/dt SEE ALSO: gyoto_Astrobj, gyoto_PatternDisk */ gyoto_namespace, Disk3D=gyoto_Disk3D; //// POLISHDOUGHNUT extern _gyoto_PolishDoughnut_register_as_Astrobj; _gyoto_PolishDoughnut_register_as_Astrobj; /* xDOCUMENT _gyoto__register_as_Astrobj To be called exactly once in gyoto_.i */ extern gyoto_PolishDoughnut; /* DOCUMENT pd = gyoto_PolishDoughnut([filename, ][members=values]) or pd, members=values or value = pd(member=) PURPOSE: Create and manipulate GYOTO PolishDoughnut objects. PolishDoughnuts are toroidal accretion structures in KerrBL metric. They can be optically thin or optically thick and the spectrum can be computed. For basic syntax, see "help, gyoto" and "help, gyoto_Astrobj". MEMBERS: In addition to those listed in "help, gyoto_Astrobj": lambda= (a double) the lambda parameter tempratio, centraldensity, centraltempovervirial, beta metric= a gyoto_Metric object (KerrBL only) METHODS: Some characteristic values can be retrieved with value=pd(keyword=): l0, Wsurface, Wcentre, rcusp, rcentre SEE ALSO: gyoto, gyoto_Astrobj, gyoto_KerrBL */ gyoto_namespace, PolishDoughnut=gyoto_PolishDoughnut; /////// SPECTRUM KIND /////// /* PowerLaw */ extern gyoto_PowerLawSpectrum; /* DOCUMENT spectrum = gyoto_PowerLawSpectrum([filename, ][members=values]); spectrum, members=values; value = spectrum(member=); Inu = spectrum(nu) SEE ALSO: gyoto, gyoto_Spectrum */ gyoto_namespace, PowerLawSpectrum=gyoto_PowerLawSpectrum; extern _gyoto_PowerLawSpectrum_register_as_Metric; _gyoto_PowerLawSpectrum_register_as_Metric; /* BlackBody */ extern gyoto_BlackBodySpectrum; /* DOCUMENT spectrum = gyoto_BlackBodySpectrum([filename, ][members=values]); spectrum, members=values; value = spectrum(member=); Inu = spectrum(nu) SEE ALSO: gyoto, gyoto_Spectrum */ gyoto_namespace, BlackBodySpectrum=gyoto_BlackBodySpectrum; extern _gyoto_BlackBodySpectrum_register_as_Metric; _gyoto_BlackBodySpectrum_register_as_Metric; Gyoto-0.1.0/yorick/ygyoto.h000066400000000000000000000612531217470755400156370ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __YGYOTO_H #define __YGYOTO_H #include "GyotoConfig.h" #include "GyotoMetric.h" #include "GyotoAstrobj.h" #include "GyotoThinDisk.h" #include "GyotoSpectrum.h" #include "GyotoScreen.h" #include "GyotoPhoton.h" #include "GyotoScenery.h" #include "GyotoScreen.h" #define YGYOTO_TYPE_LEN 21 #define YGYOTO_STD_CATCH catch(Gyoto::Error e) \ { y_error(e.get_message().c_str()); } #define YGYOTO_MAX_REGISTERED 20 typedef void ygyoto_Metric_eval_worker_t(Gyoto::SmartPointer*, int); typedef void ygyoto_Astrobj_eval_worker_t(Gyoto::SmartPointer*, int); typedef void ygyoto_Spectrum_eval_worker_t(Gyoto::SmartPointer*,\ int); typedef void ygyoto_Spectrometer_eval_worker_t(Gyoto::SmartPointer*, int); #ifndef YGYOTO_LOCAL_SUPPLIER /* To push or get a Gyoto Object or to check if iarg is a Gyoto object of a given type, use the following wrappers around the YAPI functions ypush_obj() and yget_obj(). yarg_OBJTYPE return 1 if iarg is an object of that type. */ Gyoto::SmartPointer *yget_Metric(int iarg); Gyoto::SmartPointer *ypush_Metric(); int yarg_Metric(int iarg); Gyoto::SmartPointer* yget_Astrobj(int iarg); Gyoto::SmartPointer* ypush_Astrobj(); int yarg_Astrobj(int iarg); Gyoto::SmartPointer* yget_Screen(int iarg); Gyoto::SmartPointer* ypush_Screen(); int yarg_Screen(int iarg); Gyoto::SmartPointer* yget_Photon(int iarg); Gyoto::SmartPointer* ypush_Photon(); int yarg_Photon(int iarg) ; Gyoto::SmartPointer* yget_Scenery(int iarg); Gyoto::SmartPointer* ypush_Scenery(); int yarg_Scenery(int iarg); Gyoto::SmartPointer* yget_Screen(int iarg); Gyoto::SmartPointer* ypush_Screen(); int yarg_Screen(int iarg); Gyoto::SmartPointer* yget_Spectrum(int iarg); Gyoto::SmartPointer* ypush_Spectrum(); int yarg_Spectrum(int iarg); Gyoto::SmartPointer* yget_Spectrometer(int iarg); Gyoto::SmartPointer* ypush_Spectrometer(); int yarg_Spectrometer(int iarg); /* You can register your own on_eval worker. It will be called when a Metric object GG_OBJ of your specific kind is called as gg_obj(arguments). (Resp. Astrobj.) In your own routins, you can also call the generic eval (and you certainly should, it's the one that processes the generic keywords below). The generic Metric on eval must be called at the end of your specific on eval because it will try to return the metric coefficients if no other outpur value has been pushed. */ void ygyoto_Metric_register(char const * const kind, ygyoto_Metric_eval_worker_t* on_eval); void ygyoto_Metric_generic_eval(Gyoto::SmartPointer*, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit); void ygyoto_Astrobj_register(char const * const kind, ygyoto_Astrobj_eval_worker_t* on_eval); void ygyoto_Astrobj_generic_eval(Gyoto::SmartPointer*, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit); void ygyoto_ThinDisk_generic_eval(Gyoto::SmartPointer*, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit); void ygyoto_Spectrum_register(char const * const kind, ygyoto_Spectrum_eval_worker_t*on_eval); void ygyoto_Spectrum_generic_eval (Gyoto::SmartPointer *, int *kiargs, int *piargs, int *rvset, int *paUsed, char *unit); void ygyoto_Spectrometer_register(char const * const kind, ygyoto_Spectrometer_eval_worker_t*on_eval); void ygyoto_Spectrometer_generic_eval (Gyoto::SmartPointer *, int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit); #endif /* The generic on_eval will process these keywords. You need to have initiated the kiargs table. You should call the generic on_eval after processing your SET keywords and before processing your GET keywords. rvset and paUsed are input _and_ output. *rvset == 1 if a return value (ypush_*) is already defined, *rvset == 0 if not. Likewise, *paUsed means that (at least) one positional argument has already been used. Attempting to set the return value twice or to use a positional argument twice is to be considered an error condition. */ // Keywords processed by ygyoto_Metric_generic_eval #define YGYOTO_METRIC_GENERIC_KW "prime2tdot", \ "nullifycoord", "kind", "setparameter", "scalarprod", \ "mass", "unitlength", "circularvelocity", "xmlwrite", "clone" // Number of those keywords #define YGYOTO_METRIC_GENERIC_KW_N 10 // Keywords processed by ygyoto_Astrobj_generic_eval #define YGYOTO_ASTROBJ_GENERIC_KW "metric", "rmax", "opticallythin", \ "xmlwrite", "kind", "setparameter", "clone" // number of those keywords #define YGYOTO_ASTROBJ_GENERIC_KW_N 7 // Keywords processed by ygyoto_ThinDisk_generic_eval #define YGYOTO_THINDISK_GENERIC_KW \ "innerradius", "outerradius", "thickness", "dir", \ YGYOTO_ASTROBJ_GENERIC_KW // number of those keywords #define YGYOTO_THINDISK_GENERIC_KW_N 4+YGYOTO_ASTROBJ_GENERIC_KW_N // maximum number of keywords accepted by a base Astrobj class #define YGYOTO_ASTROBJ_BASE_MAX_KW_N YGYOTO_THINDISK_GENERIC_KW_N // Keywords processed by ygyoto_Spectrum_generic_eval #define YGYOTO_SPECTRUM_GENERIC_KW "xmlwrite", "kind", "setparameter", "clone", "integrate" // number of those keywords #define YGYOTO_SPECTRUM_GENERIC_KW_N 5 // Keywords processed by ygyoto_Spectrometer_generic_eval #define YGYOTO_SPECTROMETER_GENERIC_KW "kind", "xmlwrite", "clone", "nsamples",\ "setparameter", "channels", "midpoints", "widths" // number of those keywords #define YGYOTO_SPECTROMETER_GENERIC_KW_N 8 /* The following are neat for writing workers. The worker needs to abide by my unwritten coding style. Assume MyKind is a subclass of MyBase. MyBase is one of Metric, Astrobj, Spectrum, Spectrometer. void ygyoto_MyKind_eval(SmartPointer* OBJ_, int argc) { // Define keywords static char const * knames[]={ "unit", "keyword1", "keyword2", ..., "keywordN", YGYOTO_MYBASE_GENERIC_KW, 0 }; // Parse arguments YGYOTO_WORKER_INIT(MyBase, MyKind, knames, YGYOTO_MYBASE_GENERIC_KW_N+N+1); // Read unit keyword YGYOTO_WORKER_SET_UNIT; // process individual keywords YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Keyword1); ... YGYOTO_WORKER_GETSET...(KeywordN); // Call generic worker YGYOTO_WORKER_CALL_GENERIC(MyBase); } */ #define YGYOTO_STR1(X) #X #define YGYOTO_STR(X) YGYOTO_STR1(X) #define YGYOTO_CAT1(X, Y) X##Y #define YGYOTO_CAT(X, Y) YGYOTO_CAT1(X,Y) #define YGYOTO_CONSTRUCTOR_INIT1(BASENAME, BASECLASS, DERIVEDCLASS) \ Gyoto::SmartPointer *OBJ = NULL; \ if (yarg_##BASENAME(argc-1)) { \ OBJ = yget_##BASENAME(--argc); \ GYOTO_DEBUG_EXPR(OBJ); \ } else if (yarg_string(argc-1)) { \ char * fname = ygets_q(argc-1); \ OBJ = ypush_##BASENAME(); \ GYOTO_DEBUG_EXPR(OBJ); \ * OBJ = Gyoto::Factory(fname).get##BASENAME(); \ GYOTO_DEBUG << "Swapping object for filename\n"; \ yarg_swap(0, argc); \ GYOTO_DEBUG << "Dropping filename from stack\n"; \ yarg_drop(1); \ GYOTO_DEBUG << "Dropped filename from stack\n"; \ --argc; \ } else { \ OBJ = ypush_##BASENAME(); \ GYOTO_DEBUG_EXPR(OBJ); \ *OBJ = new DERIVEDCLASS(); \ for (int arg=0; arg *OBJ = \ (Gyoto::SmartPointer *)YGYOTO_CAT(OBJ, _); \ static long kglobs[NKW+1]; \ int kiargs[NKW]; \ int piargs[]={-1,-1,-1,-1}; \ yarg_kw_init(const_cast(KNAMES), kglobs, kiargs); \ int iarg=argc, parg=0; \ while (iarg>=1) { \ iarg = yarg_kw(iarg, kglobs, kiargs); \ if (iarg>=1) { \ if (parg<4) piargs[parg++]=iarg--; \ else y_error( #CLASS " worker takes at most 4 positional arguments"); \ } \ } \ GYOTO_DEBUG_ARRAY(piargs, 4); \ GYOTO_DEBUG_ARRAY(kiargs, NKW); \ int k=-1; \ char const * rmsg="Cannot set return value more than once"; \ char const * pmsg="Cannot use positional argument more than once"; \ char * unit=NULL; #define YGYOTO_WORKER_GETSET_VECTOR(MEMBER, N) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error(rmsg); \ long dims[] = {1,N}; \ double * coord=ypush_d(dims); \ (*OBJ)-> get##MEMBER (coord); \ } else { \ long ntot; \ double * pos = ygeta_d(iarg, &ntot, NULL); \ if (ntot set##MEMBER (pos); \ } \ } #define YGYOTO_WORKER_GETSET4(MEMBER) \ YGYOTO_WORKER_GETSET_VECTOR(MEMBER, 4) #define YGYOTO_WORKER_GETSET_DOUBLE_UNIT(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error("Only one return value possible"); \ ypush_double((*OBJ) -> get##MEMBER (unit?unit:"")); \ } else \ (*OBJ) -> set##MEMBER (ygets_d(iarg), unit?unit:""); \ } #define YGYOTO_WORKER_GETSET_DOUBLE(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error("Only one return value possible"); \ ypush_double((*OBJ) -> get##MEMBER ()); \ } else \ (*OBJ) -> set##MEMBER (ygets_d(iarg)); \ } #define YGYOTO_WORKER_GET_DOUBLE(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error("Only one return value possible"); \ ypush_double((*OBJ) -> MEMBER ()); \ } else \ y_error( #MEMBER " is read only"); \ } #define YGYOTO_WORKER_GETSET_DOUBLE2(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error("Only one return value possible"); \ ypush_double((*OBJ) -> MEMBER ()); \ } else \ (*OBJ) -> MEMBER (ygets_d(iarg)); \ } #define YGYOTO_WORKER_GETSET_LONG(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error("Only one return value possible"); \ ypush_long((*OBJ) -> get##MEMBER ()); \ } else \ (*OBJ) -> set##MEMBER (ygets_l(iarg)); \ } #define YGYOTO_WORKER_GETSET_LONG2(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ if ((*rvset)++) y_error("Only one return value possible"); \ ypush_long((*OBJ) -> MEMBER ()); \ } else \ (*OBJ) -> MEMBER (ygets_l(iarg)); \ } #define YGYOTO_WORKER_GETSET_OBJECT(MEMBER) \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if (yarg_nil(iarg)) { \ GYOTO_DEBUG << "pushing " #MEMBER << std::endl; \ if ((*rvset)++) y_error("Only one return value possible"); \ *ypush_##MEMBER () = (*OBJ) -> get##MEMBER (); \ } else { \ GYOTO_DEBUG << "setting " #MEMBER << std::endl; \ (*OBJ) -> set##MEMBER (*yget_##MEMBER (kiargs[k])); \ } \ } #define YGYOTO_WORKER_SET_UNIT \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ GYOTO_DEBUG << "set unit" << std::endl; \ unit = ygets_q(iarg); \ } #define YGYOTO_WORKER_SETPARAMETER \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ if ((*paUsed)++) y_error("pmsg"); \ string name = ygets_q(iarg); \ string content = ""; \ if (piargs[0] >= 0) content = ygets_q(*piargs); \ try { \ (*OBJ)->setParameter(name, content, unit?unit:""); \ } YGYOTO_STD_CATCH; \ } #ifdef GYOTO_USE_XERCES # define YGYOTO_WORKER_XMLWRITE \ if ((iarg=kiargs[++k])>=0) { \ iarg+=*rvset; \ char *filename=ygets_q(iarg); \ Gyoto::Factory(*OBJ).write(filename); \ } #else # define YGYOTO_WORKER_XMLWRITE \ if ((iarg=kiargs[++k])>=0) { \ y_error("This GYOTO was compiled without xerces: no xml i/o"); \ } #endif #define YGYOTO_WORKER_CLONE(TYPE) \ if ((iarg=kiargs[++k])>=0) { \ if ((*rvset)++) y_error(rmsg); \ *ypush_##TYPE () = (*OBJ)->clone(); \ } #define YGYOTO_WORKER_RUN(METHOD) \ if ((iarg=kiargs[++k])>=0) { \ GYOTO_DEBUG << #METHOD << std::endl ; \ iarg+=*rvset; \ (*OBJ)-> METHOD ; \ } #define YGYOTO_WORKER_CALL_GENERIC(BASE) \ ygyoto_##BASE##_generic_eval(YGYOTO_CAT(OBJ,_), \ kiargs+k+1, piargs, rvset, paUsed, unit); /* The following are to declare a new base (such as Metric or Astrobj) or independent (such as Photon) class. Seldom used in a Gyoto extension. */ #ifdef GYOTO_USE_XERCES # define YGYOTO_PRINT_YUSEROBJ(NAME) \ void gyoto_##NAME##_print(void *obj) { \ string rest="", sub=""; \ size_t pos=0, len=0; \ try {rest = Factory(((gyoto_##NAME*)obj)->smptr).format();} \ YGYOTO_STD_CATCH; \ while (len=rest.length()) { \ sub=rest.substr(0, pos=rest.find_first_of("\n",0)); \ rest=rest.substr(pos+1, len-1); \ y_print( sub.c_str(),1 ); \ } \ } #else # define YGYOTO_PRINT_YUSEROBJ(NAME) \ void gyoto_##NAME##_print(void *obj) { \ y_print("GYOTO " #NAME,0); \ } #endif #define YGYOTO_YUSEROBJ(NAME, CLASS) \ extern "C" { \ typedef struct gyoto_##NAME { \ Gyoto::SmartPointer smptr; \ } gyoto_##NAME; \ void gyoto_##NAME##_free(void *obj) { \ if (((gyoto_##NAME*)obj)->smptr) { \ ((gyoto_##NAME*)obj)->smptr=NULL; \ } else printf("null pointer\n"); \ } \ YGYOTO_PRINT_YUSEROBJ(NAME) \ void gyoto_##NAME##_eval(void *obj, int argc); \ void gyoto_##NAME##_extract(void *obj, char *member) { \ long idxo = yget_global("__gyoto_obj", 0); \ long idxr = yget_global("__gyoto_res", 0); \ *ypush_##NAME()= ((gyoto_##NAME*)obj)->smptr; \ yput_global(idxo, 0); \ yarg_drop(1); \ long dims[Y_DIMSIZE]={1,1}; \ string stmt = "eq_nocopy, __gyoto_res, __gyoto_obj("; \ stmt.append(member).append("=);"); \ *ypush_q(dims)=p_strcpy(stmt.c_str()); \ yexec_include(0, 1); \ yarg_drop(1); \ ypush_global(idxr); \ } \ static y_userobj_t gyoto_##NAME##_obj = \ {const_cast("gyoto_" #NAME), \ &gyoto_##NAME##_free, \ &gyoto_##NAME##_print, \ &gyoto_##NAME##_eval, \ &gyoto_##NAME##_extract, \ 0}; \ } \ Gyoto::SmartPointer* yget_##NAME(int iarg) { \ return &(((gyoto_##NAME*)yget_obj(iarg, &gyoto_##NAME##_obj))->smptr); \ } \ Gyoto::SmartPointer* ypush_##NAME() { \ return &(((gyoto_##NAME*)ypush_obj(&gyoto_##NAME##_obj, \ sizeof(gyoto_##NAME)))->smptr); \ } \ int yarg_##NAME(int iarg) { \ return yget_obj(iarg,0)==gyoto_##NAME##_obj.type_name; \ } \ extern "C" { \ void Y_is_gyoto_##NAME(int argc) \ { \ ypush_long(yarg_##NAME(0)); \ } \ } #define YGYOTO_BASE_CONSTRUCTOR(BASE) \ extern "C" { \ void Y_gyoto_##BASE(int argc) { \ Gyoto::SmartPointer *OBJ = NULL; \ if (yarg_##BASE(argc-1)) { \ OBJ = yget_##BASE(argc); \ } else { \ if (!yarg_string(argc-1)) \ y_error("Cannot allocate object of virtual class " #BASE); \ char * fname = ygets_q(argc-1); \ OBJ = ypush_##BASE(); \ Gyoto::BASE::Subcontractor_t * sub = \ Gyoto::BASE::getSubcontractor(fname, 1); \ if (sub) { \ GYOTO_DEBUG << "found a subcontractor for \"" << fname \ << "\", calling it now\n"; \ *OBJ = (*sub)(NULL); \ } else { \ GYOTO_DEBUG << "found no subcontractor for \"" << fname \ << "\", calling Factory now\n"; \ *OBJ = Factory(fname).get##BASE(); \ } \ yarg_swap(0, argc); \ yarg_drop(1); \ } \ --argc; \ gyoto_##BASE##_eval(OBJ, argc); \ } \ } /* The following are needed to export the ABI to other plug-ins. You usually don't need to read below this line. */ typedef Gyoto::SmartPointer *ygyoto_yget_Metric_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Metric_t(); typedef int yarg_OBJTYPE_t(int); typedef void ygyoto_Metric_register_t(char const * const, ygyoto_Metric_eval_worker_t*); typedef void ygyoto_Metric_generic_eval_t(Gyoto::SmartPointer*, \ int *, int *, int*, int*, char *); typedef Gyoto::SmartPointer *ygyoto_yget_Astrobj_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Astrobj_t(); //typedef int yarg_Astrobj_t(int); typedef void ygyoto_Astrobj_register_t(char const * const, ygyoto_Astrobj_eval_worker_t*); typedef void ygyoto_Astrobj_generic_eval_t \ (Gyoto::SmartPointer*, int *, int *, int*, int*, char *); typedef Gyoto::SmartPointer *\ ygyoto_yget_Spectrum_t(int); typedef Gyoto::SmartPointer *\ ygyoto_ypush_Spectrum_t(); //typedef int yarg_Spectrum::Generic_t(int); typedef void ygyoto_Spectrum_register_t\ (char const*const, ygyoto_Spectrum_eval_worker_t*); typedef void ygyoto_Spectrum_generic_eval_t \ (Gyoto::SmartPointer*, int *, int *, int*, int*, char*); typedef Gyoto::SmartPointer *ygyoto_yget_Screen_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Screen_t(); typedef Gyoto::SmartPointer *ygyoto_yget_Scenery_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Scenery_t(); typedef Gyoto::SmartPointer *ygyoto_yget_Photon_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Photon_t(); typedef Gyoto::SmartPointer *\ ygyoto_yget_Spectrometer_t(int); typedef Gyoto::SmartPointer *\ ygyoto_ypush_Spectrometer_t(); //typedef int yarg_Spectrometer::Generic_t(int); typedef void ygyoto_Spectrometer_register_t\ (char const*const, ygyoto_Spectrometer_eval_worker_t*); typedef void ygyoto_Spectrometer_generic_eval_t \ (Gyoto::SmartPointer*, int *, int *, int*, int*, char*); typedef struct YGyotoSupplier { // Metric ygyoto_yget_Metric_t *yget_Metric; ygyoto_ypush_Metric_t *ypush_Metric; yarg_OBJTYPE_t *yarg_Metric; ygyoto_Metric_register_t *ygyoto_Metric_register; ygyoto_Metric_generic_eval_t* ygyoto_Metric_generic_eval; // Astrobj ygyoto_yget_Astrobj_t *yget_Astrobj; ygyoto_ypush_Astrobj_t *ypush_Astrobj; yarg_OBJTYPE_t *yarg_Astrobj; ygyoto_Astrobj_register_t *ygyoto_Astrobj_register; ygyoto_Astrobj_generic_eval_t* ygyoto_Astrobj_generic_eval; ygyoto_Astrobj_generic_eval_t* ygyoto_ThinDisk_generic_eval; // Spectrum ygyoto_yget_Spectrum_t *yget_Spectrum; ygyoto_ypush_Spectrum_t *ypush_Spectrum; yarg_OBJTYPE_t *yarg_Spectrum; ygyoto_Spectrum_register_t *ygyoto_Spectrum_register; ygyoto_Spectrum_generic_eval_t* ygyoto_Spectrum_generic_eval; // Screen ygyoto_yget_Screen_t *yget_Screen; ygyoto_ypush_Screen_t *ypush_Screen; yarg_OBJTYPE_t *yarg_Screen; // Scenery ygyoto_yget_Scenery_t *yget_Scenery; ygyoto_ypush_Scenery_t *ypush_Scenery; yarg_OBJTYPE_t *yarg_Scenery; // Photon ygyoto_yget_Photon_t *yget_Photon; ygyoto_ypush_Photon_t *ypush_Photon; yarg_OBJTYPE_t *yarg_Photon; // Spectrometer ygyoto_yget_Spectrometer_t *yget_Spectrometer; ygyoto_ypush_Spectrometer_t *ypush_Spectrometer; yarg_OBJTYPE_t *yarg_Spectrometer; ygyoto_Spectrometer_register_t *ygyoto_Spectrometer_register; ygyoto_Spectrometer_generic_eval_t* ygyoto_Spectrometer_generic_eval; } YGyotoSupplier_t; #ifdef YGYOTO_LOCAL_SUPPLIER // The above ABI is exposed as macros in external plug-ins extern YGyotoSupplier_t* YGYOTO_LOCAL_SUPPLIER; #define yget_Metric(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Metric(iarg) #define ypush_Metric() YGYOTO_LOCAL_SUPPLIER -> ypush_Metric() #define yarg_Metric(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Metric(iarg) #define ygyoto_Metric_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Metric_register(kind, on_eval) #define ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define yget_Astrobj(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Astrobj(iarg) #define ypush_Astrobj() YGYOTO_LOCAL_SUPPLIER -> ypush_Astrobj() #define yarg_Astrobj(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Astrobj(iarg) #define ygyoto_Astrobj_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Astrobj_register(kind, on_eval) #define ygyoto_Astrobj_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Astrobj_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define ygyoto_ThinDisk_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_ThinDisk_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define yget_Spectrum(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Spectrum(iarg) #define ypush_Spectrum() YGYOTO_LOCAL_SUPPLIER -> ypush_Spectrum() #define yarg_Spectrum(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Spectrum(iarg) #define ygyoto_Spectrum_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Spectrum_register(kind, on_eval) #define ygyoto_Spectrum_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Spectrum_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define yget_Screen(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Screen(iarg) #define ypush_Screen() YGYOTO_LOCAL_SUPPLIER -> ypush_Screen() #define yarg_Screen(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Screen(iarg) #define yget_Scenery(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Scenery(iarg) #define ypush_Scenery() YGYOTO_LOCAL_SUPPLIER -> ypush_Scenery() #define yarg_Scenery(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Scenery(iarg) #define yget_Photon(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Photon(iarg) #define ypush_Photon() YGYOTO_LOCAL_SUPPLIER -> ypush_Photon() #define yarg_Photon(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Photon(iarg) #define yget_Spectrometer(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Spectrometer(iarg) #define ypush_Spectrometer() YGYOTO_LOCAL_SUPPLIER -> ypush_Spectrometer() #define yarg_Spectrometer(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Spectrometer(iarg) #define ygyoto_Spectrometer_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Spectrometer_register(kind, on_eval) #define ygyoto_Spectrometer_generic_eval(gg, kiargs, piargs, rvset, paUsed) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Spectrometer_generic_eval(gg, kiargs, piargs, rvset,paUsed) #endif #endif Gyoto-0.1.0/yorick/ygyoto_idx.h000066400000000000000000000023461217470755400165010ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #ifndef __YGYOTO_IDX_H #define __YGYOTO_IDX_H namespace YGyoto { class Idx; } class YGyoto::Idx { private: int _is_nuller; int _is_range; int _is_list; int _is_scalar; int _is_double; int _is_first; long _range[3]; double _dval; long *_idx; long _nel; long _cur; int _valid; public: Idx(int iarg, int res); int isNuller(); int getNDims(); long getNElements(); long first(); int valid(); long next(); long current(); double getDVal(); int isDouble(); int isFirst(); int isLast(); }; #endif Gyoto-0.1.0/yorick/ygyoto_supplier.C000066400000000000000000000021041217470755400175030ustar00rootroot00000000000000/* Copyright 2011 Thibaut Paumard This file is part of Gyoto. Gyoto 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. Gyoto 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 Gyoto. If not, see . */ #include #include #define JOIN(x, y) JOIN_AGAIN(x, y) #define JOIN_AGAIN(x, y) x ## y #define Y___SET_YGYOTO_LOCAL_SUPPLIER JOIN(Y___set_, YGYOTO_LOCAL_SUPPLIER) YGyotoSupplier_t* YGYOTO_LOCAL_SUPPLIER = 0; extern "C" { void Y___SET_YGYOTO_LOCAL_SUPPLIER (int argc) { YGYOTO_LOCAL_SUPPLIER = (YGyotoSupplier_t*) ygets_l(0); ypush_nil(); } } Gyoto-0.1.0/yorick/yorick-gyoto.aliases000066400000000000000000000001371217470755400201300ustar00rootroot00000000000000gyoto gyoto_constants gyoto_Metric gyoto_Photon gyoto_Scenery gyoto_std gyoto_Kerr gyoto_Star Gyoto-0.1.0/yorick/yorick-gyoto.keywords000066400000000000000000000000651217470755400203560ustar00rootroot00000000000000relativity ray-tracing geodesic scenery metric orbit Gyoto-0.1.0/yorick/yorick-gyoto.packinfo000066400000000000000000000004471217470755400203050ustar00rootroot00000000000000:newsubsection gyoto: the General relativitY Orbit Tracer of Observatoire de Paris :gyoto computing orbits in curved space-times, relativistic ray-tracing :gyoto_std low level access to the objects and metrics in Gyoto's standard plug-in :gyotoy graphical tool to visualize a single geodesic