From 0b31b96c55620dcf7c5ca657d3572a8c635c971b Mon Sep 17 00:00:00 2001 From: Erik Reckase Date: Mon, 19 Apr 2010 19:52:20 +0000 Subject: Initial commit of early-clip branch of flam3 into google code. git-svn-id: https://flam3.googlecode.com/svn/trunk@3 77852712-ef1d-11de-8684-7d64432d61a3 --- src/COPYING | 674 ++ src/COPYING.txt | 674 ++ src/Makefile.am | 37 + src/Makefile.in | 816 ++ src/README.txt | 820 ++ src/aclocal.m4 | 896 ++ src/animate.dsp | 138 + src/config.guess | 1516 ++++ src/config.h.in | 89 + src/config.sub | 1626 ++++ src/configure | 14453 +++++++++++++++++++++++++++++ src/configure.in | 84 + src/convert.dsp | 146 + src/docstring.c | 206 + src/filters.c | 490 + src/filters.h | 65 + src/flam3-animate.c | 342 + src/flam3-animate.man | 36 + src/flam3-convert.c | 239 + src/flam3-convert.man | 36 + src/flam3-genome.c | 1075 +++ src/flam3-genome.man | 36 + src/flam3-palettes.xml | 23135 +++++++++++++++++++++++++++++++++++++++++++++++ src/flam3-render.c | 421 + src/flam3-render.man | 36 + src/flam3.c | 3994 ++++++++ src/flam3.dsw | 65 + src/flam3.h | 657 ++ src/flam3.pc.in | 12 + src/genome.dsp | 146 + src/img.h | 44 + src/install-sh | 250 + src/interpolation.c | 956 ++ src/interpolation.h | 58 + src/isaac.c | 110 + src/isaac.h | 56 + src/isaacs.h | 46 + src/jpeg.c | 145 + src/ltmain.sh | 6964 ++++++++++++++ src/missing | 353 + src/mkinstalldirs | 40 + src/palettes.c | 483 + src/palettes.h | 37 + src/parser.c | 1364 +++ src/parser.h | 35 + src/png.c | 229 + src/private.h | 154 + src/rect.c | 1268 +++ src/render.dsp | 143 + src/test.flam3 | 14 + src/variations.c | 2521 ++++++ src/variations.h | 140 + src/vidres.flam3 | 12 + 53 files changed, 68382 insertions(+) create mode 100644 src/COPYING create mode 100644 src/COPYING.txt create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/README.txt create mode 100644 src/aclocal.m4 create mode 100644 src/animate.dsp create mode 100755 src/config.guess create mode 100644 src/config.h.in create mode 100755 src/config.sub create mode 100755 src/configure create mode 100644 src/configure.in create mode 100644 src/convert.dsp create mode 100644 src/docstring.c create mode 100644 src/filters.c create mode 100644 src/filters.h create mode 100644 src/flam3-animate.c create mode 100644 src/flam3-animate.man create mode 100644 src/flam3-convert.c create mode 100644 src/flam3-convert.man create mode 100644 src/flam3-genome.c create mode 100644 src/flam3-genome.man create mode 100644 src/flam3-palettes.xml create mode 100644 src/flam3-render.c create mode 100644 src/flam3-render.man create mode 100644 src/flam3.c create mode 100644 src/flam3.dsw create mode 100644 src/flam3.h create mode 100644 src/flam3.pc.in create mode 100644 src/genome.dsp create mode 100644 src/img.h create mode 100755 src/install-sh create mode 100644 src/interpolation.c create mode 100644 src/interpolation.h create mode 100644 src/isaac.c create mode 100644 src/isaac.h create mode 100644 src/isaacs.h create mode 100644 src/jpeg.c create mode 100755 src/ltmain.sh create mode 100755 src/missing create mode 100755 src/mkinstalldirs create mode 100644 src/palettes.c create mode 100644 src/palettes.h create mode 100644 src/parser.c create mode 100644 src/parser.h create mode 100755 src/png.c create mode 100644 src/private.h create mode 100644 src/rect.c create mode 100644 src/render.dsp create mode 100644 src/test.flam3 create mode 100644 src/variations.c create mode 100644 src/variations.h create mode 100755 src/vidres.flam3 (limited to 'src') diff --git a/src/COPYING b/src/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/src/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/COPYING.txt b/src/COPYING.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/src/COPYING.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..05f518e --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,37 @@ +AUTOMAKE_OPTIONS = foreign no-dependencies + +SVN_DEF = -D'SVN_REV="$(shell svnversion -n .)"' +AM_CFLAGS = -g -O3 -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF) + +ACLOCAL_AMFLAGS = -I m4 + +man1_MANS = flam3-animate.man flam3-genome.man flam3-render.man flam3-convert.man +bin_PROGRAMS = flam3-animate flam3-genome flam3-render flam3-convert +lib_LTLIBRARIES = libflam3.la +include_HEADERS = flam3.h isaac.h isaacs.h + +libflam3_la_SOURCES = flam3.c filters.c parser.c variations.c interpolation.c palettes.c jpeg.c png.c isaac.c +libflam3_la_LDFLAGS = -no-undefined -ljpeg -lpng -lz -lpthread + +flam3_genome_SOURCES = flam3-genome.c docstring.c +flam3_genome_LDADD = libflam3.la -lm + +flam3_animate_SOURCES = flam3-animate.c docstring.c +flam3_animate_LDADD = libflam3.la -lm + +flam3_render_SOURCES = flam3-render.c docstring.c +flam3_render_LDADD = libflam3.la -lm + +flam3_convert_SOURCES = flam3-convert.c docstring.c +flam3_convert_LDADD = libflam3.la -lm + +pkgdata_DATA = flam3-palettes.xml + +EXTRA_DIST = rect.c flam3.h palettes.h variations.h interpolation.h parser.h \ + private.h isaac.h isaacs.h img.h test.flam3 vidres.flam3 \ + flam3.dsw render.dsp animate.dsp genome.dsp convert.dsp \ + mkinstalldirs README.txt COPYING.txt flam3-palettes.xml \ + flam3-animate.man flam3-render.man flam3-genome.man flam3-convert.man + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = flam3.pc diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..6626e7a --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,816 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = flam3-animate$(EXEEXT) flam3-genome$(EXEEXT) \ + flam3-render$(EXEEXT) flam3-convert$(EXEEXT) +subdir = . +DIST_COMMON = $(am__configure_deps) $(include_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(srcdir)/flam3.pc.in \ + $(top_srcdir)/configure COPYING config.guess config.sub \ + install-sh ltmain.sh missing mkinstalldirs +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 = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = flam3.pc +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 = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libflam3_la_LIBADD = +am_libflam3_la_OBJECTS = flam3.lo filters.lo parser.lo variations.lo \ + interpolation.lo palettes.lo jpeg.lo png.lo isaac.lo +libflam3_la_OBJECTS = $(am_libflam3_la_OBJECTS) +libflam3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libflam3_la_LDFLAGS) $(LDFLAGS) -o $@ +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_flam3_animate_OBJECTS = flam3-animate.$(OBJEXT) docstring.$(OBJEXT) +flam3_animate_OBJECTS = $(am_flam3_animate_OBJECTS) +flam3_animate_DEPENDENCIES = libflam3.la +am_flam3_convert_OBJECTS = flam3-convert.$(OBJEXT) docstring.$(OBJEXT) +flam3_convert_OBJECTS = $(am_flam3_convert_OBJECTS) +flam3_convert_DEPENDENCIES = libflam3.la +am_flam3_genome_OBJECTS = flam3-genome.$(OBJEXT) docstring.$(OBJEXT) +flam3_genome_OBJECTS = $(am_flam3_genome_OBJECTS) +flam3_genome_DEPENDENCIES = libflam3.la +am_flam3_render_OBJECTS = flam3-render.$(OBJEXT) docstring.$(OBJEXT) +flam3_render_OBJECTS = $(am_flam3_render_OBJECTS) +flam3_render_DEPENDENCIES = libflam3.la +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libflam3_la_SOURCES) $(flam3_animate_SOURCES) \ + $(flam3_convert_SOURCES) $(flam3_genome_SOURCES) \ + $(flam3_render_SOURCES) +DIST_SOURCES = $(libflam3_la_SOURCES) $(flam3_animate_SOURCES) \ + $(flam3_convert_SOURCES) $(flam3_genome_SOURCES) \ + $(flam3_render_SOURCES) +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man1_MANS) +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +pkgdataDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) $(pkgdata_DATA) +includeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +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_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign no-dependencies +SVN_DEF = -D'SVN_REV="$(shell svnversion -n .)"' +AM_CFLAGS = -g -O3 -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF) +ACLOCAL_AMFLAGS = -I m4 +man1_MANS = flam3-animate.man flam3-genome.man flam3-render.man flam3-convert.man +lib_LTLIBRARIES = libflam3.la +include_HEADERS = flam3.h isaac.h isaacs.h +libflam3_la_SOURCES = flam3.c filters.c parser.c variations.c interpolation.c palettes.c jpeg.c png.c isaac.c +libflam3_la_LDFLAGS = -no-undefined -ljpeg -lpng -lz -lpthread +flam3_genome_SOURCES = flam3-genome.c docstring.c +flam3_genome_LDADD = libflam3.la -lm +flam3_animate_SOURCES = flam3-animate.c docstring.c +flam3_animate_LDADD = libflam3.la -lm +flam3_render_SOURCES = flam3-render.c docstring.c +flam3_render_LDADD = libflam3.la -lm +flam3_convert_SOURCES = flam3-convert.c docstring.c +flam3_convert_LDADD = libflam3.la -lm +pkgdata_DATA = flam3-palettes.xml +EXTRA_DIST = rect.c flam3.h palettes.h variations.h interpolation.h parser.h \ + private.h isaac.h isaacs.h img.h test.flam3 vidres.flam3 \ + flam3.dsw render.dsp animate.dsp genome.dsp convert.dsp \ + mkinstalldirs README.txt COPYING.txt flam3-palettes.xml \ + flam3-animate.man flam3-render.man flam3-genome.man flam3-convert.man + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = flam3.pc +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign 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) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(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) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +flam3.pc: $(top_builddir)/config.status $(srcdir)/flam3.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + 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 +libflam3.la: $(libflam3_la_OBJECTS) $(libflam3_la_DEPENDENCIES) + $(libflam3_la_LINK) -rpath $(libdir) $(libflam3_la_OBJECTS) $(libflam3_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +flam3-animate$(EXEEXT): $(flam3_animate_OBJECTS) $(flam3_animate_DEPENDENCIES) + @rm -f flam3-animate$(EXEEXT) + $(LINK) $(flam3_animate_OBJECTS) $(flam3_animate_LDADD) $(LIBS) +flam3-convert$(EXEEXT): $(flam3_convert_OBJECTS) $(flam3_convert_DEPENDENCIES) + @rm -f flam3-convert$(EXEEXT) + $(LINK) $(flam3_convert_OBJECTS) $(flam3_convert_LDADD) $(LIBS) +flam3-genome$(EXEEXT): $(flam3_genome_OBJECTS) $(flam3_genome_DEPENDENCIES) + @rm -f flam3-genome$(EXEEXT) + $(LINK) $(flam3_genome_OBJECTS) $(flam3_genome_LDADD) $(LIBS) +flam3-render$(EXEEXT): $(flam3_render_OBJECTS) $(flam3_render_DEPENDENCIES) + @rm -f flam3-render$(EXEEXT) + $(LINK) $(flam3_render_OBJECTS) $(flam3_render_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $$i; then file=$$i; \ + else file=$(srcdir)/$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done +install-pkgdataDATA: $(pkgdata_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" + @list='$(pkgdata_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done + +uninstall-pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgdata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(includedir)/$$f"; \ + 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: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + 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; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + 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)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && 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 $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(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) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(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 + $(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: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \ + config.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS install-man \ + install-pkgconfigDATA install-pkgdataDATA + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -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-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-man uninstall-pkgconfigDATA \ + uninstall-pkgdataDATA + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \ + dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-libLTLIBRARIES install-man install-man1 install-pdf \ + install-pdf-am install-pkgconfigDATA install-pkgdataDATA \ + 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-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man1 uninstall-pkgconfigDATA \ + uninstall-pkgdataDATA + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/README.txt b/src/README.txt new file mode 100644 index 0000000..2e02bdd --- /dev/null +++ b/src/README.txt @@ -0,0 +1,820 @@ +FLAM3 - cosmic recursive fractal flames +see the file COPYING for the license covering this software. + +This is free software to render fractal flames as described on +http://flam3.com. Flam3-animate makes animations, and flam3-render +makes still images. Flam3-genome creates and manipulates genomes +(parameter sets). A C library is also installed. + +Note: the following instructions are written for Linux users. Windows +users may install the cygwin package to get the "env" command or set +the envars in your windows command prompt manually. That means +instead of a command like + + env dtime=5 prefix=foo. in=test.flame flam3-animate + +say + + set dtime=5 + set prefix=foo. + set in=test.flame + flam3-animate + +As usual, to configure, build, and install: + + ./configure + make + sudo make install + +This package depends on development packages for libz, libpng, +libjpeg, and libxml2. + +To test it, run + + flam3-render < test.flam3 + +and it should produce 00000.jpg and 00001.jpg, one image for each + element in the parameter file. To make an animation run + + flam3-animate < test.flam3 + +and it should produce 100 files named 00000.jpg through 00099.jpg that +interpolate between the two elements. + + +envar default meaning +===== ======= ======= +prefix (empty) prefix names of output files with this string. +begin j time of first frame to render (j=first time in input file) (animate only) +end n-1 time of last frame to render (n=last time specified in the input file) (animate only) +time NA time of first and last frame (ie do one frame) (animate only) +frame NA synonym for "time" (animate only) +in stdin name of input file +out NA name of output file (bad idea if rending more than one, use prefix instead) +template NA apply defaults based on this genome (genome only) +dtime 1 time between frames (animate only) +fields 0 if 1 then render fields, ie odd scanlines at time+0.5 +nstrips 1 number of strips, ie render fractions of a frame at once (render only) +qs 1 quality scale, multiply quality of all frames by this +ss 1 size scale, multiply size (in pixels) of all frames by this +jpeg NA jpeg quality for compression, default is native jpeg default +format png "jpg" or "ppm" or "png" +pixel_aspect 1.0 aspect ratio of pixels (width over height), eg 0.90909 for NTSC +isaac_seed random string to be used in generating random seed. defaults to time(0) +seed random integer seed for random numbers, defaults to time+pid. deprecated. +nthreads auto number of threads to use (render and animate) +verbose 0 if non-zero then print progress meter on stderr +bits 33 also 32 or 64: sets bit-width of internal buffers (33 means 32-bit floating-point) +bpc 8 bits per channel of color: only png supports 16 (render/animate) +image filename replace palette with png, jpg, or ppm image +use_vars -1 comma sep list of variation #'s to use when generating a random flame (genome only) +dont_use_vars unset comma sep list of variation #'s to NOT use when generating a random flame. (genome only) +cross0 NA randomly select one genome from this file to genetically cross (genome only) +cross1 NA with one genome from this file (genome only) +method NA method for genetic cross: alternate, interpolate, or union. (genome only) +mutate NA randomly mutate a random genome from this file (genome only) +symmetry NA set symmetry of result. (genome only) +clone NA clone random flame in input (genome only) +clone_all NA clones all flames in file. useful for applying template to all flames (genome only) +animate NA interpolates between all flames in a file, using times specified in file (genome only) +sequence NA 360 degree rotation 'loops' times of each control point plus rotating transitions (genome only) +loops NA number of times to rotate each control point in sequence (genome only) +tries 50 number of tries to make to find a good genome. (genome only) +strip NA strip input, frame and nframes control which one. (genome only) +transparency 0 make bknd transparent, if format supports it (render/animate) +name_enable 0 use 'name' attr in to name image output if present (render only) +nick "" nickname to use in tags / img comments +url "" url to use in tags / img comments +id "" ID to use in tags / img comments +comment "" comment string for tags (genome only) +use_mem auto floating point number of bytes of memory to use (render only) +noedits unset omit edit tags from output (genome only) +write_genome 0 write out genome associated with center of motion blur window (animate only) +print_edit_depth 0 depth to truncate tag structure. 0 prints all tags (genome only) +intpalette unset round palette entries for importing into older Apophysis versions (genome only) +insert_palette unset insert the palette into the image. +enable_jpeg_comments 1 enables comments in the jpeg header (render and animate) +enable_png_comments 1 enables comments in the png header (render and animate) + +New in 2.8: + +earlyclip 0 enables the early clipping of rgb values for better antialiasing and resizing + defaults to 0 for backwards compatibility +flam27 0 flam3 2.7 compatibility mode; ensures generated genomes can be used by flam3 2.7.18 +stagger 0 affects simultaneity of xform interpolation during genome interpolation. + represents how 'separate' the xforms are interpolated. set to 1 for each + xform to be interpolated individually, fractions control interp overlap. + +for example: + + env dtime=5 prefix=foo. in=test.flam3 flam3-animate + +means to render every 5th frame of parameter file foo.flam3, and store +the results in files named foo.XXXX.jpg. + +the flam3-convert program reads from stdin the old format created by +the GIMP and writes to stdout the new xml format. + +the flam3-genome program creates random parameter files. it also mutates, +rotates, and interpolates existing parameter files. for example to +create 10 wholly new control points and render them at normal quality: + + env template=vidres.flam3 repeat=10 flam3-genome > new.flam3 + flam3-render < new.flam3 + +if you left out the "template=vidres.flam3" part then the size, +quality, etc parameters would be their default (small) values. you +can set the symmetry group: + + env template=vidres.flam3 symmetry=3 flam3-genome > new3.flam3 + env template=vidres.flam3 symmetry=-2 flam3-genome > new-2.flam3 + flam3-render < new3.flam3 + flam3-render < new-2.flam3 + +Mutation is done by giving an input flame file to alter: + + env template=vidres.flam3 flam3-genome > parent.flam3 + env prefix=parent. flam3-render < parent.flam3 + env template=vidres.flam3 mutate=parent.flam3 repeat=10 flam3-genome > mutation.flam3 + flam3-render < mutation.flam3 + +Normally one wouldn't use the same file for the template and the file +to mutate. Crossover is handled similarly: + + env template=vidres.flam3 flam3-genome > parent0.flam3 + env prefix=parent0. flam3-render < parent0.flam3 + env template=vidres.flam3 flam3-genome > parent1.flam3 + env prefix=parent1. flam3-render < parent1.flam3 + env template=vidres.flam3 cross0=parent0.flam3 cross1=parent1.flam3 flam3-genome > crossover.flam3 + flam3-render < crossover.flam3 + +flam3-genome has 3 ways to produce parameter files for animation in +the style of electric sheep. the highest level and most useful from +the command line is the sequence method. it takes a collection of +control points and makes an animation that has each flame do fractal +rotation for 360 degrees, then make a smooth transition to the next. +for example: + + env sequence=test.flam3 nframes=20 flam3-genome > seq.flam3 + flam3-animate < seq.flam3 + +creates and renders a 60 frame animation. there are two flames in +test.flam3, so the animation consists three stages: the first one +rotating, then a transition, then the second one rotating. each stage +has 20 frames as specified on the command line. if you want to +render only some fraction of a whole animation file, specify the begin +and end times: + + env begin=20 end=40 flam3-animate < seq.flam3 + +the other two methods are harder to use because they produce files that +are only good for one frame of animation. the output consists of 3 +control points, one for the time requested, one before and one after. +that allows proper motion blur. for example: + + env template=vidres.flam3 flam3-genome > rotme.flam3 + env rotate=rotme.flam3 frame=10 nframes=20 flam3-genome > rot10.flam3 + env frame=10 flam3-animate < rot10.flam3 + +the file rot10.flam3 specifies the animation for just one frame, in +this case 10 out of 20 frames in the complete animation. C1 +continuous electric sheep genetic crossfades are created like this: + + env inter=test.flam3 frame=10 nframes=20 flam3-genome > inter10.flam3 + env frame=10 flam3-animate < inter10.flam3 + +see http://flam3.com/flame.pdf for descriptions & formulas, and +see http://electricsheep.wikispaces.com/Variations for updates. + +The complete list of variations: + + 0. linear + 1. sinusoidal + 2. spherical + 3. swirl + 4. horseshoe + 5. polar + 6. handkerchief + 7. heart + 8. disc + 9. spiral + 10. hyperbolic + 11. diamond + 12. ex + 13. julia + 14. bent + 15. waves + 16. fisheye + 17. popcorn + 18. exponential + 19. power + 20. cosine + 21. rings + 22. fan + 23. blob + 24. pdj + 25. fan2 + 26. rings2 + 27. eyefish + 28. bubble + 29. cylinder + 30. perspective + 31. noise + 32. julian + 33. juliascope + 34. blur + 35. gaussian_blur + 36. radial_blur + 37. pie + 38. ngon + 39. curl + 40. rectangles + 41. arch + 42. tangent + 43. square + 44. rays + 45. blade + 46. secant2 + 47. twintrian + 48. cross + 49. disc2 + 50. super_shape + 51. flower + 52. conic + 53. parabola + 54. bent2 + 55. bipolar + 56. boarders + 57. butterfly + 58. cell + 59. cpow + 60. curve + 61. edisc + 62. elliptic + 63. escher + 64. foci + 65. lazysusan + 66. loonie + 67. pre_blur + 68. modulus + 69. oscilloscope + 70. polar2 + 71. popcorn2 + 72. scry + 73. separation + 74. split + 75. splits + 76. stripes + 77. wedge + 78. wedge_julia + 79. wedge_sph + 80. whorl + 81. waves2 + 82. exp + 83. log + 84. sin + 85. cos + 86. tan + 87. sec + 88. csc + 89. cot + 90. sinh + 91. cosh + 92. tanh + 93. sech + 94. csch + 95. coth + 96. auger + +see http://flam3.com/flame.pdf for descriptions & formulas for each of +these. note that, by default, if a random flame is requested and neither +'use_vars' or 'dont_use_vars' are specified, the following variations are +not used: noise, blur, gaussian_blur, radial_blur, ngon, square, rays, +and cross. + +note: these variations do not use the variation weight to scale their +contributions, and so will not be implemented in flam3: +circlize + + +====================================== + +todo: eliminate all static storage. + +====================================== + +changelog: + +12/20/09 Highlight power now interpolates smoothly from old behavior + (-1) to new behavior. flam3-genome 'split' mode was broken, fixed + (thanks Exper.) Die gracefully instead of segfault when very small + estimator_curve values are specified. Version attribute added to + flame tag. Number of iterations used to fuse attractor increased to + 100. Release as 2.8beta7. + +11/24/09 Potential speedup of 5% over prior versions. Many threading + issues identified and resolved when using flam3 shared library as + back end for user interfaces. 14 complex plane variations added. + auger variation added. new flam3_make_strip library function to + generate stripped genomes for external ui strip renders. bug fix: + when rendering strips, use the same random context for each strip + to prevent edge effects where strips butt against each other. flam3 + will now linearly interpolate missing colors in the colormap. + Release as 2.8beta6. + +10/16/09 Non-threadsafe progress tracking code in main iteration thread + replaced with per-render progress storage. Fixed bug where pausing + render during density estimation stage terminated render. Waves2 + variation fixed (thx Joel F). Release as 2.8beta5. + +10/07/09 Fixed bug affecting 'animate' mode with flam3-genome. Changed + estimate_bounding_box to increase discarded iterations if numerous + badvals were encountered during iterations. Exported a few more + functions for Windows DLL. Release as 2.8beta4. + +10/03/09 Changed color_speed range from 0 (no color change) to 1 + (use new xform color). Animate attribute is now 0 for no motion, + 1 for motion. Removed final xform from stagger algorithm. 'oscope' + parameters are now called 'oscilloscope' to match the rest of the + parametric variations (backwards compatible, so old genomes can be + read.) Stagger now affects morphing as well as sheep rotation, but + only using flam3-genome (not flam3-animate). Release as 2.8beta3. + +03/18/09 Major upgrade : + - 28 variations added, mostly from the sourceforge plugins pack + - significant speed optimization of variations + - setting earlyclip env var on commandline will enable an alternate + calculation of color values, resulting in better antialiasing + - 'highlight_power' flame element controls the white highlights in + dense areas, eliminating the hue shift bug + - Apophysis chaos and solo xform/plotmode features have been + implemented. solo/plotmode are promoted to floating point + 'opacity'. opacity and chaos are both interpolatable. + - tag now available for xforms...allows cyclic variation + of any regular xform parameter/coef/post. + - env var 'stagger' affects the simultaneity of xform interpolation + when morphing from one flame to another. set to 0 for existing + behaviour, set to 1 to make each xform interpolate individually + - symmetry has been broken out into color_speed and animate tags + with the same sense (which is confusing and will be fixed in a + future release). + - set the flam27 parameter to output backwards compatible genomes. + - passes the consistency test where rendering an image at double + size and filtering it down produces the same results as the + original (modulo quality). + +03/17/09 Added fuzz testing with zzuf to the regression tests. 'Strip' + mode and genomes with the zoom parameter used now break into pieces + properly. insert_palette fixed (broken a few versions ago.) fixed + twintrian variation when small weights are used. various rare + segfaults and memory leaks fixed. 'palette_mode' attribute added to + flame element for smoother palette interpolation in slow animations; + possible values are 'step' and 'linear' ('step' mode is default and + matches previous behaviour.) Release as 2.7.18. + +11/11/08 Add error checking on the numbers in the input genome. Do + not exit on read errors, fail gracefully. Changed sin/cos = tan in + the tangent variation. Added polar to list of variations that use + the inverted linear identity. Bugfix: temporal_filter_exp was not + set properly in template. Apply interpolation attribute in + templates. Add/publish datarootdir with pkg-config so the palette + file is easy to find (for qosmic). Copyright by Spotworks LLC + instead of Spot and Erik. Add fuzz checks to the regression + suite. include LNX/OSX/WIN in the version string. In + flam3-genome animate command, added one to last flame time, so the + end time is inclusive. Release as 2.7.17. + +09/06/08 Added 'clone_all' to flam3_genome to allow application of + template to all flames in a file at once, and 'animate' to write + a full sequence of interpolations out. 'animate' is similar to + 'sequence' except that no control point rotation is performed. + Fixed non-functional 'write_genome' env var for flam3_animate. + Two bugs associated with interpolating from a log interpolation_type + to a non-log interpolation_type fixed (rotate angle reduction and + special inverted identity). when using flam3_rotate in 'spin_inter' + the interp type of the first genome is now used rather than the + current genome's interp type. Enforced upper and lower bounds for + xform color and upper bound for interpolated colormap values + as "smooth" interpolation led to values out of range. If "smooth" + interpolation is specified for all flames in a file, the first and + second-to-last genome is switched to "linear" with a warning. + spatial filters with non-box-filter window functions fixed. + Release as 2.7.16. + + +08/25/08 Added new interpolation types 'old' and 'older', for use in + recreating old animations. 'linear' mode now does not rotate padded + xforms (results in prettier symmetric singularities). switched to + using a 'padding' flag instead of a 'just initialized' flag; padding + flag used for implementation of 'old' and 'older' types. + interpolation_space now deprecated, instead use interpolation_type. + flam3_align is now idempotent (multiple applications do not change + the control points.) Default number of temporal samples bumped to + 1000. Removed CVS headers from source code (now using SVN). + Default interpolation mode now log. Removed 'move' and 'split' vars. + changes to flam3-genome: sequence mode now returns linear + interpolation mode for all control points except first/last of edges + - these cps will use the original interpolation mode; inter and + rotate modes will now return padded genomes for all control points, + all with linear interpolation specified. instead of centering + sometimes reframe by golden mean plus noise. Release as 2.7.15. + +07/21/08 Add configuration option for atomic-ops. bug fix: do not + truncate floating point palettes. new motion blur features: add + temporal_filter_type, can be "box" (default) or "gaussian" or + "exp". Temporal_filter_width and temporal_filter_exp are parms to + it. 'blur' env var no longer used. Small bug fix: iteration + count depends only on the size of the output image, not the padded + image (the gutter). When interpolating, only do -pi/pi adjustment + for non-asymmetric cases. Julian/juliascope variations use the + alternate inverted identity for interpolation (reduces wedge + effect). Add python script for regression and consistency + checking. Add svn revision number to version string (in the + software not of the package). Release as 2.7.14. + +05/28/08 Restored upper limit on particle coordinates. Release as + 2.7.13. + +05/16/08 Added man pages. Removed upper limit on particle + coordinates. fixed FSF address in comments. update to automake + 1.10.1. added eps to denom of perspective fraction to avoid + infinities (thanks fred). Put contents of 'id' env var in png/jpg + comment block. Release as 2.7.12. + +04/05/08 Added 16 bit per channel support to PNG via bpc envar. + isaac.h is now installed with the flam3 headers. Strip indexing + now done with size_t's to fix bug in large images (thanks Paul). + Progress callback now returns ETA, and per-thread verbose flag + functionality fixed. Enumerated spatial filter types now used in + flam3.h, taking the place of function pointers (simplifies the + API). Fix bug by moving precalculation of variation variables to + flam3_iterate (thanks david). Release as 2.7.11. + +03/15/08 fixed interpolation bug when magnitude of rotation/scaling + component of affine transform is 0. replaced secant variation + with more flame-friendly secant2 (eliminates gap in y direction, + scales y-coordinate by weight). warning message now printed when + unrecognized variation is present in an xform. fixed bad + inequality when checking for -pi/pi discontinuity during complex + interpolation. release as 2.7.10. + +02/08/08 non-zero weights for final xforms no longer allowed, and now + have no effect. recompiled windows exes with mingw gcc 4.1 to + take advantage of scalability improvements in flam3 2.7.8 (was + compiling with mingw gcc 3.4 until now). for fedora package + compliance, flam3.pc.in patched by ian weller and moved use of + config.h to c files only. release as 2.7.9. + +01/26/08 better scalability across multiple CPUs by using compare and + swap (from Tim Hockin). fix bug in large images (>2GB). add + flam3_srandom and flam3_malloc/free to better support wrapping + with python on windows, which links with a different C + runtime. add --enable-shared option to configure script (from + Bobby R Ward). release as 2.7.8. + +12/16/07 fixed bug (rare random crash) identified by david burnett. + initialize new xforms with better defaults for parametric + variations (based on interpolated-against xforms). add id envar, + like nick/url. add clone_action envar. return to xform + interpolation based on complex logs, but make consistent decisions + about counter/clockwise rotation across the sheep edges. + interpolation_space attribute to flame element can be set to + "linear" to go back to the simpler method, or "log" to use this + new (default) method. release as 2.7.7 + +10/20/07 fixed action string overflow when many xforms are present. + added 'print_edit_depth' env var to control how many levels of + tags are saved when using flam3-genome. Fixed wrong + placement of random improve_colors code in flam3-genome. go to + five digit filenames. fixed bug in supershape variation. API + cleanup, thanks to david bitseff. release 2.7.6. + +08/14/07 various code updates to assist with compiling under msvc++. + now can specify --disable-pthread or --enable-pthread to configure + to better control compilation. fixed bug preventing renders of + flames with more than 128 xforms. release 2.7.5. + +07/12/07 fixed bug in split variation, now compatible with both + versions of Apo. added insert_palette option. switched density + estimation kernel from Epanichnikov to Gaussian. genetic cross + now crosses palettes rather than selecting one of the parent + palettes. remove noisy variations from random generation if + use_vars or dont_use_vars not specified. fixed metrics calculated + on small test render for genetic operations. reduced memory + requirements for density estimation filters. 64-bit linux distros + now supported. release 2.7.4. + + +06/21/07 flam3 version, rendered genome, some render statistics and + optionally nick/url stored in jpeg/png headers. fixed two bugs + in isaac rng code (strongly affected temporal blur). prevent + final xform rotation for sheep animation. fixed interpolation + when only one flame has final xform. added Supershape, Flower, + Conic, Parabola, Move and Split variations. Shape combined with + Supershape via 'rnd' parameter. flam3-genome now writes 'name' + attribute for rotate and sequence modes. oversample attribute + deprecated; supersample now preferred. new build process for + windows exes using MinGW/MSYS. added 'intpalette' env var to + round floating point palettes to allow older versions of Apophysis + to read them. default image type is now PNG, transparency off. + density estimation code revised to be more consistent between + different supersample levels, which required change to default + de params. limit number of de filters to conserve memory. fixed + julia variation dependency on non-thread-safe random bit function. + removed random number storage for radial blur variation. + release 2.7.3. + 07/26/08: Note, incompat. change made to direction of cp->rotate + (as of 2.7.3, rotates shortest distance instead of clockwise) + +02/09/07 use isaac random number generator to avoid differences + between mac/pc/linux. use multiple threads to take advantage + of multiple CPUs or cores. new variations: disc2, Arch, + Tangent, Square, Rays, Blade, Secant, Twintrian, Cross. + fixed bug reading hex color format - must remove \n prior to + start of colors if present. use EPS in spiral, hyperbolic + and spherical to eliminate black spots. fix numbering of + disc2, change parameter to estimate_bounding_box. made blur + kernel type templatable. removed extraneous 'enabled="1"' in + writing out final xform information (no longer needed). + release 2.7.2. + +12/31/06 fixed bug in waves precalculation code. curl and rectangles + variations from joel faber. remove visibility of + rotation_center attribute, fix strips operator to handle + rotation without it. added motion exponent and gamma lin + thresh to flam3_print. list of variations in the docstring + automatically generated. flam3-genome: envar noedits + suppresses output of edit history. release 2.7.1. + +09/27/06 print out palette as floating point with up to 6 digits + rather than integers (for very slow smooth transitions). + Added optimization to only recalculate the xform distrib + array when necessary (Thanks Joel Faber). Added settable + kernel for downrez. Added XML reading code for new + format for gradients. Functionalized hex gradient read. + Removed color shift experimental feature. New + 'motion_exponent' attribute controls fade of temporal steps. + added gaussian_blur and radial_blur vars from apo. added pie + and ngon variations from joel faber. add rotation_center + attribute. added but disabled image variation from joel. + release as 2.7. + +06/26/06 use new libpng api, handle libpng errors properly (from nix + at esperi.org.uk). print out palette as floating point with + 6 digits rather than integers (for very slow smooth + transitions). + +06/11/06 disable density estimation for 16 and 32 bit buffers because + it doesn't work. Apo team removed "enabled" from final xform + specification, so now it defaults to on. make default + temporal samples be 60 so that motion blur is the default, + but explicitly ignore temporal samples when rendering still + frames. add strip genetic operator to flam3-genome for + breaking a flame into strips for parallel rendering. add + subpixel offsets for antialiasing by averaging multiple + images. release as 2.7b8. + +05/25/06 change attribute name "batches" to "passes" because many old + genomes have it set, and with density estimation it is + harmful. + +04/28/06 remove debugging code, release as 2.7b7. + +04/28/06 add attribute interpolation="smooth" for catmull-rom + interpolation. known bug: some frames come out dark. + release as 2.7b6. + +04/15/06 rename XML attribute "estimator" to "estimator_radius". fix + the progress callback. add use_mem envar. move palette + database to external file. cleanup namespace. add new + variations blur, julian, and juliascope. fix flam3-convert. + add experimental color shifting via "shift" envar. supports + finalxform. can read hex palette format. avoids the "square" + that appears from NaNs. release as 2.7b5. + +01/11/06 unlimited number of xforms per flame. new variations + cylinder and perspective. rename rename de_max_filter to + estimator, de_min_filter to estimator_minimum, de_alpha + to estimator_curve, and jitters to temporal_samples. + release as 2.7b4. + +11/28/05 performance optimization, fix symmetry singularities, added + bubble variation, fixed handkerchief variation, templates + apply to sequence and rotate flam3-genome commands, added + envar "name_enable" to render filenames specified in the + "name" attribute of the flame element, small bugfixes, + release as 2.7b3. + +11/04/05 verbose on by default. Added 'transparency' envar for png + renders without transparency channel. Fixed non-black + background jpeg renders. add improve_colors mutation, + rewrite most of estimate_bounding_box. added new variations + blob pdjd fan2 rings2 eyefish. added '33bit' method for + 32-bit floats. tags track history. alter the gamma + curve to be linear near 0 to avoid singularity and reduce + noise, set with gamma_threshold. release as v2.7b2. + +09/24/05 new density estimator and temporal jitter code from Erik + Reckase (note removal of todo items above :). allow gamma, + vibrancy, contrast, pixels_per_unit, and brightness to vary + as part of the genome rather than as part of the rendering + parameters. flam3-genome does not retry when cloning. ditch + 2nd color coordinates. release as v2.7b1. + +06/27/05 in flam3_dimension, give up and return NaN if 90% or more of + the samples are being clipped. release v2.6. + +06/22/05 add envar to control the number of tries. + +06/06/05 add new form of mutation that introduces post xforms. + +05/20/05 fix memory trashing bug resulting from xform overflow. put + regular xforms before symmetry in printed genomes. enforce + weights non-negative & at least one xform. remove + nan-protection from popcorn variation. truncate xforms with + very small weight. + +05/13/05 fix bug reported by erik reckase where fan variation could + blow up to NaN because the domain of atan2 was not protected. + remove protection from all atan2 calls and instead detect NaN + results and replace them with noise. count really large + values as bad too to prevent blowing up to infinity. enforce + 0<=hue<1, release v2.6b1. + +05/05/05 report choices made during genome generation in notes + attribute. flam3_dimension no longer hangs when most of the + attractor is outside the camera. limit number of variations + produced by genetic operators to 5. reduce rate of + interpolation method of crossover. + +03/17/05 put cloning back in (found by James Rantanen). + +03/08/05 change sawtooth variation (incompatible!). add fan + variation. rename sawtooth to rings. release as v2.5. + +03/01/05 fix rotation when nstrips > 1. add flam3_dimension(). minor + bugfixes. release as v2.4. + +01/25/05 release as v2.3. + +01/18/05 support post xforms (idea from eric nguyen). support camera + rotation. + +12/28/04 release as v2.2. + +12/27/04 preview implementation of image fractalization by adding a + color coordinate. changed how random/default color + coordinates are selected (they alternate 0 and 1 instead of + being distributed between 0 and 1). WARNING: incompatible + format change to samples argument of flam3_iterate. + +12/20/04 allow mutation and crossover from files with multiple + genomes. a random genome is selected for each repetition. + +12/11/04 fix bug printing out interpolated non-built-in palettes. + warn if any images sizes in animation do not match. + +12/01/04 remove debugging code left in flam3-convert, thanks to Paul + Fishwick for reporting this. add cosine variation. add + sawtooth variation. handle nstrips that do not divide the + height. write partial results as strips are computed. fix + old bug where in 32 bit mode one of the terms appeared to be + calculated at 16 bits. release as v2.1. + +10/28/04 fix docstring bug. release as v2.0.1. + +10/28/04 renaming, cleanup, and modularization. now exports + libflam3.a and flam3.h, all names prefixed with flam3_. + binaries named with flam3- prefix, genome files use flam3 + suffix. create and install a flam3.pc pkg-config file. + release as v2.0. + +09/21/04 fix bug where code for integer rounding was left in 64-bit + floating point version. round remaining time up so we do not + say ETA in 0 seconds. do not use static allocation to hold + onto memory, just malloc and free what we need every frame. + enforce positive oversampling. fix bug in hqi on sequences + of images of different sizes. release as v1.15. + +09/17/04 change name of envar to control jpeg compression quality from + "quality" to "jpeg". check for bad nbatches values. release + as v1.14. + +08/23/04 add about 600 cmaps from Jackie, Pat Phillips, Classylady, + and BTomchek. use 64-bit (double) sized buffers. remove + white_level. add new variations: exponential & power. fix + bug where hue_rotation was left uninitialized. add clone + option to pick-flame which just applies template to the input + without modifying genome. random_control_point can now put + multiple variations in one xform. remove altivec code because + it is incompatible with 64-bit buffers. verbose (progress bar + on stderr) from Jon Morton. control random number seeds via + seed envar. support buffer sizes 16, 32, or 64 bits with + three versions of rect.c included into libifs.c. + +03/28/04 fix bug interpolating between flames with different numbers + of xforms introduced by the new de/parsing. add modified + version of the popcorn variation from apophysis. fix small + bug in waves variation. make distribution of variations + even. add altivec code from R.J. Berry of warwick.ac.uk. + release as v1.13. + +03/26/04 add wave variation. allow negative variational coefs. do + not truncate filter width to an integer. add fisheye + variation. make variations print by name instead of using a + vector, that is say spherical="1" instead of var="0 0 1" or + var1="2". it should still read the old format. + +03/07/04 fix bug printing out result of interpolating between + symmetries. release as v1.11. + +03/03/04 add new means of crossover: a random point between the + parents as defined by linear interpolation. in all kinds of + crossover, reset the color coordinates to make sure they are + spread out well. somehow lost part of the extra_attributes + patch, so put it in again. add pixel_aspect_ratio envar. + decrease filter cutoff threshold. the edges of the filter + were almost zeros, so making the filter smaller saves time + with almost no effect on the results. do not print out the + attributes of control points that have default values. + release as v1.10. + +02/26/04 remove prefix argument to print_control_point, and add + extra_attributes. allow any value for vibrancy parameter. + allow variation blending coefs to have any values. do not + normalize them. on windows nstrips is computated + automatically to fit within memory (leaves at least 20% + unused). support png image format and if output is png then + compute & output alpha channel. release as v1.9. + +02/01/04 add julia variation, and put bent variation back in. change + how colors are computed in presense of symmetry: xforms that + come from a symmetry do not change the color index. this + prevents the colors from washing out. since an xform may be + interpolated between a symmetry and not, this this is a + blending factor. add more documentation. add function to + compute lyapunov coefs. allow control over symmetries + produced by pick-flame. release as v1.8. + +07/20/03 cleanup, update documentation, release as v1.7. + +07/15/03 fix bug in interpolation where in last frame when going from + non-symmetric to symmetric it left out some xforms. drop + support for "cmap_inter". add var1 as a abbreviation to var + in xml output, and do not print trailing 0s in var string. + +07/09/03 change matrix interpolation to be linear rather than complex + log to avoid the discontinuity at 180 degrees. this was + causing jumpiness in the C1 continuous algorithm. this means + that rotation has to be handled with pick-flame. put direct + support for symmetries in the de/parser to make control + points smaller and easier to understand. support + combinations of bilateral & rotational symmetry. + +06/22/03 bug in colormap interpolation. release as v1.6. + +06/20/03 fix some bugs, in particular remove sorting of the xforms + when control points are read. they are only sorted when they + are generated. updated dates on copyright notices. added + time parameter to anim, shorthand for begin & end being the + same. added a fairly terrible hack to allow palettes to be + specified as blending of two basic palettes. this requires + much less bandwidth than sending 256 rgb triples. in + pick-flame change default to be enclosed xml output. + +06/09/03 add C1 continuous interpolation to pick-flame (suggested by + Cassidy Curtis). added new variations from Ultra Fractal + version by Mark Townsend. added symmetry xforms. + +06/02/03 add convert-flame which reads the old file format and writes + the new one. release as v1.5. + +03/22/03 fix bug in hqi & anim. somewhere along the way (prolly jpeg) + nstrips was broken. add qs and ss params to hqi. + discontinue strips for anim because the implementation is a + bit problematic (animating zoom??). bump version to 1.4. + +03/05/03 add pick-flame.c to the project, and extend it with mutation + and crossover capability. add parse_control_points_from_file + (and use it). rename non-xml variants of de/parsers to *_old + and rename xml variants to remove _xml. add + rotate_control_point. bump version to 1.3. + +02/10/03 increase CHOOSE_XFORM_GRAIN by 10x and use chars instead of + ints. remove extra -ljpeg from Makefile. lose hack that + ignored density xforms after interpolation. what was that + for?? it makes a difference, and just makes interpolation + less smooth as far as i can tell. bump version to 1.2. + +01/17/03 release as v1.1. + +01/16/03 support output in jpeg format; this is the default. support + win32. + +01/08/03 by default don't render the last frame so that animations + dove-tail and loop + +01/06/03 fix how too many xforms are detected so that one more xform + is allowed. + +12/22/02 first release as independent package. release as v1.0. diff --git a/src/aclocal.m4 b/src/aclocal.m4 new file mode 100644 index 0000000..066dfa3 --- /dev/null +++ b/src/aclocal.m4 @@ -0,0 +1,896 @@ +# generated automatically by aclocal 1.10.2 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 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. + +# 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.63],, +[m4_warning([this file was generated for autoconf 2.63. +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 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +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.10.2], [], + [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.10.2])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 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# 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 8 + +# 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 +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 +# 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 + +# 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'. + 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 + 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 + + case $depmode in + 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 + ;; + none) break ;; + esac + # 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. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])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"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 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 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 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 13 + +# 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.60])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) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +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 +]) +]) + + +# 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 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +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 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_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.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 +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +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 +# 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_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 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# 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 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_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 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_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 +# 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_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 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 + +# _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. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/src/animate.dsp b/src/animate.dsp new file mode 100644 index 0000000..59291ea --- /dev/null +++ b/src/animate.dsp @@ -0,0 +1,138 @@ +# Microsoft Developer Studio Project File - Name="anim" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=anim - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "animate.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "animate.mak" CFG="anim - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "anim - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "anim - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "anim - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "c:\src\libpng" /I "c:\src\zlib" /I "c:\src\libxml2\include" /I "c:\src\jpeg" /I "c:\src\iconv\include" /I "c:\src\pthreads" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib c:\src\pthreads\pthreadVC2.lib /nologo /subsystem:console /machine:I386 /out:"Release/flam3-animate.exe" + +!ELSEIF "$(CFG)" == "anim - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\src\jpeg" /I "c:\src\libpng" /I "c:\src\zlib" /I "c:\src\libxml2\include" /I "c:\src\iconv\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "anim - Win32 Release" +# Name "anim - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\docstring.c +# End Source File +# Begin Source File + +SOURCE=".\flam3-animate.c" +# End Source File +# Begin Source File + +SOURCE=".\flam3-palettes.c" +# End Source File +# Begin Source File + +SOURCE=.\flam3.c +# End Source File +# Begin Source File + +SOURCE=.\isaac.c +# End Source File +# Begin Source File + +SOURCE=.\jpeg.c +# End Source File +# Begin Source File + +SOURCE=.\png.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=config.h +# End Source File +# Begin Source File + +SOURCE=.\jpeg.h +# End Source File +# Begin Source File + +SOURCE=rect.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/config.guess b/src/config.guess new file mode 100755 index 0000000..278f9e9 --- /dev/null +++ b/src/config.guess @@ -0,0 +1,1516 @@ +#! /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 Free Software Foundation, +# Inc. + +timestamp='2007-07-22' + +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, 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. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted 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. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +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 +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 tupples: *-*-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 __ELF__ >/dev/null + 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'` + exit ;; + 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 ;; + 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:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-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:*:[45]) + 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 __LP64__ >/dev/null + 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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-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*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-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 ;; + 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 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + 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:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-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 ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + 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 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-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 ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) + 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 i386. + echo i386-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; } ;; + 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.0*:*) + 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 ;; + 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 + 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 ;; + 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 ;; +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: diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..28af21a --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,89 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Have 64-bit __sync_bool_compare_and_swap() and friends. */ +#undef HAVE_GCC_64BIT_ATOMIC_OPS + +/* Have 32-bit __sync_bool_compare_and_swap() and friends. */ +#undef HAVE_GCC_ATOMIC_OPS + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `jpeg' library (-ljpeg). */ +#undef HAVE_LIBJPEG + +/* Define to 1 if you have the `png' library (-lpng). */ +#undef HAVE_LIBPNG + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the `xml2' library (-lxml2). */ +#undef HAVE_LIBXML2 + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the 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 the header file. */ +#undef HAVE_UNISTD_H + +/* 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 version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/src/config.sub b/src/config.sub new file mode 100755 index 0000000..1761d8b --- /dev/null +++ b/src/config.sub @@ -0,0 +1,1626 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-06-28' + +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, 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. + + +# Please send patches to . Submit a context +# diff and a properly formatted 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. + +# 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 +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-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + 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) + os= + basic_machine=$1 + ;; + -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*) + 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 \ + | 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 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | 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 | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-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-* \ + | 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-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | 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-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | 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-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | 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-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # 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 + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + 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) + 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 + ;; + 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'm not sure what "Sysv32" means. Should this be sysv3.2? + 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 + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + 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-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + 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 + ;; + 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 + ;; + 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) basic_machine=powerpc-unknown + ;; + ppc-*) 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 + ;; + 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 + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + 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 + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-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[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. + -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* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -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* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -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*) + # 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 + ;; + -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 + ;; + # 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 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + 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 + ;; + -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: diff --git a/src/configure b/src/configure new file mode 100755 index 0000000..9b8d595 --- /dev/null +++ b/src/configure @@ -0,0 +1,14453 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.63. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 + + + + +# PATH needs CR +# 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_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 +if (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 + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +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 + + +# Name of the executable. +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'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +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 + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +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_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. 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 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# 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 + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, 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= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="flam3-animate.c" +# 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='LTLIBOBJS +LIBOBJS +XML2_CONFIG +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_pthread +enable_atomic_ops +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + 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_echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + 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_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $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_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + 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-pthread compile FLAM3 with threads enabled (default=yes) + --enable-atomic-ops compile FLAM3 with atom ops enabled (default=yes, independently checks for 32 and 64 bit sizes) + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=no] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + +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 C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.63. 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) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$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 + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + 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:$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= ;; #( + *) $as_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 + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + 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 + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + 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 + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + 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'; { (exit 1); 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 + +# 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 + + +# 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 + ac_site_file1=$CONFIG_SITE +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 -r "$ac_site_file"; then + { $as_echo "$as_me:$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" + 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. + if test -f "$cache_file"; then + { $as_echo "$as_me:$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:$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:$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:$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:$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:$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:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$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. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers config.h" + +# Check whether --enable-pthread was given. +if test "${enable_pthread+set}" = set; then + enableval=$enable_pthread; +fi + +# Check whether --enable-atomic_ops was given. +if test "${enable_atomic_ops+set}" = set; then + enableval=$enable_atomic_ops; +fi + +am__api_version='1.10' + +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_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$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:$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 +# 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_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$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` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ $as_echo "$as_me:$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 test "${ac_cv_path_mkdir+set}" = set; 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 + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + + 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. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$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:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + 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=flam3 + VERSION="2.8b7" + + +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"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# 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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$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:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$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:$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" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + + + +# Save CFLAGS from the environment +save_CFLAGS=$CFLAGS + +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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + +# Provide some information about the compiler. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + fi + fi +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +rm -f conftest$ac_cv_exeext +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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:$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:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +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:$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:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +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:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$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 +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ $as_echo "$as_me:$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='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. + 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 + 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 + + case $depmode in + 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 + ;; + none) break ;; + esac + # 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. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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:$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 + + + +CFLAGS=$save_CFLAGS + +# 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:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$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:$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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# 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=no +fi + + + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:$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.2.6' +macro_revision='1.3012' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; 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_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +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:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; 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_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +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:$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 test "${ac_cv_path_SED+set}" = set; 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 + $as_unset ac_script || ac_script= + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:$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:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:$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:$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:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; 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:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; 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:$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 test "${lt_cv_path_NM+set}" = set; 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:$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 "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + 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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$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:$LINENO: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:$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 -symbols" "link -dump -symbols" +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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:$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:$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 + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; 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:4481: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:4484: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:4487: 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:$LINENO: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:$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:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; 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; + ;; + + 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 + ;; + + 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$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:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:$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:$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"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:$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:$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:$LINENO: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:$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 + 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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$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:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; 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. + if ( 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 + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +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]) 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 Linux ELF. +linux* | k*bsd*-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:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +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}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:$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:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$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 +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$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:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$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:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$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:$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 \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 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:$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 test "${lt_cv_sys_global_symbol_pipe+set}" = set; 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};"\ +" /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 + + # 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:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$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:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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 +#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. */ +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_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_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:$LINENO: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + + +# 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:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 5693 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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:$LINENO: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_cc_needs_belf=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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:$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + 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" + + + 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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:$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:$LINENO: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:$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:$LINENO: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:$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:$LINENO: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:$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:$LINENO: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:$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:$LINENO: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:$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:$LINENO: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:$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:$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:$LINENO: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; 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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_ld_exported_symbols_list=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_ld_exported_symbols_list=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&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" != ":"; 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:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +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:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +rm -f 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +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 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +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` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = 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 +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +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:$LINENO: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; 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:$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 + +# Sed substitution that helps us do robust quoting. It backslashifies +# 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' + +# 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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:$LINENO: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; 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:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$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:$LINENO: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; 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:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$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 + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; 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:7520: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7524: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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:$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= + +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + 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' + ;; + + 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 + 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) + 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' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # 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*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # 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='' + ;; + 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*) + 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:$LINENO: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:$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 test "${lt_cv_prog_compiler_pic_works+set}" = set; 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:7859: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7863: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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:$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:$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 test "${lt_cv_prog_compiler_static_works+set}" = set; 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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:$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:$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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:7964: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7968: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:$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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:8019: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8023: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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:$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:$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:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:$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:$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_flag_spec_ld= + 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 + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = 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 + *\ [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.9.1, 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 modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_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' + 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/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + 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 + ;; + + 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) + 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= + 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + 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; $ECHO \"$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*) + # 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= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_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 $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' + 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 $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 + ;; + + 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 $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 + + 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 + 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")) && (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. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + 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. + 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 `$ECHO "X$deplibs" | $Xsed -e '\''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' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + 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=echo + 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 + ;; + + freebsd1*) + ld_shlibs=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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${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_flag_spec_ld='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${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' + ;; + *) + archive_cmds='$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 + 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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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:$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:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 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:$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:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$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 + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # 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 -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # 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; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +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 + 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 + 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=`$ECHO "X$lib" | $Xsed -e '\''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 + 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,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + 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 + ;; + 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 + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # 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 + 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 + ;; + +freebsd1*) + dynamic_linker=no + ;; + +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[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + 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 + 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' + ;; + +interix[3-9]*) + 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' + 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 + 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 Linux ELF. +linux* | k*bsd*-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' + 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 + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then + shlibpath_overrides_runpath=yes +fi + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # 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;/^$/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 + 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 + 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 + 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 + 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 + 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 + 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:$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:$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:$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:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; 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 + + ;; + + *) + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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_shl_load || defined __stub___shl_load +choke me +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$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" = x""yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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_dlopen || defined __stub___dlopen +choke me +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_svld_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_dld_link=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$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" = x""yes; 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:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; 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 10832 "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 + +void fnord() { int i=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; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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:$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:$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 test "${lt_cv_dlopen_self_static+set}" = set; 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 10928 "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 + +void fnord() { int i=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; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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:$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:$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:$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:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:$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:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:$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:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +rm -f 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +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 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const /**/ +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if test "${ac_cv_header_time+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + +{ $as_echo "$as_me:$LINENO: checking for deflateInit_ in -lz" >&5 +$as_echo_n "checking for deflateInit_ in -lz... " >&6; } +if test "${ac_cv_lib_z_deflateInit_+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 deflateInit_ (); +int +main () +{ +return deflateInit_ (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_z_deflateInit_=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_z_deflateInit_=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflateInit_" >&5 +$as_echo "$ac_cv_lib_z_deflateInit_" >&6; } +if test "x$ac_cv_lib_z_deflateInit_" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: zlib is required." >&5 +$as_echo "$as_me: error: zlib is required." >&2;} + { (exit 1); exit 1; }; } +fi + + +{ $as_echo "$as_me:$LINENO: checking for png_write_image in -lpng" >&5 +$as_echo_n "checking for png_write_image in -lpng... " >&6; } +if test "${ac_cv_lib_png_png_write_image+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpng $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 png_write_image (); +int +main () +{ +return png_write_image (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_png_png_write_image=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_png_png_write_image=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_write_image" >&5 +$as_echo "$ac_cv_lib_png_png_write_image" >&6; } +if test "x$ac_cv_lib_png_png_write_image" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPNG 1 +_ACEOF + + LIBS="-lpng $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: The png library is required." >&5 +$as_echo "$as_me: error: The png library is required." >&2;} + { (exit 1); exit 1; }; } +fi + + +{ $as_echo "$as_me:$LINENO: checking for xmlParseFile in -lxml2" >&5 +$as_echo_n "checking for xmlParseFile in -lxml2... " >&6; } +if test "${ac_cv_lib_xml2_xmlParseFile+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxml2 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 xmlParseFile (); +int +main () +{ +return xmlParseFile (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_xml2_xmlParseFile=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_xml2_xmlParseFile=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlParseFile" >&5 +$as_echo "$ac_cv_lib_xml2_xmlParseFile" >&6; } +if test "x$ac_cv_lib_xml2_xmlParseFile" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXML2 1 +_ACEOF + + LIBS="-lxml2 $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: The xml2 library is required." >&5 +$as_echo "$as_me: error: The xml2 library is required." >&2;} + { (exit 1); exit 1; }; } +fi + + + +if test "${enable_atomic_ops}" = "" ; then + enable_atomic_ops=yes +fi + +if test "${enable_atomic_ops}" = "yes" ; then + + { $as_echo "$as_me:$LINENO: checking whether $CC knows 32-bit __sync_bool_compare_and_swap()" >&5 +$as_echo_n "checking whether $CC knows 32-bit __sync_bool_compare_and_swap()... " >&6; } + cat >conftest.$ac_ext <<_ACEOF +#include + int main() { uint32_t a = 4; + __sync_bool_compare_and_swap(&a, 4, 5); } +_ACEOF + $CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null + ret=$? + rm -f conftest.o conftest + if test $ret -eq 0 ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GCC_ATOMIC_OPS 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no - try specifying CFLAGS=-march={your_arch}" >&5 +$as_echo "no - try specifying CFLAGS=-march={your_arch}" >&6; } + fi + + { $as_echo "$as_me:$LINENO: checking whether $CC knows 64-bit __sync_bool_compare_and_swap()" >&5 +$as_echo_n "checking whether $CC knows 64-bit __sync_bool_compare_and_swap()... " >&6; } + cat >conftest.$ac_ext <<_ACEOF +#include + int main() { uint64_t a = 4; __sync_bool_compare_and_swap(&a, 4, 5); } +_ACEOF + $CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null + ret=$? + rm -f conftest.o conftest + if test $ret -eq 0 ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GCC_64BIT_ATOMIC_OPS 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no - try specifying CFLAGS=-march={your_arch}" >&5 +$as_echo "no - try specifying CFLAGS=-march={your_arch}" >&6; } + fi +fi + +if test "${enable_pthread}" = "" ; then + enable_pthread=yes +fi + +if test "${enable_pthread}" = "yes" ; then + +{ $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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_create (); +int +main () +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthread_pthread_create=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_pthread_create=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +else + { $as_echo "$as_me:$LINENO: WARNING: Pthread library not found - threads disabled." >&5 +$as_echo "$as_me: WARNING: Pthread library not found - threads disabled." >&2;} +fi + +fi + +{ $as_echo "$as_me:$LINENO: checking for jpeg_start_compress in -ljpeg" >&5 +$as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; } +if test "${ac_cv_lib_jpeg_jpeg_start_compress+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 jpeg_start_compress (); +int +main () +{ +return jpeg_start_compress (); + ; + return 0; +} +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_jpeg_jpeg_start_compress=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_jpeg_jpeg_start_compress=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBJPEG 1 +_ACEOF + + LIBS="-ljpeg $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: The jpeg library is required." >&5 +$as_echo "$as_me: error: The jpeg library is required." >&2;} + { (exit 1); exit 1; }; } +fi + +# Extract the first word of "xml2-config", so it can be a program name with args. +set dummy xml2-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XML2_CONFIG+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $XML2_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_path_XML2_CONFIG" && ac_cv_path_XML2_CONFIG="no" + ;; +esac +fi +XML2_CONFIG=$ac_cv_path_XML2_CONFIG +if test -n "$XML2_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5 +$as_echo "$XML2_CONFIG" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +if test "$XML2_CONFIG" != "no" +then + CPPFLAGS="`$XML2_CONFIG --cflags` $CPPFLAGS" +fi + +ac_config_files="$ac_config_files Makefile flam3.pc" + +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:$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= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$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= +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. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +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:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_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} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_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 + + + + +# PATH needs CR +# 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_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 +if (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 + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +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 + + +# Name of the executable. +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'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. 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 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.63. 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 from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, 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_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 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=$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 ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$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 + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { $as_echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --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_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$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' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +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 \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +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_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +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' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "flam3.pc") CONFIG_FILES="$CONFIG_FILES flam3.pc" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + 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= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# 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=' ' +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 {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ 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[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + 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_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +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_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$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:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + 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" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + 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:$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 "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } + 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:$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 + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # 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 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="" + +# ### BEGIN LIBTOOL CONFIG + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# 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 + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# 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 + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# 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 + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# 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 + +# 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 + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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 + +# 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 + +# 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 + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# 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 + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# 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 + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# 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 + +# 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 + +# ### 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_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}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 || { (exit 1); exit 1; } +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/src/configure.in b/src/configure.in new file mode 100644 index 0000000..f519a8c --- /dev/null +++ b/src/configure.in @@ -0,0 +1,84 @@ +dnl $Id: configure.in,v 1.42 2008-07-21 18:51:56 spotspot Exp $ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(flam3-animate.c) +AM_CONFIG_HEADER(config.h) +AC_ARG_ENABLE(pthread, [ --enable-pthread compile FLAM3 with threads enabled (default=yes)]) +AC_ARG_ENABLE(atomic_ops, [ --enable-atomic-ops compile FLAM3 with atom ops enabled (default=yes, independently checks for 32 and 64 bit sizes)]) +AM_INIT_AUTOMAKE(flam3,"2.8b7") + +AC_CONFIG_MACRO_DIR([m4]) + +# Save CFLAGS from the environment +save_CFLAGS=$CFLAGS + +AC_PROG_CC + +CFLAGS=$save_CFLAGS + +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AM_DISABLE_SHARED +AC_PROG_LIBTOOL +AC_HEADER_STDC +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_CHECK_LIB([z],[deflateInit_],,[AC_MSG_ERROR([zlib is required.])]) +AC_CHECK_LIB([png],[png_write_image],,[AC_MSG_ERROR([The png library is required.])]) +AC_CHECK_LIB([xml2],[xmlParseFile],,[AC_MSG_ERROR([The xml2 library is required.])]) + + +if test "${enable_atomic_ops}" = "" ; then + enable_atomic_ops=yes +fi + +if test "${enable_atomic_ops}" = "yes" ; then + + AC_MSG_CHECKING([whether $CC knows 32-bit __sync_bool_compare_and_swap()]) + AC_LANG_CONFTEST([#include + int main() { uint32_t a = 4; + __sync_bool_compare_and_swap(&a, 4, 5); }]) + $CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null + ret=$? + rm -f conftest.o conftest + if test $ret -eq 0 ; then + AC_DEFINE([HAVE_GCC_ATOMIC_OPS], 1, [Have 32-bit __sync_bool_compare_and_swap() and friends.]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no - try specifying CFLAGS=-march={your_arch}]) + fi + + AC_MSG_CHECKING([whether $CC knows 64-bit __sync_bool_compare_and_swap()]) + AC_LANG_CONFTEST([#include + int main() { uint64_t a = 4; __sync_bool_compare_and_swap(&a, 4, 5); }]) + $CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null + ret=$? + rm -f conftest.o conftest + if test $ret -eq 0 ; then + AC_DEFINE([HAVE_GCC_64BIT_ATOMIC_OPS], 1, [Have 64-bit __sync_bool_compare_and_swap() and friends.]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no - try specifying CFLAGS=-march={your_arch}]) + fi +fi + +if test "${enable_pthread}" = "" ; then + enable_pthread=yes +fi + +if test "${enable_pthread}" = "yes" ; then + AC_CHECK_LIB([pthread],[pthread_create],,[AC_MSG_WARN([Pthread library not found - threads disabled.])]) +fi +AC_CHECK_LIB([jpeg],[jpeg_start_compress],,[AC_MSG_ERROR([The jpeg library is required.])]) +AC_PATH_PROG(XML2_CONFIG,xml2-config, no, $PATH:/bin:/usr/bin:/usr/local/bin) + +if test "$XML2_CONFIG" != "no" +then + CPPFLAGS="`$XML2_CONFIG --cflags` $CPPFLAGS" +fi + +AC_OUTPUT([ +Makefile +flam3.pc +]) diff --git a/src/convert.dsp b/src/convert.dsp new file mode 100644 index 0000000..0f7fba1 --- /dev/null +++ b/src/convert.dsp @@ -0,0 +1,146 @@ +# Microsoft Developer Studio Project File - Name="convert" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=convert - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "convert.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "convert.mak" CFG="convert - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "convert - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "convert - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "convert - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "c:\src\libxml2\include" /I "c:\src\jpeg" /I "c:\src\iconv\include" /I "c:\src\pthreads" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 c:\src\expat\expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib c:\src\pthreads\pthreadVC2.lib /nologo /subsystem:console /machine:I386 /out:"Release/flam3-convert.exe" + +!ELSEIF "$(CFG)" == "convert - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\src\expat\xmlparse" /I "c:\src\jpeg" /I "c:\src\libxml2\include" /I "c:\src\iconv\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\expat\expat.lib c:\src\jpeg\libjpeg.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "convert - Win32 Release" +# Name "convert - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\docstring.c +# End Source File +# Begin Source File + +SOURCE=".\flam3-convert.c" +# End Source File +# Begin Source File + +SOURCE=".\flam3-palettes.c" +# End Source File +# Begin Source File + +SOURCE=.\flam3.c +# End Source File +# Begin Source File + +SOURCE=.\isaac.c +# End Source File +# Begin Source File + +SOURCE=.\jpeg.c +# End Source File +# Begin Source File + +SOURCE=.\png.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=cmap.h +# End Source File +# Begin Source File + +SOURCE=config.h +# End Source File +# Begin Source File + +SOURCE=jpeg.h +# End Source File +# Begin Source File + +SOURCE=libifs.h +# End Source File +# Begin Source File + +SOURCE=rect.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/docstring.c b/src/docstring.c new file mode 100644 index 0000000..c562e6d --- /dev/null +++ b/src/docstring.c @@ -0,0 +1,206 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#include "config.h" +#include "flam3.h" + + +static char *the_docstring0 = + "FLAM3 - cosmic recursive fractal flames version "; + +static char *the_docstring1 = +"\n\n" +"This software is licensed under the GPL. You should have access\n" +"to the source code; see http://www.fsf.org/licenses/gpl.html.\n" +"\n" +"This is free software to render fractal flames as described on\n" +"http://flam3.com. Flam3-animate makes animations, and flam3-render\n" +"makes still images. Flam3-genome creates and manipulates genomes\n" +"(parameter sets). A C library is also installed.\n" +"\n" +"Note: the following instructions are written for Linux users. Windows\n" +"users may have to install the cygwin package to get the \"env\"\n" +"command or set the envars in your windows command prompt manually.\n" +"That means instead of a command like\n" +"\n" +" env dtime=5 prefix=foo. in=test.flame flam3-animate\n" +"\n" +"say\n" +"\n" +" set dtime=5\n" +" set prefix=foo.\n" +" set in=test.flame\n" +" flam3-animate\n" +"\n" +"\n" +"envar default meaning\n" +"===== ======= =======\n" +"prefix (empty) prefix names of output files with this string.\n" +"begin j time of first frame to render (j=first time specified in file) (animate only)\n" +"end n-1 time of last frame to render (n=last time specified in the input file) (animate only)\n" +"time NA time of first and last frame (ie do one frame) (animate only)\n" +"frame NA synonym for \"time\" (animate only)\n" +"in stdin name of input file\n" +"out NA name of output file (bad idea if rending more than one, use prefix instead)\n" +"template NA apply defaults based on this genome (genome only)\n" +"dtime 1 time between frames (animate only)\n" +"fields 0 if 1 then render fields, ie odd scanlines at time+0.5\n" +"nstrips 1 number of strips, ie render fractions of a frame at once (render only)\n" +"qs 1 quality scale, multiply quality of all frames by this\n" +"ss 1 size scale, multiply size (in pixels) of all frames by this\n" +"jpeg NA jpeg quality for compression, default is native jpeg default\n" +"format png jpg or ppm or png\n" +"pixel_aspect 1.0 aspect ratio of pixels (width over height), eg 0.90909 for NTSC\n" +"seed random integer seed for random numbers, defaults to time+pid\n" +"isaac_seed random character-based seed for iteration loop randomness, defaults to time\n" +"nthreads 0 number of threads to use for render. default auto-detects.\n" +"verbose 0 if non-zero then print progress meter on stderr\n" +"bits 33 also 32 or 64: sets bit-width of internal buffers (33 means 32-bit floating-point)\n" +"bpc 8 bits per color channel: png supports 16, all others are 8 only (render/animate)\n" +"image filename replace palette with png, jpg, or ppm image\n" +"use_vars -1 comma separated list of variation #'s to use when generating a random flame (genome only)\n" +"dont_use_vars NA comma separated list of variation #'s to NOT use when generating a random flame (genome only)\n" +"cross0 NA randomly select one genome from this file to genetically cross (genome only)\n" +"cross1 NA with one genome from this file (genome only)\n" +"method NA method used for genetic cross: alternate, interpolate, or union. (genome only)\n" +"mutate NA randomly mutate a random genome from this file (genome only)\n" +"symmetry NA set symmetry of result. (genome only)\n" +"clone NA clone random flame in input (genome only)\n" +"clone_all NA clones all flames in file. useful for applying template to all flames (genome only)\n" +"animate NA interpolates between all flames in a file, using times specified in file (genome only)\n" +"sequence NA 360 degree rotation 'loops' times of each control point plus rotating transitions (genome only)\n" +"loops NA number of times to rotate each control point in sequence (genome only)\n" +"tries 50 number of tries to make to find a good genome. (genome only)\n" +"strip NA strip input, frame and nframes control which one. (genome only)\n" +"transparency 0 make bknd transparent, if format supports it (render/animate)\n" +"name_enable 0 use 'name' attr in to name image output if present (render only)\n" +"nick \"\" nickname to use in tags / img comments\n" +"url \"\" url to use in tags / img comments\n" +"id \"\" ID to use in tags\n" +"comment \"\" comment string for tags (genome only)\n" +"use_mem auto floating point number of bytes of memory to use (render only)\n" +"write_genome 0 write out genome associated with center of motion blur window (animate only)\n" +"noedits unset omit edit tags from output (genome only)\n" +"print_edit_depth 0 depth to truncate tag structure. 0 prints all tags (genome only)\n" +"intpalette unset round palette entries for importing into older Apophysis versions (genome only)\n" +"insert_palette unset insert the palette into the image.\n" +"enable_jpeg_comments 1 enables comments in the jpeg header (render and animate)\n" +"enable_png_comments 1 enables comments in the png header (render and animate)\n" +"\n" +"New in 2.8:\n" +"earlyclip 0 enables the early clipping of rgb values for better antialiasing and resizing\n" +" defaults to 0 for backwards compatibility\n" +"flam27 0 flam3 2.7 compatibility mode; ensures generated genomes can be used by flam3 2.7.18\n" +"stagger 0 affects simultaneity of xform interpolation during genome interpolation.\n" +" represents how 'separate' the xforms are interpolated. set to 1 for each\n" +" xform to be interpolated individually, fractions control interp overlap.\n" + +"\n" +"for example:\n" +"\n" +" env dtime=5 prefix=foo. in=test.flam3 flam3-animate\n" +"\n" +"means to render every 5th frame of parameter file foo.flam3, and store\n" +"the results in files named foo.XXXX.jpg.\n" +"\n" +"the flam3-convert program reads from stdin the old format created by\n" +"the GIMP and writes to stdout the new xml format.\n" +"\n" +"the flam3-genome program creates random parameter files. it also mutates,\n" +"rotates, and interpolates existing parameter files. for example to\n" +"create 10 wholly new control points and render them at normal quality:\n" +"\n" +" env template=vidres.flam3 repeat=10 flam3-genome > new.flam3\n" +" flam3-render < new.flam3\n" +"\n" +"if you left out the \"template=vidres.flam3\" part then the size,\n" +"quality, etc parameters would be their default (small) values. you\n" +"can set the symmetry group:\n" +"\n" +" env template=vidres.flam3 symmetry=3 flam3-genome > new3.flam3\n" +" env template=vidres.flam3 symmetry=-2 flam3-genome > new-2.flam3\n" +" flam3-render < new3.flam3\n" +" flam3-render < new-2.flam3\n" +"\n" +"Mutation is done by giving an input flame file to alter:\n" +"\n" +" env template=vidres.flam3 flam3-genome > parent.flam3\n" +" env prefix=parent. flam3-render < parent.flam3\n" +" env template=vidres.flam3 mutate=parent.flam3 repeat=10 flam3-genome > mutation.flam3\n" +" flam3-render < mutation.flam3\n" +"\n" +"Normally one wouldn't use the same file for the template and the file\n" +"to mutate. Crossover is handled similarly:\n" +"\n" +" env template=vidres.flam3 flam3-genome > parent0.flam3\n" +" env prefix=parent0. flam3-render < parent0.flam3\n" +" env template=vidres.flam3 flam3-genome > parent1.flam3\n" +" env prefix=parent1. flam3-render < parent1.flam3\n" +" env template=vidres.flam3 cross0=parent0.flam3 cross1=parent1.flam3 flam3-genome > crossover.flam3\n" +" flam3-render < crossover.flam3\n" +"\n" +"flam3-genome has 3 ways to produce parameter files for animation in\n" +"the style of electric sheep. the highest level and most useful from\n" +"the command line is the sequence method. it takes a collection of\n" +"control points and makes an animation that has each flame do fractal\n" +"rotation for 360 degrees, then make a smooth transition to the next.\n" +"for example:\n" +"\n" +" env sequence=test.flam3 nframes=20 flam3-genome > seq.flam3\n" +" flam3-animate < seq.flam3\n" +"\n" +"creates and renders a 60 frame animation. there are two flames in\n" +"test.flam3, so the animation consists three stags: the first one\n" +"rotating, then a transition, then the second one rotating. each stage\n" +"has 20 frames as specified on the command line. if you want to\n" +"render only some fraction of a whole animation file, specify the begin\n" +"and end times:\n" +"\n" +" env begin=20 end=40 flam3-animate < seq.flam3\n" +"\n" +"the other two methods are harder to use becaues they produce files that\n" +"are only good for one frame of animation. the output consists of 3\n" +"control points, one for the time requested, one before and one after.\n" +"that allows proper motion blur. for example:\n" +"\n" +" env template=vidres.flam3 flam3-genome > rotme.flam3\n" +" env rotate=rotme.flam3 frame=10 nframes=20 flam3-genome > rot10.flam3\n" +" env frame=10 flam3-animate < rot10.flam3\n" +"\n" +"the file rot10.flam3 specifies the animation for just one frame, in\n" +"this case 10 out of 20 frames in the complete animation. C1\n" +"continuous electric sheep genetic crossfades are created like this:\n" +"\n" +" env inter=test.flam3 frame=10 nframes=20 flam3-genome > inter10.flam3\n" +" env frame=10 flam3-animate < inter10.flam3\n" +"\n" +"see http://flam3.com/flame.pdf for descriptions & formulas, and\n" +"see http://electricsheep.wikispaces.com/Variations for updates.\n" +"\n" +"The complete list of variations:\n" +; + +void docstring() { + int i; + fputs(the_docstring0, stdout); + fputs(flam3_version(), stdout); + fputs(the_docstring1, stdout); + for (i = 0; i < flam3_nvariations; i++) + printf(" %2d. %s\n", i, flam3_variation_names[i]); +} diff --git a/src/filters.c b/src/filters.c new file mode 100644 index 0000000..1af5d4a --- /dev/null +++ b/src/filters.c @@ -0,0 +1,490 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "filters.h" + + +/* + * filter function definitions + * from Graphics Gems III code + * and ImageMagick resize.c + */ + + +double flam3_spatial_support[flam3_num_spatialfilters] = { + + 1.5, /* gaussian */ + 1.0, /* hermite */ + 0.5, /* box */ + 1.0, /* triangle */ + 1.5, /* bell */ + 2.0, /* b spline */ + 2.0, /* mitchell */ + 1.0, /* blackman */ + 2.0, /* catrom */ + 1.0, /* hanning */ + 1.0, /* hamming */ + 3.0, /* lanczos3 */ + 2.0, /* lanczos2 */ + 1.5 /* quadratic */ +}; + +double flam3_hermite_filter(double t) { + /* f(t) = 2|t|^3 - 3|t|^2 + 1, -1 <= t <= 1 */ + if(t < 0.0) t = -t; + if(t < 1.0) return((2.0 * t - 3.0) * t * t + 1.0); + return(0.0); +} + +double flam3_box_filter(double t) { + if((t > -0.5) && (t <= 0.5)) return(1.0); + return(0.0); +} + +double flam3_triangle_filter(double t) { + if(t < 0.0) t = -t; + if(t < 1.0) return(1.0 - t); + return(0.0); +} + +double flam3_bell_filter(double t) { + /* box (*) box (*) box */ + if(t < 0) t = -t; + if(t < .5) return(.75 - (t * t)); + if(t < 1.5) { + t = (t - 1.5); + return(.5 * (t * t)); + } + return(0.0); +} + +double flam3_b_spline_filter(double t) { + + /* box (*) box (*) box (*) box */ + double tt; + + if(t < 0) t = -t; + if(t < 1) { + tt = t * t; + return((.5 * tt * t) - tt + (2.0 / 3.0)); + } else if(t < 2) { + t = 2 - t; + return((1.0 / 6.0) * (t * t * t)); + } + return(0.0); +} + +double flam3_sinc(double x) { + x *= M_PI; + if(x != 0) return(sin(x) / x); + return(1.0); +} + +double flam3_blackman_filter(double x) { + return(0.42+0.5*cos(M_PI*x)+0.08*cos(2*M_PI*x)); +} + +double flam3_catrom_filter(double x) { + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(0.5*(4.0+x*(8.0+x*(5.0+x)))); + if (x < 0.0) + return(0.5*(2.0+x*x*(-5.0-3.0*x))); + if (x < 1.0) + return(0.5*(2.0+x*x*(-5.0+3.0*x))); + if (x < 2.0) + return(0.5*(4.0+x*(-8.0+x*(5.0-x)))); + return(0.0); +} + +double flam3_mitchell_filter(double t) { + double tt; + + tt = t * t; + if(t < 0) t = -t; + if(t < 1.0) { + t = (((12.0 - 9.0 * flam3_mitchell_b - 6.0 * flam3_mitchell_c) * (t * tt)) + + ((-18.0 + 12.0 * flam3_mitchell_b + 6.0 * flam3_mitchell_c) * tt) + + (6.0 - 2 * flam3_mitchell_b)); + return(t / 6.0); + } else if(t < 2.0) { + t = (((-1.0 * flam3_mitchell_b - 6.0 * flam3_mitchell_c) * (t * tt)) + + ((6.0 * flam3_mitchell_b + 30.0 * flam3_mitchell_c) * tt) + + ((-12.0 * flam3_mitchell_b - 48.0 * flam3_mitchell_c) * t) + + (8.0 * flam3_mitchell_b + 24 * flam3_mitchell_c)); + return(t / 6.0); + } + return(0.0); +} + +double flam3_hanning_filter(double x) { + return(0.5+0.5*cos(M_PI*x)); +} + +double flam3_hamming_filter(double x) { + return(0.54+0.46*cos(M_PI*x)); +} + +double flam3_lanczos3_filter(double t) { + if(t < 0) t = -t; + if(t < 3.0) return(flam3_sinc(t) * flam3_sinc(t/3.0)); + return(0.0); +} + +double flam3_lanczos2_filter(double t) { + if(t < 0) t = -t; + if(t < 2.0) return(flam3_sinc(t) * flam3_sinc(t/2.0)); + return(0.0); +} + +double flam3_gaussian_filter(double x) { + return(exp((-2.0*x*x))*sqrt(2.0/M_PI)); +} + +double flam3_quadratic_filter(double x) { + if (x < -1.5) + return(0.0); + if (x < -0.5) + return(0.5*(x+1.5)*(x+1.5)); + if (x < 0.5) + return(0.75-x*x); + if (x < 1.5) + return(0.5*(x-1.5)*(x-1.5)); + return(0.0); +} + +double flam3_spatial_filter(int knum, double x) { + + if (knum==0) + return flam3_gaussian_filter(x); + else if (knum==1) + return flam3_hermite_filter(x); + else if (knum==2) + return flam3_box_filter(x); + else if (knum==3) + return flam3_triangle_filter(x); + else if (knum==4) + return flam3_bell_filter(x); + else if (knum==5) + return flam3_b_spline_filter(x); + else if (knum==6) + return flam3_mitchell_filter(x); + else if (knum==7) + return flam3_sinc(x)*flam3_blackman_filter(x); + else if (knum==8) + return flam3_catrom_filter(x); + else if (knum==9) + return flam3_sinc(x)*flam3_hanning_filter(x); + else if (knum==10) + return flam3_sinc(x)*flam3_hamming_filter(x); + else if (knum==11) + return flam3_lanczos3_filter(x)*flam3_sinc(x/3.0); + else if (knum==12) + return flam3_lanczos2_filter(x)*flam3_sinc(x/2.0); + else if (knum==13) + return flam3_quadratic_filter(x); +} + +int normalize_vector(double *v, int n) { + double t = 0.0; + int i; + for (i = 0; i < n; i++) + t += v[i]; + if (0.0 == t) return 1; + t = 1.0 / t; + for (i = 0; i < n; i++) + v[i] *= t; + return 0; +} + + +int flam3_create_spatial_filter(flam3_frame *spec, int field, double **filter) { + + int sf_kernel = spec->genomes[0].spatial_filter_select; + int supersample = spec->genomes[0].spatial_oversample; + double sf_radius = spec->genomes[0].spatial_filter_radius; + double aspect_ratio = spec->pixel_aspect_ratio; + double sf_supp = flam3_spatial_support[sf_kernel]; + + double fw = 2.0 * sf_supp * supersample * sf_radius / aspect_ratio; + double adjust, ii, jj; + + int fwidth = ((int) fw) + 1; + int i,j; + + + /* Make sure the filter kernel has same parity as oversample */ + if ((fwidth ^ supersample) & 1) + fwidth++; + + /* Calculate the coordinate scaling factor for the kernel values */ + if (fw > 0.0) + adjust = sf_supp * fwidth / fw; + else + adjust = 1.0; + + /* Calling function MUST FREE THE RETURNED KERNEL, lest ye leak memory */ + (*filter) = (double *)calloc(fwidth * fwidth,sizeof(double)); + + /* fill in the coefs */ + for (i = 0; i < fwidth; i++) + for (j = 0; j < fwidth; j++) { + + /* Calculate the function inputs for the kernel function */ + ii = ((2.0 * i + 1.0) / (double)fwidth - 1.0)*adjust; + jj = ((2.0 * j + 1.0) / (double)fwidth - 1.0)*adjust; + + /* Scale for scanlines */ + if (field) jj *= 2.0; + + /* Adjust for aspect ratio */ + jj /= aspect_ratio; + + (*filter)[i + j * fwidth] = + flam3_spatial_filter(sf_kernel,ii) * flam3_spatial_filter(sf_kernel,jj); + } + + + if (normalize_vector((*filter), fwidth * fwidth)) { + fprintf(stderr, "Spatial filter value is too small: %g. Terminating.\n",sf_radius); + return(-1); + } + + return (fwidth); +} + +flam3_de_helper flam3_create_de_filters(double max_rad, double min_rad, double curve, int ss) { + + flam3_de_helper de; + double comp_max_radius, comp_min_radius; + double num_de_filters_d; + int num_de_filters,de_max_ind; + int de_row_size, de_half_size; + int filtloop; + int keep_thresh=100; + + de.kernel_size=-1; + + if (curve <= 0.0) { + fprintf(stderr,"estimator curve must be > 0\n"); + return(de); + } + + if (max_rad < min_rad) { + fprintf(stderr,"estimator must be larger than estimator_minimum.\n"); + fprintf(stderr,"(%f > %f) ? \n",max_rad,min_rad); + return(de); + } + + /* We should scale the filter width by the oversample */ + /* The '+1' comes from the assumed distance to the first pixel */ + comp_max_radius = max_rad*ss + 1; + comp_min_radius = min_rad*ss + 1; + + /* Calculate how many filter kernels we need based on the decay function */ + /* */ + /* num filters = (de_max_width / de_min_width)^(1/estimator_curve) */ + /* */ + num_de_filters_d = pow( comp_max_radius/comp_min_radius, 1.0/curve ); + if (num_de_filters_d>1e7) { + fprintf(stderr,"too many filters required in this configuration (%g)\n",num_de_filters_d); + return(de); + } + num_de_filters = (int)ceil(num_de_filters_d); + + /* Condense the smaller kernels to save space */ + if (num_de_filters>keep_thresh) { + de_max_ind = (int)ceil(DE_THRESH + pow(num_de_filters-DE_THRESH,curve))+1; + de.max_filtered_counts = (int)pow( (double)(de_max_ind-DE_THRESH), 1.0/curve) + DE_THRESH; + } else { + de_max_ind = num_de_filters; + de.max_filtered_counts = de_max_ind; + } + + /* Allocate the memory for these filters */ + /* and the hit/width lookup vector */ + de_row_size = (int)(2*ceil(comp_max_radius)-1); + de_half_size = (de_row_size-1)/2; + de.kernel_size = (de_half_size+1)*(2+de_half_size)/2; + + de.filter_coefs = (double *) calloc (de_max_ind * de.kernel_size,sizeof(double)); + de.filter_widths = (double *) calloc (de_max_ind,sizeof(double)); + + /* Generate the filter coefficients */ + de.max_filter_index = 0; + for (filtloop=0;filtloop1.0) + de.filter_coefs[filter_coef_idx] = 0.0; + else { + + /* Gaussian */ + de.filter_coefs[filter_coef_idx] = flam3_spatial_filter(flam3_gaussian_kernel, + flam3_spatial_support[flam3_gaussian_kernel]*de_filt_d)/de_filt_sum; + + /* Epanichnikov */ +// de_filter_coefs[filter_coef_idx] = (1.0 - (de_filt_d * de_filt_d))/de_filt_sum; + } + + filter_coef_idx ++; + } + } + + if (de.max_filter_index>0) + break; + } + + if (de.max_filter_index==0) + de.max_filter_index = de_max_ind-1; + + + return(de); +} + +double flam3_create_temporal_filter(int numsteps, int filter_type, double filter_exp, double filter_width, + double **temporal_filter, double **temporal_deltas) { + + double maxfilt = 0.0; + double sumfilt = 0.0; + double slpx,halfsteps; + double *deltas, *filter; + + int i; + + /* Allocate memory - this must be freed in the calling routine! */ + deltas = (double *)malloc(numsteps*sizeof(double)); + filter = (double *)malloc(numsteps*sizeof(double)); + + /* Deal with only one step */ + if (numsteps==1) { + deltas[0] = 0; + filter[0] = 1.0; + *temporal_deltas = deltas; + *temporal_filter = filter; + return(1.0); + } + + /* Define the temporal deltas */ + for (i = 0; i < numsteps; i++) + deltas[i] = ((double)i /(double)(numsteps - 1) - 0.5)*filter_width; + + /* Define the filter coefs */ + if (flam3_temporal_exp == filter_type) { + + for (i=0; i < numsteps; i++) { + + if (filter_exp>=0) + slpx = ((double)i+1.0)/numsteps; + else + slpx = (double)(numsteps - i)/numsteps; + + /* Scale the color based on these values */ + filter[i] = pow(slpx,fabs(filter_exp)); + + /* Keep the max */ + if (filter[i]>maxfilt) + maxfilt = filter[i]; + } + + } else if (flam3_temporal_gaussian == filter_type) { + + halfsteps = numsteps/2.0; + for (i=0; i < numsteps; i++) { + + /* Gaussian */ + filter[i] = flam3_spatial_filter(flam3_gaussian_kernel, + flam3_spatial_support[flam3_gaussian_kernel]*fabs(i - halfsteps)/halfsteps); + /* Keep the max */ + if (filter[i]>maxfilt) + maxfilt = filter[i]; + } + + } else { // (flam3_temporal_box) + + for (i=0; i < numsteps; i++) + filter[i] = 1.0; + + maxfilt = 1.0; + + } + + /* Adjust the filter so that the max is 1.0, and */ + /* calculate the K2 scaling factor */ + for (i=0;i. +*/ + +#ifndef filters_included +#define filters_included + +#include "private.h" + +#define DE_THRESH 100 + +/* Spatial filter kernels */ +#define flam3_gaussian_kernel 0 +#define flam3_hermite_kernel 1 +#define flam3_box_kernel 2 +#define flam3_triangle_kernel 3 +#define flam3_bell_kernel 4 +#define flam3_b_spline_kernel 5 +#define flam3_lanczos3_kernel 6 +#define flam3_lanczos2_kernel 7 +#define flam3_mitchell_kernel 8 +#define flam3_blackman_kernel 9 +#define flam3_catrom_kernel 10 +#define flam3_hamming_kernel 11 +#define flam3_hanning_kernel 12 +#define flam3_quadratic_kernel 13 + +/* Temporal filters */ +#define flam3_temporal_box 0 +#define flam3_temporal_gaussian 1 +#define flam3_temporal_exp 2 + +typedef struct { + int max_filtered_counts; + int max_filter_index; + int kernel_size; + double *filter_widths; + double *filter_coefs; +} flam3_de_helper; + +extern double flam3_spatial_support[flam3_num_spatialfilters]; + +double flam3_spatial_filter(int knum, double x); +int flam3_create_spatial_filter(flam3_frame *spec, int field, double **filter); +flam3_de_helper flam3_create_de_filters(double max_rad, double min_rad, double curve, int ss); +double flam3_create_temporal_filter(int numsteps, int filter_type, double filter_exp, double filter_width, + double **temporal_filter, double **temporal_deltas); + +#endif + + diff --git a/src/flam3-animate.c b/src/flam3-animate.c new file mode 100644 index 0000000..7f00676 --- /dev/null +++ b/src/flam3-animate.c @@ -0,0 +1,342 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#include "private.h" +#include "img.h" +#include "isaacs.h" + +int main(int argc, char **argv) { + char *ai, *fname; + char flamename[256]; + char *prefix = args("prefix", ""); + int first_frame = argi("begin", 0); + int last_frame = argi("end", 0); + int frame_time = argi("time", 0); + int dtime = argi("dtime", 1); + int do_fields = argi("fields", 0); + int write_genome = argi("write_genome",0); + double qs = argf("qs", 1.0); + double ss = argf("ss", 1.0); + char *format = getenv("format"); + int verbose = argi("verbose", 1); + int transparency = argi("transparency", 0); + int bits = argi("bits", 33); + int sub_batch_size = argi("sub_batch_size", 10000); + int bpc = argi("bpc",8); + int earlyclip = argi("earlyclip",0); + int ftime, channels; + unsigned char *image; + flam3_genome *cps,center_cp; + int i, ncps = 0; + char *inf = getenv("in"); + double pixel_aspect = argf("pixel_aspect", 1.0); + int num_threads = argi("nthreads",0); + FILE *in,*fp,*genfp; + flam3_frame f; + flam3_img_comments fpc; + stat_struct stats,stats2; + + char badval_string[64]; + char numiter_string[64]; + char rtime_string[64]; + +#ifdef WIN32 + + char *slashloc; + char exepath[256]; + char palpath[256]; + memset(exepath,0,256); + memset(palpath,0,256); + slashloc = strrchr(argv[0],'\\'); + if (NULL==slashloc) { + sprintf(palpath,"flam3_palettes=flam3-palettes.xml"); + } else { + strncpy(exepath,argv[0],slashloc-argv[0]+1); + sprintf(palpath,"flam3_palettes=%sflam3-palettes.xml",exepath); + } + putenv(palpath); + +#endif + + + memset(¢er_cp,0, sizeof(flam3_genome)); + + if (1 != argc) { + docstring(); + exit(0); + } + + /* Init random number generators */ + flam3_init_frame(&f); + flam3_srandom(); + + /* Set the number of threads */ + if (num_threads==0) { + num_threads = flam3_count_nthreads(); + if (verbose > 1) + fprintf(stderr,"Automatically detected %d core(s)...\n",num_threads); + } else{ + if (verbose) + fprintf(stderr,"Manually specified %d thread(s)...\n",num_threads); + } + + if (getenv("frame")) { + if (getenv("time")) { + fprintf(stderr, "cannot specify both time and frame.\n"); + exit(1); + } + if (getenv("begin") || getenv("end")) { + fprintf(stderr, "cannot specify both frame and begin or end.\n"); + exit(1); + } + first_frame = last_frame = atoi(getenv("frame")); + } + + if (getenv("time")) { + if (getenv("begin") || getenv("end")) { + fprintf(stderr, "cannot specify both time and begin or end.\n"); + exit(1); + } + first_frame = last_frame = frame_time; + } + + if (NULL == format) format = "png"; + if (strcmp(format, "jpg") && + strcmp(format, "ppm") && + strcmp(format, "png")) { + fprintf(stderr, "format must be either jpg, ppm, or png, not %s.\n", format); + exit(1); + } + + + if (pixel_aspect <= 0.0) { + fprintf(stderr, "pixel aspect ratio must be positive, not %g.\n", + pixel_aspect); + exit(1); + } + + if (inf) + in = fopen(inf, "rb"); + else + in = stdin; + if (NULL == in) { + perror(inf); + exit(1); + } + + cps = flam3_parse_from_file(in, inf, flam3_defaults_on, &ncps); + if (inf) + fclose(in); + if (NULL == cps) { + fprintf(stderr," error reading genomes.\n"); + exit(1); + } + if (0 == ncps) { + fprintf(stderr, "error: no genomes.\n"); + exit(1); + } + for (i = 0; i < ncps; i++) { + cps[i].sample_density *= qs; + cps[i].height = (int)(cps[i].height * ss); + cps[i].width = (int)(cps[i].width * ss); + cps[i].pixels_per_unit *= ss; + if (cps[i].height<=0 || cps[i].width<=0) { + fprintf(stderr,"output image has dimension <=0, aborting.\n"); + exit(1); + } + if (i > 0 && cps[i].time <= cps[i-1].time) { + fprintf(stderr, "error: control points must be sorted by time, but %g <= %g, index %d.\n", + cps[i].time, cps[i-1].time, i); + exit(1); + } + if ((cps[i].width != cps[0].width) || + (cps[i].height != cps[0].height)) { + fprintf(stderr, "warning: flame %d at time %g size mismatch. " + "(%d,%d) should be (%d,%d).\n", + i, cps[i].time, + cps[i].width, cps[i].height, + cps[0].width, cps[0].height); + cps[i].width = cps[0].width; + cps[i].height = cps[0].height; + } + } + if (!getenv("time") && !getenv("frame")) { + if (!getenv("begin")) { + first_frame = (int) cps[0].time; + } + if (!getenv("end")) { + last_frame = (int) cps[ncps-1].time - 1; + if (last_frame < first_frame) last_frame = first_frame; + } + } + channels = strcmp(format, "png") ? 3 : 4; + + /* Check for 16-bit-per-channel processing */ + if ( (16 == bpc) && (strcmp(format,"png") != 0)) { + fprintf(stderr,"Support for 16 bpc images is only present for the png format.\n"); + exit(1); + } else if (bpc != 8 && bpc != 16) { + fprintf(stderr,"Unexpected bpc specified (%d)\n",bpc); + exit(1); + } + +// f.temporal_filter_radius = argf("blur", 0.5); + f.pixel_aspect_ratio = pixel_aspect; + f.genomes = cps; + f.ngenomes = ncps; + f.verbose = verbose; + f.bits = bits; + f.progress = 0; + f.earlyclip = earlyclip; + f.nthreads = num_threads; + f.sub_batch_size = sub_batch_size; + + if (16==bpc) + f.bytes_per_channel = 2; + else + f.bytes_per_channel = 1; + + + image = (void *) malloc((size_t)channels * + (size_t)cps[0].width * + (size_t)cps[0].height * f.bytes_per_channel); + + if (dtime < 1) { + fprintf(stderr, "dtime must be positive, not %d.\n", dtime); + exit(1); + } + + for (ftime = first_frame; ftime <= last_frame; ftime += dtime) { + f.time = (double) ftime; + + if (verbose && ((last_frame-first_frame)/dtime) >= 1) { + fprintf(stderr, "time = %d/%d/%d\n", ftime, last_frame, dtime); + } + + if (do_fields) { + + if (flam3_render(&f, image, flam3_field_even, channels, transparency,&stats)) { + fprintf(stderr,"error rendering image: aborting.\n"); + exit(1); + } + f.time += 0.5; + if (flam3_render(&f, image, flam3_field_odd, channels, transparency,&stats2)) { + fprintf(stderr,"error rendering image: aborting.\n"); + exit(1); + } + + stats.badvals+=stats2.badvals; + stats.render_seconds+=stats2.render_seconds; + stats.num_iters+=stats2.num_iters; + } else { + if (flam3_render(&f, image, flam3_field_both, channels, transparency,&stats)) { + fprintf(stderr,"error rendering image: aborting.\n"); + exit(1); + } + } + + if (getenv("out")) + fname = getenv("out"); + else { + fname = malloc(strlen(prefix) + 20); + sprintf(fname, "%s%05d.%s", prefix, ftime, format); + } + + if (verbose) + fprintf(stderr, "writing %s...", fname); + + if (write_genome) { + sprintf(flamename,"%s.flam3",fname); + + /* get center genome */ + flam3_interpolate(f.genomes, f.ngenomes, f.time, 0, ¢er_cp); + + /* write it out */ + genfp = fopen(flamename,"w"); + if (NULL == genfp) { + perror(flamename); + exit(1); + } + + flam3_print(genfp, ¢er_cp, NULL, flam3_print_edits); + + fclose(genfp); + } + + fp = fopen(fname, "wb"); + if (NULL == fp) { + perror(fname); + exit(1); + } + + /* Get center cp for embedding in png file */ + flam3_interpolate(f.genomes, f.ngenomes, f.time, 0, ¢er_cp); + + /* Convert to string */ + fpc.genome = flam3_print_to_string(¢er_cp); + sprintf(badval_string, "%g",stats.badvals/(double)stats.num_iters); + fpc.badvals = badval_string; + sprintf(numiter_string,"%g",(double)stats.num_iters); + fpc.numiters = numiter_string; + sprintf(rtime_string,"%d",stats.render_seconds); + fpc.rtime = rtime_string; + + if (!strcmp(format, "png")) { + + write_png(fp, image, cps[0].width, cps[0].height, &fpc, 1); + + } else if (!strcmp(format, "jpg")) { + + write_jpeg(fp, image, cps[0].width, cps[0].height, &fpc); + + } else { + int size = 3 * cps[0].width * cps[0].height; + fprintf(fp, "P6\n"); + fprintf(fp, "%d %d\n255\n", cps[0].width, cps[0].height); + if (size != fwrite(image, 1, size, fp)) { + perror(fname); + } + } + + /* Free string */ + free(fpc.genome); + + clear_cp(¢er_cp,0); + + fclose(fp); + + if (!getenv("out")) + free(fname); + + } + + for (i = 0; i < ncps; i++) { + xmlFreeDoc(cps[i].edits); + clear_cp(&cps[i],0); + } + free(cps); + + free(image); + + if (verbose) + fprintf(stderr, "done.\n"); + + fflush(stderr); + return 0; +} diff --git a/src/flam3-animate.man b/src/flam3-animate.man new file mode 100644 index 0000000..b754356 --- /dev/null +++ b/src/flam3-animate.man @@ -0,0 +1,36 @@ +.TH flam3-animate 1 "" "" +.SH NAME +flam3-animate +flam3-render +flam3-genome +flam3-convert - render and animate FLAM3s and manipulate their genomes +.SH SYNOPSIS +.B flam3-render < input + +.SH DESCRIPTION + +FLAM3 implements a visual language based on a recursive set equation. + +Flam3-genome creates and manipulates genomes (xml parameter sets) in +this language. Flam3-render turns genomes into still images, and +Flam3-animate renders motion-blurred frames of animation. + +Flam3-convert reads from stdin files in the old format used by the +flame GIMP plugin, and writes the new format to stdout. + +.SH OPTIONS + +Any command line option will cause the program to write its +documentation to standard out. + +.SH ENVIRONMENT + +The environment variables are in the documention written to standard +out given any command line option. + +.SH SEE ALSO +.BR WWW.FLAM3.COM, +.BR electricsheep (1), + +.SH AUTHOR +spot aka Scott Draves, Erik Reckase diff --git a/src/flam3-convert.c b/src/flam3-convert.c new file mode 100644 index 0000000..3062a4b --- /dev/null +++ b/src/flam3-convert.c @@ -0,0 +1,239 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "private.h" + + +#define MAXARGS 1000 +#define streql(x,y) (!strcmp(x,y)) + + +/* + * split a string passed in ss into tokens on whitespace. + * # comments to end of line. ; terminates the record + */ +void tokenize(ss, argv, argc) + char **ss; + char *argv[]; + int *argc; +{ + char *s = *ss; + int i = 0, state = 0; + + while (*s != ';') { + char c = *s; + switch (state) { + case 0: + if ('#' == c) + state = 2; + else if (!isspace(c)) { + argv[i] = s; + i++; + state = 1; + } + case 1: + if (isspace(c)) { + *s = 0; + state = 0; + } + case 2: + if ('\n' == c) + state = 0; + } + s++; + } + *s = 0; + *ss = s+1; + *argc = i; +} + +/* + * given a pointer to a string SS, fill fields of a control point CP. + * return a pointer to the first unused char in SS. totally barfucious, + * must integrate with tcl soon... + */ + +void parse_control_point_old(char **ss, flam3_genome *cp) { + char *argv[MAXARGS]; + int argc, i, j; + int set_cm = 0, set_image_size = 0, set_nbatches = 0, set_white_level = 0, set_cmap_inter = 0; + int set_spatial_oversample = 0, set_hr = 0; + double *slot, xf, cm, t, nbatches, white_level, spatial_oversample, cmap_inter; + double image_size[2]; + + memset(cp, 0, sizeof(flam3_genome)); + + flam3_add_xforms(cp, flam3_nxforms, 0, 0); + + for (i = 0; i < flam3_nxforms; i++) { + cp->xform[i].density = 0.0; + cp->xform[i].color = i&1; + cp->xform[i].color_speed = 0.5; + cp->xform[i].animate = 1.0; + cp->xform[i].var[0] = 1.0; + for (j = 1; j < flam3_nvariations; j++) + cp->xform[i].var[j] = 0.0; + cp->xform[i].c[0][0] = 1.0; + cp->xform[i].c[0][1] = 0.0; + cp->xform[i].c[1][0] = 0.0; + cp->xform[i].c[1][1] = 1.0; + cp->xform[i].c[2][0] = 0.0; + cp->xform[i].c[2][1] = 0.0; + } + + tokenize(ss, argv, &argc); + for (i = 0; i < argc; i++) { + if (streql("xform", argv[i])) + slot = &xf; + else if (streql("time", argv[i])) + slot = &cp->time; + else if (streql("brightness", argv[i])) + slot = &cp->brightness; + else if (streql("contrast", argv[i])) + slot = &cp->contrast; + else if (streql("gamma", argv[i])) + slot = &cp->gamma; + else if (streql("vibrancy", argv[i])) + slot = &cp->vibrancy; + else if (streql("hue_rotation", argv[i])) { + slot = &cp->hue_rotation; + set_hr = 1; + } else if (streql("zoom", argv[i])) + slot = &cp->zoom; + else if (streql("image_size", argv[i])) { + slot = image_size; + set_image_size = 1; + } else if (streql("center", argv[i])) + slot = cp->center; + else if (streql("background", argv[i])) + slot = cp->background; + else if (streql("pixels_per_unit", argv[i])) + slot = &cp->pixels_per_unit; + else if (streql("spatial_filter_radius", argv[i])) + slot = &cp->spatial_filter_radius; + else if (streql("sample_density", argv[i])) + slot = &cp->sample_density; + else if (streql("nbatches", argv[i])) { + slot = &nbatches; + set_nbatches = 1; + } else if (streql("white_level", argv[i])) { + slot = &white_level; + set_white_level = 1; + } else if (streql("spatial_oversample", argv[i])) { + slot = &spatial_oversample; + set_spatial_oversample = 1; + } else if (streql("cmap", argv[i])) { + slot = &cm; + set_cm = 1; + } else if (streql("palette", argv[i])) { + slot = &cp->palette[0].color[0]; + } else if (streql("density", argv[i])) + slot = &cp->xform[(int)xf].density; + else if (streql("color", argv[i])) + slot = &cp->xform[(int)xf].color; + else if (streql("coefs", argv[i])) { + slot = cp->xform[(int)xf].c[0]; + cp->xform[(int)xf].density = 1.0; + } else if (streql("var", argv[i])) + slot = cp->xform[(int)xf].var; + else if (streql("cmap_inter", argv[i])) { + slot = &cmap_inter; + set_cmap_inter = 1; + } else + *slot++ = atof(argv[i]); + } + if (set_cm) { + double hr = set_hr ? cp->hue_rotation : 0.0; + cp->palette_index = (int) cm; + flam3_get_palette(cp->palette_index, cp->palette, hr); + } + if (set_image_size) { + cp->width = (int) image_size[0]; + cp->height = (int) image_size[1]; + } + if (set_nbatches) + cp->nbatches = (int) nbatches; + if (set_spatial_oversample) + cp->spatial_oversample = (int) spatial_oversample; + if (set_white_level) { + /* ignore */ + } + for (i = 0; i < flam3_nxforms; i++) { + t = 0.0; + for (j = 0; j < flam3_nvariations; j++) + t += cp->xform[i].var[j]; + t = 1.0 / t; + for (j = 0; j < flam3_nvariations; j++) + cp->xform[i].var[j] *= t; + } +} + +int +main(int argc, char **argv) +{ + char *s, *ss; + +#ifdef WIN32 + + char *slashloc; + char palpath[256],exepath[256]; + + slashloc = strrchr(argv[0],'\\'); + if (NULL==slashloc) { + sprintf(palpath,"flam3_palettes=flam3-palettes.xml"); + } else { + strncpy(exepath,argv[0],slashloc-argv[0]+1); + sprintf(palpath,"flam3_palettes=%sflam3-palettes.xml",exepath); + } + putenv(palpath); + +#endif + + if (1 != argc) { + docstring(); + exit(0); + } + + { + int i, c, slen = 5000; + s = malloc(slen); + i = 0; + do { + c = getchar(); + if (EOF == c) goto done_reading; + s[i++] = c; + if (i == slen-1) { + slen *= 2; + s = realloc(s, slen); + } + } while (1); + done_reading: + s[i] = 0; + } + + ss = s; + s += strlen(s); + printf("\n"); + while (strchr(ss, ';')) { + flam3_genome cp; + parse_control_point_old(&ss, &cp); + flam3_print(stdout, &cp, NULL, flam3_print_edits); + } + printf("\n"); + return 0; +} diff --git a/src/flam3-convert.man b/src/flam3-convert.man new file mode 100644 index 0000000..b754356 --- /dev/null +++ b/src/flam3-convert.man @@ -0,0 +1,36 @@ +.TH flam3-animate 1 "" "" +.SH NAME +flam3-animate +flam3-render +flam3-genome +flam3-convert - render and animate FLAM3s and manipulate their genomes +.SH SYNOPSIS +.B flam3-render < input + +.SH DESCRIPTION + +FLAM3 implements a visual language based on a recursive set equation. + +Flam3-genome creates and manipulates genomes (xml parameter sets) in +this language. Flam3-render turns genomes into still images, and +Flam3-animate renders motion-blurred frames of animation. + +Flam3-convert reads from stdin files in the old format used by the +flame GIMP plugin, and writes the new format to stdout. + +.SH OPTIONS + +Any command line option will cause the program to write its +documentation to standard out. + +.SH ENVIRONMENT + +The environment variables are in the documention written to standard +out given any command line option. + +.SH SEE ALSO +.BR WWW.FLAM3.COM, +.BR electricsheep (1), + +.SH AUTHOR +spot aka Scott Draves, Erik Reckase diff --git a/src/flam3-genome.c b/src/flam3-genome.c new file mode 100644 index 0000000..1e00e9b --- /dev/null +++ b/src/flam3-genome.c @@ -0,0 +1,1075 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "private.h" +#include "isaacs.h" +#include "config.h" + +int verbose; + +char *get_extras() { + char *e = getenv("extras"); + return e; +} + +void gprint(flam3_genome *cp, int extras) { + if (getenv("noedits")) + flam3_print(stdout, cp, extras ? get_extras() : NULL, flam3_dont_print_edits); + else + flam3_print(stdout, cp, extras ? get_extras() : NULL, flam3_print_edits); +} + + +void test_cp(flam3_genome *cp) { + cp->time = 0.0; + cp->interpolation = flam3_interpolation_linear; + cp->palette_interpolation = flam3_palette_interpolation_hsv; + cp->background[0] = 0.0; + cp->background[1] = 0.0; + cp->background[2] = 0.0; + cp->center[0] = 0.0; + cp->center[1] = 0.0; + cp->rotate = 0.0; + cp->pixels_per_unit = 64; + cp->width = 128; + cp->height = 128; + cp->spatial_oversample = 1; + cp->spatial_filter_radius = 0.5; + cp->spatial_filter_select = 0; + cp->zoom = 0.0; + cp->sample_density = 1; + cp->nbatches = 1; + cp->ntemporal_samples = 1; + cp->estimator = 0.0; + cp->estimator_minimum = 0.0; + cp->estimator_curve = 0.6; +} + +flam3_genome *string_to_cp(char *s, int *n) { + flam3_genome *cp; + FILE *fp; + + fp = fopen(s, "rb"); + if (NULL == fp) { + perror(s); + exit(1); + } + cp = flam3_parse_from_file(fp, s, flam3_defaults_on, n); + if (NULL == cp) { + fprintf(stderr, "could not read genome from %s.\n", s); + exit(1); + } + return cp; +} + +xmlDocPtr create_new_editdoc(char *action, flam3_genome *parent0, flam3_genome *parent1) { + + xmlDocPtr doc = NULL, comment_doc = NULL; + xmlNodePtr root_node = NULL, node = NULL, nodecopy = NULL; + xmlNodePtr root_comment = NULL; + struct tm *localt; + time_t mytime; + char *ai; + char timestring[100]; + char *nick = getenv("nick"); + char *url = getenv("url"); + char *id = getenv("id"); + char *comment = getenv("comment"); + int sheep_gen = argi("sheep_gen",-1); + int sheep_id = argi("sheep_id",-1); + char buffer[100]; + char comment_string[100]; + + doc = xmlNewDoc( (const xmlChar *)"1.0"); + + /* Create the root node, called "edit" */ + root_node = xmlNewNode(NULL, (const xmlChar *)"edit"); + xmlDocSetRootElement(doc,root_node); + /* Add the edit attributes */ + + /* date */ + mytime = time(NULL); + localt = localtime(&mytime); + /* XXX use standard time format including timezone */ + strftime(timestring, 100, "%a %b %e %H:%M:%S %z %Y", localt); + xmlNewProp(root_node, (const xmlChar *)"date", (const xmlChar *)timestring); + + /* nick */ + if (nick) { + xmlNewProp(root_node, (const xmlChar *)"nick", (const xmlChar *)nick); + } + + /* url */ + if (url) { + xmlNewProp(root_node, (const xmlChar *)"url", (const xmlChar *)url); + } + + if (id) { + xmlNewProp(root_node, (const xmlChar *)"id", (const xmlChar *)id); + } + + /* action */ + xmlNewProp(root_node, (const xmlChar *)"action", (const xmlChar *)action); + + /* sheep info */ + if (sheep_gen > 0 && sheep_id > 0) { + /* Create a child node of the root node called sheep */ + node = xmlNewChild(root_node, NULL, (const xmlChar *)"sheep", NULL); + + /* Create the sheep attributes */ + sprintf(buffer, "%d", sheep_gen); + xmlNewProp(node, (const xmlChar *)"generation", (const xmlChar *)buffer); + + sprintf(buffer, "%d", sheep_id); + xmlNewProp(node, (const xmlChar *)"id", (const xmlChar *)buffer); + } + + /* Check for the parents */ + /* If Parent 0 not specified, this is a randomly generated genome. */ + if (parent0) { + if (parent0->edits) { + /* Copy the node from the parent */ + node = xmlDocGetRootElement(parent0->edits); + nodecopy = xmlCopyNode(node, 1); + xmlNewProp(nodecopy,(const xmlChar *)"filename", (const xmlChar *)parent0->parent_fname); + sprintf(buffer,"%d",parent0->genome_index); + xmlNewProp(nodecopy,(const xmlChar *)"index", (const xmlChar *)buffer); + xmlAddChild(root_node, nodecopy); + } else { + /* Insert a (parent has no edit) message */ + nodecopy = xmlNewChild(root_node, NULL, (const xmlChar *)"edit",NULL); + xmlNewProp(nodecopy,(const xmlChar *)"filename", (const xmlChar *)parent0->parent_fname); + sprintf(buffer,"%d",parent0->genome_index); + xmlNewProp(nodecopy,(const xmlChar *)"index", (const xmlChar *)buffer); + + } + } + + if (parent1) { + + if (parent1->edits) { + /* Copy the node from the parent */ + node = xmlDocGetRootElement(parent1->edits); + nodecopy = xmlCopyNode(node, 1); + xmlNewProp(nodecopy,(const xmlChar *)"filename", (const xmlChar *)parent1->parent_fname); + sprintf(buffer,"%d",parent1->genome_index); + xmlNewProp(nodecopy,(const xmlChar *)"index", (const xmlChar *)buffer); + xmlAddChild(root_node, nodecopy); + } else { + /* Insert a (parent has no edit) message */ + nodecopy = xmlNewChild(root_node, NULL, (const xmlChar *)"edit",NULL); + xmlNewProp(nodecopy,(const xmlChar *)"filename", (const xmlChar *)parent1->parent_fname); + sprintf(buffer,"%d",parent1->genome_index); + xmlNewProp(nodecopy,(const xmlChar *)"index", (const xmlChar *)buffer); + } + } + + /* Comment string */ + /* This one's hard, since we have to treat the comment string as */ + /* a valid XML document. Create a new document using the comment */ + /* string as the in-memory document, and then copy all children of */ + /* the root node into the edit structure */ + /* Parsing the comment string should be done once and then copied */ + /* for each call to create_new_editdoc, but that's for later. */ + if (comment) { + + sprintf(comment_string,"%s",comment); + + comment_doc = xmlReadMemory(comment_string, strlen(comment_string), "comment.env", NULL, XML_PARSE_NONET); + + /* Check for errors */ + if (comment_doc==NULL) { + fprintf(stderr, "Failed to parse comment into XML!\n"); + exit(1); + } + + /* Loop through the children of the new document and copy */ + /* them into the root_node */ + root_comment = xmlDocGetRootElement(comment_doc); + + for (node=root_comment->children; node; node = node->next) { + + nodecopy = xmlCopyNode(node,1); + xmlAddChild(root_node, nodecopy); + } + + /* Free the created document */ + xmlFreeDoc(comment_doc); + } + + + /* return the xml doc */ + return(doc); +} + +void offset(flam3_genome *g) { + char *os = getenv("offset"); + double ox, oy; + if (NULL == os) return; + sscanf(os, "%lf:%lf", &ox, &oy); + g->center[0] += ox / (g->pixels_per_unit * g->spatial_oversample); + g->center[1] += oy / (g->pixels_per_unit * g->spatial_oversample); +} + +void spin(int frame, double blend, flam3_genome *parent, flam3_genome *templ) +{ + flam3_genome *result; + char action[50]; + xmlDocPtr doc; + + /* Spin the parent blend*360 degrees */ + result = sheep_loop(parent,blend); + + /* Apply the template if necessary */ + if (templ) + flam3_apply_template(result, templ); + + /* Set genome parameters accordingly */ + result->time = (double)frame; + result->interpolation = flam3_interpolation_linear; + result->palette_interpolation = flam3_palette_interpolation_hsv; + + /* Force linear interpolation - unsure if this is still necessary */ + /* I believe we put this in so that older clients could render frames */ +// result->interpolation_type = flam3_inttype_linear; + + /* Create the edit doc xml */ + sprintf(action,"rotate %g",blend*360.0); + doc = create_new_editdoc(action, parent, (flam3_genome *)NULL); + result->edits = doc; + + /* Subpixel jitter */ + offset(result); + + /* Make the name of the flame the time */ + sprintf(result->flame_name,"%f",result->time); + + /* Print the resulting xml */ + gprint(result, 1); + + /* Clear out the xml doc */ + xmlFreeDoc(result->edits); + + /* Clear the result cp */ + clear_cp(result,flam3_defaults_on); + + /* Free the cp allocated in flam3_sheep_loop */ + free(result); +} + +void spin_inter(int frame, double blend, int seqflag, flam3_genome *parents, flam3_genome *templ) { + + flam3_genome *result; + char action[50]; + xmlDocPtr doc; + char *ai; + double stagger = argf("stagger", 0.0); + + /* Interpolate between spun parents */ + result = sheep_edge(parents, blend, seqflag, stagger); + + /* Unsure why we check for random palettes on both ends... */ + if ((parents[0].palette_index != flam3_palette_random) && + (parents[1].palette_index != flam3_palette_random)) { + + result->palette_index = flam3_palette_interpolated; + result->palette_index0 = parents[0].palette_index; + result->hue_rotation0 = parents[0].hue_rotation; + result->palette_index1 = parents[1].palette_index; + result->hue_rotation1 = parents[1].hue_rotation; + result->palette_blend = blend; + } + + /* Apply template if necessary */ + if (templ) + flam3_apply_template(result, templ); + + /* Set genome attributes */ + result->time = (double)frame; +// result->interpolation_type = flam3_inttype_linear; + + /* Create the edit doc xml */ + sprintf(action,"interpolate %g",blend*360.0); + doc = create_new_editdoc(action, &parents[0], &parents[1]); + result->edits = doc; + + /* Subpixel jitter */ + offset(result); + + /* Make the name of the flame the time */ + sprintf(result->flame_name,"%f",result->time); + + /* Print the genome */ + gprint(result, 1); + + /* Clean up */ + xmlFreeDoc(result->edits); + + /* Free genome storage */ + clear_cp(result,flam3_defaults_on); + free(result); +} + +void truncate_variations(flam3_genome *g, int max_vars, char *action) { + int i, j, nvars, smallest; + double sv=0; + char trunc_note[30]; + + for (i = 0; i < g->num_xforms; i++) { + double d = g->xform[i].density; + +/* if (0.0 < d && d < 0.001) */ + + if (d < 0.001 && (g->final_xform_index != i)) { + sprintf(trunc_note," trunc_density %d",i); + //strcat(action,trunc_note); + add_to_action(action,trunc_note); + flam3_delete_xform(g, i); + +/* g->xform[i].density = 0.0; + } else if (d > 0.0) { +*/ + } else { + do { + nvars = 0; + smallest = -1; + for (j = 0; j < flam3_nvariations; j++) { + double v = g->xform[i].var[j]; + if (v != 0.0) { + nvars++; + if (-1 == smallest || fabs(v) < sv) { + smallest = j; + sv = fabs(v); + } + } + } + if (nvars > max_vars) { + sprintf(trunc_note," trunc %d %d",i,smallest); + //strcat(action,trunc_note); + add_to_action(action,trunc_note); + g->xform[i].var[smallest] = 0.0; + } + } while (nvars > max_vars); + } + } +} + +static double golden_bit(randctx *rc) { + return flam3_random_isaac_bit(rc)?0.38196:0.61804; +} + +int +main(argc, argv) + int argc; + char **argv; +{ + int debug = 0; + int count; + char *ai; + unsigned char *image; + flam3_genome *templ = NULL; + flam3_genome cp_orig, cp_save; + int i, j; + double avg_pix, fraction_black, fraction_white; + double avg_thresh = argf("avg", 20.0); + double black_thresh = argf("black", 0.01); + double white_limit = argf("white", 0.05); + int nframes = argi("nframes", 100); + int sym = argi("symmetry", 0); + int enclosed = argi("enclosed", 1); + char *clone = getenv("clone"); + char *clone_all = getenv("clone_all"); + char *animate = getenv("animate"); + char *mutate = getenv("mutate"); + char *cross0 = getenv("cross0"); + char *cross1 = getenv("cross1"); + char *method = getenv("method"); + char *inter = getenv("inter"); + char *rotate = getenv("rotate"); + char *strip = getenv("strip"); + char *sequence = getenv("sequence"); + int loops = argi("loops", 1); + int frame = argi("frame", 0); + int rep, repeat = argi("repeat", 1); + double speed = argf("speed", 0.1); + int bits = argi("bits", 33); + int ntries = argi("tries", 10); + char *use_vars = getenv("use_vars"); + char *dont_use_vars = getenv("dont_use_vars"); + flam3_genome *parent0=NULL, *parent1=NULL; + flam3_genome selp0, selp1; + flam3_genome *aselp0, *aselp1; + int parent0_n, parent1_n; + int num_threads = 1; + flam3_genome *cp; + int ncp; + + int ivars[max_specified_vars]; + int novars[max_specified_vars]; + int num_ivars = 0; + int num_novars = 0; + char *var_tok; + + flam3_frame f; + char action[flam3_max_action_length]; + + stat_struct stats; + + + +#ifdef WIN32 + + char *slashloc; + char exepath[256]; + char palpath[256]; + memset(exepath,0,256); + memset(palpath,0,256); + slashloc = strrchr(argv[0],'\\'); + if (NULL==slashloc) { + sprintf(palpath,"flam3_palettes=flam3-palettes.xml"); + } else { + strncpy(exepath,argv[0],slashloc-argv[0]+1); + sprintf(palpath,"flam3_palettes=%sflam3-palettes.xml",exepath); + } + putenv(palpath); + +#endif + + + verbose = argi("verbose", 0); + + memset(&cp_orig, 0, sizeof(flam3_genome)); + memset(&cp_save, 0, sizeof(flam3_genome)); + memset(&selp0, 0, sizeof(flam3_genome)); + memset(&selp1, 0, sizeof(flam3_genome)); + + if (1 != argc) { + docstring(); + exit(0); + } + + /* Init random number generators */ + flam3_init_frame(&f); + flam3_srandom(); + + //f.temporal_filter_radius = 0.0; + f.bits = bits; + f.bytes_per_channel = 1; + f.earlyclip = 1; + f.verbose = 0; + f.genomes = &cp_orig; + f.ngenomes = 1; + f.pixel_aspect_ratio = 1.0; + f.progress = 0; + f.nthreads = num_threads; + f.sub_batch_size = 10000; + test_cp(&cp_orig); // just for the width & height + + /* Are the variations to be used specified? */ + if (use_vars && dont_use_vars) { + fprintf(stderr,"use_vars and dont_use_vars cannot both be specified. Terminating.\n"); + exit(-1); + } + + /* Specify reasonable defaults if nothing is specified */ + if (!use_vars && !dont_use_vars) { + novars[num_novars++] = VAR_NOISE; + novars[num_novars++] = VAR_BLUR; + novars[num_novars++] = VAR_GAUSSIAN_BLUR; + novars[num_novars++] = VAR_RADIAL_BLUR; + novars[num_novars++] = VAR_NGON; + novars[num_novars++] = VAR_SQUARE; + novars[num_novars++] = VAR_RAYS; + novars[num_novars++] = VAR_CROSS; + novars[num_novars++] = VAR_PRE_BLUR; + novars[num_novars++] = VAR_SEPARATION; + novars[num_novars++] = VAR_SPLIT; + novars[num_novars++] = VAR_SPLITS; + + + + /* Loop over the novars and set ivars to the complement */ + for (i=0;i=flam3_nvariations) { + fprintf(stderr,"specified variation list includes bad value. (%d)\n",ivars[i]); + exit(1); + } + } + } else if (dont_use_vars) { + /* Parse comma-separated list of variations NOT to use */ + var_tok = strtok(dont_use_vars,","); + novars[num_novars++] = atoi(var_tok); + while(1) { + var_tok = strtok(NULL,","); + + if (var_tok==NULL) + break; + + novars[num_novars++] = atoi(var_tok); + + if (num_novars==max_specified_vars) { + fprintf(stderr,"Maximum number of user-specified variations exceeded. Truncating.\n"); + break; + } + } + + /* Loop over the novars and set ivars to the complement */ + for (i=0;i\n", flam3_version()); + for (i = 0; i < ncp; i++) { + if (templ) flam3_apply_template(&cp[i], templ); + offset(&cp[i]); + gprint(&cp[i], 1); + } + printf("\n"); + + exit(0); + } + + if (animate) { + flam3_genome interpolated; + int first_frame,last_frame; + int ftime,iscp; + double stagger = argf("stagger", 0.0); + cp = string_to_cp(animate, &ncp); + + + for (i = 0; i < ncp; i++) { + if (i > 0 && cp[i].time <= cp[i-1].time) { + fprintf(stderr, "error: control points must be sorted by time, but %g <= %g, index %d.\n", + cp[i].time, cp[i-1].time, i); + exit(1); + } + /* Strip out all motion elements here */ + for (j=0;j\n", flam3_version()); + + for (ftime = first_frame; ftime <= last_frame; ftime += 1) { + iscp=0; + for (i=0;i\n"); + exit(0); + } + + + if (sequence) { + double blend, spread; + int seqflag; + int framecount; + + if (nframes <= 0) { + fprintf(stderr, "nframes must be positive, not %d.\n", nframes); + exit(1); + } + + cp = string_to_cp(sequence, &ncp); + + if (enclosed) printf("\n", flam3_version()); + spread = 1.0/nframes; + framecount = 0; +#if 1 + for (i = 0; i < ncp; i++) { + if (loops) { + for (frame = 0; frame < nframes; frame++) { + blend = frame/(double)nframes; + spin(framecount++, blend, &cp[i], templ); + } + } + if (i < ncp-1) + for (frame = 0; frame < nframes; frame++) { + if (0==frame || nframes-1==frame) + seqflag=1; + else + seqflag=0; + blend = frame/(double)nframes; + spin_inter(framecount++, blend, seqflag, &cp[i], templ); + } + } + spin(framecount, 0.0, &cp[ncp-1], templ); +#else + if (1) { + flam3_genome res; + memset(&res, 0, sizeof(flam3_genome)); + res.final_xform_index = -1; + flam3_add_xforms(&res, cp[0].num_xforms, 0); + + if (ncp < 4) { + fprintf(stderr, "catmull-rom requires 4 or more control points.\n"); + exit(1); + } + for (i = 0; i < ncp - 3; i++) { + for (frame = 0; frame < nframes; frame++) { + blend = frame/(double)nframes; + interpolate_catmull_rom(cp+i, blend, &res); + res.time = frame + i * nframes; + gprint(&res, 0); + fflush(stdout); + } + } + } +#endif + if (enclosed) printf("\n"); + exit(0); + } + + if (inter || rotate) { + + double blend, spread; + char *fname = inter?inter:rotate; + int ni; + + if (nframes <= 0) { + fprintf(stderr, "nframes must be positive, not %d.\n", nframes); + exit(1); + } + + blend = frame/(double)nframes; + spread = 1.0/nframes; + + cp = string_to_cp(fname, &ncp); + + if (enclosed) printf("\n", flam3_version()); + if (rotate) { + if (1 != ncp) { + fprintf(stderr, "rotation requires one control point, not %d.\n", ncp); + exit(1); + } + spin(frame - 1, blend - spread, cp, templ); + spin(frame , blend , cp, templ); + spin(frame + 1, blend + spread, cp, templ); + } else { + if (2 != ncp) { + fprintf(stderr, "interpolation requires two control points, not %d.\n", ncp); + exit(1); + } + spin_inter(frame - 1, blend - spread, 0, cp, templ); + spin_inter(frame , blend , 0, cp, templ); + spin_inter(frame + 1, blend + spread, 0, cp, templ); + } + if (enclosed) printf("\n"); + + for (ni=0;ni\n", flam3_version()); + + for (i = 0; i < ncp; i++) { + double old_center[2]; + + /* Strip out motion elements */ + for (j=0;j\n"); + exit(0); + } + + /* pick a control point until it looks good enough */ + if (repeat <= 0) { + fprintf(stderr, "repeat must be positive, not %d.\n", repeat); + exit(1); + } + + if (enclosed) printf("\n", flam3_version()); + image = (unsigned char *) malloc(3 * cp_orig.width * cp_orig.height); + + for (rep = 0; rep < repeat; rep++) { + + if (verbose) + fprintf(stderr, "flame = %d/%d..", rep+1, repeat); + + count = 0; + + if (clone) { + + parent0 = string_to_cp(clone, &parent0_n); + /* Action is 'clone' with trunc_vars concat */ + sprintf(action,"clone"); + + if (getenv("clone_action")) + sprintf(action,"clone %s", getenv("clone_action")); + + flam3_copy(&selp0, &(parent0[random()%parent0_n])); + flam3_copy(&cp_save, &selp0); + aselp0 = &selp0; + aselp1 = NULL; + truncate_variations(&cp_save, 5, action); + + cp_save.edits = create_new_editdoc(action, aselp0, aselp1); + + } else { + int did_color; + + do { + + int random_mode=0; + + if (verbose) fprintf(stderr, "."); + did_color = 0; + f.time = (double) 0.0; + action[0] = 0; + + if (mutate) { + int mutmeth; + + parent0 = string_to_cp(mutate, &parent0_n); + flam3_copy(&selp0, &(parent0[((unsigned)irand(&f.rc))%parent0_n])); + flam3_copy(&cp_orig, &selp0); + aselp0 = &selp0; + aselp1 = NULL; + + if (NULL == getenv("method")) + mutmeth = MUTATE_NOT_SPECIFIED; + else if (!strcmp(method,"all_vars")) + mutmeth = MUTATE_ALL_VARIATIONS; + else if (!strcmp(method,"one_xform")) + mutmeth = MUTATE_ONE_XFORM_COEFS; + else if (!strcmp(method,"add_symmetry")) + mutmeth = MUTATE_ADD_SYMMETRY; + else if (!strcmp(method,"post_xforms")) + mutmeth = MUTATE_POST_XFORMS; + else if (!strcmp(method,"color_palette")) + mutmeth = MUTATE_COLOR_PALETTE; + else if (!strcmp(method,"delete_xform")) + mutmeth = MUTATE_DELETE_XFORM; + else if (!strcmp(method,"all_coefs")) + mutmeth = MUTATE_ALL_COEFS; + else { + fprintf(stderr,"method '%s' not defined for mutate. defaulting to random.\n",method); + mutmeth = MUTATE_NOT_SPECIFIED; + } + + flam3_mutate(&cp_orig, mutmeth, ivars, num_ivars, sym, speed, &f.rc, action); + + /* Scan string returned for 'mutate color' */ + if ( strstr(action,"mutate color") ) + did_color = 1; + + if (cp_orig.flame_name[0]) { + char tm[flam3_name_len+1]; + strncpy(tm, cp_orig.flame_name, flam3_name_len); + snprintf(cp_orig.flame_name, flam3_name_len, "mutation %d of %s", rep, tm); + } + + } else if (cross0) { + int i0, i1; + int crossmeth; + + parent0 = string_to_cp(cross0, &parent0_n); + parent1 = string_to_cp(cross1, &parent1_n); + + i0 = ((unsigned)irand(&f.rc))%parent0_n; + i1 = ((unsigned)irand(&f.rc))%parent1_n; + + flam3_copy(&selp0, &(parent0[i0])); + flam3_copy(&selp1, &(parent1[i1])); + + aselp0 = &selp0; + aselp1 = &selp1; + + if (NULL == getenv("method")) + crossmeth = CROSS_NOT_SPECIFIED; + else if (!strcmp(method,"union")) + crossmeth = CROSS_UNION; + else if (!strcmp(method,"interpolate")) + crossmeth = CROSS_INTERPOLATE; + else if (!strcmp(method,"alternate")) + crossmeth = CROSS_ALTERNATE; + else { + fprintf(stderr,"method '%s' not defined for cross. defaulting to random.\n",method); + crossmeth = CROSS_NOT_SPECIFIED; + } + + flam3_cross(&parent0[i0], &parent1[i1], &cp_orig, crossmeth, &f.rc, action); + + if (parent0[i0].flame_name[0] || parent1[i1].flame_name[0]) { + snprintf(cp_orig.flame_name, flam3_name_len, "%d of %s x %s", + rep, parent0[i0].flame_name, parent1[i1].flame_name); + } + + } else { + sprintf(action,"random"); + random_mode=1; + flam3_random(&cp_orig, ivars, num_ivars, sym, 0); + + + aselp0 = NULL; + aselp1 = NULL; + } + + /* Adjust bounding box half the time */ + if (flam3_random_bit(&f.rc) || random_mode) { + double bmin[2], bmax[2]; + flam3_estimate_bounding_box(&cp_orig, 0.01, 100000, bmin, bmax, &f.rc); + if (flam3_random_isaac_01(&f.rc) < 0.3) { + cp_orig.center[0] = (bmin[0] + bmax[0]) / 2.0; + cp_orig.center[1] = (bmin[1] + bmax[1]) / 2.0; + add_to_action(action," recentered"); + } else { + double mix0, mix1; + if (flam3_random_isaac_bit(&f.rc)) { + mix0 = golden_bit(&f.rc) + flam3_random_isaac_11(&f.rc)/5; + mix1 = golden_bit(&f.rc); + add_to_action(action," reframed0"); + } else if (flam3_random_isaac_bit(&f.rc)) { + mix0 = golden_bit(&f.rc); + mix1 = golden_bit(&f.rc) + flam3_random_isaac_11(&f.rc)/5; + add_to_action(action," reframed1"); + } else { + mix0 = golden_bit(&f.rc) + flam3_random_isaac_11(&f.rc)/5; + mix1 = golden_bit(&f.rc) + flam3_random_isaac_11(&f.rc)/5; + add_to_action(action," reframed2"); + } + cp_orig.center[0] = mix0 * bmin[0] + (1-mix0)*bmax[0]; + cp_orig.center[1] = mix1 * bmin[1] + (1-mix1)*bmax[1]; + } + cp_orig.rot_center[0] = cp_orig.center[0]; + cp_orig.rot_center[1] = cp_orig.center[1]; + cp_orig.pixels_per_unit = cp_orig.width / (bmax[0] - bmin[0]); + } + + truncate_variations(&cp_orig, 5, action); + + if (!did_color && random()&1) { + if (debug) + fprintf(stderr,"improving colors...\n"); + + flam3_improve_colors(&cp_orig, 100, 0, 10); + //strcat(action," improved colors"); + add_to_action(action," improved colors"); + } + + cp_orig.edits = create_new_editdoc(action, aselp0, aselp1); + flam3_copy(&cp_save, &cp_orig); + test_cp(&cp_orig); + if (flam3_render(&f, image, flam3_field_both, 3, 0, &stats)) { + fprintf(stderr,"error rendering test image: aborting.\n"); + exit(1); + } + + if (1) { + int n, tot, totb, totw; + n = cp_orig.width * cp_orig.height; + tot = 0; + totb = 0; + totw = 0; + for (i = 0; i < 3*n; i+=3) { + + tot += (image[i]+image[i+1]+image[i+2]); + if (0 == image[i] && 0 == image[i+1] && 0 == image[i+2]) totb++; + if (255 == image[i] && 255 == image[i+1] && 255 == image[i+2]) totw++; + + // printf("%d ", image[i]); + } + + avg_pix = (tot / (double)(3*n)); + fraction_black = totb / (double)n; + fraction_white = totw / (double)n; + + if (debug) + fprintf(stderr, + "avg_pix=%g fraction_black=%g fraction_white=%g n=%g\n", + avg_pix, fraction_black, fraction_white, (double)n); + + } else { + avg_pix = avg_thresh + 1.0; + fraction_black = black_thresh + 1.0; + fraction_white = white_limit - 1.0; + } + + clear_cp(&cp_orig,flam3_defaults_on); + + count++; + } while ((avg_pix < avg_thresh || + fraction_black < black_thresh || + fraction_white > white_limit) && + count < ntries); + + if (ntries == count) { + fprintf(stderr, "warning: reached maximum attempts, giving up.\n"); + } + + } + + if (templ) + flam3_apply_template(&cp_save,templ); + + cp_save.time = (double)rep; + + if (1) { + char *maxforms = getenv("maxforms"); + if (maxforms && atoi(maxforms)) { + cp_save.symmetry = 0; + while (cp_save.num_xforms > atoi(maxforms)) + flam3_delete_xform(&cp_save, cp_save.num_xforms - 1); + } + } + + gprint(&cp_save, 1); + fflush(stdout); + + /* Free created documents */ + /* (Only free once, since the copy is a ptr to the original) */ + xmlFreeDoc(cp_save.edits); + clear_cp(&cp_save,0); + + if (verbose) { + fprintf(stderr, "\ndone. action = %s\n", action); + } + + } + if (enclosed) printf("\n"); + free(image); + + return 0; +} diff --git a/src/flam3-genome.man b/src/flam3-genome.man new file mode 100644 index 0000000..b754356 --- /dev/null +++ b/src/flam3-genome.man @@ -0,0 +1,36 @@ +.TH flam3-animate 1 "" "" +.SH NAME +flam3-animate +flam3-render +flam3-genome +flam3-convert - render and animate FLAM3s and manipulate their genomes +.SH SYNOPSIS +.B flam3-render < input + +.SH DESCRIPTION + +FLAM3 implements a visual language based on a recursive set equation. + +Flam3-genome creates and manipulates genomes (xml parameter sets) in +this language. Flam3-render turns genomes into still images, and +Flam3-animate renders motion-blurred frames of animation. + +Flam3-convert reads from stdin files in the old format used by the +flame GIMP plugin, and writes the new format to stdout. + +.SH OPTIONS + +Any command line option will cause the program to write its +documentation to standard out. + +.SH ENVIRONMENT + +The environment variables are in the documention written to standard +out given any command line option. + +.SH SEE ALSO +.BR WWW.FLAM3.COM, +.BR electricsheep (1), + +.SH AUTHOR +spot aka Scott Draves, Erik Reckase diff --git a/src/flam3-palettes.xml b/src/flam3-palettes.xml new file mode 100644 index 0000000..d9a258a --- /dev/null +++ b/src/flam3-palettes.xml @@ -0,0 +1,23135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/flam3-render.c b/src/flam3-render.c new file mode 100644 index 0000000..11b69cf --- /dev/null +++ b/src/flam3-render.c @@ -0,0 +1,421 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + 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 . +*/ + +#ifdef WIN32 +#define WINVER 0x0500 +#include +#endif + +#ifdef __APPLE__ +#include +#endif + +#include + + +#include "private.h" +#include "img.h" +#include "isaacs.h" + + +int calc_nstrips(flam3_frame *spec) { + double mem_required; + double mem_available; + int nstrips,ninc; + char *testmalloc; +#ifdef WIN32 + MEMORYSTATUS stat; + stat.dwLength = sizeof(stat); + GlobalMemoryStatus(&stat); // may want to go to GlobalMemoryStatusEx eventually + mem_available = (double)stat.dwTotalPhys; +// fprintf(stderr,"%lu bytes free memory...\n",(size_t)stat.dwAvailPhys); +// if (mem_available > 1e9) mem_available = 1e9; +#elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) + mem_available = + (double)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE); +#elif defined __APPLE__ + unsigned int physmem; + size_t len = sizeof(physmem); + static int mib[2] = { CTL_HW, HW_PHYSMEM }; + if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0 && len == sizeof(physmem)) { + mem_available = (double )physmem; + } else { + fprintf(stderr, "warning: unable to determine physical memory.\n"); + mem_available = 2e9; + } +#else + fprintf(stderr, "warning: unable to determine physical memory.\n"); + mem_available = 2e9; +#endif +#if 0 + fprintf(stderr,"available phyical memory is %lu\n", + (unsigned long)mem_available); +#endif + mem_available *= 0.8; + if (getenv("use_mem")) { + mem_available = atof(getenv("use_mem")); + } + mem_required = flam3_render_memory_required(spec); + if (mem_available >= mem_required) return 1; + nstrips = (int) ceil(mem_required / mem_available); + +if (0) { + /* Attempt to malloc a strip, and if it fails, try adding additional strips */ + ninc=-1; + testmalloc = NULL; + while(NULL==testmalloc && ninc<3) { + ninc++; + testmalloc = (char *)malloc((int)ceil(mem_required / (nstrips+ninc))); + } + if (NULL==testmalloc) { + fprintf(stderr,"Unable to allocate memory for render. Please close some running programs and try to render again.\n"); + exit(1); + } else { + free(testmalloc); + nstrips = nstrips + ninc; + } +} + + return nstrips; +} + +int print_progress(void *foo, double fraction, int stage, double eta) { + fprintf(stderr, "stage=%s progress=%g eta=%g\n", stage?"filtering":"chaos", fraction, eta); + return 0; +} + +int main(int argc, char **argv) { + flam3_frame f; + char *ai; + flam3_genome *cps; + int ncps; + int i; + void *image=NULL; + FILE *fp; + char fname[256]; + size_t this_size, last_size = -1; + double imgmem; + unsigned int strip; + double center_y, center_base; + unsigned int nstrips; + randctx savectx; + char *prefix = args("prefix", ""); + char *out = args("out", NULL); + char *format = getenv("format"); + int verbose = argi("verbose", 1); + int bits = argi("bits", 33); + int bpc = argi("bpc",8); + int seed = argi("seed", 0); + int transparency = argi("transparency", 0); + char *inf = getenv("in"); + double qs = argf("qs", 1.0); + double ss = argf("ss", 1.0); + double pixel_aspect = argf("pixel_aspect", 1.0); + int sub_batch_size = argi("sub_batch_size",10000); + int name_enable = argi("name_enable",0); + int num_threads = argi("nthreads",0); + int earlyclip = argi("earlyclip",0); + FILE *in; + double zoom_scale; + unsigned int channels; + long start_time = (long)time(0); + flam3_img_comments fpc; + stat_struct stats; + char numiter_string[64]; + char badval_string[64]; + char rtime_string[64]; + +#ifdef WIN32 + + char *slashloc; + char exepath[256]; + char palpath[256]; + memset(exepath,0,256); + memset(palpath,0,256); + + slashloc = strrchr(argv[0],'\\'); + if (NULL==slashloc) { + sprintf(palpath,"flam3_palettes=flam3-palettes.xml"); + } else { + strncpy(exepath,argv[0],slashloc-argv[0]+1); + sprintf(palpath,"flam3_palettes=%sflam3-palettes.xml",exepath); + } + putenv(palpath); + +#endif + + + if (1 != argc) { + docstring(); + exit(0); + } + + /* Init random number generators */ + flam3_init_frame(&f); + flam3_srandom(); + + /* Set the number of threads */ + if (num_threads==0) { + num_threads = flam3_count_nthreads(); + if (verbose > 1) + fprintf(stderr,"Automatically detected %d core(s)...\n",num_threads); + } else{ + if (verbose) + fprintf(stderr,"Manually specified %d thread(s)...\n",num_threads); + } + + + if (NULL == format) format = "png"; + if (strcmp(format, "jpg") && + strcmp(format, "ppm") && + strcmp(format, "png")) { + fprintf(stderr, + "format must be either jpg, ppm, or png, not %s.\n", + format); + exit(1); + } + + channels = strcmp(format, "png") ? 3 : 4; + + /* Check for 16-bit-per-channel processing */ + if ( (16 == bpc) && (strcmp(format,"png") != 0)) { + fprintf(stderr,"Support for 16 bpc images is only present for the png format.\n"); + exit(1); + } else if (bpc != 8 && bpc != 16) { + fprintf(stderr,"Unexpected bpc specified (%d)\n",bpc); + exit(1); + } + + if (pixel_aspect <= 0.0) { + fprintf(stderr, "pixel aspect ratio must be positive, not %g.\n", + pixel_aspect); + exit(1); + } + + if (inf) + in = fopen(inf, "rb"); + else + in = stdin; + if (NULL == in) { + perror(inf); + exit(1); + } + + cps = flam3_parse_from_file(in, inf, flam3_defaults_on, &ncps); + if (NULL == cps) { + fprintf(stderr,"error reading genomes from file\n"); + exit(1); + } + + if (inf) + fclose(in); + + for (i = 0; i < ncps; i++) { + /* Force ntemporal_samples to 1 for -render */ + cps[i].ntemporal_samples = 1; + cps[i].sample_density *= qs; + cps[i].height = (int)(cps[i].height * ss); + cps[i].width = (int)(cps[i].width * ss); + cps[i].pixels_per_unit *= ss; + if (cps[i].height<=0 || cps[i].width<=0) { + fprintf(stderr,"output image has dimension <=0, aborting.\n"); + exit(1); + } + } + + if (out && (ncps > 1)) { + fprintf(stderr, "hqi-flame: warning: writing multiple images " + "to one file. all but last will be lost.\n"); + } + + + for (i = 0; i < ncps; i++) { + int real_height; + + if (verbose && ncps > 1) { + fprintf(stderr, "flame = %d/%d ", i+1, ncps); + } + +// f.temporal_filter_radius = 0.0; + f.genomes = &cps[i]; + f.ngenomes = 1; + f.verbose = verbose; + f.bits = bits; + f.time = 0.0; + f.pixel_aspect_ratio = pixel_aspect; + f.progress = 0;//print_progress; + f.nthreads = num_threads; + f.earlyclip = earlyclip; + f.sub_batch_size = sub_batch_size; + + if (16==bpc) + f.bytes_per_channel = 2; + else + f.bytes_per_channel = 1; + + + if (getenv("nstrips")) { + nstrips = atoi(getenv("nstrips")); + } else { + nstrips = calc_nstrips(&f); + } + + if (nstrips > cps[i].height) { + fprintf(stderr, "cannot have more strips than rows but %d>%d.\n", + nstrips, cps[i].height); + exit(1); + } + + imgmem = (double)channels * (double)cps[i].width + * (double)cps[i].height * f.bytes_per_channel; + + if (imgmem > ULONG_MAX) { + fprintf(stderr,"Image size > ULONG_MAX. Aborting.\n"); + exit(1); + } + + this_size = (size_t)channels * (size_t)cps[i].width + * (size_t)cps[i].height * f.bytes_per_channel; + if (this_size != last_size) { + if (last_size != -1) + free(image); + last_size = this_size; + image = (void *) malloc(this_size); + if (NULL==image) { + fprintf(stderr,"Error allocating memory for image. Aborting\n"); + exit(1); + } + } else { + memset(image, 0, this_size); + } + + cps[i].sample_density *= nstrips; + real_height = cps[i].height; + cps[i].height = (int) ceil(cps[i].height / (double) nstrips); + center_y = cps[i].center[1]; + zoom_scale = pow(2.0, cps[i].zoom); + center_base = center_y - ((nstrips - 1) * cps[i].height) / + (2 * cps[i].pixels_per_unit * zoom_scale); + + /* Copy off random context to use for each strip */ + memcpy(&savectx, &f.rc, sizeof(randctx)); + + for (strip = 0; strip < nstrips; strip++) { + size_t ssoff = (size_t)cps[i].height * strip * cps[i].width * channels * f.bytes_per_channel; + void *strip_start = image + ssoff; + cps[i].center[1] = center_base + cps[i].height * (double) strip / (cps[i].pixels_per_unit * zoom_scale); + + if ((cps[i].height * (strip + 1)) > real_height) { + int oh = cps[i].height; + cps[i].height = real_height - oh * strip; + cps[i].center[1] -= + (oh - cps[i].height) * 0.5 / + (cps[i].pixels_per_unit * zoom_scale); + } + + /* Use the same random context for each strip */ + memcpy(&f.rc, &savectx, sizeof(randctx)); + + if (verbose && nstrips > 1) { + fprintf(stderr, "strip = %d/%d\n", strip+1, nstrips); + } + if (verbose && (1 == nstrips) && (ncps > 1)) { + fprintf(stderr, "\n"); + } + cps[i].ntemporal_samples = 1; + if (flam3_render(&f, strip_start, flam3_field_both, channels, transparency, &stats)) { + fprintf(stderr,"error rendering image: aborting.\n"); + exit(1); + } + + if (NULL != out) { + strcpy(fname,out); + } else if (name_enable && cps[i].flame_name[0]>0) { + sprintf(fname, "%s.%s",cps[i].flame_name,format); + } else { + sprintf(fname, "%s%05d.%s", prefix, i, format); + } + if (verbose) { + fprintf(stderr, "writing %s...", fname); + } + fp = fopen(fname, "wb"); + if (NULL == fp) { + perror(fname); + exit(1); + } + + /* Generate temp file with genome */ + fpc.genome = flam3_print_to_string(f.genomes); + + sprintf(badval_string,"%g",stats.badvals/(double)stats.num_iters); + fpc.badvals = badval_string; + sprintf(numiter_string,"%g",(double)stats.num_iters); + fpc.numiters = numiter_string; + sprintf(rtime_string,"%d",stats.render_seconds); + fpc.rtime = rtime_string; + + if (!strcmp(format, "png")) { + + write_png(fp, image, cps[i].width, real_height, &fpc, f.bytes_per_channel); + + } else if (!strcmp(format, "jpg")) { + + write_jpeg(fp, (unsigned char *)image, cps[i].width, real_height, &fpc); + + } else { + fprintf(fp, "P6\n"); + fprintf(fp, "%d %d\n255\n", cps[i].width, real_height); + if (this_size != fwrite((unsigned char *)image, 1, this_size, fp)) { + perror(fname); + } + } + /* Free string */ + free(fpc.genome); + + fclose(fp); + } + + /* restore the cps values to their original values */ + cps[i].sample_density /= nstrips; + cps[i].height = real_height; + cps[i].center[1] = center_y; + + if (verbose) { + fprintf(stderr, "done.\n"); + } + } + if (verbose && ((ncps > 1) || (nstrips > 1))) { + long total_time = (long)time(0) - start_time; + + if (total_time > 100) + fprintf(stderr, "total time = %.1f minutes\n", total_time / 60.0); + else + fprintf(stderr, "total time = %ld seconds\n", total_time); + } + + for (i=0;i. +*/ + +#ifndef _MSC_VER /* VC++ */ +#define _GNU_SOURCE +#endif + +#include "private.h" +#include "img.h" +#include "config.h" +#include "variations.h" +#include "interpolation.h" +#include "parser.h" +#include "filters.h" +#include "palettes.h" +#include +#include +#include +#ifdef HAVE_STDINT_H +#include +#endif +#include + +#ifdef HAVE_LIBPTHREAD +#include +#endif + +#ifdef __APPLE__ +#include +#include +#define flam3_os "OSX" +#else +#ifdef _WIN32 +#define WINVER 0x0500 +#include +#define flam3_os "WIN" +#else +#define flam3_os "LNX" +#endif +#endif + + + +char *flam3_version() { + + if (strcmp(SVN_REV, "exported")) + return flam3_os "-" VERSION "." SVN_REV; + return VERSION; +} + + +#define CHOOSE_XFORM_GRAIN 10000 + +#define random_distrib(v) ((v)[random()%vlen(v)]) + + +unsigned short *flam3_create_xform_distrib(flam3_genome *cp) { + + /* Xform distrib is created in this function */ + int numrows; + int dist_row,i; + unsigned short *xform_distrib; + + numrows = cp->num_xforms - (cp->final_xform_index>=0) + 1; + xform_distrib = calloc(numrows*CHOOSE_XFORM_GRAIN,sizeof(unsigned short)); + + /* First, set up the first row of the xform_distrib (raw weights) */ + flam3_create_chaos_distrib(cp, -1, xform_distrib); + + /* Check for non-unity chaos */ + cp->chaos_enable = 1 - flam3_check_unity_chaos(cp); + + if (cp->chaos_enable) { + + /* Now set up a row for each of the xforms */ + dist_row = 0; + for (i=0;inum_xforms;i++) { + + if (cp->final_xform_index == i) + continue; + else + dist_row++; + + if (flam3_create_chaos_distrib(cp, i, &(xform_distrib[CHOOSE_XFORM_GRAIN*(dist_row)]))) { + free(xform_distrib); + return(NULL); + } + } + } + + return(xform_distrib); +} + +/* Run this on a copy of a genome to get a strip of the output */ +int flam3_make_strip(flam3_genome *cp, int nstrips, int stripnum) { + + double old_center[2]; + int j; + + /* Strip out motion elements */ + for (j=0;jnum_xforms;j++) + flam3_delete_motion_elements(&cp->xform[j]); + + old_center[0] = cp->center[0]; + old_center[1] = cp->center[1]; + cp->height /= nstrips; + cp->center[1] = cp->center[1] - ((nstrips - 1) * cp->height) / (2 * cp->pixels_per_unit * pow(2.0, cp->zoom)); + cp->center[1] += cp->height * stripnum / ( cp->pixels_per_unit * pow(2.0,cp->zoom) ); + rotate_by(cp->center, old_center, cp->rotate); + + return(0); +} + + +void rotate_by(double *p, double *center, double by) { + double r[2]; + double th = by * 2 * M_PI / 360.0; + double c = cos(th); + double s = -sin(th); + p[0] -= center[0]; + p[1] -= center[1]; + r[0] = c * p[0] - s * p[1]; + r[1] = s * p[0] + c * p[1]; + p[0] = r[0] + center[0]; + p[1] = r[1] + center[1]; +} + + +int flam3_check_unity_chaos(flam3_genome *cp) { + + int i,j; + int num_std; + int unity=1; + num_std = cp->num_xforms - (cp->final_xform_index >= 0); + + for (i=0;ichaos[i][j]-1.0) > EPS) + unity=0; + } + } + + return(unity); +} + +int flam3_create_chaos_distrib(flam3_genome *cp, int xi, unsigned short *xform_distrib) { + + /* Xform distrib is a preallocated array of CHOOSE_XFORM_GRAIN chars */ + /* address of array is passed in, contents are modified */ + double t,r,dr; + int i,j; + int num_std; + + //fprintf(stdout,"storing at %ld\n",xform_distrib); + + num_std = cp->num_xforms - (cp->final_xform_index >= 0); + + dr = 0.0; + for (i = 0; i < num_std; i++) { + double d = cp->xform[i].density; + + if (xi>=0) + d *= cp->chaos[xi][i]; + + //fprintf(stdout,"%f ",d); + if (d < 0.0) { + fprintf(stderr, "xform weight must be non-negative, not %g.\n", d); + return(1); + } + + dr += d; + } + + //fprintf(stdout,"dr=%f\n",dr); + + if (dr == 0.0) { + fprintf(stderr, "cannot iterate empty flame.\n"); + return(1); + } + + dr = dr / CHOOSE_XFORM_GRAIN; + + j = 0; + t = cp->xform[0].density; + if (xi>=0) + t *= cp->chaos[xi][0]; + r = 0.0; + for (i = 0; i < CHOOSE_XFORM_GRAIN; i++) { + while (r >= t) { + j++; + + if (xi>=0) + t += cp->xform[j].density*cp->chaos[xi][j]; + else + t += cp->xform[j].density; + + } + //fprintf(stdout,"%d ",j); + xform_distrib[i] = j; + r += dr; + } + //fprintf(stdout,"\n---\n"); + + return(0); +} +/* + * run the function system described by CP forward N generations. store + * the N resulting 4-vectors in SAMPLES. the initial point is passed in + * SAMPLES[0..3]. ignore the first FUSE iterations. + */ + + +int flam3_iterate(flam3_genome *cp, int n, int fuse, double *samples, unsigned short *xform_distrib, randctx *rc) { + int i; + double p[4], q[4]; + int consec = 0; + int badvals = 0; + int lastxf=0; + int fn; + + p[0] = samples[0]; + p[1] = samples[1]; + p[2] = samples[2]; + p[3] = samples[3]; + + /* Perform precalculations */ + for (i=0;inum_xforms;i++) + xform_precalc(cp,i); + + for (i = -4*fuse; i < 4*n; i+=4) { + + if (cp->chaos_enable) + fn = xform_distrib[ lastxf*CHOOSE_XFORM_GRAIN + (((unsigned)irand(rc)) % CHOOSE_XFORM_GRAIN)]; + else + fn = xform_distrib[ ((unsigned)irand(rc)) % CHOOSE_XFORM_GRAIN ]; + + if (apply_xform(cp, fn, p, q, rc)>0) { + consec ++; + badvals ++; + if (consec<5) { + p[0] = q[0]; + p[1] = q[1]; + p[2] = q[2]; + p[3] = q[3]; + i -= 4; + continue; + } else + consec = 0; + } else + consec = 0; + + /* Store the last used transform */ + lastxf = fn+1; + + p[0] = q[0]; + p[1] = q[1]; + p[2] = q[2]; + p[3] = q[3]; + + if (cp->final_xform_enable == 1) { + if (cp->xform[cp->final_xform_index].opacity==1 || + flam3_random_isaac_01(rc)xform[cp->final_xform_index].opacity) { + apply_xform(cp, cp->final_xform_index, p, q, rc); + /* Keep the opacity from the original xform */ + q[3] = p[3]; + } + } + + /* if fuse over, store it */ + if (i >= 0) { + samples[i] = q[0]; + samples[i+1] = q[1]; + samples[i+2] = q[2]; + samples[i+3] = q[3]; + } + } + + return(badvals); +} + +int flam3_xform_preview(flam3_genome *cp, int xi, double range, int numvals, int depth, double *result, randctx *rc) { + + /* We will evaluate the 'xi'th xform 'depth' times, over the following values: */ + /* x in [-range : range], y in [-range : range], with 2* (2*numvals+1)^2 values returned */ + double p[4]; + double incr; + int outi; + int xx,yy,dd; + double oldweight; + + outi=0; + + oldweight = cp->xform[xi].density; + cp->xform[xi].density = 1.0; + + /* Prepare the function pointers */ + if (prepare_xform_fn_ptrs(cp,rc)) { + cp->xform[xi].density = oldweight; + return(1); + } + + /* Calculate increment */ + incr = range / (double)numvals; + + /* Perform precalculations */ + xform_precalc(cp,xi); + + /* Loop over the grid */ + for (xx=-numvals;xx<=numvals;xx++) { + for (yy=-numvals;yy<=numvals;yy++) { + + /* Calculate the input coordinates */ + p[0] = (double)xx * incr; + p[1] = (double)yy * incr; + + /* Loop over the depth */ + for (dd=0;ddxform[xi].density = oldweight; + + return(0); +} + +int flam3_colorhist(flam3_genome *cp, int num_batches, double *hist) { + + int lp,plp; + int mycolor; + long int default_isaac_seed = (long int)time(0); + randctx rc; + unsigned short *xform_distrib; + int sbs = 10000; + double sub_batch[4*10000]; + + /* Set up the isaac rng */ + for (lp = 0; lp < RANDSIZ; lp++) + rc.randrsl[lp] = default_isaac_seed; + + irandinit(&rc,1); + + memset(hist,0,256*sizeof(double)); + + for (lp=0;lpCMAP_SIZE_M1) mycolor=CMAP_SIZE_M1; + + hist[mycolor] += 1; + } + } + + for (plp=0;plp<256;plp++) + hist[plp] /= (float)(num_batches*sbs); + + return(0); +} + +flam3_genome *sheep_loop(flam3_genome *cp, double blend) { + + flam3_genome *result; + int i; + + /* Allocate the genome - this must be freed by calling function */ + result = calloc(1,sizeof(flam3_genome)); + + /* Clear it */ + clear_cp(result,flam3_defaults_on); + + /* Copy the original */ + flam3_copy(result,cp); + + /* + * Insert motion magic here : + * if there are motion elements, we will modify the contents of + * the result genome before flam3_rotate is called. + */ + for (i=0;inum_xforms;i++) { + if (cp->xform[i].num_motion>0) { + /* Apply motion parameters to result.xform[i] using blend parameter */ + apply_motion_parameters(&cp->xform[i], &result->xform[i], blend); + } + + /* Delete the motion parameters from the result */ + flam3_delete_motion_elements(&result->xform[i]); + } + + /* Rotate the affines */ + flam3_rotate(result, blend*360.0,result->interpolation_type); + + return(result); +} + + + + +flam3_genome *sheep_edge(flam3_genome *cp, double blend, int seqflag, double stagger) { + + flam3_genome spun[2]; + flam3_genome prealign[2]; + flam3_genome *result; + int i,si; + char *ai; + + memset(spun, 0, 2*sizeof(flam3_genome)); + memset(prealign, 0, 2*sizeof(flam3_genome)); + + /* Allocate the memory for the result */ + result = calloc(1,sizeof(flam3_genome)); + + /* + * Insert motion magic here : + * if there are motion elements, we will modify the contents of + * the prealign genomes before we rotate and interpolate. + */ + + for (si=0;si<2;si++) { + flam3_copy(&prealign[si], &cp[si]); + for (i=0;i0) { + /* Apply motion parameters to result.xform[i] using blend parameter */ + apply_motion_parameters(&cp[si].xform[i], &prealign[si].xform[i], blend); + } + } + } + + /* Use the un-padded original for blend=0 when creating a sequence */ + /* This keeps the original interpolation type intact */ + if (seqflag && 0.0 == blend) { + flam3_copy(result, &prealign[0]); + } else { + + /* Align what we're going to interpolate */ + flam3_align(spun, prealign, 2); + + spun[0].time = 0.0; + spun[1].time = 1.0; + + /* Call this first to establish the asymmetric reference angles */ + establish_asymmetric_refangles(spun,2); + + /* Rotate the aligned xforms */ + flam3_rotate(&spun[0], blend*360.0, spun[0].interpolation_type); + flam3_rotate(&spun[1], blend*360.0, spun[0].interpolation_type); + + /* Now call the interpolation */ + if (argi("unsmoother",0) == 0) + flam3_interpolate(spun, 2, smoother(blend), stagger, result); + else + flam3_interpolate(spun, 2, blend, stagger, result); + + + /* Interpolation type no longer needs to be forced to linear mode */ +// if (!seqflag) +// result.interpolation_type = flam3_inttype_linear; + } + + /* Clear the genomes we used */ + clear_cp(&spun[0],flam3_defaults_on); + clear_cp(&spun[1],flam3_defaults_on); + clear_cp(&prealign[0],flam3_defaults_on); + clear_cp(&prealign[1],flam3_defaults_on); + + /* Make sure there are no motion elements in the result */ + for (i=0;inum_xforms;i++) + flam3_delete_motion_elements(&result->xform[i]); + + return(result); +} + + +/* BY is angle in degrees */ +void flam3_rotate(flam3_genome *cp, double by, int interpolation_type) { + int i; + for (i = 0; i < cp->num_xforms; i++) { + double r[2][2]; + double T[2][2]; + double U[2][2]; + double dtheta = by * 2.0 * M_PI / 360.0; + + /* Don't rotate xforms with > 0 animate values */ + if (cp->xform[i].animate == 0.0) + continue; + + if (cp->xform[i].padding == 1) { + if (interpolation_type == flam3_inttype_compat) { + /* gen 202 era flam3 did not rotate padded xforms */ + continue; + } else if (interpolation_type == flam3_inttype_older) { + /* not sure if 198 era flam3 rotated padded xforms */ + continue; + } else if (interpolation_type == flam3_inttype_linear) { + /* don't rotate for prettier symsings */ + continue; + } else if (interpolation_type == flam3_inttype_log) { + /* Current flam3: what do we prefer? */ + //continue; + } + } + + /* Do NOT rotate final xforms */ + if (cp->final_xform_enable==1 && cp->final_xform_index==i) + continue; + + r[1][1] = r[0][0] = cos(dtheta); + r[0][1] = sin(dtheta); + r[1][0] = -r[0][1]; + T[0][0] = cp->xform[i].c[0][0]; + T[1][0] = cp->xform[i].c[1][0]; + T[0][1] = cp->xform[i].c[0][1]; + T[1][1] = cp->xform[i].c[1][1]; + mult_matrix(r, T, U); + cp->xform[i].c[0][0] = U[0][0]; + cp->xform[i].c[1][0] = U[1][0]; + cp->xform[i].c[0][1] = U[0][1]; + cp->xform[i].c[1][1] = U[1][1]; + } +} + +#define APPMOT(x) do { addto->x += mot[i].x * motion_funcs(func,freq*blend); } while (0); + +void apply_motion_parameters(flam3_xform *xf, flam3_xform *addto, double blend) { + + int i,j,k; + int freq; + int func; + flam3_xform* mot; + + mot = xf->motion; + + /* Loop over the motion elements and add their contribution to the original vals */ + for (i=0; inum_motion; i++) { + + freq = mot->motion_freq; + func = mot->motion_func; + + APPMOT(density); /* Must ensure > 0 after all is applied */ + APPMOT(color); /* Must ensure [0,1] after all is applied */ + + APPMOT(opacity); + APPMOT(color_speed); + APPMOT(animate); + APPMOT(blob_low); + APPMOT(blob_high); + APPMOT(blob_waves); + APPMOT(pdj_a); + APPMOT(pdj_b); + APPMOT(pdj_c); + APPMOT(pdj_d); + APPMOT(fan2_x); + APPMOT(fan2_y); + APPMOT(rings2_val); + APPMOT(perspective_angle); + APPMOT(perspective_dist); + APPMOT(julian_power); + APPMOT(julian_dist); + APPMOT(juliascope_power); + APPMOT(juliascope_dist); + APPMOT(radial_blur_angle); + APPMOT(pie_slices); + APPMOT(pie_rotation); + APPMOT(pie_thickness); + APPMOT(ngon_sides); + APPMOT(ngon_power); + APPMOT(ngon_circle); + APPMOT(ngon_corners); + APPMOT(curl_c1); + APPMOT(curl_c2); + APPMOT(rectangles_x); + APPMOT(rectangles_y); + APPMOT(amw_amp); + APPMOT(disc2_rot); + APPMOT(disc2_twist); + APPMOT(super_shape_rnd); + APPMOT(super_shape_m); + APPMOT(super_shape_n1); + APPMOT(super_shape_n2); + APPMOT(super_shape_n3); + APPMOT(super_shape_holes); + APPMOT(flower_petals); + APPMOT(flower_holes); + APPMOT(conic_eccentricity); + APPMOT(conic_holes); + APPMOT(parabola_height); + APPMOT(parabola_width); + APPMOT(bent2_x); + APPMOT(bent2_y); + APPMOT(bipolar_shift); + APPMOT(cell_size); + APPMOT(cpow_r); + APPMOT(cpow_i); + APPMOT(cpow_power); + APPMOT(curve_xamp); + APPMOT(curve_yamp); + APPMOT(curve_xlength); + APPMOT(curve_ylength); + APPMOT(escher_beta); + APPMOT(lazysusan_x); + APPMOT(lazysusan_y); + APPMOT(lazysusan_twist); + APPMOT(lazysusan_space); + APPMOT(lazysusan_spin); + APPMOT(modulus_x); + APPMOT(modulus_y); + APPMOT(oscope_separation); + APPMOT(oscope_frequency); + APPMOT(oscope_amplitude); + APPMOT(oscope_damping); + APPMOT(popcorn2_x); + APPMOT(popcorn2_y); + APPMOT(popcorn2_c); + APPMOT(separation_x); + APPMOT(separation_xinside); + APPMOT(separation_y); + APPMOT(separation_yinside); + APPMOT(split_xsize); + APPMOT(split_ysize); + APPMOT(splits_x); + APPMOT(splits_y); + APPMOT(stripes_space); + APPMOT(stripes_warp); + APPMOT(wedge_angle); + APPMOT(wedge_hole); + APPMOT(wedge_count); + APPMOT(wedge_swirl); + APPMOT(wedge_julia_angle); + APPMOT(wedge_julia_count); + APPMOT(wedge_julia_power); + APPMOT(wedge_julia_dist); + APPMOT(wedge_sph_angle); + APPMOT(wedge_sph_hole); + APPMOT(wedge_sph_count); + APPMOT(wedge_sph_swirl); + APPMOT(whorl_inside); + APPMOT(whorl_outside); + APPMOT(waves2_scalex); + APPMOT(waves2_scaley); + APPMOT(waves2_freqx); + APPMOT(waves2_freqy); + APPMOT(auger_sym); + APPMOT(auger_weight); + APPMOT(auger_freq); + APPMOT(auger_scale); + + for (j = 0; j < flam3_nvariations; j++) + APPMOT(var[j]); + + for (j=0; j<3; j++) { + for (k=0; k<2; k++) { + APPMOT(c[j][k]); + APPMOT(post[j][k]); + } + } + + } + + /* Make sure certain params are within reasonable bounds */ + if (addto->color<0) addto->color=0; + if (addto->color>1) addto->color=1; + if (addto->density<0) addto->density=0; + +} + + +/* + * create a control point that interpolates between the control points + * passed in CPS. CPS must be sorted by time. + */ +void flam3_interpolate(flam3_genome cps[], int ncps, + double time, double stagger, flam3_genome *result) { + int i1, i2; + double c[2]; + flam3_genome cpi[4]; + + if (1 == ncps) { + flam3_copy(result, &(cps[0])); + return; + } + + if (cps[0].time >= time) { + i1 = 0; + i2 = 1; + } else if (cps[ncps - 1].time <= time) { + i1 = ncps - 2; + i2 = ncps - 1; + } else { + i1 = 0; + while (cps[i1].time < time) + i1++; + + i1--; + i2 = i1 + 1; + + } + + c[0] = (cps[i2].time - time) / (cps[i2].time - cps[i1].time); + c[1] = 1.0 - c[0]; + + memset(cpi, 0, 4*sizeof(flam3_genome)); + + /* To interpolate the xforms, we will make copies of the source cps */ + /* and ensure that they both have the same number before progressing */ + if (flam3_interpolation_linear == cps[i1].interpolation) { + flam3_align(&cpi[0], &cps[i1], 2); + + } else { + if (0 == i1) { + fprintf(stderr, "error: cannot use smooth interpolation on first segment.\n"); + exit(1); + } + if (ncps-1 == i2) { + fprintf(stderr, "error: cannot use smooth interpolation on last segment.\n"); + exit(1); + } + flam3_align(&cpi[0], &cps[i1-1], 4); + } + + /* Clear the destination cp */ + clear_cp(result, 1); + + if (cpi[0].final_xform_index >= 0) { + flam3_add_xforms(result, cpi[0].num_xforms-1, 0, 0); + flam3_add_xforms(result, 1, 0, 1); + } else + flam3_add_xforms(result, cpi[0].num_xforms, 0, 0); + + + result->time = time; + result->interpolation = flam3_interpolation_linear; + result->interpolation_type = cpi[0].interpolation_type; + result->palette_interpolation = flam3_palette_interpolation_hsv; + + if (flam3_interpolation_linear == cps[i1].interpolation) { + flam3_interpolate_n(result, 2, cpi, c, stagger); + } else { + interpolate_catmull_rom(cpi, c[1], result); + clear_cp(&(cpi[2]),0); + clear_cp(&(cpi[3]),0); + } + + clear_cp(&(cpi[0]),0); + clear_cp(&(cpi[1]),0); + +} + +void flam3_copy_params(flam3_xform *dest, flam3_xform *src, int varn) { + + /* We only want to copy param var coefs for this one */ + if (varn==VAR_BLOB) { + /* Blob */ + dest->blob_low = src->blob_low; + dest->blob_high = src->blob_high; + dest->blob_waves = src->blob_waves; + } else if (varn==VAR_PDJ) { + /* PDJ */ + dest->pdj_a = src->pdj_a; + dest->pdj_b = src->pdj_b; + dest->pdj_c = src->pdj_c; + dest->pdj_d = src->pdj_d; + } else if (varn==VAR_FAN2) { + /* Fan2 */ + dest->fan2_x = src->fan2_x; + dest->fan2_y = src->fan2_y; + } else if (varn==VAR_RINGS2) { + /* Rings2 */ + dest->rings2_val = src->rings2_val; + } else if (varn==VAR_PERSPECTIVE) { + /* Perspective */ + dest->perspective_angle = src->perspective_angle; + dest->perspective_dist = src->perspective_dist; + dest->persp_vsin = src->persp_vsin; + dest->persp_vfcos = src->persp_vfcos; + } else if (varn==VAR_JULIAN) { + /* Julia_N */ + dest->julian_power = src->julian_power; + dest->julian_dist = src->julian_dist; + dest->julian_rN = src->julian_rN; + dest->julian_cn = src->julian_cn; + } else if (varn==VAR_JULIASCOPE) { + /* Julia_Scope */ + dest->juliascope_power = src->juliascope_power; + dest->juliascope_dist = src->juliascope_dist; + dest->juliascope_rN = src->juliascope_rN; + dest->juliascope_cn = src->juliascope_cn; + } else if (varn==VAR_RADIAL_BLUR) { + /* Radial Blur */ + dest->radial_blur_angle = src->radial_blur_angle; + } else if (varn==VAR_PIE) { + /* Pie */ + dest->pie_slices = src->pie_slices; + dest->pie_rotation = src->pie_rotation; + dest->pie_thickness = src->pie_thickness; + } else if (varn==VAR_NGON) { + /* Ngon */ + dest->ngon_sides = src->ngon_sides; + dest->ngon_power = src->ngon_power; + dest->ngon_corners = src->ngon_corners; + dest->ngon_circle = src->ngon_circle; + } else if (varn==VAR_CURL) { + /* Curl */ + dest->curl_c1 = src->curl_c1; + dest->curl_c2 = src->curl_c2; + } else if (varn==VAR_RECTANGLES) { + /* Rect */ + dest->rectangles_x = src->rectangles_x; + dest->rectangles_y = src->rectangles_y; + } else if (varn==VAR_DISC2) { + /* Disc2 */ + dest->disc2_rot = src->disc2_rot; + dest->disc2_twist = src->disc2_twist; + } else if (varn==VAR_SUPER_SHAPE) { + /* Supershape */ + dest->super_shape_rnd = src->super_shape_rnd; + dest->super_shape_m = src->super_shape_m; + dest->super_shape_n1 = src->super_shape_n1; + dest->super_shape_n2 = src->super_shape_n2; + dest->super_shape_n3 = src->super_shape_n3; + dest->super_shape_holes = src->super_shape_holes; + } else if (varn==VAR_FLOWER) { + /* Flower */ + dest->flower_petals = src->flower_petals; + dest->flower_petals = src->flower_petals; + } else if (varn==VAR_CONIC) { + /* Conic */ + dest->conic_eccentricity = src->conic_eccentricity; + dest->conic_holes = src->conic_holes; + } else if (varn==VAR_PARABOLA) { + /* Parabola */ + dest->parabola_height = src->parabola_height; + dest->parabola_width = src->parabola_width; + } else if (varn==VAR_BENT2) { + /* Bent2 */ + dest->bent2_x = src->bent2_x; + dest->bent2_y = src->bent2_y; + } else if (varn==VAR_BIPOLAR) { + /* Bipolar */ + dest->bipolar_shift = src->bipolar_shift; + } else if (varn==VAR_CELL) { + /* Cell */ + dest->cell_size = src->cell_size; + } else if (varn==VAR_CPOW) { + /* Cpow */ + dest->cpow_i = src->cpow_i; + dest->cpow_r = src->cpow_r; + dest->cpow_power = src->cpow_power; + } else if (varn==VAR_CURVE) { + /* Curve */ + dest->curve_xamp = src->curve_xamp; + dest->curve_yamp = src->curve_yamp; + dest->curve_xlength = src->curve_xlength; + dest->curve_ylength = src->curve_ylength; + } else if (varn==VAR_ESCHER) { + /* Escher */ + dest->escher_beta = src->escher_beta; + } else if (varn==VAR_LAZYSUSAN) { + /* Lazysusan */ + dest->lazysusan_x = src->lazysusan_x; + dest->lazysusan_y = src->lazysusan_y; + dest->lazysusan_spin = src->lazysusan_spin; + dest->lazysusan_space = src->lazysusan_space; + dest->lazysusan_twist = src->lazysusan_twist; + } else if (varn==VAR_MODULUS) { + /* Modulus */ + dest->modulus_x = src->modulus_x; + dest->modulus_y = src->modulus_y; + } else if (varn==VAR_OSCILLOSCOPE) { + /* Oscope */ + dest->oscope_separation = src->oscope_separation; + dest->oscope_frequency = src->oscope_frequency; + dest->oscope_amplitude = src->oscope_amplitude; + dest->oscope_damping = src->oscope_damping; + } else if (varn==VAR_POPCORN2) { + /* Popcorn2 */ + dest->popcorn2_x = src->popcorn2_x; + dest->popcorn2_y = src->popcorn2_y; + dest->popcorn2_c = src->popcorn2_c; + } else if (varn==VAR_SEPARATION) { + /* Separation */ + dest->separation_x = src->separation_x; + dest->separation_y = src->separation_y; + dest->separation_xinside = src->separation_xinside; + dest->separation_yinside = src->separation_yinside; + } else if (varn==VAR_SPLIT) { + /* Split */ + dest->split_xsize = src->split_xsize; + dest->split_ysize = src->split_ysize; + } else if (varn==VAR_SPLITS) { + /* Splits */ + dest->splits_x = src->splits_x; + dest->splits_y = src->splits_y; + } else if (varn==VAR_STRIPES) { + /* Stripes */ + dest->stripes_space = src->stripes_space; + dest->stripes_warp = src->stripes_warp; + } else if (varn==VAR_WEDGE) { + /* Wedge */ + dest->wedge_angle = src->wedge_angle; + dest->wedge_hole = src->wedge_hole; + dest->wedge_count = src->wedge_count; + dest->wedge_swirl = src->wedge_swirl; + } else if (varn==VAR_WEDGE_JULIA) { + /* Wedge_Julia */ + dest->wedge_julia_angle = src->wedge_julia_angle; + dest->wedge_julia_count = src->wedge_julia_count; + dest->wedge_julia_power = src->wedge_julia_power; + dest->wedge_julia_dist = src->wedge_julia_dist; + dest->wedgeJulia_cf = src->wedgeJulia_cf; + dest->wedgeJulia_cn = src->wedgeJulia_cn; + dest->wedgeJulia_rN = src->wedgeJulia_rN; + } else if (varn==VAR_WEDGE_SPH) { + /* Wedge_sph */ + dest->wedge_sph_angle = src->wedge_sph_angle; + dest->wedge_sph_hole = src->wedge_sph_hole; + dest->wedge_sph_count = src->wedge_sph_count; + dest->wedge_sph_swirl = src->wedge_sph_swirl; + } else if (varn==VAR_WHORL) { + /* whorl */ + dest->whorl_inside = src->whorl_inside; + dest->whorl_outside = src->whorl_outside; + } else if (varn==VAR_WAVES2) { + /* waves2 */ + dest->waves2_scalex = src->waves2_scalex; + dest->waves2_scaley = src->waves2_scaley; + dest->waves2_freqx = src->waves2_freqx; + dest->waves2_freqy = src->waves2_freqy; + } else if (varn==VAR_AUGER) { + /* auger */ + dest->auger_sym = src->auger_sym; + dest->auger_weight = src->auger_weight; + dest->auger_freq = src->auger_freq; + dest->auger_scale = src->auger_scale; + } +} + +/* Motion support functions */ +void flam3_add_motion_element(flam3_xform *xf) { + + /* Add one to the xform's count of motion elements */ + xf->num_motion++; + + /* Reallocate the motion storage to include the empty space */ + xf->motion = (struct xform *)realloc(xf->motion, xf->num_motion * sizeof(struct xform)); + + /* Initialize the motion element */ + /* In this case, all elements should be set to 0 */ + memset( &(xf->motion[xf->num_motion-1]), 0, sizeof(struct xform)); + +} + +/* Motion support functions */ +void flam3_delete_motion_elements(flam3_xform *xf) { + + /* Free the motion elements */ + if (xf->num_motion>0) { + free(xf->motion); + xf->num_motion = 0; + } + +} + +/* Xform support functions */ +void flam3_add_xforms(flam3_genome *thiscp, int num_to_add, int interp_padding, int final_flag) { + + int i,j; + int old_num = thiscp->num_xforms; + int oldstd,numstd; + flam3_xform tmp; + + oldstd = thiscp->num_xforms - (thiscp->final_xform_index >= 0); + + /* !!! must make sure that if final_flag is specified, we don't already have a final xform! !!! */ + +// if (thiscp->num_xforms > 0) + thiscp->xform = (flam3_xform *)realloc(thiscp->xform, (thiscp->num_xforms + num_to_add) * sizeof(flam3_xform)); +// else +// thiscp->xform = (flam3_xform *)malloc(num_to_add * sizeof(flam3_xform)); + + thiscp->num_xforms += num_to_add; + + /* Initialize all the new xforms */ + initialize_xforms(thiscp, old_num); + + /* Set the padding flag for the new xforms */ + if (interp_padding) { + for (i = old_num ; i < thiscp->num_xforms ; i++) + thiscp->xform[i].padding=1; + } + + /* If the final xform is not the last xform in the list, make it so */ + if (thiscp->final_xform_index >= 0 && thiscp->final_xform_index != thiscp->num_xforms-1) { + tmp = thiscp->xform[thiscp->final_xform_index]; + for (i=thiscp->final_xform_index; i < thiscp->num_xforms-1; i++) + thiscp->xform[i] = thiscp->xform[i+1]; + + thiscp->final_xform_index = thiscp->num_xforms-1; + thiscp->xform[thiscp->final_xform_index] = tmp; + } + + if (final_flag) { + /* Set the final xform index */ + thiscp->final_xform_enable = 1; + thiscp->final_xform_index = thiscp->num_xforms-1; + } else { + /* Handle the chaos array */ + numstd = thiscp->num_xforms - (thiscp->final_xform_index>=0); + + /* Pad existing rows */ + for (i=0;ichaos[i] = realloc(thiscp->chaos[i], numstd * sizeof(double)); + for (j=oldstd; jchaos[i][j] = 1.0; + } + + /* Add new rows */ + thiscp->chaos = realloc(thiscp->chaos,numstd * sizeof(double *)); + for (i=oldstd; ichaos[i] = malloc(numstd * sizeof(double)); + for (j=0;jchaos[i][j] = 1.0; + } + } +} + +void flam3_delete_xform(flam3_genome *thiscp, int idx_to_delete) { + + int i,j; + int num_std = thiscp->num_xforms - (thiscp->final_xform_index >= 0); + + if (thiscp->final_xform_index != idx_to_delete) { + /* We're going to delete the nth std xform. */ + + /* Delete the nth_std row of the chaos array */ + free(thiscp->chaos[idx_to_delete]); + + /* Shift the pointers down one */ + for (i=idx_to_delete+1;ichaos[i-1] = thiscp->chaos[i]; + + /* Realloc the pointer array */ + thiscp->chaos = realloc(thiscp->chaos,(num_std-1)*sizeof(double *)); + num_std--; + + /* Loop over all of the rows and remove the nth_std element from them */ + for (i=0;ichaos[i][j-1] = thiscp->chaos[i][j]; + } + /* Realloc the vector to have one less element */ + thiscp->chaos[i] = realloc(thiscp->chaos[i],num_std*sizeof(double)); + + } + } + + /* Handle the final xform index */ + if (thiscp->final_xform_index == idx_to_delete) { + thiscp->final_xform_index = -1; + thiscp->final_xform_enable = 0; + } else if (thiscp->final_xform_index > idx_to_delete) { + thiscp->final_xform_index--; + } + + /* Delete the motion elements of the banished xform */ + flam3_delete_motion_elements(&(thiscp->xform[idx_to_delete])); + + /* Move all of the xforms down one - this does not require manual motion xform adjustment */ + for (i=idx_to_delete; inum_xforms-1; i++) + thiscp->xform[i] = thiscp->xform[i+1]; + + thiscp->num_xforms--; + + /* Reduce the memory storage by one xform */ + thiscp->xform = (flam3_xform *)realloc(thiscp->xform, sizeof(flam3_xform) * thiscp->num_xforms); + +} + +void flam3_copy_xform(flam3_xform *dest, flam3_xform *src) { + + int j; + + /* Make sure the dest doesn't have motion already */ + if (dest->num_motion>0) + flam3_delete_motion_elements(dest); + + /* Copy everything */ + *dest = *src; + + /* Reset motion in dest and copy it */ + dest->num_motion=0; + dest->motion=NULL; + + if (src->num_motion>0) { + for (j=0;jnum_motion;j++) + flam3_add_motion_element(dest); + + memcpy(dest->motion,src->motion,src->num_motion*sizeof(flam3_xform)); + } +} + +/* Copy one control point to another */ +void flam3_copy(flam3_genome *dest, flam3_genome *src) { + + int i,ii; + int numstd; + + /* If there are any xforms in dest before the copy, clean them up */ + clear_cp(dest, 1); + + /* Copy main contents of genome */ + memcpy(dest, src, sizeof(flam3_genome)); + + /* Only the pointer to the xform was copied, not the actual xforms. */ + /* We need to create new xform memory storage for this new cp */ + /* This goes for chaos, too. */ + dest->num_xforms = 0; + dest->final_xform_index = -1; + dest->xform = NULL; + dest->chaos = NULL; + + /* Add the standard xforms first */ + numstd = src->num_xforms-(src->final_xform_index>=0); + flam3_add_xforms(dest, numstd, 0, 0); + for (i=0;ixform[i], &src->xform[i]); + + /* Add the final x if it's present */ + if (src->final_xform_index>=0) { + i = src->final_xform_index; + flam3_add_xforms(dest, 1, 0, 1); + ii = dest->final_xform_index; + flam3_copy_xform(&dest->xform[ii],&src->xform[i]); + } + + /* Also, only the pointer to the chaos array was copied. + * We have to take care of that as well. */ + for (i=0;ichaos[i],src->chaos[i], numstd * sizeof(double)); + +} + +void flam3_copyx(flam3_genome *dest, flam3_genome *src, int dest_std_xforms, int dest_final_xform) { + + int i,numsrcstd; + + /* If there are any xforms in dest before the copy, clean them up */ + clear_cp(dest, 1); + + /* Copy main contents of genome */ + memcpy(dest, src, sizeof(flam3_genome)); + + /* Only the pointer to the xform was copied, not the actual xforms. */ + /* We need to create new xform memory storage for this new cp */ + /* This goes for chaos, too. */ + dest->num_xforms = 0; + dest->xform = NULL; + dest->chaos = NULL; + dest->final_xform_index = -1; + + /* Add the padded standard xform list */ + /* Set the pad to 1 for these */ + flam3_add_xforms(dest, dest_std_xforms, 1, 0); + + numsrcstd = src->num_xforms - (src->final_xform_index >= 0); + + for(i=0;ixform[i],&src->xform[i]); + + /* Copy the initial chaos from the src - the rest are already 1 */ + memcpy(dest->chaos[i], src->chaos[i], numsrcstd*sizeof(double)); + + } + + /* Add the final xform if necessary */ + if (dest_final_xform > 0) { + flam3_add_xforms(dest, dest_final_xform, 1, 1); + + if (src->final_xform_enable > 0) { + + i = src->final_xform_index; + + flam3_copy_xform(&dest->xform[dest->num_xforms-1],&src->xform[i]); + + } else { + /* Interpolated-against final xforms need animate & color_speed set to 0.0 */ + dest->xform[dest->num_xforms-1].num_motion = 0; + dest->xform[dest->num_xforms-1].motion=NULL; + dest->xform[dest->num_xforms-1].animate=0.0; + dest->xform[dest->num_xforms-1].color_speed=0.0; + } + + } else { + dest->final_xform_index = -1; + dest->final_xform_enable = 0; + } + +} + +void clear_cp(flam3_genome *cp, int default_flag) { + cp->palette_index = flam3_palette_random; + cp->center[0] = 0.0; + cp->center[1] = 0.0; + cp->rot_center[0] = 0.0; + cp->rot_center[1] = 0.0; + cp->gamma = 4.0; + cp->vibrancy = 1.0; + cp->contrast = 1.0; + cp->brightness = 4.0; + cp->symmetry = 0; + cp->hue_rotation = 0.0; + cp->rotate = 0.0; + cp->pixels_per_unit = 50; + cp->interpolation = flam3_interpolation_linear; + cp->palette_interpolation = flam3_palette_interpolation_hsv; + + cp->genome_index = 0; + memset(cp->parent_fname,0,flam3_parent_fn_len); + + if (default_flag==flam3_defaults_on) { + /* If defaults are on, set to reasonable values */ + cp->highlight_power = -1.0; + cp->background[0] = 0.0; + cp->background[1] = 0.0; + cp->background[2] = 0.0; + cp->width = 100; + cp->height = 100; + cp->spatial_oversample = 1; + cp->spatial_filter_radius = 0.5; + cp->zoom = 0.0; + cp->sample_density = 1; + /* Density estimation stuff defaulting to ON */ + cp->estimator = 9.0; + cp->estimator_minimum = 0.0; + cp->estimator_curve = 0.4; + cp->gam_lin_thresh = 0.01; +// cp->motion_exp = 0.0; + cp->nbatches = 1; + cp->ntemporal_samples = 1000; + cp->spatial_filter_select = flam3_gaussian_kernel; + cp->interpolation_type = flam3_inttype_log; + cp->temporal_filter_type = flam3_temporal_box; + cp->temporal_filter_width = 1.0; + cp->temporal_filter_exp = 0.0; + cp->palette_mode = flam3_palette_mode_step; + + } else { + /* Defaults are off, so set to UN-reasonable values. */ + cp->highlight_power = -1.0; + cp->background[0] = -1.0; + cp->background[1] = -1.0; + cp->background[2] = -1.0; + cp->zoom = 999999999; + cp->spatial_oversample = -1; + cp->spatial_filter_radius = -1; + cp->nbatches = -1; + cp->ntemporal_samples = -1; + cp->width = -1; + cp->height = -1; + cp->sample_density = -1; + cp->estimator = -1; + cp->estimator_minimum = -1; + cp->estimator_curve = -1; + cp->gam_lin_thresh = -1; +// cp->motion_exp = -999; + cp->nbatches = 0; + cp->ntemporal_samples = 0; + cp->spatial_filter_select = -1; + cp->interpolation_type = -1; + cp->temporal_filter_type = -1; + cp->temporal_filter_width = -1; + cp->temporal_filter_exp = -999; + cp->palette_mode = -1; + } + + if (cp->xform != NULL && cp->num_xforms > 0) { + int i; + int ns = cp->num_xforms - (cp->final_xform_index>=0); + + for (i=0;ichaos[i]); + } + free(cp->chaos); + cp->chaos=NULL; + + for (i=0;inum_xforms;i++) + flam3_delete_motion_elements(&cp->xform[i]); + + free(cp->xform); + cp->xform=NULL; + + cp->num_xforms = 0; + } + + cp->final_xform_enable = 0; + cp->final_xform_index = -1; + +} + + +int flam3_count_nthreads(void) { + int nthreads; +#ifndef HAVE_LIBPTHREAD + return(1); +#endif + +#ifdef _WIN32 + SYSTEM_INFO sysInfo; + GetSystemInfo(&sysInfo); + nthreads = sysInfo.dwNumberOfProcessors; +#else +#ifdef __APPLE__ + kern_return_t kr; + host_name_port_t host; + unsigned int size; + struct host_basic_info hi; + + host = mach_host_self(); + size = sizeof(hi)/sizeof(int); + kr = host_info(host, HOST_BASIC_INFO, (host_info_t)&hi, &size); + if (kr != KERN_SUCCESS) { + mach_error("host_info():", kr); + exit(EXIT_FAILURE); + } + nthreads = hi.avail_cpus; +#else +#ifndef _SC_NPROCESSORS_ONLN + char line[MAXBUF]; + FILE *f = fopen("/proc/cpuinfo", "r"); + if (NULL == f) goto def; + nthreads = 0; + while (fgets(line, MAXBUF, f)) { + if (!strncmp("processor\t:", line, 11)) + nthreads++; + } + fclose(f); + if (nthreads < 1) goto def; + return (nthreads); +def: + fprintf(stderr, "could not read /proc/cpuinfo, using one render thread.\n"); + nthreads = 1; +#else + nthreads = sysconf(_SC_NPROCESSORS_ONLN); + if (nthreads < 1) nthreads = 1; +#endif +#endif +#endif + return (nthreads); +} + +flam3_genome *flam3_parse_xml2(char *xmldata, char *xmlfilename, int default_flag, int *ncps) { + + xmlDocPtr doc; /* Parsed XML document tree */ + xmlNode *rootnode; + char *bn; + int i; + int loc_all_ncps=0; + flam3_genome *loc_all_cp=NULL; + char* locale = NULL; + char* lorig = setlocale(LC_NUMERIC, NULL); + + /* Parse XML string into internal document */ + /* Forbid network access during read */ + doc = xmlReadMemory(xmldata, (int)strlen(xmldata), xmlfilename, NULL, XML_PARSE_NONET); + + /* Check for errors */ + if (doc==NULL) { + fprintf(stderr, "Failed to parse %s\n", xmlfilename); + return NULL; + } + + /* What is the root node of the document? */ + rootnode = xmlDocGetRootElement(doc); + + // force use of "C" locale when writing reals. + // first save away the current settings. + if (lorig == NULL) + fprintf(stderr, "error: couldn't get current locale\n"); + else { + int slen = strlen(lorig) + 1; + locale = (char*)malloc(slen); + if (locale != NULL) + memcpy(locale, lorig, slen); + } + if (setlocale(LC_NUMERIC, "C") == NULL) + fprintf(stderr, "error: couldn't set C locale\n"); + + /* Scan for nodes, starting with this node */ + bn = basename(xmlfilename); + + /* Have to use &loc_all_cp since the memory gets allocated in scan_for_flame_nodes */ + scan_for_flame_nodes(rootnode, bn, default_flag,&loc_all_cp,&loc_all_ncps); + + // restore locale + if (locale != NULL) { + if (setlocale(LC_NUMERIC, locale) == NULL) + fprintf(stderr, "error: couldn't replace locale settings\n"); + free(locale); + } + + xmlFreeDoc(doc); + + *ncps = loc_all_ncps; + + /* Check to see if the first control point or the second-to-last */ + /* control point has interpolation="smooth". This is invalid */ + /* and should be reset to linear (with a warning). */ + if (loc_all_ncps>=1) { + if (loc_all_cp[0].interpolation == flam3_interpolation_smooth) { + fprintf(stderr,"Warning: smooth interpolation cannot be used for first segment.\n" + " switching to linear.\n"); + loc_all_cp[0].interpolation = flam3_interpolation_linear; + } + } + + if (loc_all_ncps>=2) { + if (loc_all_cp[(loc_all_ncps)-2].interpolation == flam3_interpolation_smooth) { + fprintf(stderr,"Warning: smooth interpolation cannot be used for last segment.\n" + " switching to linear.\n"); + loc_all_cp[loc_all_ncps-2].interpolation = flam3_interpolation_linear; + } + } + + /* Finally, ensure that consecutive 'rotate' parameters never exceed */ + /* a difference of more than 180 degrees (+/-) for interpolation. */ + /* An adjustment of +/- 360 degrees is made until this is true. */ + if (*ncps>1) { + + for (i=1;i<*ncps;i++) { + + /* Only do this adjustment if we're not in compat mode */ + if (flam3_inttype_compat != loc_all_cp[i-1].interpolation_type + && flam3_inttype_older != loc_all_cp[i-1].interpolation_type) { + + while (loc_all_cp[i].rotate < loc_all_cp[i-1].rotate-180) + loc_all_cp[i].rotate += 360; + + while (loc_all_cp[i].rotate > loc_all_cp[i-1].rotate+180) + loc_all_cp[i].rotate -= 360; + } + } + } + + //Note that concurrent calls to flam3, if in parallel, potentially segfault + //if this function is called. technically it's required but it doesn't + //leak memory continuously. + //xmlCleanupParser(); + + return loc_all_cp; +} + +flam3_genome * flam3_parse_from_file(FILE *f, char *fname, int default_flag, int *ncps) { + int i, c, slen = 5000; + char *s, *snew; + flam3_genome *ret; + + /* Incrementally read XML file into a string */ + s = malloc(slen); + i = 0; + do { + c = getc(f); + if (EOF == c) + break; + s[i++] = c; + if (i == slen-1) { + slen *= 2; + snew = realloc(s, slen); + if (snew==NULL) { + fprintf(stderr,"XML file too large to be read - aborting.\n"); + free(s); + exit(1); + } else + s = snew; + } + } while (1); + + /* Null-terminate the read XML data */ + s[i] = 0; + + /* Parse the XML string */ + if (fname) + ret = flam3_parse_xml2(s, fname, default_flag, ncps); + else + ret = flam3_parse_xml2(s, "stdin", default_flag, ncps); + + free(s); + + return(ret); + +} + + +void flam3_apply_template(flam3_genome *cp, flam3_genome *templ) { + + /* Check for invalid values - only replace those with valid ones */ + if (templ->background[0] >= 0) + cp->background[0] = templ->background[0]; + if (templ->background[1] >= 0) + cp->background[1] = templ->background[1]; + if (templ->background[1] >= 0) + cp->background[2] = templ->background[2]; + if (templ->zoom < 999999998) + cp->zoom = templ->zoom; + if (templ->spatial_oversample > 0) + cp->spatial_oversample = templ->spatial_oversample; + if (templ->spatial_filter_radius >= 0) + cp->spatial_filter_radius = templ->spatial_filter_radius; + if (templ->sample_density > 0) + cp->sample_density = templ->sample_density; + if (templ->nbatches > 0) + cp->nbatches = templ->nbatches; + if (templ->ntemporal_samples > 0) + cp->ntemporal_samples = templ->ntemporal_samples; + if (templ->width > 0) { + /* preserving scale should be an option */ + cp->pixels_per_unit = cp->pixels_per_unit * templ->width / cp->width; + cp->width = templ->width; + } + if (templ->height > 0) + cp->height = templ->height; + if (templ->estimator >= 0) + cp->estimator = templ->estimator; + if (templ->estimator_minimum >= 0) + cp->estimator_minimum = templ->estimator_minimum; + if (templ->estimator_curve >= 0) + cp->estimator_curve = templ->estimator_curve; + if (templ->gam_lin_thresh >= 0) + cp->gam_lin_thresh = templ->gam_lin_thresh; + if (templ->nbatches>0) + cp->nbatches = templ->nbatches; + if (templ->ntemporal_samples>0) + cp->ntemporal_samples = templ->ntemporal_samples; + if (templ->spatial_filter_select>0) + cp->spatial_filter_select = templ->spatial_filter_select; + if (templ->interpolation >= 0) + cp->interpolation = templ->interpolation; + if (templ->interpolation_type >= 0) + cp->interpolation_type = templ->interpolation_type; + if (templ->temporal_filter_type >= 0) + cp->temporal_filter_type = templ->temporal_filter_type; + if (templ->temporal_filter_width > 0) + cp->temporal_filter_width = templ->temporal_filter_width; + if (templ->temporal_filter_exp > -900) + cp->temporal_filter_exp = templ->temporal_filter_exp; + if (templ->highlight_power >=0) + cp->highlight_power = templ->highlight_power; + if (templ->palette_mode >= 0) + cp->palette_mode = templ->palette_mode; + +} + +char *flam3_print_to_string(flam3_genome *cp) { + + FILE *tmpflame; + long stringbytes; + char *genome_string; + + tmpflame = tmpfile(); + flam3_print(tmpflame,cp,NULL,flam3_dont_print_edits); + stringbytes = ftell(tmpflame); + fseek(tmpflame,0L, SEEK_SET); + genome_string = (char *)calloc(stringbytes+1,1); + if (stringbytes != fread(genome_string, 1, stringbytes, tmpflame)) { + perror("FLAM3: reading string from temp file"); + } + fclose(tmpflame); + + return(genome_string); +} + + +void flam3_print(FILE *f, flam3_genome *cp, char *extra_attributes, int print_edits) { + int i,numstd; + int flam27_flag; + char *ai; + + // force use of "C" locale when writing reals. + // first save away the current settings. + char* locale = NULL; + char* lorig = setlocale(LC_NUMERIC, NULL); + if (lorig == NULL) + fprintf(stderr, "error: couldn't get current locale\n"); + else { + int slen = strlen(lorig) + 1; + locale = (char*)malloc(slen); + if (locale != NULL) + memcpy(locale, lorig, slen); + } + if (setlocale(LC_NUMERIC, "C") == NULL) + fprintf(stderr, "error: couldn't set C locale\n"); + + + flam27_flag = argi("flam27",0); + + fprintf(f, "time); + + if (cp->flame_name[0]!=0) + fprintf(f, " name=\"%s\"",cp->flame_name); + + fprintf(f, " size=\"%d %d\"", cp->width, cp->height); + fprintf(f, " center=\"%g %g\"", cp->center[0], cp->center[1]); + fprintf(f, " scale=\"%g\"", cp->pixels_per_unit); + + if (cp->zoom != 0.0) + fprintf(f, " zoom=\"%g\"", cp->zoom); + + fprintf(f, " rotate=\"%g\"", cp->rotate); + fprintf(f, " supersample=\"%d\"", cp->spatial_oversample); + fprintf(f, " filter=\"%g\"", cp->spatial_filter_radius); + + /* Need to print the correct kernel to use */ + if (cp->spatial_filter_select == flam3_gaussian_kernel) + fprintf(f, " filter_shape=\"gaussian\""); + else if (cp->spatial_filter_select == flam3_hermite_kernel) + fprintf(f, " filter_shape=\"hermite\""); + else if (cp->spatial_filter_select == flam3_box_kernel) + fprintf(f, " filter_shape=\"box\""); + else if (cp->spatial_filter_select == flam3_triangle_kernel) + fprintf(f, " filter_shape=\"triangle\""); + else if (cp->spatial_filter_select == flam3_bell_kernel) + fprintf(f, " filter_shape=\"bell\""); + else if (cp->spatial_filter_select == flam3_b_spline_kernel) + fprintf(f, " filter_shape=\"bspline\""); + else if (cp->spatial_filter_select == flam3_mitchell_kernel) + fprintf(f, " filter_shape=\"mitchell\""); + else if (cp->spatial_filter_select == flam3_blackman_kernel) + fprintf(f, " filter_shape=\"blackman\""); + else if (cp->spatial_filter_select == flam3_catrom_kernel) + fprintf(f, " filter_shape=\"catrom\""); + else if (cp->spatial_filter_select == flam3_hanning_kernel) + fprintf(f, " filter_shape=\"hanning\""); + else if (cp->spatial_filter_select == flam3_hamming_kernel) + fprintf(f, " filter_shape=\"hamming\""); + else if (cp->spatial_filter_select == flam3_lanczos3_kernel) + fprintf(f, " filter_shape=\"lanczos3\""); + else if (cp->spatial_filter_select == flam3_lanczos2_kernel) + fprintf(f, " filter_shape=\"lanczos2\""); + else if (cp->spatial_filter_select == flam3_quadratic_kernel) + fprintf(f, " filter_shape=\"quadratic\""); + + if (cp->temporal_filter_type == flam3_temporal_box) + fprintf(f, " temporal_filter_type=\"box\""); + else if (cp->temporal_filter_type == flam3_temporal_gaussian) + fprintf(f, " temporal_filter_type=\"gaussian\""); + else if (cp->temporal_filter_type == flam3_temporal_exp) + fprintf(f, " temporal_filter_type=\"exp\" temporal_filter_exp=\"%g\"",cp->temporal_filter_exp); + + fprintf(f, " temporal_filter_width=\"%g\"",cp->temporal_filter_width); + + + + fprintf(f, " quality=\"%g\"", cp->sample_density); + fprintf(f, " passes=\"%d\"", cp->nbatches); + fprintf(f, " temporal_samples=\"%d\"", cp->ntemporal_samples); + fprintf(f, " background=\"%g %g %g\"", + cp->background[0], cp->background[1], cp->background[2]); + fprintf(f, " brightness=\"%g\"", cp->brightness); + fprintf(f, " gamma=\"%g\"", cp->gamma); + + if (!flam27_flag) + fprintf(f, " highlight_power=\"%g\"", cp->highlight_power); + + fprintf(f, " vibrancy=\"%g\"", cp->vibrancy); + fprintf(f, " estimator_radius=\"%g\" estimator_minimum=\"%g\" estimator_curve=\"%g\"", + cp->estimator, cp->estimator_minimum, cp->estimator_curve); + fprintf(f, " gamma_threshold=\"%g\"", cp->gam_lin_thresh); + + if (flam3_palette_mode_step == cp->palette_mode) + fprintf(f, " palette_mode=\"step\""); + else if (flam3_palette_mode_linear == cp->palette_mode) + fprintf(f, " palette_mode=\"linear\""); + + if (flam3_interpolation_linear != cp->interpolation) + fprintf(f, " interpolation=\"smooth\""); + + if (flam3_inttype_linear == cp->interpolation_type) + fprintf(f, " interpolation_type=\"linear\""); + else if (flam3_inttype_log == cp->interpolation_type) + fprintf(f, " interpolation_type=\"log\""); + else if (flam3_inttype_compat == cp->interpolation_type) + fprintf(f, " interpolation_type=\"old\""); + else if (flam3_inttype_older == cp->interpolation_type) + fprintf(f, " interpolation_type=\"older\""); + + + if (flam3_palette_interpolation_hsv != cp->palette_interpolation) + fprintf(f, " palette_interpolation=\"sweep\""); + + if (extra_attributes) + fprintf(f, " %s", extra_attributes); + + fprintf(f, ">\n"); + + if (cp->symmetry) + fprintf(f, " \n", cp->symmetry); + + numstd = cp->num_xforms - (cp->final_xform_index>=0); + + for (i = 0; i < cp->num_xforms; i++) { + + if (i==cp->final_xform_index) + flam3_print_xform(f, &cp->xform[i], 1, numstd, NULL, 0); + else + flam3_print_xform(f, &cp->xform[i], 0, numstd, cp->chaos[i], 0); + + } + + for (i = 0; i < 256; i++) { + double r, g, b, a; + r = (cp->palette[i].color[0] * 255.0); + g = (cp->palette[i].color[1] * 255.0); + b = (cp->palette[i].color[2] * 255.0); + a = (cp->palette[i].color[3] * 255.0); + +// if (i%4 == 0) + fprintf(f, " "); + + if (flam27_flag || a==255.0) { + + if (flam27_flag && a!=255.0) + fprintf(stderr,"alpha channel in palette cannot be stored in 2.7 compatibility mode; truncating\n"); + + if (getenv("intpalette")) + fprintf(f, "", i, (int)rint(r), (int)rint(g), (int)rint(b)); + else { +#ifdef USE_FLOAT_INDICES + fprintf(f, "", cp->palette[i].index, r, g, b); +#else + fprintf(f, "", i, r, g, b); +#endif + } + } else { + if (getenv("intpalette")) + fprintf(f, " ", i, (int)rint(r), (int)rint(g), (int)rint(b), (int)rint(a)); + else + fprintf(f, " ", i, r, g, b, a); + } +// if (i%4 == 3) + fprintf(f, "\n"); + + } + + if (cp->edits != NULL && print_edits==flam3_print_edits) { + + /* We need a custom script for printing these */ + /* and it needs to be recursive */ + xmlNodePtr elem_node = xmlDocGetRootElement(cp->edits); + flam3_edit_print(f,elem_node, 1, 1); + } + fprintf(f, "\n"); + + if (locale != NULL) { + if (setlocale(LC_NUMERIC, locale) == NULL) + fprintf(stderr, "error: couldn't restore locale settings\n"); + free(locale); + } +} + +#define PRINTNON(p) do { if (x->p != 0.0) fprintf(f, #p "=\"%f\" ",x->p); } while(0) + + +void flam3_print_xform(FILE *f, flam3_xform *x, int final_flag, int numstd, double *chaos_row, int motion_flag) { + + int blob_var=0,pdj_var=0,fan2_var=0,rings2_var=0,perspective_var=0; + int juliaN_var=0,juliaScope_var=0,radialBlur_var=0,pie_var=0,disc2_var=0; + int ngon_var=0,curl_var=0,rectangles_var=0,supershape_var=0; + int flower_var=0,conic_var=0,parabola_var=0,bent2_var=0,bipolar_var=0; + int cell_var=0,cpow_var=0,curve_var=0,escher_var=0,lazys_var=0; + int modulus_var=0,oscope_var=0,popcorn2_var=0,separation_var=0; + int split_var=0,splits_var=0,stripes_var=0,wedge_var=0,wedgeJ_var=0; + int wedgeS_var=0,whorl_var=0,waves2_var=0,auger_var=0; + + int j; + int lnv; + + int flam27_flag; + char *ai; + + flam27_flag = argi("flam27",0); + + /* Motion flag will not be set if flam27_flag is set */ + if (motion_flag) { + fprintf(f, " motion_freq); + if (x->motion_func == MOTION_SIN) + fprintf(f, "motion_function=\"sin\" "); + else if (x->motion_func == MOTION_TRIANGLE) + fprintf(f, "motion_function=\"triangle\" "); + else if (x->motion_func == MOTION_HILL) + fprintf(f, "motion_function=\"hill\" "); + } else { + if (final_flag) + fprintf(f, " density); + } + + if (!motion_flag || x->color != 0.0) + fprintf(f, "color=\"%g\" ", x->color); + + if (flam27_flag) + fprintf(f, "symmetry=\"%g\" ", 1.0-2.0*x->color_speed); + else if (!motion_flag) + fprintf(f, "color_speed=\"%g\" ", x->color_speed); + + if (!final_flag && !motion_flag && !flam27_flag) + fprintf(f, "animate=\"%g\" ", x->animate); + + lnv = flam27_flag ? 54:flam3_nvariations; + + for (j = 0; j < lnv; j++) { + double v = x->var[j]; + if (0.0 != v) { + fprintf(f, "%s=\"%g\" ", flam3_variation_names[j], v); + if (j==VAR_BLOB) + blob_var=1; + else if (j==VAR_PDJ) + pdj_var=1; + else if (j==VAR_FAN2) + fan2_var=1; + else if (j==VAR_RINGS2) + rings2_var=1; + else if (j==VAR_PERSPECTIVE) + perspective_var=1; + else if (j==VAR_JULIAN) + juliaN_var=1; + else if (j==VAR_JULIASCOPE) + juliaScope_var=1; + else if (j==VAR_RADIAL_BLUR) + radialBlur_var=1; + else if (j==VAR_PIE) + pie_var=1; + else if (j==VAR_NGON) + ngon_var=1; + else if (j==VAR_CURL) + curl_var=1; + else if (j==VAR_RECTANGLES) + rectangles_var=1; + else if (j==VAR_DISC2) + disc2_var=1; + else if (j==VAR_SUPER_SHAPE) + supershape_var=1; + else if (j==VAR_FLOWER) + flower_var=1; + else if (j==VAR_CONIC) + conic_var=1; + else if (j==VAR_PARABOLA) + parabola_var=1; + else if (j==VAR_BENT2) + bent2_var=1; + else if (j==VAR_BIPOLAR) + bipolar_var=1; + else if (j==VAR_CELL) + cell_var=1; + else if (j==VAR_CPOW) + cpow_var=1; + else if (j==VAR_CURVE) + curve_var=1; + else if (j==VAR_ESCHER) + escher_var=1; + else if (j==VAR_LAZYSUSAN) + lazys_var=1; + else if (j==VAR_MODULUS) + modulus_var=1; + else if (j==VAR_OSCILLOSCOPE) + oscope_var=1; + else if (j==VAR_POPCORN2) + popcorn2_var=1; + else if (j==VAR_SPLIT) + split_var=1; + else if (j==VAR_SPLITS) + splits_var=1; + else if (j==VAR_STRIPES) + stripes_var=1; + else if (j==VAR_WEDGE) + wedge_var=1; + else if (j==VAR_WEDGE_JULIA) + wedgeJ_var=1; + else if (j==VAR_WEDGE_SPH) + wedgeS_var=1; + else if (j==VAR_WHORL) + whorl_var=1; + else if (j==VAR_WAVES2) + waves2_var=1; + else if (j==VAR_AUGER) + auger_var=1; + } + } + + if (!motion_flag) { + if (blob_var==1) { + fprintf(f, "blob_low=\"%g\" ", x->blob_low); + fprintf(f, "blob_high=\"%g\" ", x->blob_high); + fprintf(f, "blob_waves=\"%g\" ", x->blob_waves); + } + + if (pdj_var==1) { + fprintf(f, "pdj_a=\"%g\" ", x->pdj_a); + fprintf(f, "pdj_b=\"%g\" ", x->pdj_b); + fprintf(f, "pdj_c=\"%g\" ", x->pdj_c); + fprintf(f, "pdj_d=\"%g\" ", x->pdj_d); + } + + if (fan2_var==1) { + fprintf(f, "fan2_x=\"%g\" ", x->fan2_x); + fprintf(f, "fan2_y=\"%g\" ", x->fan2_y); + } + + if (rings2_var==1) { + fprintf(f, "rings2_val=\"%g\" ", x->rings2_val); + } + + if (perspective_var==1) { + fprintf(f, "perspective_angle=\"%g\" ", x->perspective_angle); + fprintf(f, "perspective_dist=\"%g\" ", x->perspective_dist); + } + + if (juliaN_var==1) { + fprintf(f, "julian_power=\"%g\" ", x->julian_power); + fprintf(f, "julian_dist=\"%g\" ", x->julian_dist); + } + + if (juliaScope_var==1) { + fprintf(f, "juliascope_power=\"%g\" ", x->juliascope_power); + fprintf(f, "juliascope_dist=\"%g\" ", x->juliascope_dist); + } + + if (radialBlur_var==1) { + fprintf(f, "radial_blur_angle=\"%g\" ", x->radial_blur_angle); + } + + if (pie_var==1) { + fprintf(f, "pie_slices=\"%g\" ", x->pie_slices); + fprintf(f, "pie_rotation=\"%g\" ", x->pie_rotation); + fprintf(f, "pie_thickness=\"%g\" ", x->pie_thickness); + } + + if (ngon_var==1) { + fprintf(f, "ngon_sides=\"%g\" ", x->ngon_sides); + fprintf(f, "ngon_power=\"%g\" ", x->ngon_power); + fprintf(f, "ngon_corners=\"%g\" ", x->ngon_corners); + fprintf(f, "ngon_circle=\"%g\" ", x->ngon_circle); + } + + if (curl_var==1) { + fprintf(f, "curl_c1=\"%g\" ", x->curl_c1); + fprintf(f, "curl_c2=\"%g\" ", x->curl_c2); + } + + if (rectangles_var==1) { + fprintf(f, "rectangles_x=\"%g\" ", x->rectangles_x); + fprintf(f, "rectangles_y=\"%g\" ", x->rectangles_y); + } + + if (disc2_var==1) { + fprintf(f, "disc2_rot=\"%g\" ", x->disc2_rot); + fprintf(f, "disc2_twist=\"%g\" ", x->disc2_twist); + } + + if (supershape_var==1) { + fprintf(f, "super_shape_rnd=\"%g\" ", x->super_shape_rnd); + fprintf(f, "super_shape_m=\"%g\" ", x->super_shape_m); + fprintf(f, "super_shape_n1=\"%g\" ", x->super_shape_n1); + fprintf(f, "super_shape_n2=\"%g\" ", x->super_shape_n2); + fprintf(f, "super_shape_n3=\"%g\" ", x->super_shape_n3); + fprintf(f, "super_shape_holes=\"%g\" ", x->super_shape_holes); + } + + if (flower_var==1) { + fprintf(f, "flower_petals=\"%g\" ", x->flower_petals); + fprintf(f, "flower_holes=\"%g\" ", x->flower_holes); + } + + if (conic_var==1) { + fprintf(f, "conic_eccentricity=\"%g\" ", x->conic_eccentricity); + fprintf(f, "conic_holes=\"%g\" ", x->conic_holes); + } + + if (parabola_var==1) { + fprintf(f, "parabola_height=\"%g\" ", x->parabola_height); + fprintf(f, "parabola_width=\"%g\" ", x->parabola_width); + } + + if (bent2_var==1) { + fprintf(f, "bent2_x=\"%g\" ", x->bent2_x); + fprintf(f, "bent2_y=\"%g\" ", x->bent2_y); + } + + if (bipolar_var==1) { + fprintf(f, "bipolar_shift=\"%g\" ", x->bipolar_shift); + } + + if (cell_var==1) { + fprintf(f, "cell_size=\"%g\" ", x->cell_size); + } + + if (cpow_var==1) { + fprintf(f, "cpow_i=\"%g\" ", x->cpow_i); + fprintf(f, "cpow_r=\"%g\" ", x->cpow_r); + fprintf(f, "cpow_power=\"%g\" ", x->cpow_power); + } + + if (curve_var==1) { + fprintf(f, "curve_xamp=\"%g\" ", x->curve_xamp); + fprintf(f, "curve_yamp=\"%g\" ", x->curve_yamp); + fprintf(f, "curve_xlength=\"%g\" ", x->curve_xlength); + fprintf(f, "curve_ylength=\"%g\" ", x->curve_ylength); + } + + if (escher_var==1) { + fprintf(f, "escher_beta=\"%g\" ", x->escher_beta); + } + + if (lazys_var==1) { + fprintf(f, "lazysusan_x=\"%g\" ", x->lazysusan_x); + fprintf(f, "lazysusan_y=\"%g\" ", x->lazysusan_y); + fprintf(f, "lazysusan_spin=\"%g\" ", x->lazysusan_spin); + fprintf(f, "lazysusan_space=\"%g\" ", x->lazysusan_space); + fprintf(f, "lazysusan_twist=\"%g\" ", x->lazysusan_twist); + } + + if (modulus_var==1) { + fprintf(f, "modulus_x=\"%g\" ", x->modulus_x); + fprintf(f, "modulus_y=\"%g\" ", x->modulus_y); + } + + if (oscope_var==1) { + fprintf(f, "oscilloscope_separation=\"%g\" ", x->oscope_separation); + fprintf(f, "oscilloscope_frequency=\"%g\" ", x->oscope_frequency); + fprintf(f, "oscilloscope_amplitude=\"%g\" ", x->oscope_amplitude); + fprintf(f, "oscilloscope_damping=\"%g\" ", x->oscope_damping); + } + + if (popcorn2_var==1) { + fprintf(f, "popcorn2_x=\"%g\" ", x->popcorn2_x); + fprintf(f, "popcorn2_y=\"%g\" ", x->popcorn2_y); + fprintf(f, "popcorn2_c=\"%g\" ", x->popcorn2_c); + } + + if (separation_var==1) { + fprintf(f, "separation_x=\"%g\" ", x->separation_x); + fprintf(f, "separation_y=\"%g\" ", x->separation_y); + fprintf(f, "separation_xinside=\"%g\" ", x->separation_xinside); + fprintf(f, "separation_yinside=\"%g\" ", x->separation_yinside); + } + + if (split_var==1) { + fprintf(f, "split_xsize=\"%g\" ", x->split_xsize); + fprintf(f, "split_ysize=\"%g\" ", x->split_ysize); + } + + if (splits_var==1) { + fprintf(f, "splits_x=\"%g\" ", x->splits_x); + fprintf(f, "splits_y=\"%g\" ", x->splits_y); + } + + if (stripes_var==1) { + fprintf(f, "stripes_space=\"%g\" ", x->stripes_space); + fprintf(f, "stripes_warp=\"%g\" ", x->stripes_warp); + } + + if (wedge_var==1) { + fprintf(f, "wedge_angle=\"%g\" ", x->wedge_angle); + fprintf(f, "wedge_hole=\"%g\" ", x->wedge_hole); + fprintf(f, "wedge_count=\"%g\" ", x->wedge_count); + fprintf(f, "wedge_swirl=\"%g\" ", x->wedge_swirl); + } + + if (wedgeJ_var==1) { + fprintf(f, "wedge_julia_angle=\"%g\" ", x->wedge_julia_angle); + fprintf(f, "wedge_julia_count=\"%g\" ", x->wedge_julia_count); + fprintf(f, "wedge_julia_power=\"%g\" ", x->wedge_julia_power); + fprintf(f, "wedge_julia_dist=\"%g\" ", x->wedge_julia_dist); + } + + if (wedgeS_var==1) { + fprintf(f, "wedge_sph_angle=\"%g\" ", x->wedge_sph_angle); + fprintf(f, "wedge_sph_hole=\"%g\" ", x->wedge_sph_hole); + fprintf(f, "wedge_sph_count=\"%g\" ", x->wedge_sph_count); + fprintf(f, "wedge_sph_swirl=\"%g\" ", x->wedge_sph_swirl); + } + + if (whorl_var==1) { + fprintf(f, "whorl_inside=\"%g\" ", x->whorl_inside); + fprintf(f, "whorl_outside=\"%g\" ", x->whorl_outside); + } + + if (waves2_var==1) { + fprintf(f, "waves2_scalex=\"%g\" ", x->waves2_scalex); + fprintf(f, "waves2_scaley=\"%g\" ", x->waves2_scaley); + fprintf(f, "waves2_freqx=\"%g\" ", x->waves2_freqx); + fprintf(f, "waves2_freqy=\"%g\" ", x->waves2_freqy); + } + + if (auger_var==1) { + fprintf(f, "auger_sym=\"%g\" ", x->auger_sym); + fprintf(f, "auger_weight=\"%g\" ", x->auger_weight); + fprintf(f, "auger_freq=\"%g\" ", x->auger_freq); + fprintf(f, "auger_scale=\"%g\" ", x->auger_scale); + } + + fprintf(f, "coefs=\""); + for (j = 0; j < 3; j++) { + if (j) fprintf(f, " "); + fprintf(f, "%g %g", x->c[j][0], x->c[j][1]); + } + fprintf(f, "\""); + + if (!id_matrix(x->post)) { + fprintf(f, " post=\""); + for (j = 0; j < 3; j++) { + if (j) fprintf(f, " "); + fprintf(f, "%g %g", x->post[j][0], x->post[j][1]); + } + fprintf(f, "\""); + } + + + } else { + /* For motion, print any parameter if it's nonzero */ + PRINTNON(blob_low); + PRINTNON(blob_high); + PRINTNON(blob_waves); + + PRINTNON(pdj_a); + PRINTNON(pdj_b); + PRINTNON(pdj_c); + PRINTNON(pdj_d); + + PRINTNON(fan2_x); + PRINTNON(fan2_y); + + PRINTNON(rings2_val); + + PRINTNON(perspective_angle); + PRINTNON(perspective_dist); + + PRINTNON(julian_power); + PRINTNON(julian_dist); + + PRINTNON(juliascope_power); + PRINTNON(juliascope_dist); + + PRINTNON(radial_blur_angle); + + PRINTNON(pie_slices); + PRINTNON(pie_rotation); + PRINTNON(pie_thickness); + + PRINTNON(ngon_sides); + PRINTNON(ngon_power); + PRINTNON(ngon_corners); + PRINTNON(ngon_circle); + + PRINTNON(curl_c1); + PRINTNON(curl_c2); + + PRINTNON(rectangles_x); + PRINTNON(rectangles_y); + + PRINTNON(disc2_rot); + PRINTNON(disc2_twist); + + PRINTNON(super_shape_rnd); + PRINTNON(super_shape_m); + PRINTNON(super_shape_n1); + PRINTNON(super_shape_n2); + PRINTNON(super_shape_n3); + PRINTNON(super_shape_holes); + + PRINTNON(flower_petals); + PRINTNON(flower_holes); + + PRINTNON(conic_eccentricity); + PRINTNON(conic_holes); + + PRINTNON(parabola_height); + PRINTNON(parabola_width); + + PRINTNON(bent2_x); + PRINTNON(bent2_y); + + PRINTNON(bipolar_shift); + + PRINTNON(cell_size); + + PRINTNON(cpow_i); + PRINTNON(cpow_r); + PRINTNON(cpow_power); + + PRINTNON(curve_xamp); + PRINTNON(curve_yamp); + PRINTNON(curve_xlength); + PRINTNON(curve_ylength); + + PRINTNON(escher_beta); + + PRINTNON(lazysusan_x); + PRINTNON(lazysusan_y); + PRINTNON(lazysusan_spin); + PRINTNON(lazysusan_space); + PRINTNON(lazysusan_twist); + + PRINTNON(modulus_x); + PRINTNON(modulus_y); + + PRINTNON(oscope_separation); + PRINTNON(oscope_frequency); + PRINTNON(oscope_amplitude); + PRINTNON(oscope_damping); + + PRINTNON(popcorn2_x); + PRINTNON(popcorn2_y); + PRINTNON(popcorn2_c); + + PRINTNON(separation_x); + PRINTNON(separation_y); + PRINTNON(separation_xinside); + PRINTNON(separation_yinside); + + PRINTNON(split_xsize); + PRINTNON(split_ysize); + + PRINTNON(splits_x); + PRINTNON(splits_y); + + PRINTNON(stripes_space); + PRINTNON(stripes_warp); + + PRINTNON(wedge_angle); + PRINTNON(wedge_hole); + PRINTNON(wedge_count); + PRINTNON(wedge_swirl); + + PRINTNON(wedge_julia_angle); + PRINTNON(wedge_julia_count); + PRINTNON(wedge_julia_power); + PRINTNON(wedge_julia_dist); + + PRINTNON(wedge_sph_angle); + PRINTNON(wedge_sph_hole); + PRINTNON(wedge_sph_count); + PRINTNON(wedge_sph_swirl); + + PRINTNON(whorl_inside); + PRINTNON(whorl_outside); + + PRINTNON(waves2_scalex); + PRINTNON(waves2_scaley); + PRINTNON(waves2_freqx); + PRINTNON(waves2_freqy); + + PRINTNON(auger_sym); + PRINTNON(auger_weight); + PRINTNON(auger_freq); + PRINTNON(auger_scale); + + if (!zero_matrix(x->c)) { + fprintf(f, "coefs=\""); + for (j = 0; j < 3; j++) { + if (j) fprintf(f, " "); + fprintf(f, "%g %g", x->c[j][0], x->c[j][1]); + } + fprintf(f, "\""); + } + + if (!zero_matrix(x->post)) { + fprintf(f, " post=\""); + for (j = 0; j < 3; j++) { + if (j) fprintf(f, " "); + fprintf(f, "%g %g", x->post[j][0], x->post[j][1]); + } + fprintf(f, "\""); + } + } + + if (!final_flag && !motion_flag && !flam27_flag) { + + /* Print out the chaos row for this xform */ + int numcols = numstd; + + while (numcols > 0 && chaos_row[numcols-1]==1.0) + numcols--; + + if (numcols>0) { + fprintf(f, " chaos=\""); + for (j=0;jopacity); + } + + if (!motion_flag && x->num_motion>0 && !flam27_flag) { + int nm; + + fprintf(f,">\n"); + + for (nm=0; nmnum_motion; nm++) + flam3_print_xform(f, &(x->motion[nm]), 0, 0, NULL, 1); + + fprintf(f," \n"); + } else + fprintf(f, "/>\n"); +} + + +/* returns a uniform variable from 0 to 1 */ +double flam3_random01() { + return (random() & 0xfffffff) / (double) 0xfffffff; +} + +double flam3_random11() { + return ((random() & 0xfffffff) - 0x7ffffff) / (double) 0x7ffffff; +} + +/* This function must be called prior to rendering a frame */ +void flam3_init_frame(flam3_frame *f) { + + char *ai; + char *isaac_seed = args("isaac_seed",NULL); + long int default_isaac_seed = (long int)time(0); + + /* Clear out the isaac state */ + memset(f->rc.randrsl, 0, RANDSIZ*sizeof(ub4)); + + /* Set the isaac seed */ + if (NULL == isaac_seed) { + int lp; + /* No isaac seed specified. Use the system time to initialize. */ + for (lp = 0; lp < RANDSIZ; lp++) + f->rc.randrsl[lp] = default_isaac_seed; + } else { + /* Use the specified string */ + strncpy((char *)&f->rc.randrsl,(const char *)isaac_seed, RANDSIZ*sizeof(ub4)); + } + + /* Initialize the random number generator */ + irandinit(&f->rc,1); +} + +/* returns uniform variable from ISAAC rng */ +double flam3_random_isaac_01(randctx *ct) { + return ((int)irand(ct) & 0xfffffff) / (double) 0xfffffff; +} + +double flam3_random_isaac_11(randctx *ct) { + return (((int)irand(ct) & 0xfffffff) - 0x7ffffff) / (double) 0x7ffffff; +} + +int flam3_random_bit() { + /* might not be threadsafe */ + static int n = 0; + static int l; + if (0 == n) { + l = random(); + n = 20; + } else { + l = l >> 1; + n--; + } + return l & 1; +} + +int flam3_random_isaac_bit(randctx *ct) { + int tmp = irand(ct); + return tmp & 1; +} + +static double round6(double x) { + x *= 1e6; + if (x < 0) x -= 1.0; + return 1e-6*(int)(x+0.5); +} + +/* sym=2 or more means rotational + sym=1 means identity, ie no symmetry + sym=0 means pick a random symmetry (maybe none) + sym=-1 means bilateral (reflection) + sym=-2 or less means rotational and reflective +*/ +void flam3_add_symmetry(flam3_genome *cp, int sym) { + int i, j, k; + double a; + int result = 0; + + if (0 == sym) { + static int sym_distrib[] = { + -4, -3, + -2, -2, -2, + -1, -1, -1, + 2, 2, 2, + 3, 3, + 4, 4, + }; + if (random()&1) { + sym = random_distrib(sym_distrib); + } else if (random()&31) { + sym = (random()%13)-6; + } else { + sym = (random()%51)-25; + } + } + + if (1 == sym || 0 == sym) return; + + cp->symmetry = sym; + + if (sym < 0) { + + i = cp->num_xforms; + flam3_add_xforms(cp,1,0,0); + + cp->xform[i].density = 1.0; + cp->xform[i].color_speed = 0.0; + cp->xform[i].animate = 0.0; + cp->xform[i].var[0] = 1.0; + for (j = 1; j < flam3_nvariations; j++) + cp->xform[i].var[j] = 0; + cp->xform[i].color = 1.0; + cp->xform[i].c[0][0] = -1.0; + cp->xform[i].c[0][1] = 0.0; + cp->xform[i].c[1][0] = 0.0; + cp->xform[i].c[1][1] = 1.0; + cp->xform[i].c[2][0] = 0.0; + cp->xform[i].c[2][1] = 0.0; + + result++; + sym = -sym; + } + + a = 2*M_PI/sym; + + for (k = 1; k < sym; k++) { + + i = cp->num_xforms; + flam3_add_xforms(cp, 1, 0,0); + + cp->xform[i].density = 1.0; + cp->xform[i].color_speed = 0.0; + cp->xform[i].animate = 0.0; + cp->xform[i].var[0] = 1.0; + for (j = 1; j < flam3_nvariations; j++) + cp->xform[i].var[j] = 0; + cp->xform[i].color = (sym<3) ? 0.0 : ((k-1.0)/(sym-2.0)); + cp->xform[i].c[0][0] = round6(cos(k*a)); + cp->xform[i].c[0][1] = round6(sin(k*a)); + cp->xform[i].c[1][0] = round6(-cp->xform[i].c[0][1]); + cp->xform[i].c[1][1] = cp->xform[i].c[0][0]; + cp->xform[i].c[2][0] = 0.0; + cp->xform[i].c[2][1] = 0.0; + + result++; + } + + qsort((char *) &cp->xform[cp->num_xforms-result], result, + sizeof(flam3_xform), compare_xforms); + +} + +void add_to_action(char *action, char *addtoaction) { + + /* action is a flam3_max_action_length array */ + if (action != NULL) { + + int alen = strlen(action); + int addlen = strlen(addtoaction); + + if (alen+addlen < flam3_max_action_length) + strcat(action,addtoaction); + else + fprintf(stderr,"action string too long, truncating...\n"); + } +} + + +void flam3_cross(flam3_genome *cp0, flam3_genome *cp1, flam3_genome *out, int cross_mode, randctx *rc, char *action) { + + int i0,i1, i,j, rb; + char ministr[10]; + + if (cross_mode == CROSS_NOT_SPECIFIED) { + + double s = flam3_random_isaac_01(rc); + + if (s < 0.1) + cross_mode = CROSS_UNION; + else if (s < 0.2) + cross_mode = CROSS_INTERPOLATE; + else + cross_mode = CROSS_ALTERNATE; + + } + + if (cross_mode == CROSS_UNION) { + + flam3_xform mycopy; + + /* Make a copy of cp0 */ + flam3_copy(out, cp0); + + for (j=0;jnum_xforms;j++) { + /* Skip over the final xform, if it's present. */ + /* Default behavior keeps the final from parent0. */ + if (cp1->final_xform_index == j) + continue; + flam3_add_xforms(out, 1, 0, 0); + flam3_copy_xform(&out->xform[out->num_xforms-1],&cp1->xform[j]); + } + + /* Put the final xform last (if there is one) */ + /* We do not need to do complicated xform copies here since we're just moving them around */ + if (out->final_xform_index >= 0) { + mycopy = out->xform[out->final_xform_index]; + out->xform[out->final_xform_index] = out->xform[out->num_xforms-1]; + out->xform[out->num_xforms-1] = mycopy; + out->final_xform_index = out->num_xforms-1; + } + + add_to_action(action,"cross union"); + + } else if (cross_mode == CROSS_INTERPOLATE) { + + /* linearly interpolate somewhere between the two */ + flam3_genome parents[2]; + double t = flam3_random_isaac_01(rc); + + memset(parents, 0, 2*sizeof(flam3_genome)); + + flam3_copy(&(parents[0]), cp0); + flam3_copy(&(parents[1]), cp1); + + parents[0].time = 0.0; + parents[1].time = 1.0; + flam3_interpolate(parents, 2, t, 0, out); + + for (i=0;inum_xforms;i++) + flam3_delete_motion_elements(&out->xform[i]); + + clear_cp(&parents[0],flam3_defaults_on); + clear_cp(&parents[1],flam3_defaults_on); + + sprintf(ministr,"%7.5g",t); + + add_to_action(action,"cross interpolate "); + add_to_action(action,ministr); + + } else { + + /* alternate mode */ + int got0, got1, used_parent; + char *trystr; + + trystr = calloc(4 * (cp0->num_xforms + cp1->num_xforms), sizeof(char)); + + /* each xform comes from a random parent, possible for an entire parent to be excluded */ + do { + + trystr[0] = 0; + got0 = got1 = 0; + rb = flam3_random_isaac_bit(rc); + sprintf(ministr,"%d:",rb); + strcat(trystr,ministr); + + /* Copy the parent, sorting the final xform to the end if it's present. */ + if (rb) + flam3_copyx(out, cp1, cp1->num_xforms - (cp1->final_xform_index > 0), cp1->final_xform_enable); + else + flam3_copyx(out, cp0, cp0->num_xforms - (cp0->final_xform_index > 0), cp0->final_xform_enable); + + used_parent = rb; + + /* Only replace non-final xforms */ + + for (i = 0; i < out->num_xforms - out->final_xform_enable; i++) { + rb = flam3_random_isaac_bit(rc); + + /* Replace xform if bit is 1 */ + if (rb==1) { + if (used_parent==0) { + if (i < cp1->num_xforms && cp1->xform[i].density > 0) { + flam3_copy_xform(&out->xform[i],&cp1->xform[i]); + sprintf(ministr," 1"); + got1 = 1; + } else { + sprintf(ministr," 0"); + got0 = 1; + } + } else { + if (i < cp0->num_xforms && cp0->xform[i].density > 0) { + flam3_copy_xform(&out->xform[i],&cp0->xform[i]); + sprintf(ministr," 0"); + got0 = 1; + } else { + sprintf(ministr," 1"); + got1 = 1; + } + } + } else { + sprintf(ministr," %d",used_parent); + if (used_parent) + got1 = 1; + else + got0 = 1; + } + + strcat(trystr,ministr); + } + + if (used_parent==0 && cp0->final_xform_enable) + got0 = 1; + else if (used_parent==1 && cp1->final_xform_enable) + got1 = 1; + + } while ((i > 1) && !(got0 && got1)); + + add_to_action(action,"cross alternate "); + add_to_action(action,trystr); + + free(trystr); + } + + /* reset color coords */ + for (i = 0; i < out->num_xforms; i++) { + out->xform[i].color = i&1; + } + + /* Potentially genetically cross the two colormaps together */ + if (flam3_random_isaac_01(rc) < 0.4) { + + /* Select the starting parent */ + int startParent=flam3_random_isaac_bit(rc); + int ci; + + add_to_action(action," cmap_cross"); + sprintf(ministr," %d:",startParent); + add_to_action(action,ministr); + + /* Loop over the entries, switching to the other parent 1% of the time */ + for (ci=0;ci<256;ci++) { + if (flam3_random_isaac_01(rc)<.01) { + startParent = 1-startParent; + sprintf(ministr," %d",ci); + add_to_action(action,ministr); + } + + out->palette[ci] = startParent ? cp1->palette[ci]: cp0->palette[ci]; + } + } + +} + +void flam3_mutate(flam3_genome *cp, int mutate_mode, int *ivars, int ivars_n, int sym, double speed, randctx *rc, char *action) { + + double randselect; + flam3_genome mutation; + int i,j,done; + char ministr[30]; + + /* If mutate_mode = -1, choose a random mutation mode */ + if (mutate_mode == MUTATE_NOT_SPECIFIED) { + + randselect = flam3_random_isaac_01(rc); + + if (randselect < 0.1) + mutate_mode = MUTATE_ALL_VARIATIONS; + else if (randselect < 0.3) + mutate_mode = MUTATE_ONE_XFORM_COEFS; + else if (randselect < 0.5) + mutate_mode = MUTATE_ADD_SYMMETRY; + else if (randselect < 0.6) + mutate_mode = MUTATE_POST_XFORMS; + else if (randselect < 0.7) + mutate_mode = MUTATE_COLOR_PALETTE; + else if (randselect < 0.8) + mutate_mode = MUTATE_DELETE_XFORM; + else + mutate_mode = MUTATE_ALL_COEFS; + + } + + memset(&mutation, 0, sizeof(flam3_genome)); + + if (mutate_mode == MUTATE_ALL_VARIATIONS) { + + add_to_action(action,"mutate all variations"); + + do { + /* Create a random flame, and use the variations */ + /* to replace those in the original */ + flam3_random(&mutation, ivars, ivars_n, sym, cp->num_xforms); + for (i = 0; i < cp->num_xforms; i++) { + for (j = 0; j < flam3_nvariations; j++) { + if (cp->xform[i].var[j] != mutation.xform[i].var[j]) { + + /* Copy the new var weights */ + cp->xform[i].var[j] = mutation.xform[i].var[j]; + + /* Copy parameters for this variation only */ + flam3_copy_params(&(cp->xform[i]),&(mutation.xform[i]),j); + + done = 1; + } + } + } + } while (!done); + + } else if (mutate_mode == MUTATE_ONE_XFORM_COEFS) { + + int modxf; + + /* Generate a 2-xform random */ + flam3_random(&mutation, ivars, ivars_n, sym, 2); + + /* Which xform do we mutate? */ + modxf = ((unsigned)irand(rc)) % cp->num_xforms; + + add_to_action(action,"mutate xform "); + sprintf(ministr,"%d coefs",modxf); + add_to_action(action,ministr); + + /* if less than 3 xforms, then change only the translation part */ + if (2 >= cp->num_xforms) { + for (j = 0; j < 2; j++) + cp->xform[modxf].c[2][j] = mutation.xform[0].c[2][j]; + } else { + for (i = 0; i < 3; i++) + for (j = 0; j < 2; j++) + cp->xform[modxf].c[i][j] = mutation.xform[0].c[i][j]; + } + + } else if (mutate_mode == MUTATE_ADD_SYMMETRY) { + + add_to_action(action,"mutate symmetry"); + flam3_add_symmetry(cp, 0); + + } else if (mutate_mode == MUTATE_POST_XFORMS) { + + int b = 1 + ((unsigned)irand(rc))%6; + int same = ((unsigned)irand(rc))&3; /* 25% chance of using the same post for all of them */ + + sprintf(ministr,"(%d%s)",b,(same>0) ? " same" : ""); + add_to_action(action,"mutate post xforms "); + add_to_action(action,ministr); + for (i = 0; i < cp->num_xforms; i++) { + int copy = (i > 0) && same; + + if (copy) { /* Copy the post from the first xform to the rest of them */ + for (j = 0; j < 3; j++) { + cp->xform[i].post[j][0] = cp->xform[0].post[j][0]; + cp->xform[i].post[j][1] = cp->xform[0].post[j][1]; + } + + } else { + + if (b&1) { /* 50% chance */ + + double f = M_PI * flam3_random_isaac_11(rc); + double t[2][2]; + + t[0][0] = (cp->xform[i].c[0][0] * cos(f) + cp->xform[i].c[0][1] * -sin(f)); + t[0][1] = (cp->xform[i].c[0][0] * sin(f) + cp->xform[i].c[0][1] * cos(f)); + t[1][0] = (cp->xform[i].c[1][0] * cos(f) + cp->xform[i].c[1][1] * -sin(f)); + t[1][1] = (cp->xform[i].c[1][0] * sin(f) + cp->xform[i].c[1][1] * cos(f)); + + cp->xform[i].c[0][0] = t[0][0]; + cp->xform[i].c[0][1] = t[0][1]; + cp->xform[i].c[1][0] = t[1][0]; + cp->xform[i].c[1][1] = t[1][1]; + + f *= -1.0; + + t[0][0] = (cp->xform[i].post[0][0] * cos(f) + cp->xform[i].post[0][1] * -sin(f)); + t[0][1] = (cp->xform[i].post[0][0] * sin(f) + cp->xform[i].post[0][1] * cos(f)); + t[1][0] = (cp->xform[i].post[1][0] * cos(f) + cp->xform[i].post[1][1] * -sin(f)); + t[1][1] = (cp->xform[i].post[1][0] * sin(f) + cp->xform[i].post[1][1] * cos(f)); + + cp->xform[i].post[0][0] = t[0][0]; + cp->xform[i].post[0][1] = t[0][1]; + cp->xform[i].post[1][0] = t[1][0]; + cp->xform[i].post[1][1] = t[1][1]; + + } + + if (b&2) { /* 33% chance */ + + double f = 0.2 + flam3_random_isaac_01(rc); + double g = 0.2 + flam3_random_isaac_01(rc); + + if (flam3_random_isaac_bit(rc)) + f = 1.0 / f; + + if (flam3_random_isaac_bit(rc)) + g = f; + else { + if (flam3_random_isaac_bit(rc)) + g = 1.0 / g; + } + + cp->xform[i].c[0][0] /= f; + cp->xform[i].c[0][1] /= f; + cp->xform[i].c[1][1] /= g; + cp->xform[i].c[1][0] /= g; + cp->xform[i].post[0][0] *= f; + cp->xform[i].post[1][0] *= f; + cp->xform[i].post[0][1] *= g; + cp->xform[i].post[1][1] *= g; + } + + if (b&4) { /* 16% chance */ + + double f = flam3_random_isaac_11(rc); + double g = flam3_random_isaac_11(rc); + + cp->xform[i].c[2][0] -= f; + cp->xform[i].c[2][1] -= g; + cp->xform[i].post[2][0] += f; + cp->xform[i].post[2][1] += g; + } + } + } + } else if (mutate_mode == MUTATE_COLOR_PALETTE) { + + double s = flam3_random_isaac_01(rc); + + if (s < 0.4) { /* randomize xform color coords */ + + flam3_improve_colors(cp, 100, 0, 10); + add_to_action(action,"mutate color coords"); + + } else if (s < 0.8) { /* randomize xform color coords and palette */ + + flam3_improve_colors(cp, 25, 1, 10); + add_to_action(action,"mutate color all"); + + } else { /* randomize palette only */ + + cp->palette_index = flam3_get_palette(flam3_palette_random, cp->palette, cp->hue_rotation); + add_to_action(action,"mutate color palette"); + + } + } else if (mutate_mode == MUTATE_DELETE_XFORM) { + + int nx = ((unsigned)irand(rc))%cp->num_xforms; + sprintf(ministr,"%d",nx); + add_to_action(action,"mutate delete xform "); + add_to_action(action,ministr); + + if (cp->num_xforms > 1) + flam3_delete_xform(cp,nx); + + } else { /* MUTATE_ALL_COEFS */ + + int x; + add_to_action(action,"mutate all coefs"); + flam3_random(&mutation, ivars, ivars_n, sym, cp->num_xforms); + + /* change all the coefs by a fraction of the random */ + for (x = 0; x < cp->num_xforms; x++) { + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + cp->xform[x].c[i][j] += speed * mutation.xform[x].c[i][j]; + + } + } + /* Eventually, we can mutate the parametric variation coefs here. */ + } + } + + clear_cp(&mutation,flam3_defaults_on); + +} + +static int random_var() { + return random() % flam3_nvariations; +} + +static int random_varn(int n) { + return random() % n; +} + +void flam3_random(flam3_genome *cp, int *ivars, int ivars_n, int sym, int spec_xforms) { + + int i, j, nxforms, var, samed, multid, samepost, postid, addfinal=0; + int finum = -1; + int n; + char *ai; + int f27 = argi("flam27",0); + int mvar = f27 ? 54 : flam3_nvariations; + double sum; + + static int xform_distrib[] = { + 2, 2, 2, 2, + 3, 3, 3, 3, + 4, 4, 4, + 5, 5, + 6 + }; + + clear_cp(cp,flam3_defaults_on); + + cp->hue_rotation = (random()&7) ? 0.0 : flam3_random01(); + cp->palette_index = flam3_get_palette(flam3_palette_random, cp->palette, cp->hue_rotation); + cp->time = 0.0; + cp->interpolation = flam3_interpolation_linear; + cp->palette_interpolation = flam3_palette_interpolation_hsv; + + /* Choose the number of xforms */ + if (spec_xforms>0) { + nxforms = spec_xforms; + flam3_add_xforms(cp,nxforms,0,0); + } else { + nxforms = random_distrib(xform_distrib); + flam3_add_xforms(cp,nxforms,0,0); + /* Add a final xform 15% of the time */ + addfinal = flam3_random01() < 0.15; + if (addfinal) { + flam3_add_xforms(cp,1,0,1); + nxforms = nxforms + addfinal; + finum = nxforms-1; + } + } + + /* If first input variation is 'flam3_variation_random' */ + /* choose one to use or decide to use multiple */ + if (flam3_variation_random == ivars[0]) { + if (flam3_random_bit()) { + var = random_varn(mvar); + } else { + var = flam3_variation_random; + } + } else { + var = flam3_variation_random_fromspecified; + } + + samed = flam3_random_bit(); + multid = flam3_random_bit(); + postid = flam3_random01() < 0.6; + samepost = flam3_random_bit(); + + /* Loop over xforms */ + for (i = 0; i < nxforms; i++) { + int j, k; + cp->xform[i].density = 1.0 / nxforms; + cp->xform[i].color = i&1; + cp->xform[i].color_speed = 0.5; + cp->xform[i].animate = 1.0; + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + cp->xform[i].c[j][k] = flam3_random11(); + cp->xform[i].post[j][k] = (double)(k==j); + } + } + + if ( i != finum ) { + + if (!postid) { + + for (j = 0; j < 3; j++) + for (k = 0; k < 2; k++) { + if (samepost || (i==0)) + cp->xform[i].post[j][k] = flam3_random11(); + else + cp->xform[i].post[j][k] = cp->xform[0].post[j][k]; + } + } + + /* Clear all variation coefs */ + for (j = 0; j < flam3_nvariations; j++) + cp->xform[i].var[j] = 0.0; + + if (flam3_variation_random != var && + flam3_variation_random_fromspecified != var) { + + /* Use only one variation specified for all xforms */ + cp->xform[i].var[var] = 1.0; + + } else if (multid && flam3_variation_random == var) { + + /* Choose a random var for this xform */ + cp->xform[i].var[random_varn(mvar)] = 1.0; + + } else { + + if (samed && i > 0) { + + /* Copy the same variations from the previous xform */ + for (j = 0; j < flam3_nvariations; j++) { + cp->xform[i].var[j] = cp->xform[i-1].var[j]; + flam3_copy_params(&(cp->xform[i]),&(cp->xform[i-1]),j); + } + + } else { + + /* Choose a random number of vars to use, at least 2 */ + /* but less than flam3_nvariations.Probability leans */ + /* towards fewer variations. */ + n = 2; + while ((flam3_random_bit()) && (nxform[i].var[random_varn(mvar)] = flam3_random01(); + else + cp->xform[i].var[ivars[random_varn(ivars_n)]] = flam3_random01(); + } + + /* Normalize weights to 1.0 total. */ + sum = 0.0; + for (j = 0; j < flam3_nvariations; j++) + sum += cp->xform[i].var[j]; + if (sum == 0.0) + cp->xform[i].var[random_var()] = 1.0; + else { + for (j = 0; j < flam3_nvariations; j++) + cp->xform[i].var[j] /= sum; + } + } + } + } else { + /* Handle final xform randomness. */ + n = 1; + if (flam3_random_bit()) n++; + + /* Randomly choose n variations, and change their weights. */ + /* A var can be selected more than once, further reducing */ + /* the probability that multiple vars are used. */ + for (j = 0; j < n; j++) { + if (flam3_variation_random_fromspecified != var) + cp->xform[i].var[random_varn(mvar)] = flam3_random01(); + else + cp->xform[i].var[ivars[random_varn(ivars_n)]] = flam3_random01(); + } + + /* Normalize weights to 1.0 total. */ + sum = 0.0; + for (j = 0; j < flam3_nvariations; j++) + sum += cp->xform[i].var[j]; + if (sum == 0.0) + cp->xform[i].var[random_var()] = 1.0; + else { + for (j = 0; j < flam3_nvariations; j++) + cp->xform[i].var[j] /= sum; + } + } + + /* Generate random params for parametric variations, if selected. */ + if (cp->xform[i].var[VAR_BLOB] > 0) { + /* Create random params for blob */ + cp->xform[i].blob_low = 0.2 + 0.5 * flam3_random01(); + cp->xform[i].blob_high = 0.8 + 0.4 * flam3_random01(); + cp->xform[i].blob_waves = (int)(2 + 5 * flam3_random01()); + } + + if (cp->xform[i].var[VAR_PDJ] > 0) { + /* Create random params for PDJ */ + cp->xform[i].pdj_a = 3.0 * flam3_random11(); + cp->xform[i].pdj_b = 3.0 * flam3_random11(); + cp->xform[i].pdj_c = 3.0 * flam3_random11(); + cp->xform[i].pdj_d = 3.0 * flam3_random11(); + } + + if (cp->xform[i].var[VAR_FAN2] > 0) { + /* Create random params for fan2 */ + cp->xform[i].fan2_x = flam3_random11(); + cp->xform[i].fan2_y = flam3_random11(); + } + + if (cp->xform[i].var[VAR_RINGS2] > 0) { + /* Create random params for rings2 */ + cp->xform[i].rings2_val = 2*flam3_random01(); + } + + if (cp->xform[i].var[VAR_PERSPECTIVE] > 0) { + + /* Create random params for perspective */ + cp->xform[i].perspective_angle = flam3_random01(); + cp->xform[i].perspective_dist = 2*flam3_random01() + 1.0; + + } + + if (cp->xform[i].var[VAR_JULIAN] > 0) { + + /* Create random params for julian */ + cp->xform[i].julian_power = (int)(5*flam3_random01() + 2); + cp->xform[i].julian_dist = 1.0; + + } + + if (cp->xform[i].var[VAR_JULIASCOPE] > 0) { + + /* Create random params for juliaScope */ + cp->xform[i].juliascope_power = (int)(5*flam3_random01() + 2); + cp->xform[i].juliascope_dist = 1.0; + + } + + if (cp->xform[i].var[VAR_RADIAL_BLUR] > 0) { + + /* Create random params for radialBlur */ + cp->xform[i].radial_blur_angle = (2 * flam3_random01() - 1); + + } + + if (cp->xform[i].var[VAR_PIE] > 0) { + /* Create random params for pie */ + cp->xform[i].pie_slices = (int) 10.0*flam3_random01(); + cp->xform[i].pie_thickness = flam3_random01(); + cp->xform[i].pie_rotation = 2.0 * M_PI * flam3_random11(); + } + + if (cp->xform[i].var[VAR_NGON] > 0) { + /* Create random params for ngon */ + cp->xform[i].ngon_sides = (int) flam3_random01()* 10 + 3; + cp->xform[i].ngon_power = 3*flam3_random01() + 1; + cp->xform[i].ngon_circle = 3*flam3_random01(); + cp->xform[i].ngon_corners = 2*flam3_random01()*cp->xform[i].ngon_circle; + } + + if (cp->xform[i].var[VAR_CURL] > 0) { + /* Create random params for curl */ + cp->xform[i].curl_c1 = flam3_random01(); + cp->xform[i].curl_c2 = flam3_random01(); + } + + if (cp->xform[i].var[VAR_RECTANGLES] > 0) { + /* Create random params for rectangles */ + cp->xform[i].rectangles_x = flam3_random01(); + cp->xform[i].rectangles_y = flam3_random01(); + } + + if (cp->xform[i].var[VAR_DISC2] > 0) { + /* Create random params for disc2 */ + cp->xform[i].disc2_rot = 0.5 * flam3_random01(); + cp->xform[i].disc2_twist = 0.5 * flam3_random01(); + + } + + if (cp->xform[i].var[VAR_SUPER_SHAPE] > 0) { + /* Create random params for supershape */ + cp->xform[i].super_shape_rnd = flam3_random01(); + cp->xform[i].super_shape_m = (int) flam3_random01()*6; + cp->xform[i].super_shape_n1 = flam3_random01()*40; + cp->xform[i].super_shape_n2 = flam3_random01()*20; + cp->xform[i].super_shape_n3 = cp->xform[i].super_shape_n2; + cp->xform[i].super_shape_holes = 0.0; + } + + if (cp->xform[i].var[VAR_FLOWER] > 0) { + /* Create random params for flower */ + cp->xform[i].flower_petals = 4 * flam3_random01(); + cp->xform[i].flower_holes = flam3_random01(); + } + + if (cp->xform[i].var[VAR_CONIC] > 0) { + /* Create random params for conic */ + cp->xform[i].conic_eccentricity = flam3_random01(); + cp->xform[i].conic_holes = flam3_random01(); + } + + if (cp->xform[i].var[VAR_PARABOLA] > 0) { + /* Create random params for parabola */ + cp->xform[i].parabola_height = 0.5 + flam3_random01(); + cp->xform[i].parabola_width = 0.5 + flam3_random01(); + } + + if (cp->xform[i].var[VAR_BENT2] > 0) { + /* Create random params for bent2 */ + cp->xform[i].bent2_x = 3*(-0.5 + flam3_random01()); + cp->xform[i].bent2_y = 3*(-0.5 + flam3_random01()); + } + + if (cp->xform[i].var[VAR_BIPOLAR] > 0) { + /* Create random params for bipolar */ + cp->xform[i].bipolar_shift = 2.0 * flam3_random01() - 1; + } + + if (cp->xform[i].var[VAR_CELL] > 0) { + /* Create random params for cell */ + cp->xform[i].cell_size = 2.0 * flam3_random01() + 0.5; + } + + if (cp->xform[i].var[VAR_CPOW] > 0) { + /* Create random params for cpow */ + cp->xform[i].cpow_r = 3.0 * flam3_random01(); + cp->xform[i].cpow_i = flam3_random01() - 0.5; + cp->xform[i].cpow_power = (int)(5.0 * flam3_random01()); + } + + if (cp->xform[i].var[VAR_CURVE] > 0) { + /* Create random params for curve */ + cp->xform[i].curve_xamp = 5 * (flam3_random01()-.5); + cp->xform[i].curve_yamp = 4 * (flam3_random01()-.5); + cp->xform[i].curve_xlength = 2 * (flam3_random01()+.5); + cp->xform[i].curve_ylength = 2 * (flam3_random01()+.5); + } + + if (cp->xform[i].var[VAR_ESCHER] > 0) { + /* Create random params for escher */ + cp->xform[i].escher_beta = M_PI * flam3_random11(); + } + + if (cp->xform[i].var[VAR_LAZYSUSAN] > 0) { + /* Create random params for lazysusan */ + cp->xform[i].lazysusan_x = 2.0*flam3_random11(); + cp->xform[i].lazysusan_y = 2.0*flam3_random11(); + cp->xform[i].lazysusan_spin = M_PI*flam3_random11(); + cp->xform[i].lazysusan_space = 2.0*flam3_random11(); + cp->xform[i].lazysusan_twist = 2.0*flam3_random11(); + } + + if (cp->xform[i].var[VAR_MODULUS] > 0) { + /* Create random params for modulus */ + cp->xform[i].modulus_x = flam3_random11(); + cp->xform[i].modulus_y = flam3_random11(); + } + + if (cp->xform[i].var[VAR_OSCILLOSCOPE] > 0) { + /* Create random params for oscope */ + cp->xform[i].oscope_separation = 1.0 + flam3_random11(); + cp->xform[i].oscope_frequency = M_PI * flam3_random11(); + cp->xform[i].oscope_amplitude = 1.0 + 2 * flam3_random01(); + cp->xform[i].oscope_damping = flam3_random01(); + } + + if (cp->xform[i].var[VAR_POPCORN2] > 0) { + /* Create random params for popcorn2 */ + cp->xform[i].popcorn2_x = 0.2 * flam3_random01(); + cp->xform[i].popcorn2_y = 0.2 * flam3_random01(); + cp->xform[i].popcorn2_c = 5 * flam3_random01(); + } + + if (cp->xform[i].var[VAR_SEPARATION] > 0) { + /* Create random params for separation */ + cp->xform[i].separation_x = 1 + flam3_random11(); + cp->xform[i].separation_y = 1 + flam3_random11(); + cp->xform[i].separation_xinside = flam3_random11(); + cp->xform[i].separation_yinside = flam3_random11(); + } + + if (cp->xform[i].var[VAR_SPLIT] > 0) { + /* Create random params for split */ + cp->xform[i].split_xsize = flam3_random11(); + cp->xform[i].split_ysize = flam3_random11(); + } + + if (cp->xform[i].var[VAR_SPLITS] > 0) { + /* Create random params for splits */ + cp->xform[i].splits_x = flam3_random11(); + cp->xform[i].splits_y = flam3_random11(); + } + + if (cp->xform[i].var[VAR_STRIPES] > 0) { + /* Create random params for stripes */ + cp->xform[i].stripes_space = flam3_random01(); + cp->xform[i].stripes_warp = 5*flam3_random01(); + } + + if (cp->xform[i].var[VAR_WEDGE] > 0) { + /* Create random params for wedge */ + cp->xform[i].wedge_angle = M_PI*flam3_random01(); + cp->xform[i].wedge_hole = 0.5*flam3_random11(); + cp->xform[i].wedge_count = floor(5*flam3_random01())+1; + cp->xform[i].wedge_swirl = flam3_random01(); + } + + if (cp->xform[i].var[VAR_WEDGE_JULIA] > 0) { + + /* Create random params for wedge_julia */ + cp->xform[i].wedge_julia_power = (int)(5*flam3_random01() + 2); + cp->xform[i].wedge_julia_dist = 1.0; + cp->xform[i].wedge_julia_count = (int)(3*flam3_random01() + 1); + cp->xform[i].wedge_julia_angle = M_PI * flam3_random01(); + + } + + if (cp->xform[i].var[VAR_WEDGE_SPH] > 0) { + /* Create random params for wedge_sph */ + cp->xform[i].wedge_sph_angle = M_PI*flam3_random01(); + cp->xform[i].wedge_sph_hole = 0.5*flam3_random11(); + cp->xform[i].wedge_sph_count = floor(5*flam3_random01())+1; + cp->xform[i].wedge_sph_swirl = flam3_random01(); + } + + if (cp->xform[i].var[VAR_WHORL] > 0) { + /* Create random params for whorl */ + cp->xform[i].whorl_inside = flam3_random01(); + cp->xform[i].whorl_outside = flam3_random01(); + } + + if (cp->xform[i].var[VAR_WAVES2] > 0) { + /* Create random params for waves2 */ + cp->xform[i].waves2_scalex = 0.5 + flam3_random01(); + cp->xform[i].waves2_scaley = 0.5 + flam3_random01(); + cp->xform[i].waves2_freqx = 4 * flam3_random01(); + cp->xform[i].waves2_freqy = 4 * flam3_random01(); + } + + if (cp->xform[i].var[VAR_AUGER] > 0) { + /* Create random params for auger */ + cp->xform[i].auger_sym = 0; + cp->xform[i].auger_weight = 0.5 + flam3_random01()/2.0; + cp->xform[i].auger_freq = floor(5*flam3_random01())+1; + cp->xform[i].auger_scale = flam3_random01(); + } + + } + + /* Randomly add symmetry (but not if we've already added a final xform) */ + if (sym || (!(random()%4) && !addfinal)) + flam3_add_symmetry(cp, sym); + else + cp->symmetry = 0; + + //qsort((char *) cp->xform, (cp->num_xforms-addfinal), sizeof(flam3_xform), compare_xforms); + + +} + + +static int sort_by_x(const void *av, const void *bv) { + double *a = (double *) av; + double *b = (double *) bv; + if (a[0] < b[0]) return -1; + if (a[0] > b[0]) return 1; + return 0; +} + +static int sort_by_y(const void *av, const void *bv) { + double *a = (double *) av; + double *b = (double *) bv; + if (a[1] < b[1]) return -1; + if (a[1] > b[1]) return 1; + return 0; +} + + +/* Memory helper functions because + + Python on Windows uses the MSVCR71.dll version of the C Runtime and + mingw uses the MSVCRT.dll version. */ + +void *flam3_malloc(size_t size) { + + return (malloc(size)); + +} + +void flam3_free(void *ptr) { + + free(ptr); + +} + +/* + * find a 2d bounding box that does not enclose eps of the fractal density + * in each compass direction. + */ +int flam3_estimate_bounding_box(flam3_genome *cp, double eps, int nsamples, + double *bmin, double *bmax, randctx *rc) { + int i; + int low_target, high_target; + double min[2], max[2]; + double *points; + int bv; + unsigned short *xform_distrib; + + if (nsamples <= 0) nsamples = 10000; + + points = (double *) malloc(sizeof(double) * 4 * nsamples); + points[0] = flam3_random_isaac_11(rc); + points[1] = flam3_random_isaac_11(rc); + points[2] = 0.0; + points[3] = 0.0; + + if (prepare_xform_fn_ptrs(cp,rc)) + return(-1); + xform_distrib = flam3_create_xform_distrib(cp); + if (xform_distrib==NULL) + return(-1); + bv=flam3_iterate(cp, nsamples, 20, points, xform_distrib, rc); + free(xform_distrib); + + if ( bv/(double)nsamples > eps ) + eps = 3*bv/(double)nsamples; + + if ( eps > 0.3 ) + eps = 0.3; + + low_target = (int)(nsamples * eps); + high_target = nsamples - low_target; + + + min[0] = min[1] = 1e10; + max[0] = max[1] = -1e10; + + for (i = 0; i < nsamples; i++) { + double *p = &points[4*i]; + if (p[0] < min[0]) min[0] = p[0]; + if (p[1] < min[1]) min[1] = p[1]; + if (p[0] > max[0]) max[0] = p[0]; + if (p[1] > max[1]) max[1] = p[1]; + } + + if (low_target == 0) { + bmin[0] = min[0]; + bmin[1] = min[1]; + bmax[0] = max[0]; + bmax[1] = max[1]; + free(points); + return(bv); + } + + qsort(points, nsamples, sizeof(double) * 4, sort_by_x); + bmin[0] = points[4 * low_target]; + bmax[0] = points[4 * high_target]; + + qsort(points, nsamples, sizeof(double) * 4, sort_by_y); + bmin[1] = points[4 * low_target + 1]; + bmax[1] = points[4 * high_target + 1]; + free(points); + + return(bv); +} + + +typedef double bucket_double[5]; +typedef double abucket_double[4]; +typedef unsigned int bucket_int[5]; +typedef unsigned int abucket_int[4]; +typedef float bucket_float[5]; +typedef float abucket_float[4]; + +#ifdef HAVE_GCC_64BIT_ATOMIC_OPS +static inline void +double_atomic_add(double *dest, double delta) +{ + uint64_t *int_ptr = (uint64_t *)dest; + union { + double dblval; + uint64_t intval; + } old_val, new_val; + int success; + + do { + old_val.dblval = *dest; + new_val.dblval = old_val.dblval + delta; + success = __sync_bool_compare_and_swap( + int_ptr, old_val.intval, new_val.intval); + } while (!success); +} +#endif /* HAVE_GCC_64BIT_ATOMIC_OPS */ + +#ifdef HAVE_GCC_ATOMIC_OPS +static inline void +float_atomic_add(float *dest, float delta) +{ + uint32_t *int_ptr = (uint32_t *)dest; + union { + float fltval; + uint32_t intval; + } old_val, new_val; + int success; + + do { + old_val.fltval = *dest; + new_val.fltval = old_val.fltval + delta; + success = __sync_bool_compare_and_swap( + int_ptr, old_val.intval, new_val.intval); + } while (!success); +} + +static inline void +uint_atomic_add(unsigned int *dest, unsigned int delta) +{ + unsigned int old_val, new_val; + int success; + + do { + old_val = *dest; + if (UINT_MAX - old_val > delta) + new_val = old_val + delta; + else + new_val = UINT_MAX; + success = __sync_bool_compare_and_swap( + dest, old_val, new_val); + } while (!success); +} + +static inline void +ushort_atomic_add(unsigned short *dest, unsigned short delta) +{ + unsigned short old_val, new_val; + int success; + + do { + old_val = *dest; + if (USHRT_MAX - old_val > delta) + new_val = old_val + delta; + else + new_val = USHRT_MAX; + success = __sync_bool_compare_and_swap( + dest, old_val, new_val); + } while (!success); +} +#endif /* HAVE_GCC_ATOMIC_OPS */ + +/* 64-bit datatypes */ +#define bucket bucket_double +#define abucket abucket_double +#define abump_no_overflow(dest, delta) do {dest += delta;} while (0) +#define add_c_to_accum(acc,i,ii,j,jj,wid,hgt,c) do { \ + if ( (j) + (jj) >=0 && (j) + (jj) < (hgt) && (i) + (ii) >=0 && (i) + (ii) < (wid)) { \ + abucket *a = (acc) + ( (i) + (ii) ) + ( (j) + (jj) ) * (wid); \ + abump_no_overflow(a[0][0],(c)[0]); \ + abump_no_overflow(a[0][1],(c)[1]); \ + abump_no_overflow(a[0][2],(c)[2]); \ + abump_no_overflow(a[0][3],(c)[3]); \ + } \ +} while (0) +/* single-threaded */ +#define USE_LOCKS +#define bump_no_overflow(dest, delta) do {dest += delta;} while (0) +#define render_rectangle render_rectangle_double +#define iter_thread iter_thread_double +#define de_thread_helper de_thread_helper_64 +#define de_thread de_thread_64 +#include "rect.c" +#ifdef HAVE_GCC_64BIT_ATOMIC_OPS + /* multi-threaded */ + #undef USE_LOCKS + #undef bump_no_overflow + #undef render_rectangle + #undef iter_thread + #undef de_thread_helper + #undef de_thread + #define bump_no_overflow(dest, delta) double_atomic_add(&dest, delta) + #define render_rectangle render_rectangle_double_mt + #define iter_thread iter_thread_double_mt + #define de_thread_helper de_thread_helper_64_mt + #define de_thread de_thread_64_mt + #include "rect.c" +#else /* !HAVE_GCC_64BIT_ATOMIC_OPS */ + #define render_rectangle_double_mt render_rectangle_double +#endif /* HAVE_GCC_64BIT_ATOMIC_OPS */ +#undef render_rectangle +#undef iter_thread +#undef add_c_to_accum +#undef bucket +#undef abucket +#undef bump_no_overflow +#undef abump_no_overflow +#undef de_thread_helper +#undef de_thread + +/* 32-bit datatypes */ +#define bucket bucket_int +#define abucket abucket_int +#define abump_no_overflow(dest, delta) do { \ + if (UINT_MAX - dest > delta) dest += delta; else dest = UINT_MAX; \ +} while (0) +#define add_c_to_accum(acc,i,ii,j,jj,wid,hgt,c) do { \ + if ( (j) + (jj) >=0 && (j) + (jj) < (hgt) && (i) + (ii) >=0 && (i) + (ii) < (wid)) { \ + abucket *a = (acc) + ( (i) + (ii) ) + ( (j) + (jj) ) * (wid); \ + abump_no_overflow(a[0][0],(c)[0]); \ + abump_no_overflow(a[0][1],(c)[1]); \ + abump_no_overflow(a[0][2],(c)[2]); \ + abump_no_overflow(a[0][3],(c)[3]); \ + } \ +} while (0) +/* single-threaded */ +#define USE_LOCKS +#define bump_no_overflow(dest, delta) do { \ + if (UINT_MAX - dest > delta) dest += delta; else dest = UINT_MAX; \ +} while (0) +#define render_rectangle render_rectangle_int +#define iter_thread iter_thread_int +#define de_thread_helper de_thread_helper_32 +#define de_thread de_thread_32 +#include "rect.c" +#ifdef HAVE_GCC_ATOMIC_OPS + /* multi-threaded */ + #undef USE_LOCKS + #undef bump_no_overflow + #undef render_rectangle + #undef iter_thread + #undef de_thread_helper + #undef de_thread + #define bump_no_overflow(dest, delta) uint_atomic_add(&dest, delta) + #define render_rectangle render_rectangle_int_mt + #define iter_thread iter_thread_int_mt + #define de_thread_helper de_thread_helper_32_mt + #define de_thread de_thread_32_mt + #include "rect.c" +#else /* !HAVE_GCC_ATOMIC_OPS */ + #define render_rectangle_int_mt render_rectangle_int +#endif /* HAVE_GCC_ATOMIC_OPS */ +#undef iter_thread +#undef render_rectangle +#undef add_c_to_accum +#undef bucket +#undef abucket +#undef bump_no_overflow +#undef abump_no_overflow +#undef de_thread_helper +#undef de_thread + +/* experimental 32-bit datatypes (called 33) */ +#define bucket bucket_int +#define abucket abucket_float +#define abump_no_overflow(dest, delta) do {dest += delta;} while (0) +#define add_c_to_accum(acc,i,ii,j,jj,wid,hgt,c) do { \ + if ( (j) + (jj) >=0 && (j) + (jj) < (hgt) && (i) + (ii) >=0 && (i) + (ii) < (wid)) { \ + abucket *a = (acc) + ( (i) + (ii) ) + ( (j) + (jj) ) * (wid); \ + abump_no_overflow(a[0][0],(c)[0]); \ + abump_no_overflow(a[0][1],(c)[1]); \ + abump_no_overflow(a[0][2],(c)[2]); \ + abump_no_overflow(a[0][3],(c)[3]); \ + } \ +} while (0) +/* single-threaded */ +#define USE_LOCKS +#define bump_no_overflow(dest, delta) do { \ + if (UINT_MAX - dest > delta) dest += delta; else dest = UINT_MAX; \ +} while (0) +#define render_rectangle render_rectangle_float +#define iter_thread iter_thread_float +#define de_thread_helper de_thread_helper_33 +#define de_thread de_thread_33 +#include "rect.c" +#ifdef HAVE_GCC_ATOMIC_OPS + /* multi-threaded */ + #undef USE_LOCKS + #undef bump_no_overflow + #undef render_rectangle + #undef iter_thread + #undef de_thread_helper + #undef de_thread + #define bump_no_overflow(dest, delta) uint_atomic_add(&dest, delta) + #define render_rectangle render_rectangle_float_mt + #define iter_thread iter_thread_float_mt + #define de_thread_helper de_thread_helper_33_mt + #define de_thread de_thread_33_mt + #include "rect.c" +#else /* !HAVE_GCC_ATOMIC_OPS */ + #define render_rectangle_float_mt render_rectangle_float +#endif /* HAVE_GCC_ATOMIC_OPS */ +#undef iter_thread +#undef render_rectangle +#undef add_c_to_accum +#undef bucket +#undef abucket +#undef bump_no_overflow +#undef abump_no_overflow +#undef de_thread_helper +#undef de_thread + + +double flam3_render_memory_required(flam3_frame *spec) +{ + flam3_genome *cps = spec->genomes; + int real_bits = spec->bits; + + if (33 == real_bits) real_bits = 32; + + /* note 4 channels * 2 buffers cancels out 8 bits per byte */ + /* does not yet include memory for density estimation filter */ + + return + (double) cps[0].spatial_oversample * cps[0].spatial_oversample * + (double) cps[0].width * cps[0].height * real_bits; +} + +void bits_error(flam3_frame *spec) { + fprintf(stderr, "flam3: bits must be 32, 33, or 64 not %d.\n", + spec->bits); +} + +int flam3_render(flam3_frame *spec, void *out, + int field, int nchan, int trans, stat_struct *stats) { + + int retval; + + if (spec->nthreads <= 2) { + /* single-threaded or 2 threads without atomic operations */ + switch (spec->bits) { + case 32: + retval = render_rectangle_int(spec, out, field, nchan, trans, stats); + return(retval); + case 33: + retval = render_rectangle_float(spec, out, field, nchan, trans, stats); + return(retval); + case 64: + retval = render_rectangle_double(spec, out, field, nchan, trans, stats); + return(retval); + default: + bits_error(spec); + return(1); + } + } else { + /* 3+ threads using atomic ops if available */ + switch (spec->bits) { + case 32: + retval = render_rectangle_int_mt(spec, out, field, nchan, trans, stats); + return(retval); + case 33: + retval = render_rectangle_float_mt(spec, out, field, nchan, trans, stats); + return(retval); + case 64: + retval = render_rectangle_double_mt(spec, out, field, nchan, trans, stats); + return(retval); + default: + bits_error(spec); + return(1); + } + } +} + + +void flam3_srandom() { + unsigned int seed; + char *s = getenv("seed"); + + if (s) + seed = atoi(s); + else + seed = time(0) + getpid(); + + srandom(seed); +} + + +/* correlation dimension, after clint sprott. + computes slope of the correlation sum at a size scale + the order of 2% the size of the attractor or the camera. */ +double flam3_dimension(flam3_genome *cp, int ntries, int clip_to_camera) { + double fd; + double *hist; + double bmin[2]; + double bmax[2]; + double d2max; + int lp; + long int default_isaac_seed = (long int)time(0); + randctx rc; + int SBS = 10000; + int i, n1=0, n2=0, got, nclipped; + + /* Set up the isaac rng */ + for (lp = 0; lp < RANDSIZ; lp++) + rc.randrsl[lp] = default_isaac_seed; + + irandinit(&rc,1); + + if (ntries < 2) ntries = 3000*1000; + + if (clip_to_camera) { + double scale, ppux, corner0, corner1; + scale = pow(2.0, cp->zoom); + ppux = cp->pixels_per_unit * scale; + corner0 = cp->center[0] - cp->width / ppux / 2.0; + corner1 = cp->center[1] - cp->height / ppux / 2.0; + bmin[0] = corner0; + bmin[1] = corner1; + bmax[0] = corner0 + cp->width / ppux; + bmax[1] = corner1 + cp->height / ppux; + } else { + if (flam3_estimate_bounding_box(cp, 0.0, 0, bmin, bmax, &rc)<0) + return(-1.0); + + } + + d2max = + (bmax[0] - bmin[0]) * (bmax[0] - bmin[0]) + + (bmax[1] - bmin[1]) * (bmax[1] - bmin[1]); + + // fprintf(stderr, "d2max=%g %g %g %g %g\n", d2max, + // bmin[0], bmin[1], bmax[0], bmax[1]); + + hist = malloc(2 * ntries * sizeof(double)); + + got = 0; + nclipped = 0; + while (got < 2*ntries) { + double subb[40000]; + int i4, clipped; + unsigned short *xform_distrib; + subb[0] = flam3_random_isaac_11(&rc); + subb[1] = flam3_random_isaac_11(&rc); + subb[2] = 0.0; + subb[3] = 0.0; + if (prepare_xform_fn_ptrs(cp,&rc)) + return(-1.0); + xform_distrib = flam3_create_xform_distrib(cp); + if (xform_distrib==NULL) + return(-1.0); + flam3_iterate(cp, SBS, 20, subb, xform_distrib, &rc); + free(xform_distrib); + i4 = 0; + for (i = 0; i < SBS; i++) { + if (got == 2*ntries) break; + clipped = clip_to_camera && + ((subb[i4] < bmin[0]) || + (subb[i4+1] < bmin[1]) || + (subb[i4] > bmax[0]) || + (subb[i4+1] > bmax[1])); + if (!clipped) { + hist[got] = subb[i4]; + hist[got+1] = subb[i4+1]; + got += 2; + } else { + nclipped++; + if (nclipped > 10 * ntries) { + fprintf(stderr, "warning: too much clipping, " + "flam3_dimension giving up.\n"); + return sqrt(-1.0); + } + } + i4 += 4; + } + } + if (0) + fprintf(stderr, "cliprate=%g\n", nclipped/(ntries+(double)nclipped)); + + for (i = 0; i < ntries; i++) { + int ri; + double dx, dy, d2; + double tx, ty; + + tx = hist[2*i]; + ty = hist[2*i+1]; + + do { + ri = 2 * (random() % ntries); + } while (ri == i); + + dx = hist[ri] - tx; + dy = hist[ri+1] - ty; + d2 = dx*dx + dy*dy; + if (d2 < 0.004 * d2max) n2++; + if (d2 < 0.00004 * d2max) n1++; + } + + fd = 0.434294 * log(n2 / (n1 - 0.5)); + + if (0) + fprintf(stderr, "n1=%d n2=%d\n", n1, n2); + + free(hist); + return fd; +} + +double flam3_lyapunov(flam3_genome *cp, int ntries) { + double p[4]; + double x, y; + double xn, yn; + double xn2, yn2; + double dx, dy, r; + double eps = 1e-5; + int i; + double sum = 0.0; + unsigned short *xform_distrib; + + int lp; + long int default_isaac_seed = (long int)time(0); + randctx rc; + + /* Set up the isaac rng */ + for (lp = 0; lp < RANDSIZ; lp++) + rc.randrsl[lp] = default_isaac_seed; + + irandinit(&rc,1); + + + if (ntries < 1) ntries = 10000; + + for (i = 0; i < ntries; i++) { + x = flam3_random_isaac_11(&rc); + y = flam3_random_isaac_11(&rc); + + p[0] = x; + p[1] = y; + p[2] = 0.0; + p[3] = 0.0; + + // get into the attractor + if (prepare_xform_fn_ptrs(cp,&rc)) + return(-1.0); + xform_distrib = flam3_create_xform_distrib(cp); + if (xform_distrib==NULL) + return(-1.0); + + flam3_iterate(cp, 1, 20+(random()%10), p, xform_distrib, &rc); + free(xform_distrib); + + x = p[0]; + y = p[1]; + + // take one deterministic step + srandom(i); + + if (prepare_xform_fn_ptrs(cp,&rc)) + return(-1.0); + xform_distrib = flam3_create_xform_distrib(cp); + if (xform_distrib==NULL) + return(-1.0); + + flam3_iterate(cp, 1, 0, p, xform_distrib, &rc); + free(xform_distrib); + + xn = p[0]; + yn = p[1]; + + do { + dx = flam3_random_isaac_11(&rc); + dy = flam3_random_isaac_11(&rc); + r = sqrt(dx * dx + dy * dy); + } while (r == 0.0); + dx /= r; + dy /= r; + + dx *= eps; + dy *= eps; + + p[0] = x + dx; + p[1] = y + dy; + p[2] = 0.0; + + // take the same step but with eps + srandom(i); + if (prepare_xform_fn_ptrs(cp,&rc)) + return(-1.0); + xform_distrib = flam3_create_xform_distrib(cp); + if (xform_distrib==NULL) + return(-1.0); + + flam3_iterate(cp, 1, 0, p, xform_distrib, &rc); + free(xform_distrib); + + xn2 = p[0]; + yn2 = p[1]; + + r = sqrt((xn-xn2)*(xn-xn2) + (yn-yn2)*(yn-yn2)); + + sum += log(r/eps); + } + return sum/(log(2.0)*ntries); +} + diff --git a/src/flam3.dsw b/src/flam3.dsw new file mode 100644 index 0000000..ac76a19 --- /dev/null +++ b/src/flam3.dsw @@ -0,0 +1,65 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "anim"=.\anim.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "convert"=.\convert.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "hqi"=.\hqi.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pick"=.\pick.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/src/flam3.h b/src/flam3.h new file mode 100644 index 0000000..7ccb135 --- /dev/null +++ b/src/flam3.h @@ -0,0 +1,657 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#ifndef flam3_included +#define flam3_included + +#include +#include +#include "isaac.h" + +#if defined(_MSC_VER) /* VC++ */ +#include +#define EXPORT __declspec (dllexport) +#else +#define EXPORT +#endif + +EXPORT char *flam3_version(); + +#define flam3_palette_random (-1) +#define flam3_palette_interpolated (-2) + +#define flam3_defaults_on (1) +#define flam3_defaults_off (0) + +#define flam3_name_len 64 + +#define flam3_print_edits (1) +#define flam3_dont_print_edits (0) + +//typedef double flam3_palette[256][3]; +typedef struct { + double index; + double color[4]; +} flam3_palette_entry; + +typedef flam3_palette_entry flam3_palette[256]; + +int flam3_get_palette(int palette_index, flam3_palette p, double hue_rotation); + +#define flam3_variation_random (-1) +#define flam3_variation_random_fromspecified (-2) + +extern char *flam3_variation_names[]; + +#define flam3_nvariations 97 +#define flam3_nxforms 12 + +#define flam3_parent_fn_len 30 + +#define flam3_interpolation_linear 0 +#define flam3_interpolation_smooth 1 + +#define flam3_inttype_linear 0 +#define flam3_inttype_log 1 +#define flam3_inttype_compat 2 /* Linear and old behaviour */ +#define flam3_inttype_older 3 /* rotate padded xforms */ + +#define flam3_palette_interpolation_hsv 0 +#define flam3_palette_interpolation_sweep 1 + +#define flam3_max_action_length 10000 + +#define flam3_palette_mode_step 0 +#define flam3_palette_mode_linear 1 + +#define VAR_LINEAR 0 +#define VAR_SINUSOIDAL 1 +#define VAR_SPHERICAL 2 +#define VAR_SWIRL 3 +#define VAR_HORSESHOE 4 +#define VAR_POLAR 5 +#define VAR_HANDKERCHIEF 6 +#define VAR_HEART 7 +#define VAR_DISC 8 +#define VAR_SPIRAL 9 +#define VAR_HYPERBOLIC 10 +#define VAR_DIAMOND 11 +#define VAR_EX 12 +#define VAR_JULIA 13 +#define VAR_BENT 14 +#define VAR_WAVES 15 +#define VAR_FISHEYE 16 +#define VAR_POPCORN 17 +#define VAR_EXPONENTIAL 18 +#define VAR_POWER 19 +#define VAR_COSINE 20 +#define VAR_RINGS 21 +#define VAR_FAN 22 +#define VAR_BLOB 23 +#define VAR_PDJ 24 +#define VAR_FAN2 25 +#define VAR_RINGS2 26 +#define VAR_EYEFISH 27 +#define VAR_BUBBLE 28 +#define VAR_CYLINDER 29 +#define VAR_PERSPECTIVE 30 +#define VAR_NOISE 31 +#define VAR_JULIAN 32 +#define VAR_JULIASCOPE 33 +#define VAR_BLUR 34 +#define VAR_GAUSSIAN_BLUR 35 +#define VAR_RADIAL_BLUR 36 +#define VAR_PIE 37 +#define VAR_NGON 38 +#define VAR_CURL 39 +#define VAR_RECTANGLES 40 +#define VAR_ARCH 41 +#define VAR_TANGENT 42 +#define VAR_SQUARE 43 +#define VAR_RAYS 44 +#define VAR_BLADE 45 +#define VAR_SECANT2 46 +#define VAR_TWINTRIAN 47 +#define VAR_CROSS 48 +#define VAR_DISC2 49 +#define VAR_SUPER_SHAPE 50 +#define VAR_FLOWER 51 +#define VAR_CONIC 52 +#define VAR_PARABOLA 53 +#define VAR_BENT2 54 +#define VAR_BIPOLAR 55 +#define VAR_BOARDERS 56 +#define VAR_BUTTERFLY 57 +#define VAR_CELL 58 +#define VAR_CPOW 59 +#define VAR_CURVE 60 +#define VAR_EDISC 61 +#define VAR_ELLIPTIC 62 +#define VAR_ESCHER 63 +#define VAR_FOCI 64 +#define VAR_LAZYSUSAN 65 +#define VAR_LOONIE 66 +#define VAR_PRE_BLUR 67 +#define VAR_MODULUS 68 +#define VAR_OSCILLOSCOPE 69 +#define VAR_POLAR2 70 +#define VAR_POPCORN2 71 +#define VAR_SCRY 72 +#define VAR_SEPARATION 73 +#define VAR_SPLIT 74 +#define VAR_SPLITS 75 +#define VAR_STRIPES 76 +#define VAR_WEDGE 77 +#define VAR_WEDGE_JULIA 78 +#define VAR_WEDGE_SPH 79 +#define VAR_WHORL 80 +#define VAR_WAVES2 81 +#define VAR_EXP 82 +#define VAR_LOG 83 +#define VAR_SIN 84 +#define VAR_COS 85 +#define VAR_TAN 86 +#define VAR_SEC 87 +#define VAR_CSC 88 +#define VAR_COT 89 +#define VAR_SINH 90 +#define VAR_COSH 91 +#define VAR_TANH 92 +#define VAR_SECH 93 +#define VAR_CSCH 94 +#define VAR_COTH 95 +#define VAR_AUGER 96 + +typedef struct { + + double badvals; + long int num_iters; + int render_seconds; + +} stat_struct; + +typedef struct { + + unsigned int width, height; + int version; + int id; + + /* There are 256 levels of gray to work with */ + double intensity_weight[256]; + unsigned int bin_size[256]; + unsigned int bin_offset[256]; + + /* Pointer to newly allocated memory; we will be allocating */ + /* 2*w*h ushorts for this storage. The bin offset will */ + /* provide the starting point for a random selection from */ + /* (bin size) ordered pairs */ + unsigned short *rowcols; + +} flam3_image_store; + + +typedef struct xform { + double var[flam3_nvariations]; /* interp coefs between variations */ + double c[3][2]; /* the coefs to the affine part of the function */ + double post[3][2]; /* the post transform */ + double density; /* probability that this function is chosen. 0 - 1 */ + double color; /* color coords for this function. 0 - 1 */ + double color_speed; /* scaling factor on color added to current iteration */ + double animate; /* whether or not this xform rotates (in sheep) >0 means stationary */ + double opacity; /* 0=invisible, 1=totally visible */ + double vis_adjusted; /* adjusted visibility for better transitions */ + + int padding;/* Set to 1 for padding xforms */ + double wind[2]; /* winding numbers */ + + int precalc_angles_flag; + int precalc_atan_xy_flag; + int precalc_atan_yx_flag; + double has_preblur; + int has_post; + + /* Params for new parameterized variations */ + /* Blob */ + double blob_low; + double blob_high; + double blob_waves; + + /* PDJ */ + double pdj_a; + double pdj_b; + double pdj_c; + double pdj_d; + + /* Fan2 */ + double fan2_x; + double fan2_y; + + /* Rings2 */ + double rings2_val; + + /* Perspective */ + double perspective_angle; + double perspective_dist; + + /* Julia_N */ + double julian_power; + double julian_dist; + + /* Julia_Scope */ + double juliascope_power; + double juliascope_dist; + + /* Radial_Blur */ + double radial_blur_angle; + + /* Pie */ + double pie_slices; + double pie_rotation; + double pie_thickness; + + /* Ngon */ + double ngon_sides; + double ngon_power; + double ngon_circle; + double ngon_corners; + + /* Curl */ + double curl_c1; + double curl_c2; + + /* Rectangles */ + double rectangles_x; + double rectangles_y; + + /* AMW */ + double amw_amp; + + /* Disc 2 */ + double disc2_rot; + double disc2_twist; + + /* Supershape */ + double super_shape_rnd; + double super_shape_m; + double super_shape_n1; + double super_shape_n2; + double super_shape_n3; + double super_shape_holes; + + /* Flower */ + double flower_petals; + double flower_holes; + + /* Conic */ + double conic_eccentricity; + double conic_holes; + + /* Parabola */ + double parabola_height; + double parabola_width; + + /* Bent2 */ + double bent2_x; + double bent2_y; + + /* Bipolar */ + double bipolar_shift; + + /* Cell */ + double cell_size; + + /* Cpow */ + double cpow_r; + double cpow_i; + double cpow_power; /* int in apo */ + + /* Curve */ + double curve_xamp,curve_yamp; + double curve_xlength,curve_ylength; + + /* Escher */ + double escher_beta; + + /* Lazysusan */ + double lazysusan_spin; + double lazysusan_space; + double lazysusan_twist; + double lazysusan_x, lazysusan_y; + + /* Modulus */ + double modulus_x, modulus_y; + + /* Oscope */ + double oscope_separation; + double oscope_frequency; + double oscope_amplitude; + double oscope_damping; + + /* Popcorn2 */ + double popcorn2_x, popcorn2_y, popcorn2_c; + + /* Separation */ + double separation_x, separation_xinside; + double separation_y, separation_yinside; + + /* Split */ + double split_xsize; + double split_ysize; + + /* Splits */ + double splits_x,splits_y; + + /* Stripes */ + double stripes_space; + double stripes_warp; + + /* Wedge */ + double wedge_angle, wedge_hole; + double wedge_count, wedge_swirl; + + /* Wedge_Julia */ + double wedge_julia_angle; + double wedge_julia_count; + double wedge_julia_power; + double wedge_julia_dist; + + /* Wedge_Sph */ + double wedge_sph_angle, wedge_sph_count; + double wedge_sph_hole, wedge_sph_swirl; + + /* Whorl */ + double whorl_inside, whorl_outside; + + /* Waves2 */ + double waves2_freqx, waves2_scalex; + double waves2_freqy, waves2_scaley; + + /* Auger */ + double auger_sym, auger_weight; + double auger_freq, auger_scale; + + /* If perspective is used, precalculate these values */ + /* from the _angle and _dist */ + double persp_vsin; + double persp_vfcos; + + /* If Julia_N is used, precalculate these values */ + double julian_rN; + double julian_cn; + + /* If Julia_Scope is used, precalculate these values */ + double juliascope_rN; + double juliascope_cn; + + /* if Wedge_Julia, precalculate */ + double wedgeJulia_rN; + double wedgeJulia_cn; + double wedgeJulia_cf; + + /* If Radial_Blur is used, precalculate these values */ + double radialBlur_spinvar; + double radialBlur_zoomvar; + + /* Precalculate these values for waves */ + double waves_dx2; + double waves_dy2; + + /* If disc2 is used, precalculate these values */ + double disc2_sinadd; + double disc2_cosadd; + double disc2_timespi; + + /* If supershape is used, precalculate these values */ + double super_shape_pm_4; + double super_shape_pneg1_n1; + + int num_active_vars; + double active_var_weights[flam3_nvariations]; + int varFunc[flam3_nvariations]; + + int motion_freq; + int motion_func; + + struct xform *motion; + int num_motion; + + +} flam3_xform; + +typedef struct { + char flame_name[flam3_name_len+1]; /* 64 chars plus a null */ + double time; + int interpolation; + int interpolation_type; + int palette_interpolation; + int num_xforms; + int final_xform_index; + int final_xform_enable; + flam3_xform *xform; + + /* Xaos implementation */ + double **chaos; + int chaos_enable; + + int genome_index; /* index into source file */ + char parent_fname[flam3_parent_fn_len]; /* base filename where parent was located */ + int symmetry; /* 0 means none */ + flam3_palette palette; + char *input_image; /* preview/temporary! */ + int palette_index; + double brightness; /* 1.0 = normal */ + double contrast; /* 1.0 = normal */ + double gamma; + double highlight_power; + int width, height; /* of the final image */ + int spatial_oversample; + double center[2]; /* of camera */ + double rot_center[2]; /* really the center */ + double rotate; /* camera */ + double vibrancy; /* blend between color algs (0=old,1=new) */ + double hue_rotation; /* applies to cmap, 0-1 */ + double background[3]; + double zoom; /* effects ppu, sample density, scale */ + double pixels_per_unit; /* vertically */ + double spatial_filter_radius; /* radius of spatial filter */ + int spatial_filter_select; /* selected spatial filter */ +// double (*spatial_filter_func)(double); /* spatial filter kernel function */ +// double spatial_filter_support; /* size of standard kernel for specific function */ + double sample_density; /* samples per pixel (not bucket) */ + /* in order to motion blur more accurately we compute the logs of the + sample density many times and average the results. */ + /* nbatches is the number of times the buckets are filtered into + the abucket log accumulator */ + /* ntemporal_samples is the number of time steps per batch. this many + interpolated control points are used per batch and accumulated */ + int nbatches; + int ntemporal_samples; + + /* Density estimation parameters for blurring low density hits */ + double estimator; /* Filter width for bin with one hit */ + double estimator_curve; /* Exponent on decay function ( MAX / a^(k-1) ) */ + double estimator_minimum; /* Minimum filter width used - + forces filter to be used of at least this width on all pts */ + + /* XML Edit structure */ + xmlDocPtr edits; + + /* Small-gamma linearization threshold */ + double gam_lin_thresh; + + /* for cmap_interpolated hack */ + int palette_index0; + double hue_rotation0; + int palette_index1; + double hue_rotation1; + double palette_blend; + + int temporal_filter_type; /* Temporal filters */ + double temporal_filter_width, temporal_filter_exp; + + int palette_mode; + + +} flam3_genome; + +typedef struct { + int from; + int to; + double scalar; +} flam3_chaos_entry; + +/* xform manipulation */ + +void flam3_add_motion_element(flam3_xform *xf); +void flam3_add_xforms(flam3_genome *cp, int num_to_add, int interp_padding, int final_flag); +void flam3_delete_xform(flam3_genome *thiscp, int idx_to_delete); +void flam3_copy_xform(flam3_xform *dest, flam3_xform *src); +void flam3_copy(flam3_genome *dest, flam3_genome *src); +void flam3_copyx(flam3_genome *dest, flam3_genome *src, int num_std, int num_final); +void flam3_copy_params(flam3_xform *dest, flam3_xform *src, int varn); +void flam3_delete_motion_elements(flam3_xform *xf); + +EXPORT int flam3_xform_preview(flam3_genome *cp, int xi, double range, int numvals, int depth, double *result, randctx *rc); +EXPORT unsigned short* flam3_create_xform_distrib(flam3_genome *cp); +int flam3_create_chaos_distrib(flam3_genome *cp, int xi, unsigned short *xform_distrib); +int flam3_check_unity_chaos(flam3_genome *cp); +void clear_cp(flam3_genome *cp, int def_flag); + +/* samples is array nsamples*4 long of x,y,color triples. + using (samples[0], samples[1]) as starting XY point and + (samples[2], samples[3]) as starting color coordinate, + perform fuse iterations and throw them away, then perform + nsamples iterations and save them in the samples array */ +EXPORT int flam3_iterate(flam3_genome *g, int nsamples, int fuse, double *samples, + unsigned short *xform_distrib, randctx *rc); + +void apply_motion_parameters(flam3_xform *xf, flam3_xform *addto, double blend); + +/* genomes is array ngenomes long, with times set and in ascending order. + interpolate to the requested time and return in result */ +EXPORT void flam3_interpolate(flam3_genome *genomes, int ngenomes, double time, double stagger, flam3_genome *result); + +/* print genome to given file with extra_attributes if not NULL */ +void flam3_print(FILE *f, flam3_genome *g, char *extra_attributes, int print_edits); +void flam3_print_xform(FILE *f, flam3_xform *x, int final_flag, int numstd, double *chaos_row, int motion_flag); +char *flam3_print_to_string(flam3_genome *cp); + +/* ivars is a list of variations to use, or flam3_variation_random */ +/* ivars_n is the number of values in ivars to select from. */ +/* sym is either a symmetry group or 0 meaning random or no symmetry */ +/* spec_xforms specifies the number of xforms to use, setting to 0 makes the number random. */ +EXPORT void flam3_random(flam3_genome *g, int *ivars, int ivars_n, int sym, int spec_xforms); + +void add_to_action(char *action, char *addtoaction); + +EXPORT void flam3_mutate(flam3_genome *cp, int mutate_mode, int *ivars, int ivars_n, int sym, double speed, randctx *rc, char *action); +EXPORT void flam3_cross(flam3_genome *cp0, flam3_genome *cp1, flam3_genome *out, int cross_mode, randctx *rc, char *action); + +/* return NULL in case of error */ +EXPORT flam3_genome *flam3_parse_xml2(char *s, char *fn, int default_flag, int *ncps); +flam3_genome *flam3_parse_from_file(FILE *f, char *fn, int default_flag, int *ncps); + +void flam3_add_symmetry(flam3_genome *g, int sym); + +void flam3_improve_colors(flam3_genome *g, int ntries, int change_palette, int color_resolution); +EXPORT int flam3_colorhist(flam3_genome *cp, int num_batches, double *hist); +EXPORT int flam3_estimate_bounding_box(flam3_genome *g, double eps, int nsamples, + double *bmin, double *bmax, randctx *rc); +void flam3_rotate(flam3_genome *g, double angle, int interp_type); /* angle in degrees */ + +double flam3_dimension(flam3_genome *g, int ntries, int clip_to_camera); +double flam3_lyapunov(flam3_genome *g, int ntries); + +void flam3_apply_template(flam3_genome *cp, flam3_genome *templ); + +EXPORT int flam3_count_nthreads(void); + +typedef struct { +// double temporal_filter_radius; + double pixel_aspect_ratio; /* width over height of each pixel */ + flam3_genome *genomes; + int ngenomes; + int verbose; + int bits; + int bytes_per_channel; + int earlyclip; + double time; + int (*progress)(void *, double, int, double); + void *progress_parameter; + randctx rc; + int nthreads; + int sub_batch_size; +} flam3_frame; + + +#define flam3_field_both 0 +#define flam3_field_even 1 +#define flam3_field_odd 2 + +/* out is pixel array. + pixels are rgb or rgba if nchan is 3 or 4. */ +EXPORT int flam3_render(flam3_frame *f, void *out, int field, int nchan, int transp, stat_struct *stats); + +EXPORT double flam3_render_memory_required(flam3_frame *f); +EXPORT int flam3_make_strip(flam3_genome *cp, int nstrips, int stripnum); +void rotate_by(double *p, double *center, double by); + + +double flam3_random01(); +double flam3_random11(); +int flam3_random_bit(); + +/* ISAAC random numbers */ +double flam3_random_isaac_01(randctx *); +double flam3_random_isaac_11(randctx *); +int flam3_random_isaac_bit(randctx *); + +EXPORT void flam3_init_frame(flam3_frame *f); + +/* External memory helpers */ +EXPORT void *flam3_malloc(size_t size); +EXPORT void flam3_free(void *ptr); + +void flam3_srandom(); + +flam3_genome *sheep_loop(flam3_genome *cp, double blend); +flam3_genome *sheep_edge(flam3_genome *cp, double blend, int seqflag, double stagger); + +/* Motion function indices */ +#define MOTION_SIN 1 +#define MOTION_TRIANGLE 2 +#define MOTION_HILL 3 + +/* Mutation modes */ +#define MUTATE_NOT_SPECIFIED -1 +#define MUTATE_ALL_VARIATIONS 0 +#define MUTATE_ONE_XFORM_COEFS 1 +#define MUTATE_ADD_SYMMETRY 2 +#define MUTATE_POST_XFORMS 3 +#define MUTATE_COLOR_PALETTE 4 +#define MUTATE_DELETE_XFORM 5 +#define MUTATE_ALL_COEFS 6 + +/* Cross modes */ +#define CROSS_NOT_SPECIFIED -1 +#define CROSS_UNION 0 +#define CROSS_INTERPOLATE 1 +#define CROSS_ALTERNATE 2 + +#endif diff --git a/src/flam3.pc.in b/src/flam3.pc.in new file mode 100644 index 0000000..e78b2da --- /dev/null +++ b/src/flam3.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ + +Name: flam3 +Description: Renders and animates fractal flames and manipulates their genetic codes, see www.flam3.com for more info. +Version: @VERSION@ +Requires: libpng12 >= 1.0 libxml-2.0 +Libs: -L${libdir} -lflam3 -ljpeg -lpthread +Cflags: -I${includedir} diff --git a/src/genome.dsp b/src/genome.dsp new file mode 100644 index 0000000..5ea7f1c --- /dev/null +++ b/src/genome.dsp @@ -0,0 +1,146 @@ +# Microsoft Developer Studio Project File - Name="pick" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=pick - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "genome.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "genome.mak" CFG="pick - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pick - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "pick - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pick - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "c:\src\libpng" /I "c:\src\zlib" /I "c:\src\libxml2\include" /I "c:\src\jpeg" /I "c:\src\iconv\include" /I "c:\src\pthreads" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib c:\src\pthreads\pthreadVC2.lib /nologo /subsystem:console /machine:I386 /out:"Release/flam3-genome.exe" + +!ELSEIF "$(CFG)" == "pick - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\src\libpng" /I "c:\src\libxml2\include" /I "c:\src\jpeg" /I "c:\src\iconv\include" /I "c:\src\zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "pick - Win32 Release" +# Name "pick - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\docstring.c +# End Source File +# Begin Source File + +SOURCE=".\flam3-genome.c" +# End Source File +# Begin Source File + +SOURCE=".\flam3-palettes.c" +# End Source File +# Begin Source File + +SOURCE=.\flam3.c +# End Source File +# Begin Source File + +SOURCE=.\isaac.c +# End Source File +# Begin Source File + +SOURCE=.\jpeg.c +# End Source File +# Begin Source File + +SOURCE=.\png.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=cmap.h +# End Source File +# Begin Source File + +SOURCE=config.h +# End Source File +# Begin Source File + +SOURCE=jpeg.h +# End Source File +# Begin Source File + +SOURCE=libifs.h +# End Source File +# Begin Source File + +SOURCE=rect.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/img.h b/src/img.h new file mode 100644 index 0000000..6bab912 --- /dev/null +++ b/src/img.h @@ -0,0 +1,44 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#include +#include "flam3.h" + +#define FLAM3_PNG_COM 8 + +#ifdef WIN32 + #define snprintf _snprintf +#endif + +typedef struct { + + char *genome; + char *badvals; + char *numiters; + char *rtime; + +} flam3_img_comments; + + +void write_jpeg(FILE *file, unsigned char *image, int width, int height, flam3_img_comments *fpc); +void write_png(FILE *file, void *image, int width, int height, flam3_img_comments *fpc, int bpc); + +/* returns RGBA pixel array or NULL on failure */ +unsigned char *read_png(FILE *file, int *width, int *height); +unsigned char *read_jpeg(FILE *file, int *width, int *height); diff --git a/src/install-sh b/src/install-sh new file mode 100755 index 0000000..e843669 --- /dev/null +++ b/src/install-sh @@ -0,0 +1,250 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/src/interpolation.c b/src/interpolation.c new file mode 100644 index 0000000..d9219fd --- /dev/null +++ b/src/interpolation.c @@ -0,0 +1,956 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "interpolation.h" +#include "palettes.h" + +double adjust_percentage(double in) { + + if (in==0.0) + return(0.0); + else + return(pow(10.0, -log(1.0/in)/log(2))); + +} + +double motion_funcs(int funcnum, double timeval) { + + /* motion funcs should be cyclic, and equal to 0 at integral time values */ + /* abs peak values should be not be greater than 1 */ + if (funcnum==MOTION_SIN) { + return (sin(2.0*M_PI*timeval)); + } else if (funcnum==MOTION_TRIANGLE) { + double fr = fmod(timeval,1.0); + + if (fr<0) fr+= 1.0; + + if (fr<=.25) + fr = 4.0 * fr; + else if (fr<=.75) + fr = -4.0 * fr + 2.0; + else + fr = 4.0 * fr - 4.0; + + return(fr); + } else { //if (funcnum==MOTION_HILL) { + return( (1.0-cos(2.0*M_PI*timeval)) * 0.5); + } + +} + +double det_matrix(double s[2][2]) { + return s[0][0] * s[1][1] - s[0][1] * s[1][0]; +} + +int id_matrix(double s[3][2]) { + return + (s[0][0] == 1.0) && + (s[0][1] == 0.0) && + (s[1][0] == 0.0) && + (s[1][1] == 1.0) && + (s[2][0] == 0.0) && + (s[2][1] == 0.0); +} + +int zero_matrix(double s[3][2]) { + return + (s[0][0] == 0.0) && + (s[0][1] == 0.0) && + (s[1][0] == 0.0) && + (s[1][1] == 0.0) && + (s[2][0] == 0.0) && + (s[2][1] == 0.0); +} + +void copy_matrix(double to[3][2], double from[3][2]) { + + to[0][0] = from[0][0]; + to[0][1] = from[0][1]; + to[1][0] = from[1][0]; + to[1][1] = from[1][1]; + to[2][0] = from[2][0]; + to[2][1] = from[2][1]; +} + + +void clear_matrix(double m[3][2]) { + m[0][0] = 0.0; + m[0][1] = 0.0; + m[1][0] = 0.0; + m[1][1] = 0.0; + m[2][0] = 0.0; + m[2][1] = 0.0; +} + +void sum_matrix(double s, double m1[3][2], double m2[3][2]) { + + m2[0][0] += s * m1[0][0]; + m2[0][1] += s * m1[0][1]; + m2[1][0] += s * m1[1][0]; + m2[1][1] += s * m1[1][1]; + m2[2][0] += s * m1[2][0]; + m2[2][1] += s * m1[2][1]; +} + +void mult_matrix(double s1[2][2], double s2[2][2], double d[2][2]) { + d[0][0] = s1[0][0] * s2[0][0] + s1[1][0] * s2[0][1]; + d[1][0] = s1[0][0] * s2[1][0] + s1[1][0] * s2[1][1]; + d[0][1] = s1[0][1] * s2[0][0] + s1[1][1] * s2[0][1]; + d[1][1] = s1[0][1] * s2[1][0] + s1[1][1] * s2[1][1]; +} + +int compare_xforms(const void *av, const void *bv) { + flam3_xform *a = (flam3_xform *) av; + flam3_xform *b = (flam3_xform *) bv; + double aa[2][2]; + double bb[2][2]; + double ad, bd; + + aa[0][0] = a->c[0][0]; + aa[0][1] = a->c[0][1]; + aa[1][0] = a->c[1][0]; + aa[1][1] = a->c[1][1]; + bb[0][0] = b->c[0][0]; + bb[0][1] = b->c[0][1]; + bb[1][0] = b->c[1][0]; + bb[1][1] = b->c[1][1]; + ad = det_matrix(aa); + bd = det_matrix(bb); + + if (a->color_speed > b->color_speed) return 1; + if (a->color_speed < b->color_speed) return -1; + if (a->color_speed) { + if (ad < 0) return -1; + if (bd < 0) return 1; + ad = atan2(a->c[0][0], a->c[0][1]); + bd = atan2(b->c[0][0], b->c[0][1]); + } + + if (ad < bd) return -1; + if (ad > bd) return 1; + return 0; +} + +void interpolate_cmap(flam3_palette cmap, double blend, + int index0, double hue0, int index1, double hue1) { + + flam3_palette p0,p1; + int i, j; + + flam3_get_palette(index0, p0, hue0); + flam3_get_palette(index1, p1, hue1); + + for (i = 0; i < 256; i++) { + double t[5], s[5]; + + rgb2hsv(p0[i].color, s); + rgb2hsv(p1[i].color, t); + + s[3] = p0[i].color[3]; + t[3] = p1[i].color[3]; + + s[4] = p0[i].index; + t[4] = p1[i].index; + + for (j = 0; j < 5; j++) + t[j] = ((1.0-blend) * s[j]) + (blend * t[j]); + + hsv2rgb(t, cmap[i].color); + cmap[i].color[3] = t[3]; + cmap[i].index = t[4]; + } +} + +void interp_and_convert_back(double *c, int ncps, int xfi, double cxang[4][2], + double cxmag[4][2], double cxtrn[4][2],double store_array[3][2]) { + + int i,col; + + double accang[2],accmag[2]; + double expmag; + int accmode[2]; + + accang[0] = 0.0; + accang[1] = 0.0; + accmag[0] = 0.0; + accmag[1] = 0.0; + + accmode[0]=accmode[1]=0; + + /* accumulation mode defaults to logarithmic, but in special */ + /* cases we want to switch to linear accumulation */ + for (col=0; col<2; col++) { + for (i=0; i0 && cflag==0) { + + /* Adjust the angles to make sure that it's within wind:wind+2pi */ + refang = cp[k].xform[xfi].wind[col] - 2*M_PI; + + /* Make sure both angles are within [refang refang+2*pi] */ + while(cxang[k-1][col] < refang) + cxang[k-1][col] += 2*M_PI; + + while(cxang[k-1][col] > refang + 2*M_PI) + cxang[k-1][col] -= 2*M_PI; + + while(cxang[k][col] < refang) + cxang[k][col] += 2*M_PI; + + while(cxang[k][col] > refang + 2*M_PI) + cxang[k][col] -= 2*M_PI; + + } else { + + /* Normal way of adjusting angles */ + d = cxang[k][col]-cxang[k-1][col]; + + /* Adjust to avoid the -pi/pi discontinuity */ + if (d > M_PI+EPS) + cxang[k][col] -= 2*M_PI; + else if (d < -(M_PI-EPS) ) /* Forces clockwise rotation at 180 */ + cxang[k][col] += 2*M_PI; + } + } + } +} + +void interpolate_catmull_rom(flam3_genome cps[], double t, flam3_genome *result) { + double t2 = t * t; + double t3 = t2 * t; + double cmc[4]; + + cmc[0] = (2*t2 - t - t3) / 2; + cmc[1] = (3*t3 - 5*t2 + 2) / 2; + cmc[2] = (4*t2 - 3*t3 + t) / 2; + cmc[3] = (t3 - t2) / 2; + + flam3_interpolate_n(result, 4, cps, cmc, 0); +} + +double smoother(double t) { + return 3*t*t - 2*t*t*t; +} + +double get_stagger_coef(double t, double stagger_prc, int num_xforms, int this_xform) { + + /* max_stag is the spacing between xform start times if stagger_prc = 1.0 */ + double max_stag = (double)(num_xforms-1)/num_xforms; + + /* scale the spacing by stagger_prc */ + double stag_scaled = stagger_prc * max_stag; + + /* t ranges from 1 to 0 (the contribution of cp[0] to the blend) */ + /* the first line below makes the first xform interpolate first */ + /* the second line makes the last xform interpolate first */ + double st = stag_scaled * (num_xforms - 1 - this_xform) / (num_xforms-1); +// double st = stag_scaled * (this_xform) / (num_xforms-1); + double et = st + (1-stag_scaled); + +// printf("t=%f xf:%d st=%f et=%f : : %f\n",t,this_xform,st,et,smoother((t-st)/(1-stag_scaled))); + + if (t <= st) + return (0); + else if (t >= et) + return (1); + else + return ( smoother((t-st)/(1-stag_scaled)) ); + +} + + + +/* all cpi and result must be aligned (have the same number of xforms, + and have final xform in the same slot) */ +void flam3_interpolate_n(flam3_genome *result, int ncp, + flam3_genome *cpi, double *c, double stagger) { + int i, j, k, numstd; + + if (flam3_palette_interpolation_hsv == cpi[0].palette_interpolation) { + + for (i = 0; i < 256; i++) { + double t[3], s[4]; + s[0] = s[1] = s[2] = s[3] = s[4] = 0.0; + + for (k = 0; k < ncp; k++) { + rgb2hsv(cpi[k].palette[i].color, t); + for (j = 0; j < 3; j++) + s[j] += c[k] * t[j]; + + s[3] += c[k] * cpi[k].palette[i].color[3]; + s[4] += c[k] * cpi[k].palette[i].index; + + } + + hsv2rgb(s, result->palette[i].color); + result->palette[i].color[3] = s[3]; + result->palette[i].index = s[4]; + + for (j = 0; j < 4; j++) { + if (result->palette[i].color[j] < 0.0) + result->palette[i].color[j] = 0.0; + if (result->palette[i].color[j] > 1.0) + result->palette[i].color[j] = 1.0; + } + + if (result->palette[i].index < 0.0) + result->palette[i].index = 0.0; + if (result->palette[i].index > 255.0) + result->palette[i].index = 255.0; + } + } else { + /* Sweep - not the best option for float indices */ + for (i = 0; i < 256; i++) { + j = (i < (256 * c[0])) ? 0 : 1; + result->palette[i] = cpi[j].palette[i]; + } + } + + result->palette_index = flam3_palette_random; + result->symmetry = 0; + result->spatial_filter_select = cpi[0].spatial_filter_select; + result->temporal_filter_type = cpi[0].temporal_filter_type; + result->palette_mode = cpi[0].palette_mode; + + result->interpolation_type = cpi[0].interpolation_type; + INTERP(brightness); + INTERP(contrast); + INTERP(highlight_power); + INTERP(gamma); + INTERP(vibrancy); + INTERP(hue_rotation); + INTERI(width); + INTERI(height); + INTERI(spatial_oversample); + INTERP(center[0]); + INTERP(center[1]); + INTERP(rot_center[0]); + INTERP(rot_center[1]); + INTERP(background[0]); + INTERP(background[1]); + INTERP(background[2]); + INTERP(pixels_per_unit); + INTERP(spatial_filter_radius); + INTERP(temporal_filter_exp); + INTERP(temporal_filter_width); + INTERP(sample_density); + INTERP(zoom); + INTERP(rotate); + INTERI(nbatches); + INTERI(ntemporal_samples); + INTERP(estimator); + INTERP(estimator_minimum); + INTERP(estimator_curve); + INTERP(gam_lin_thresh); + + /* Interpolate the chaos array */ + numstd = cpi[0].num_xforms - (cpi[0].final_xform_index >= 0); + for (i=0;ichaos[i][j]<0) result->chaos[i][j]=0; + //chaos can be > 1 + //if (result->chaos[i][j]>1) result->chaos[i][j]=1.0; + } + } + + /* Interpolate each xform */ + for (i = 0; i < cpi[0].num_xforms; i++) { + + double csave[2]; + double td; + int all_id; + int nx = cpi[0].num_xforms-(cpi[0].final_xform_index>=0); + + if (ncp==2 && stagger>0 && i!=cpi[0].final_xform_index) { + csave[0] = c[0]; + csave[1] = c[1]; + c[0] = get_stagger_coef(csave[0],stagger,nx,i); + c[1] = 1.0-c[0]; + } + + + INTERP(xform[i].density); + td = result->xform[i].density; + result->xform[i].density = (td < 0.0) ? 0.0 : td; + INTERP(xform[i].color); + if (result->xform[i].color<0) result->xform[i].color=0; + if (result->xform[i].color>1) result->xform[i].color=1; + + INTERP(xform[i].color_speed); + if (result->xform[i].color_speed<0) result->xform[i].color_speed=0; + if (result->xform[i].color_speed>1) result->xform[i].color_speed=1; + + INTERP(xform[i].opacity); + INTERP(xform[i].animate); + INTERP(xform[i].blob_low); + INTERP(xform[i].blob_high); + INTERP(xform[i].blob_waves); + INTERP(xform[i].pdj_a); + INTERP(xform[i].pdj_b); + INTERP(xform[i].pdj_c); + INTERP(xform[i].pdj_d); + INTERP(xform[i].fan2_x); + INTERP(xform[i].fan2_y); + INTERP(xform[i].rings2_val); + INTERP(xform[i].perspective_angle); + INTERP(xform[i].perspective_dist); + INTERP(xform[i].julian_power); + INTERP(xform[i].julian_dist); + INTERP(xform[i].juliascope_power); + INTERP(xform[i].juliascope_dist); + INTERP(xform[i].radial_blur_angle); + INTERP(xform[i].pie_slices); + INTERP(xform[i].pie_rotation); + INTERP(xform[i].pie_thickness); + INTERP(xform[i].ngon_sides); + INTERP(xform[i].ngon_power); + INTERP(xform[i].ngon_circle); + INTERP(xform[i].ngon_corners); + INTERP(xform[i].curl_c1); + INTERP(xform[i].curl_c2); + INTERP(xform[i].rectangles_x); + INTERP(xform[i].rectangles_y); + INTERP(xform[i].amw_amp); + INTERP(xform[i].disc2_rot); + INTERP(xform[i].disc2_twist); + INTERP(xform[i].super_shape_rnd); + INTERP(xform[i].super_shape_m); + INTERP(xform[i].super_shape_n1); + INTERP(xform[i].super_shape_n2); + INTERP(xform[i].super_shape_n3); + INTERP(xform[i].super_shape_holes); + INTERP(xform[i].flower_petals); + INTERP(xform[i].flower_holes); + INTERP(xform[i].conic_eccentricity); + INTERP(xform[i].conic_holes); + INTERP(xform[i].parabola_height); + INTERP(xform[i].parabola_width); + INTERP(xform[i].bent2_x); + INTERP(xform[i].bent2_y); + INTERP(xform[i].bipolar_shift); + INTERP(xform[i].cell_size); + INTERP(xform[i].cpow_r); + INTERP(xform[i].cpow_i); + INTERP(xform[i].cpow_power); + INTERP(xform[i].curve_xamp); + INTERP(xform[i].curve_yamp); + INTERP(xform[i].curve_xlength); + INTERP(xform[i].curve_ylength); + INTERP(xform[i].escher_beta); + INTERP(xform[i].lazysusan_x); + INTERP(xform[i].lazysusan_y); + INTERP(xform[i].lazysusan_twist); + INTERP(xform[i].lazysusan_space); + INTERP(xform[i].lazysusan_spin); + INTERP(xform[i].modulus_x); + INTERP(xform[i].modulus_y); + INTERP(xform[i].oscope_separation); + INTERP(xform[i].oscope_frequency); + INTERP(xform[i].oscope_amplitude); + INTERP(xform[i].oscope_damping); + INTERP(xform[i].popcorn2_x); + INTERP(xform[i].popcorn2_y); + INTERP(xform[i].popcorn2_c); + INTERP(xform[i].separation_x); + INTERP(xform[i].separation_xinside); + INTERP(xform[i].separation_y); + INTERP(xform[i].separation_yinside); + INTERP(xform[i].split_xsize); + INTERP(xform[i].split_ysize); + INTERP(xform[i].splits_x); + INTERP(xform[i].splits_y); + INTERP(xform[i].stripes_space); + INTERP(xform[i].stripes_warp); + INTERP(xform[i].wedge_angle); + INTERP(xform[i].wedge_hole); + INTERP(xform[i].wedge_count); + INTERP(xform[i].wedge_swirl); + INTERP(xform[i].wedge_julia_angle); + INTERP(xform[i].wedge_julia_count); + INTERP(xform[i].wedge_julia_power); + INTERP(xform[i].wedge_julia_dist); + INTERP(xform[i].wedge_sph_angle); + INTERP(xform[i].wedge_sph_hole); + INTERP(xform[i].wedge_sph_count); + INTERP(xform[i].wedge_sph_swirl); + INTERP(xform[i].whorl_inside); + INTERP(xform[i].whorl_outside); + INTERP(xform[i].waves2_scalex); + INTERP(xform[i].waves2_scaley); + INTERP(xform[i].waves2_freqx); + INTERP(xform[i].waves2_freqy); + + for (j = 0; j < flam3_nvariations; j++) + INTERP(xform[i].var[j]); + + if (flam3_inttype_log == cpi[0].interpolation_type) { + double cxmag[4][2]; // XXX why only 4? should be ncp + double cxang[4][2]; + double cxtrn[4][2]; + + /* affine part */ + clear_matrix(result->xform[i].c); + convert_linear_to_polar(cpi,ncp,i,0,cxang,cxmag,cxtrn); + interp_and_convert_back(c, ncp, i, cxang, cxmag, cxtrn,result->xform[i].c); + + /* post part */ + all_id = 1; + for (k=0; kxform[i].post); + if (all_id) { + result->xform[i].post[0][0] = 1.0; + result->xform[i].post[1][1] = 1.0; + } else { + convert_linear_to_polar(cpi,ncp,i,1,cxang,cxmag,cxtrn); + interp_and_convert_back(c, ncp, i, cxang, cxmag, cxtrn,result->xform[i].post); + } + + } else { + + /* Interpolate c matrix & post */ + clear_matrix(result->xform[i].c); + clear_matrix(result->xform[i].post); + all_id = 1; + for (k = 0; k < ncp; k++) { + sum_matrix(c[k], cpi[k].xform[i].c, result->xform[i].c); + sum_matrix(c[k], cpi[k].xform[i].post, result->xform[i].post); + + all_id &= id_matrix(cpi[k].xform[i].post); + + } + if (all_id) { + clear_matrix(result->xform[i].post); + result->xform[i].post[0][0] = 1.0; + result->xform[i].post[1][1] = 1.0; + } + } + + if (ncp==2 && stagger>0 && i!=cpi[0].final_xform_index) { + c[0] = csave[0]; + c[1] = csave[1]; + } + + } + +} + +void establish_asymmetric_refangles(flam3_genome *cp, int ncps) { + + int k, xfi, col; + + double cxang[4][2],d,c1[2]; + + for (xfi=0; xfi M_PI+EPS) + cxang[k][col] -= 2*M_PI; + else if (d < -(M_PI-EPS) ) + cxang[k][col] += 2*M_PI; + + /* If this is an asymmetric case, store the NON-symmetric angle */ + /* Check them pairwise and store the reference angle in the second */ + /* to avoid overwriting if asymmetric on both sides */ + padsymflag = 0; + + sym0 = (cp[k-1].xform[xfi].animate==0 || (cp[k-1].xform[xfi].padding==1 && padsymflag)); + sym1 = (cp[k].xform[xfi].animate==0 || (cp[k].xform[xfi].padding==1 && padsymflag)); + + if ( sym1 && !sym0 ) + cp[k].xform[xfi].wind[col] = cxang[k-1][col] + 2*M_PI; + else if ( sym0 && !sym1 ) + cp[k].xform[xfi].wind[col] = cxang[k][col] + 2*M_PI; + + } + } + } +} + +void flam3_align(flam3_genome *dst, flam3_genome *src, int nsrc) { + int i, tfx, tnx, max_nx = 0, max_fx = 0; + int already_aligned=1; + int xf,j; + int ii,fnd; + double normed; + int usethisone; + + usethisone = (nsrc/2) - 1; + + max_nx = src[0].num_xforms - (src[0].final_xform_index >= 0); + max_fx = src[0].final_xform_enable; + + for (i = 1; i < nsrc; i++) { + tnx = src[i].num_xforms - (src[i].final_xform_index >= 0); + if (max_nx != tnx) { + already_aligned = 0; + if (tnx > max_nx) max_nx = tnx; + } + + tfx = src[i].final_xform_enable; + if (max_fx != tfx) { + already_aligned = 0; + max_fx |= tfx; + } + } + + /* Pad the cps to equal xforms */ + for (i = 0; i < nsrc; i++) { + flam3_copyx(&dst[i], &src[i], max_nx, max_fx); + } + + /* Skip if this genome is compatibility mode */ + if (dst[usethisone].interpolation_type == flam3_inttype_compat || + dst[usethisone].interpolation_type == flam3_inttype_older) + return; + + + /* Check to see if there's a parametric variation present in one xform */ + /* but not in an aligned xform. If this is the case, use the parameters */ + /* from the xform with the variation as the defaults for the blank one. */ + + /* All genomes will have the same number of xforms at this point */ + /* num = max_nx + max_fx */ + for (i = 0; i0) { + + /* Check to see if the prior genome's xform is populated */ + if (dst[i-1].xform[xf].var[j] != 0) { + + /* Copy the prior genome's parameters and continue */ + flam3_copy_params(&(dst[i].xform[xf]), &(dst[i-1].xform[xf]), j); + continue; + } + + } else if (i0 && dst[i-1].interpolation_type==flam3_inttype_log) ) { + + for (ii=-1; ii<=1; ii+=2) { + + /* Skip if out of bounds */ + if (i+ii<0 || i+ii>=nsrc) + continue; + + /* Skip if this is also padding */ + if (dst[i+ii].xform[xf].padding==1) + continue; + + /* Spherical / Ngon (trumps all others due to holes) */ + /* Interpolate these against a 180 degree rotated identity */ + /* with weight -1. */ + /* Added JULIAN/JULIASCOPE to get rid of black wedges */ + if (dst[i+ii].xform[xf].var[VAR_SPHERICAL]>0 || + dst[i+ii].xform[xf].var[VAR_NGON]>0 || + dst[i+ii].xform[xf].var[VAR_JULIAN]>0 || + dst[i+ii].xform[xf].var[VAR_JULIASCOPE]>0 || + dst[i+ii].xform[xf].var[VAR_POLAR]>0 || + dst[i+ii].xform[xf].var[VAR_WEDGE_SPH]>0 || + dst[i+ii].xform[xf].var[VAR_WEDGE_JULIA]>0) { + + dst[i].xform[xf].var[VAR_LINEAR] = -1.0; + /* Set the coefs appropriately */ + dst[i].xform[xf].c[0][0] = -1.0; + dst[i].xform[xf].c[0][1] = 0.0; + dst[i].xform[xf].c[1][0] = 0.0; + dst[i].xform[xf].c[1][1] = -1.0; + dst[i].xform[xf].c[2][0] = 0.0; + dst[i].xform[xf].c[2][1] = 0.0; + fnd=-1; + } + } + + } + + if (fnd==0) { + + for (ii=-1; ii<=1; ii+=2) { + + /* Skip if out of bounds */ + if (i+ii<0 || i+ii>=nsrc) + continue; + + /* Skip if also padding */ + if (dst[i+ii].xform[xf].padding==1) + continue; + + /* Rectangles */ + if (dst[i+ii].xform[xf].var[VAR_RECTANGLES]>0) { + dst[i].xform[xf].var[VAR_RECTANGLES] = 1.0; + dst[i].xform[xf].rectangles_x = 0.0; + dst[i].xform[xf].rectangles_y = 0.0; + fnd++; + } + + /* Rings 2 */ + if (dst[i+ii].xform[xf].var[VAR_RINGS2]>0) { + dst[i].xform[xf].var[VAR_RINGS2] = 1.0; + dst[i].xform[xf].rings2_val = 0.0; + fnd++; + } + + /* Fan 2 */ + if (dst[i+ii].xform[xf].var[VAR_FAN2]>0) { + dst[i].xform[xf].var[VAR_FAN2] = 1.0; + dst[i].xform[xf].fan2_x = 0.0; + dst[i].xform[xf].fan2_y = 0.0; + fnd++; + } + + /* Blob */ + if (dst[i+ii].xform[xf].var[VAR_BLOB]>0) { + dst[i].xform[xf].var[VAR_BLOB] = 1.0; + dst[i].xform[xf].blob_low = 1.0; + dst[i].xform[xf].blob_high = 1.0; + dst[i].xform[xf].blob_waves = 1.0; + fnd++; + } + + /* Perspective */ + if (dst[i+ii].xform[xf].var[VAR_PERSPECTIVE]>0) { + dst[i].xform[xf].var[VAR_PERSPECTIVE] = 1.0; + dst[i].xform[xf].perspective_angle = 0.0; + /* Keep the perspective distance as-is */ + fnd++; + } + + /* Curl */ + if (dst[i+ii].xform[xf].var[VAR_CURL]>0) { + dst[i].xform[xf].var[VAR_CURL] = 1.0; + dst[i].xform[xf].curl_c1 = 0.0; + dst[i].xform[xf].curl_c2 = 0.0; + fnd++; + } + + /* Super-Shape */ + if (dst[i+ii].xform[xf].var[VAR_SUPER_SHAPE]>0) { + dst[i].xform[xf].var[VAR_SUPER_SHAPE] = 1.0; + /* Keep supershape_m the same */ + dst[i].xform[xf].super_shape_n1 = 2.0; + dst[i].xform[xf].super_shape_n2 = 2.0; + dst[i].xform[xf].super_shape_n3 = 2.0; + dst[i].xform[xf].super_shape_rnd = 0.0; + dst[i].xform[xf].super_shape_holes = 0.0; + fnd++; + } + } + } + + /* If we didn't have any matches with those, */ + /* try the affine ones, fan and rings */ + if (fnd==0) { + + for (ii=-1; ii<=1; ii+=2) { + + /* Skip if out of bounds */ + if (i+ii<0 || i+ii>=nsrc) + continue; + + /* Skip if also a padding xform */ + if (dst[i+ii].xform[xf].padding==1) + continue; + + /* Fan */ + if (dst[i+ii].xform[xf].var[VAR_FAN]>0) { + dst[i].xform[xf].var[VAR_FAN] = 1.0; + fnd++; + } + + /* Rings */ + if (dst[i+ii].xform[xf].var[VAR_RINGS]>0) { + dst[i].xform[xf].var[VAR_RINGS] = 1.0; + fnd++; + } + + } + + if (fnd>0) { + /* Set the coefs appropriately */ + dst[i].xform[xf].c[0][0] = 0.0; + dst[i].xform[xf].c[0][1] = 1.0; + dst[i].xform[xf].c[1][0] = 1.0; + dst[i].xform[xf].c[1][1] = 0.0; + dst[i].xform[xf].c[2][0] = 0.0; + dst[i].xform[xf].c[2][1] = 0.0; + } + } + + /* If we still have no matches, switch back to linear */ + if (fnd==0) + + dst[i].xform[xf].var[VAR_LINEAR] = 1.0; + + else if (fnd>0) { + + /* Otherwise, go through and normalize the weights. */ + normed = 0.0; + for (j = 0; j < flam3_nvariations; j++) + normed += dst[i].xform[xf].var[j]; + + for (j = 0; j < flam3_nvariations; j++) + dst[i].xform[xf].var[j] /= normed; + + } + } + } /* xforms */ + } /* genomes */ + +} + diff --git a/src/interpolation.h b/src/interpolation.h new file mode 100644 index 0000000..82d3133 --- /dev/null +++ b/src/interpolation.h @@ -0,0 +1,58 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef interpolation_included +#define interpolation_included + +#include "private.h" + +#define INTERP(x) do { result->x = 0.0; \ + for (k = 0; k < ncp; k++) result->x += c[k] * cpi[k].x; } while(0) + +#define INTERI(x) do { double tt = 0.0; \ + for (k = 0; k < ncp; k++) tt += c[k] * cpi[k].x; \ + result->x = (int)rint(tt); } while(0) + +double adjust_percentage(double in); +double motion_funcs(int funcnum, double timeval); + +double smoother(double t); +double get_stagger_coef(double t, double stagger_prc, int num_xforms, int this_xform); + +double det_matrix(double s[2][2]); +int id_matrix(double s[3][2]); +int zero_matrix(double s[3][2]); +void copy_matrix(double to[3][2], double from[3][2]); +void clear_matrix(double m[3][2]); +void sum_matrix(double s, double m1[3][2], double m2[3][2]); +void mult_matrix(double s1[2][2], double s2[2][2], double d[2][2]); + +int compare_xforms(const void *av, const void *bv); + +void interpolate_cmap(flam3_palette cmap, double blend, + int index0, double hue0, int index1, double hue1); +void interp_and_convert_back(double *c, int ncps, int xfi, double cxang[4][2], + double cxmag[4][2], double cxtrn[4][2],double store_array[3][2]); +void convert_linear_to_polar(flam3_genome *cp, int ncps, int xfi, int cflag, + double cxang[4][2], double cxmag[4][2], double cxtrn[4][2]); + +void interpolate_catmull_rom(flam3_genome cps[], double t, flam3_genome *result); +void flam3_interpolate_n(flam3_genome *result, int ncp, flam3_genome *cpi, double *c, double stagger); +void establish_asymmetric_refangles(flam3_genome *cp, int ncps); +void flam3_align(flam3_genome *dst, flam3_genome *src, int nsrc); +#endif diff --git a/src/isaac.c b/src/isaac.c new file mode 100644 index 0000000..014c4d9 --- /dev/null +++ b/src/isaac.c @@ -0,0 +1,110 @@ +/* +------------------------------------------------------------------------------ +isaac.c: By Bob Jenkins. My random number generator, ISAAC. +MODIFIED: + 960327: Creation (addition of randinit, really) + 970719: use context, not global variables, for internal state + 980324: make a portable version + 991209: modified for inclusion with GNU Backgammon by Gary Wong + 070121: modified for inclusion with flam3 by Erik Reckase +------------------------------------------------------------------------------ +*/ + +#include "isaacs.h" +#include "isaac.h" + +#define ind(mm,x) ((mm)[(x>>2)&(RANDSIZ-1)]) +#define rngstep(mix,a,b,mm,m,m2,r,x) \ +{ \ + x = *m; \ + a = ((a^(mix)) + *(m2++)) & 0xffffffff; \ + *(m++) = y = (ind(mm,x) + a + b) & 0xffffffff; \ + *(r++) = b = (ind(mm,y>>RANDSIZL) + x) & 0xffffffff; \ +} + +void isaac(randctx *ctx) +{ + register ub4 a,b,x,y,*m,*mm,*m2,*r,*mend; + mm=ctx->randmem; r=ctx->randrsl; + a = ctx->randa; b = (ctx->randb + (++ctx->randc)) & 0xffffffff; + for (m = mm, mend = m2 = m+(RANDSIZ/2); m>6 , a, b, mm, m, m2, r, x); + rngstep( a<<2 , a, b, mm, m, m2, r, x); + rngstep( a>>16, a, b, mm, m, m2, r, x); + } + for (m2 = mm; m2>6 , a, b, mm, m, m2, r, x); + rngstep( a<<2 , a, b, mm, m, m2, r, x); + rngstep( a>>16, a, b, mm, m, m2, r, x); + } + ctx->randb = b; ctx->randa = a; +} + + +#define mix(a,b,c,d,e,f,g,h) \ +{ \ + a^=b<<11; d+=a; b+=c; \ + b^=c>>2; e+=b; c+=d; \ + c^=d<<8; f+=c; d+=e; \ + d^=e>>16; g+=d; e+=f; \ + e^=f<<10; h+=e; f+=g; \ + f^=g>>4; a+=f; g+=h; \ + g^=h<<8; b+=g; h+=a; \ + h^=a>>9; c+=h; a+=b; \ +} + +/* if (flag==TRUE), then use the contents of randrsl[] to initialize mm[]. */ +void irandinit(randctx *ctx, word flag) +{ + word i; + ub4 a,b,c,d,e,f,g,h; + ub4 *m,*r; + ctx->randa = ctx->randb = ctx->randc = 0; + m=ctx->randmem; + r=ctx->randrsl; + a=b=c=d=e=f=g=h=0x9e3779b9; /* the golden ratio */ + + for (i=0; i<4; ++i) /* scramble it */ + { + mix(a,b,c,d,e,f,g,h); + } + + if (flag) + { + /* initialize using the contents of r[] as the seed */ + for (i=0; irandcnt=RANDSIZ; /* prepare to use the first set of results */ +} diff --git a/src/isaac.h b/src/isaac.h new file mode 100644 index 0000000..6554569 --- /dev/null +++ b/src/isaac.h @@ -0,0 +1,56 @@ +/* +------------------------------------------------------------------------------ +isaac.h: definitions for a random number generator +MODIFIED: + 960327: Creation (addition of randinit, really) + 970719: use context, not global variables, for internal state + 980324: renamed seed to flag + 980605: recommend RANDSIZL=4 for noncryptography. + 991209: modified for inclusion with GNU Backgammon by Gary Wong + 070121: modified for inclusion with flam3 by Erik Reckase +------------------------------------------------------------------------------ +*/ + +#include "isaacs.h" + +#ifndef _ISAAC_H_ +#define _ISAAC_H_ + +#define RANDSIZL (4) /* I recommend 8 for crypto, 4 for simulations */ +#define RANDSIZ (1<randcnt-- ? \ + (isaac(r), (r)->randcnt=RANDSIZ-1, (r)->randrsl[(r)->randcnt]) : \ + (r)->randrsl[(r)->randcnt]) + +#endif + + diff --git a/src/isaacs.h b/src/isaacs.h new file mode 100644 index 0000000..687d8ae --- /dev/null +++ b/src/isaacs.h @@ -0,0 +1,46 @@ +/* + +------------------------------------------------------------------------------ + +Standard definitions and types, Bob Jenkins + +Modified for inclusion with flam3 by Erik Reckase + +------------------------------------------------------------------------------ + +*/ + +#ifndef _ISAACS_H_ + +#define _ISAACS_H_ + +typedef unsigned long int ub4; /* unsigned 4-byte quantities */ + +#define UB4MAXVAL 0xffffffff + +typedef signed long int sb4; + +#define SB4MAXVAL 0x7fffffff + +typedef unsigned short int ub2; + +#define UB2MAXVAL 0xffff + +typedef signed short int sb2; + +#define SB2MAXVAL 0x7fff + +typedef unsigned char ub1; + +#define UB1MAXVAL 0xff + +typedef signed char sb1; /* signed 1-byte quantities */ + +#define SB1MAXVAL 0x7f + +typedef int word; /* fastest type available */ + + + +#endif + diff --git a/src/jpeg.c b/src/jpeg.c new file mode 100644 index 0000000..218f1be --- /dev/null +++ b/src/jpeg.c @@ -0,0 +1,145 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#include +#include +#include +#include + +#include "config.h" +#include "img.h" +#include "flam3.h" +#include "private.h" + +void +write_jpeg(FILE *file, unsigned char *image, int width, int height, flam3_img_comments *fpc) { + struct jpeg_compress_struct info; + struct jpeg_error_mgr jerr; + size_t i; + char *nick = getenv("nick"); + char *url = getenv("url"); + char *id = getenv("id"); + char *ai; /* For argi */ + int jpegcom_enable = argi("enable_jpeg_comments",1); + + char nick_string[64], url_string[128], id_string[128]; + char bv_string[64],ni_string[64],rt_string[64]; + char genome_string[65536], ver_string[64]; + + /* Create the mandatory comment strings */ + snprintf(genome_string,65536,"flam3_genome: %s",fpc->genome); + snprintf(bv_string,64,"flam3_error_rate: %s",fpc->badvals); + snprintf(ni_string,64,"flam3_samples: %s",fpc->numiters); + snprintf(rt_string,64,"flam3_time: %s",fpc->rtime); + snprintf(ver_string,64,"flam3_version: %s",flam3_version()); + + info.err = jpeg_std_error(&jerr); + jpeg_create_compress(&info); + jpeg_stdio_dest(&info, file); + info.in_color_space = JCS_RGB; + info.input_components = 3; + info.image_width = width; + info.image_height = height; + jpeg_set_defaults(&info); + + if (getenv("jpeg")) { + int quality = atoi(getenv("jpeg")); + jpeg_set_quality(&info, quality, TRUE); + } + + jpeg_start_compress(&info, TRUE); + + /* Write comments to jpeg */ + if (jpegcom_enable==1) { + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)ver_string, (int)strlen(ver_string)); + + if (0 != nick) { + snprintf(nick_string,64,"flam3_nickname: %s",nick); + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)nick_string, (int)strlen(nick_string)); + } + + if (0 != url) { + snprintf(url_string,128,"flam3_url: %s",url); + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)url_string, (int)strlen(url_string)); + } + + if (0 != id) { + snprintf(id_string,128,"flam3_id: %s",id); + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)id_string, (int)strlen(id_string)); + } + + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)bv_string, (int)strlen(bv_string)); + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)ni_string, (int)strlen(ni_string)); + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)rt_string, (int)strlen(rt_string)); + jpeg_write_marker(&info, JPEG_COM, (unsigned char *)genome_string, (int)strlen(genome_string)); + } + + for (i = 0; i < height; i++) { + JSAMPROW row_pointer[1]; + row_pointer[0] = (unsigned char *) image + (3 * width * i); + jpeg_write_scanlines(&info, row_pointer, 1); + } + jpeg_finish_compress(&info); + jpeg_destroy_compress(&info); +} + +unsigned char *read_jpeg(FILE *ifp, int *width, int *height) { + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + int num_scanlines; + unsigned char *p, *q, *t; + + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + jpeg_stdio_src(&cinfo, ifp); + (void) jpeg_read_header(&cinfo, TRUE); + (void) jpeg_start_decompress(&cinfo); + + /* or image_width? */ + *width = cinfo.output_width; + *height = cinfo.output_height; + + if (3 != cinfo.output_components) { + printf("can only read RGB JPEG files, not %d components.\n", + cinfo.output_components); + return 0; + } + p = q = malloc(4 * *width * *height); + t = malloc(3 * *width); + + while (cinfo.output_scanline < cinfo.output_height) { + unsigned char *s = t; + int i; + num_scanlines = jpeg_read_scanlines(&cinfo, &t, 1); + for (i = 0; i < *width; i++) { + p[0] = s[0]; + p[1] = s[1]; + p[2] = s[2]; + p[3] = 255; + s += 3; + p += 4; + } + } + + (void) jpeg_finish_decompress(&cinfo); + jpeg_destroy_decompress(&cinfo); + + free(t); + return q; +} diff --git a/src/ltmain.sh b/src/ltmain.sh new file mode 100755 index 0000000..e420fac --- /dev/null +++ b/src/ltmain.sh @@ -0,0 +1,6964 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. + +basename="s,^.*/,,g" + +# 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" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION="1.5.26 Debian 1.5.26-1ubuntu1" +TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)" + +# Be Bourne compatible (taken from Autoconf:_AS_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 + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# 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 "$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" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# 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. +func_win32_libid () +{ + 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 + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $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_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 () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + 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 "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # 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. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # 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 + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + 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 + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + 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" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + 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 have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + echo "\ +$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP + +Copyright (C) 2008 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." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --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 $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# 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= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # 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= + + 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) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$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,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.[fF][09]?) xform=[fF][09]. ;; + *.for) xform=for ;; + *.java) xform=java ;; + *.obj) xform=obj ;; + *.sx) xform=sx ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # 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 + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + 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 "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + 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 $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "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." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </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." + + $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 + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </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." + + $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 + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + 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 + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + 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 + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + 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 + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$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*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + 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*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + 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 + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + 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. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'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\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + 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 test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$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 test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$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 + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + 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 + 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 "$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) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + 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 (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + 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 + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + 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 + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + 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 + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + 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 used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # 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 + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$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 + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$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 + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$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*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + 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 test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$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 + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$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 + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; 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*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + 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 "$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 module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; 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 + 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; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$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 + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$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*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$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" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$deplibdir/$depdepl" ; then + depdepl="$deplibdir/$depdepl" + elif test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + else + # Can't find it, oh well... + depdepl= + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + case " $deplibs" in + *\ -l* | *\ -L*) + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; + esac + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + 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 + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # 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="$2" + number_minor="$3" + number_revision="$4" + # + # 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 + darwin|linux|osf|windows|none) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + 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]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + 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 + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + 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 + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi + 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 + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + 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 + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + 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 + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$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) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "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 + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$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. + $rm conftest.c + cat > conftest.c </dev/null` + 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 "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$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 + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$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 + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e '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 "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $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 + fi + ;; + 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 is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + 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 + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$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 + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$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 + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$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" + if test -n "$hardcode_libdir_flag_spec_ld"; then + case $archive_cmds in + *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; + *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; + esac + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$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 "$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 + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "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"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $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:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # 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 + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$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. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + 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~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "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" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + 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\" + 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 + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(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 "$mode" = relink; then + $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 + $show "${rm}r $gentop" + $run ${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 + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run 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) + case " $deplibs" in + *\ -l* | *\ -L*) + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; + esac + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $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 "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${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" + # $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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$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 "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # 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/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + 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*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + else + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + 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 "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$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 "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + 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" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` + 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 "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "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}\" || 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 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + 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 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#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 +# 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 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +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; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + 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 ("getcwd failed"); + 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 ("getcwd failed"); + 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 * +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; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# 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. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible (taken from Autoconf:_AS_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 variable: + 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 + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + 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 >> $output "\ + + # 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 $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \$*\" + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + 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" + 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" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$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 + # 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 + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_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 + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$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= + 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 + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "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}\" || 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 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; 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 "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + 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) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# 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' + +# Libraries that this one depends upon. +dependency_libs='$dependency_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 + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # 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. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$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 "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. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` + else + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run 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 + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$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 + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run 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 + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + 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 + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo 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. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo 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. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "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) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + 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 + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; 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 + 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 + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + 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 (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [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 + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +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. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [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: $modename [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 + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +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: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [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 + -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 + -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] + +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: $modename [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." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# 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 +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/src/missing b/src/missing new file mode 100755 index 0000000..64b5f90 --- /dev/null +++ b/src/missing @@ -0,0 +1,353 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2004-09-07.08 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 +# 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, 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. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# 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' + 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 + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit 0 + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit 0 + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# 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). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + 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 "$1" 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 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + 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 [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -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 [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -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 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + 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." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + 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-end: "$" +# End: diff --git a/src/mkinstalldirs b/src/mkinstalldirs new file mode 100755 index 0000000..318cc98 --- /dev/null +++ b/src/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1.1.1 2004-10-26 19:54:13 spotspot Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/palettes.c b/src/palettes.c new file mode 100644 index 0000000..d6fc20f --- /dev/null +++ b/src/palettes.c @@ -0,0 +1,483 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "private.h" +#include "palettes.h" + +lib_palette *the_palettes = NULL; +int npalettes; + +static void parse_palettes(xmlNode *node) { + xmlAttrPtr attr; + char *val; + lib_palette *pal; + + while (node) { + if (node->type == XML_ELEMENT_NODE && !xmlStrcmp(node->name, (const xmlChar *)"palette")) { + attr = node->properties; + pal = &the_palettes[npalettes]; + memset(pal, 0, sizeof(lib_palette)); + + while (attr) { + val = (char *) xmlGetProp(node, attr->name); + if (!xmlStrcmp(attr->name, (const xmlChar *)"data")) { + int count = 256; + int c_idx = 0; + int r,g,b; + int col_count = 0; + int sscanf_ret; + + c_idx=0; + col_count = 0; + + do { + sscanf_ret = sscanf((char *)&(val[c_idx]),"00%2x%2x%2x",&r,&g,&b); + if (sscanf_ret != 3) { + printf("Error: Problem reading hexadecimal color data.\n"); + exit(1); + } + c_idx += 8; + while (isspace( (int)val[c_idx])) + c_idx++; + + pal->colors[col_count][0] = r; + pal->colors[col_count][1] = g; + pal->colors[col_count][2] = b; + + col_count++; + } while (col_countname, (const xmlChar *)"number")) { + pal->number = atoi(val); + } else if (!xmlStrcmp(attr->name, (const xmlChar *)"name")) { + strncpy(pal->name, val, flam3_name_len); + pal->name[flam3_name_len-1] = 0; + } + + xmlFree(val); + attr = attr->next; + } + + npalettes++; + the_palettes = realloc(the_palettes, (1 + npalettes) * sizeof(lib_palette)); + } else + parse_palettes(node->children); + + node = node->next; + } +} + +static int init_palettes(char *filename) { + FILE *fp; + xmlDocPtr doc; + xmlNode *rootnode; + int i, c, slen = 5000; + char *s; + + fp = fopen(filename, "rb"); + if (NULL == fp) { + fprintf(stderr, "flam3: could not open palette file "); + perror(filename); + exit(1); + } + + /* Incrementally read XML file into a string */ + s = malloc(slen); + i = 0; + do { + c = getc(fp); + if (EOF == c) { + if (ferror(fp)) { + perror(filename); + exit(1); + } + break; + } + s[i++] = c; + if (i == slen-1) { + slen *= 2; + s = realloc(s, slen); + } + } while (1); + + fclose(fp); + s[i] = 0; + + doc = xmlReadMemory(s, (int)strlen(s), filename, NULL, XML_PARSE_NONET); + if (NULL == doc) { + fprintf(stderr, "error parsing %s (%s).\n", filename, s); + exit(1); + } + rootnode = xmlDocGetRootElement(doc); + the_palettes = malloc(sizeof(lib_palette)); + npalettes = 0; + parse_palettes(rootnode); + xmlFreeDoc(doc); + + free(s); + xmlCleanupParser(); + return(1); +} + +int flam3_get_palette(int n, flam3_palette c, double hue_rotation) { + int cmap_len = 256; + int idx, i, j; + + if (NULL == the_palettes) { + + char *d = getenv("flam3_palettes"); + init_palettes(d ? d : (PACKAGE_DATA_DIR "/flam3-palettes.xml")); + } + + if (flam3_palette_random == n) + n = the_palettes[random()%npalettes].number; + + for (idx = 0; idx < npalettes; idx++) { + + if (n == the_palettes[idx].number) { + /* Loop over elements of cmap */ + for (i = 0; i < cmap_len; i++) { + int ii = (i * 256) / cmap_len; + double rgb[3], hsv[3]; + + /* Colors are in 0-1 space */ + for (j = 0; j < 3; j++) + rgb[j] = the_palettes[idx].colors[ii][j] / 255.0; + + rgb2hsv(rgb, hsv); + hsv[0] += hue_rotation * 6.0; + hsv2rgb(hsv, rgb); + + c[i].index = i; + + for (j = 0; j < 3; j++) + c[i].color[j] = rgb[j]; + + c[i].color[3] = 1.0; + } + + return n; + } + } + + fprintf(stderr, "warning: palette number %d not found, using white.\n", n); + + for (i = 0; i < cmap_len; i++) { + c[i].index = i; + for (j = 0; j < 4; j++) + c[i].color[j] = 1.0; + } + + return flam3_palette_random; +} + +/* rgb 0 - 1, + h 0 - 6, s 0 - 1, v 0 - 1 */ +void rgb2hsv(rgb, hsv) + double *rgb; double *hsv; + { + double rd, gd, bd, h, s, v, max, min, del, rc, gc, bc; + + rd = rgb[0]; + gd = rgb[1]; + bd = rgb[2]; + + /* compute maximum of rd,gd,bd */ + if (rd>=gd) { if (rd>=bd) max = rd; else max = bd; } + else { if (gd>=bd) max = gd; else max = bd; } + + /* compute minimum of rd,gd,bd */ + if (rd<=gd) { if (rd<=bd) min = rd; else min = bd; } + else { if (gd<=bd) min = gd; else min = bd; } + + del = max - min; + v = max; + if (max != 0.0) s = (del) / max; + else s = 0.0; + + h = 0; + if (s != 0.0) { + rc = (max - rd) / del; + gc = (max - gd) / del; + bc = (max - bd) / del; + + if (rd==max) h = bc - gc; + else if (gd==max) h = 2 + rc - bc; + else if (bd==max) h = 4 + gc - rc; + + if (h<0) h += 6; + } + + hsv[0] = h; + hsv[1] = s; + hsv[2] = v; +} + + +/* h 0 - 6, s 0 - 1, v 0 - 1 + rgb 0 - 1 */ +void hsv2rgb(hsv, rgb) + double *hsv; + double *rgb; +{ + double h = hsv[0], s = hsv[1], v = hsv[2]; + int j; + double rd, gd, bd; + double f, p, q, t; + + while (h >= 6.0) h = h - 6.0; + while (h < 0.0) h = h + 6.0; + j = (int) floor(h); + f = h - j; + p = v * (1-s); + q = v * (1 - (s*f)); + t = v * (1 - (s*(1 - f))); + + switch (j) { + case 0: rd = v; gd = t; bd = p; break; + case 1: rd = q; gd = v; bd = p; break; + case 2: rd = p; gd = v; bd = t; break; + case 3: rd = p; gd = q; bd = v; break; + case 4: rd = t; gd = p; bd = v; break; + case 5: rd = v; gd = p; bd = q; break; + default: rd = v; gd = t; bd = p; break; + } + + rgb[0] = rd; + rgb[1] = gd; + rgb[2] = bd; +} + +double flam3_calc_alpha(double density, double gamma, double linrange) { + + double dnorm = density; + double funcval = pow(linrange, gamma); + double frac,alpha; + + if (dnorm>0) { + if (dnorm < linrange) { + frac = dnorm/linrange; + alpha = (1.0-frac) * dnorm * (funcval / linrange) + frac * pow(dnorm,gamma); + } else + alpha = pow(dnorm,gamma); + } else + alpha = 0; + + return(alpha); +} + +void flam3_calc_newrgb(double *cbuf, double ls, double highpow, double *newrgb) { + + int rgbi; + double newls,lsratio; + double newhsv[3]; + double a, maxa=-1.0, maxc=0; + double adjhlp; + + if (ls==0.0) { + newrgb[0] = 0.0; + newrgb[1] = 0.0; + newrgb[2] = 0.0; + return; + } + + /* Identify the most saturated channel */ + for (rgbi=0;rgbi<3;rgbi++) { + a = ls * (cbuf[rgbi]/PREFILTER_WHITE); + if (a>maxa) { + maxa = a; + maxc = cbuf[rgbi]/PREFILTER_WHITE; + } + } + + /* If a channel is saturated and we have a non-negative highlight power */ + /* modify the color to prevent hue shift */ + if (maxa>255 && highpow>=0.0) { + newls = 255.0/maxc; + lsratio = pow(newls/ls,highpow); + + /* Calculate the max-value color (ranged 0 - 1) */ + for (rgbi=0;rgbi<3;rgbi++) + newrgb[rgbi] = newls*(cbuf[rgbi]/PREFILTER_WHITE)/255.0; + + /* Reduce saturation by the lsratio */ + rgb2hsv(newrgb,newhsv); + newhsv[1] *= lsratio; + hsv2rgb(newhsv,newrgb); + + for (rgbi=0;rgbi<3;rgbi++) + newrgb[rgbi] *= 255.0; + + } else { + newls = 255.0/maxc; + adjhlp = -highpow; + if (adjhlp>1) + adjhlp=1; + if (maxa<=255) + adjhlp=1.0; + + /* Calculate the max-value color (ranged 0 - 1) interpolated with the old behaviour */ + for (rgbi=0;rgbi<3;rgbi++) + newrgb[rgbi] = ((1.0-adjhlp)*newls + adjhlp*ls)*(cbuf[rgbi]/PREFILTER_WHITE); + +// for (rgbi=0;rgbi<3;rgbi++) +// newrgb[rgbi] = ls*(cbuf[rgbi]/PREFILTER_WHITE); + } +} + +static int random_xform(flam3_genome *g, int excluded) { + int ntries = 0; + while (ntries++ < 100) { + int i = random() % g->num_xforms; + if (g->xform[i].density > 0.0 && i != excluded) + return i; + } + return -1; +} + + +static double try_colors(flam3_genome *g, int color_resolution) { + int *hist; + int i, hits, res = color_resolution; + int res3 = res * res * res; + flam3_frame f; + unsigned char *image, *p; + flam3_genome saved; + double scalar; + int pixtotal; + stat_struct stats; + + memset(&saved, 0, sizeof(flam3_genome)); + + flam3_copy(&saved, g); + + g->sample_density = 1; + g->spatial_oversample = 1; + g->estimator = 0.0; + + /* Scale the image so that the total number of pixels is ~10000 */ + pixtotal = g->width * g->height; + scalar = sqrt( 10000.0 / (double)pixtotal); + g->width *= scalar; + g->height *= scalar; + g->pixels_per_unit *= scalar; + +// g->width = 100; // XXX keep aspect ratio +// g->height = 100; +// g->pixels_per_unit = 50; + g->nbatches = 1; + g->ntemporal_samples = 1; + +// f.temporal_filter_radius = 0.0; + flam3_init_frame(&f); + f.bits = 33; + f.bytes_per_channel=1; + f.verbose = 0; + f.genomes = g; + f.ngenomes = 1; + f.earlyclip = 1; + f.pixel_aspect_ratio = 1.0; + f.progress = 0; + f.nthreads = 1; + + image = (unsigned char *) calloc(g->width * g->height, 3); + if (flam3_render(&f, image, flam3_field_both, 3, 0, &stats)) { + fprintf(stderr,"Error rendering test image for trycolors. Aborting.\n"); + exit(1); + } + + hist = calloc(sizeof(int), res3); + p = image; + for (i = 0; i < g->height * g->width; i++) { + hist[(p[0] * res / 256) + + (p[1] * res / 256) * res + + (p[2] * res / 256) * res * res]++; + p += 3; + } + + if (0) { + int j, k; + for (i = 0; i < res; i++) { + fprintf(stderr, "\ni=%d: \n", i); + for (j = 0; j < res; j++) { + for (k = 0; k < res; k++) { + fprintf(stderr, " %5d", hist[i * res * res + j * res + k]); + } + fprintf(stderr, "\n"); + } + } + } + + hits = 0; + for (i = 0; i < res3; i++) { + if (hist[i]) hits++; + } + + free(hist); + free(image); + + g->sample_density = saved.sample_density; + g->width = saved.width; + g->height = saved.height; + g->spatial_oversample = saved.spatial_oversample; + g->pixels_per_unit = saved.pixels_per_unit; + g->nbatches = saved.nbatches; + g->ntemporal_samples = saved.ntemporal_samples; + g->estimator = saved.estimator; + + /* Free xform storage */ + clear_cp(&saved,flam3_defaults_on); + + return (double) hits / res3; +} + +static void change_colors(flam3_genome *g, int change_palette) { + int i; + int x0, x1; + if (change_palette) { + g->hue_rotation = 0.0; + g->palette_index = flam3_get_palette(flam3_palette_random, g->palette, 0.0); + } + for (i = 0; i < g->num_xforms; i++) { + g->xform[i].color = flam3_random01(); + } + x0 = random_xform(g, -1); + x1 = random_xform(g, x0); + if (x0 >= 0 && (random()&1)) g->xform[x0].color = 0.0; + if (x1 >= 0 && (random()&1)) g->xform[x1].color = 1.0; +} + +void flam3_improve_colors(flam3_genome *g, int ntries, int change_palette, int color_resolution) { + int i; + double best, b; + flam3_genome best_genome; + + memset(&best_genome, 0, sizeof(flam3_genome)); + best = try_colors(g, color_resolution); + flam3_copy(&best_genome,g); + for (i = 0; i < ntries; i++) { + change_colors(g, change_palette); + b = try_colors(g, color_resolution); + if (b > best) { + best = b; + flam3_copy(&best_genome,g); + } + } + flam3_copy(g,&best_genome); + clear_cp(&best_genome,flam3_defaults_on); +} + diff --git a/src/palettes.h b/src/palettes.h new file mode 100644 index 0000000..5d7b617 --- /dev/null +++ b/src/palettes.h @@ -0,0 +1,37 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef palettes_included +#define palettes_included + + +typedef struct { + int number; + char name[flam3_name_len]; + unsigned char colors[256][3]; +} lib_palette; + + +void rgb2hsv(double *rgb, double *hsv); +void hsv2rgb(double *hsv, double *rgb); + +double flam3_calc_alpha(double density, double gamma, double linrange); +void flam3_calc_newrgb(double *cbuf, double ls, double highpow, double *newrgb); + +#endif + diff --git a/src/parser.c b/src/parser.c new file mode 100644 index 0000000..272f212 --- /dev/null +++ b/src/parser.c @@ -0,0 +1,1364 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "parser.h" +#include "interpolation.h" +#include "filters.h" +#include + +static int flam3_conversion_failed; + +int flam3_atoi(char *nstr) { + + /* Note that this is NOT thread-safe, but simplifies things significantly. */ + int res; + char *endp; + + /* Reset errno */ + errno=0; + + /* Convert the string using strtol */ + res = strtol(nstr, &endp, 10); + + /* Check errno & return string */ + if (endp!=nstr+strlen(nstr)) { + flam3_conversion_failed = 1; + fprintf(stderr,"flam3_atoi : Error converting :%s: extra chars\n",nstr); + } + if (errno) { + flam3_conversion_failed = 1; + fprintf(stderr,"flam3_atoi : Error converting :%s:\n",nstr); + } + return(res); +} + +double flam3_atof(char *nstr) { + + /* Note that this is NOT thread-safe, but simplifies things significantly. */ + double res; + char *endp; + + /* Reset errno */ + errno=0; + + /* Convert the string using strtod */ + res = strtod(nstr, &endp); + + /* Check errno & return string */ + if (endp!=nstr+strlen(nstr)) { + flam3_conversion_failed = 1; + fprintf(stderr,"flam3_atof: Error converting :%s: extra chars\n",nstr); + } + if (errno) { + flam3_conversion_failed = 1; + fprintf(stderr,"flam3_atof: Error converting :%s:\n",nstr); + } + return(res); +} + +int var2n(const char *s) { + int i; + + for (i = 0; i < flam3_nvariations; i++) + if (!strcmp(s, flam3_variation_names[i])) return i; + + return flam3_variation_none; +} + +int flam3_parse_hexformat_colors(char *colstr, flam3_genome *cp, int numcolors, int chan) { + + int c_idx=0; + int col_count=0; + int r,g,b,a; + int sscanf_ret; + char tmps[2]; + int skip = (int)fabs(chan); + + /* Strip whitespace prior to first color */ + while (isspace( (int)colstr[c_idx])) + c_idx++; + + do { + + /* Parse an RGB triplet at a time... */ + a = 255; + if (chan==3) + sscanf_ret = sscanf(&(colstr[c_idx]),"%2x%2x%2x",&r,&g,&b); + else if (chan==-4) + sscanf_ret = sscanf(&(colstr[c_idx]),"00%2x%2x%2x",&r,&g,&b); + else // chan==4 + sscanf_ret = sscanf(&(colstr[c_idx]),"%2x%2x%2x%2x",&r,&g,&b,&a); + + if ((chan!=4 && sscanf_ret != 3) || (chan==4 && sscanf_ret != 4)) { + fprintf(stderr, "Error: Problem reading hexadecimal color data.\n"); + return(1); + } + + c_idx += 2*skip; + + while (isspace( (int)colstr[c_idx])) + c_idx++; + + cp->palette[col_count].color[0] = r / 255.0; + cp->palette[col_count].color[1] = g / 255.0; + cp->palette[col_count].color[2] = b / 255.0; + cp->palette[col_count].color[3] = a / 255.0; + cp->palette[col_count].index = col_count; + + col_count++; + + } while (col_count0) { + fprintf(stderr,"error: extra data at end of hex color data '%s'\n",&(colstr[c_idx])); + return(1); + } + + return(0); +} + +int flam3_interp_missing_colors(flam3_genome *cp) { + + /* Check for a non-full palette */ + int minix,maxix; + int colorli,colorri; + int wrapmin,wrapmax; + int intl, intr; + int str,enr; + int i,j,k; + double prcr; + + for (i=0; i<256; i++) { + if (cp->palette[i].index >= 0) { + minix = i; + break; + } + } + + if (i==256) { + /* No colors. Set all indices properly. */ + for (i=0;i<256;i++) + cp->palette[i].index = i; + return(1); + } + + wrapmin = minix + 256; + + for (i=255;i>=0;i--) { + if (cp->palette[i].index >= 0) { + maxix = i; + break; + } + } + + wrapmax = maxix - 256; + + /* Loop over the indices looking for negs */ + i = 0; + while(i<256) { + + if (cp->palette[i].index < 0) { + /* Start of a range of negs */ + str = i; + intl = i-1; + colorli = intl; + while (cp->palette[i].index<0 && i<256) { + enr = i; + intr = i+1; + colorri = intr; + i++; + } + + if (intl==-1) { + intl = wrapmax; + colorli = maxix; + } + + if (intr==256) { + intr = wrapmin; + colorri = minix; + } + + for (j=str;j<=enr;j++) { + + prcr = (j-intl)/(double)(intr-intl); + + for (k=0;k<=3;k++) + cp->palette[j].color[k] = cp->palette[colorli].color[k] * (1.0-prcr) + cp->palette[colorri].color[k] * prcr; + + cp->palette[j].index = j; + } + + i = colorri+1; + } else + i ++; + } + + return(0); +} + + +void scan_for_flame_nodes(xmlNode *cur_node, char *parent_file, int default_flag, flam3_genome **all_cps, int *all_ncps) { + + xmlNode *this_node = NULL; + flam3_genome loc_current_cp; + flam3_genome *genome_storage = *all_cps; /* To simplify semantics */ + size_t f3_storage; + int pfe_success; + int col_success; + + memset(&loc_current_cp,0,sizeof(flam3_genome)); + + /* Loop over this level of elements */ + for (this_node=cur_node; this_node; this_node = this_node->next) { + + /* Check to see if this element is a element */ + if (this_node->type == XML_ELEMENT_NODE && !xmlStrcmp(this_node->name, (const xmlChar *)"flame")) { + + /* This is a flame element. Parse it. */ + clear_cp(&loc_current_cp, default_flag); + + pfe_success = parse_flame_element(this_node,&loc_current_cp); + + if (pfe_success>0) { + fprintf(stderr,"error parsing flame element\n"); + all_cps = NULL; /* leaks memory but terminates */ + /* !!! free all_cp properly !!! */ + *all_ncps = 0; + return; + } + + /* Copy this cp into the array */ + f3_storage = (1+*all_ncps)*sizeof(flam3_genome); + genome_storage = realloc(genome_storage, f3_storage); + + /* Must set value of pointer to new storage location */ + *all_cps = genome_storage; + + /* Clear out the realloc'd memory */ + memset(&(genome_storage[*all_ncps]),0,sizeof(flam3_genome)); + + if (loc_current_cp.palette_index != flam3_palette_random) { + flam3_get_palette(loc_current_cp.palette_index, loc_current_cp.palette, + loc_current_cp.hue_rotation); + } + + col_success = flam3_interp_missing_colors(&loc_current_cp); + + loc_current_cp.genome_index = *all_ncps; + memset(loc_current_cp.parent_fname, 0, flam3_parent_fn_len); + strncpy(loc_current_cp.parent_fname,parent_file,flam3_parent_fn_len-1); + + flam3_copy(&(genome_storage[*all_ncps]), &loc_current_cp); + (*all_ncps) ++; + + } else { + /* Check all of the children of this element */ + scan_for_flame_nodes(this_node->children, parent_file, default_flag, all_cps, all_ncps); + } + } + + /* Clear the cp (frees allocated memory) */ + clear_cp(&loc_current_cp, default_flag); + +} + + +int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp) { + flam3_genome *cp = loc_current_cp; + xmlNode *chld_node, *motion_node; + xmlNodePtr edit_node; + xmlAttrPtr att_ptr, cur_att; + int solo_xform=-1; + char *att_str; + int num_std_xforms=-1; + char tmps[2]; + int i,j; + flam3_xform tmpcpy; + flam3_chaos_entry *xaos=NULL; + int num_xaos=0; + + /* Reset the conversion error flag */ + /* NOT threadsafe */ + flam3_conversion_failed=0; + + /* Store this flame element in the current cp */ + + /* Wipe out the current palette, replace with -1 for each element */ + for (i=0;i<256;i++) { + cp->palette[i].color[0] = 0; + cp->palette[i].color[1] = 0; + cp->palette[i].color[2] = 0; + cp->palette[i].color[3] = 0; + cp->palette[i].index = -1; + } + + /* The top level element is a flame element. */ + /* Read the attributes of it and store them. */ + att_ptr = flame_node->properties; + + if (att_ptr==NULL) { + fprintf(stderr, "Error : element has no attributes.\n"); + return(1); + } + + memset(cp->flame_name,0,flam3_name_len+1); + + for (cur_att = att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(flame_node,cur_att->name); + + /* Compare attribute names */ + if (!xmlStrcmp(cur_att->name, (const xmlChar *)"time")) { + cp->time = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"interpolation")) { + if (!strcmp("linear", att_str)) { + cp->interpolation = flam3_interpolation_linear; + } else if (!strcmp("smooth", att_str)) { + cp->interpolation = flam3_interpolation_smooth; + } else { + fprintf(stderr, "warning: unrecognized interpolation type %s.\n", att_str); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"palette_interpolation")) { + if (!strcmp("hsv", att_str)) { + cp->palette_interpolation = flam3_palette_interpolation_hsv; + } else if (!strcmp("sweep", att_str)) { + cp->palette_interpolation = flam3_palette_interpolation_sweep; + } else { + fprintf(stderr, "warning: unrecognized palette interpolation type %s.\n", att_str); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"interpolation_space") || + !xmlStrcmp(cur_att->name, (const xmlChar *)"interpolation_type")) { + + if (!strcmp("linear", att_str)) + cp->interpolation_type = flam3_inttype_linear; + else if (!strcmp("log", att_str)) + cp->interpolation_type = flam3_inttype_log; + else if (!strcmp("old", att_str)) + cp->interpolation_type = flam3_inttype_compat; + else if (!strcmp("older", att_str)) + cp->interpolation_type = flam3_inttype_older; + else + fprintf(stderr,"warning: unrecognized interpolation_type %s.\n",att_str); + + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"name")) { + strncpy(cp->flame_name, att_str, flam3_name_len); + i = (int)strlen(cp->flame_name)-1; + while(i-->0) { + if (isspace(cp->flame_name[i])) + cp->flame_name[i] = '_'; + } + + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"palette")) { + cp->palette_index = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"size")) { + if (sscanf(att_str, "%d %d%1s", &cp->width, &cp->height, tmps) != 2) { + fprintf(stderr,"error: invalid size attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"center")) { + if (sscanf(att_str, "%lf %lf%1s", &cp->center[0], &cp->center[1], tmps) != 2) { + fprintf(stderr,"error: invalid center attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + cp->rot_center[0] = cp->center[0]; + cp->rot_center[1] = cp->center[1]; + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"scale")) { + cp->pixels_per_unit = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"rotate")) { + cp->rotate = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"zoom")) { + cp->zoom = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oversample")) { + cp->spatial_oversample = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"supersample")) { + cp->spatial_oversample = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"filter")) { + cp->spatial_filter_radius = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"filter_shape")) { + if (!strcmp("gaussian", att_str)) + cp->spatial_filter_select = flam3_gaussian_kernel; + else if (!strcmp("hermite", att_str)) + cp->spatial_filter_select = flam3_hermite_kernel; + else if (!strcmp("box", att_str)) + cp->spatial_filter_select = flam3_box_kernel; + else if (!strcmp("triangle", att_str)) + cp->spatial_filter_select = flam3_triangle_kernel; + else if (!strcmp("bell", att_str)) + cp->spatial_filter_select = flam3_bell_kernel; + else if (!strcmp("bspline", att_str)) + cp->spatial_filter_select = flam3_b_spline_kernel; + else if (!strcmp("mitchell", att_str)) + cp->spatial_filter_select = flam3_mitchell_kernel; + else if (!strcmp("blackman", att_str)) + cp->spatial_filter_select = flam3_blackman_kernel; + else if (!strcmp("catrom", att_str)) + cp->spatial_filter_select = flam3_catrom_kernel; + else if (!strcmp("hanning", att_str)) + cp->spatial_filter_select = flam3_hanning_kernel; + else if (!strcmp("hamming", att_str)) + cp->spatial_filter_select = flam3_hamming_kernel; + else if (!strcmp("lanczos3", att_str)) + cp->spatial_filter_select = flam3_lanczos3_kernel; + else if (!strcmp("lanczos2", att_str)) + cp->spatial_filter_select = flam3_lanczos2_kernel; + else if (!strcmp("quadratic", att_str)) + cp->spatial_filter_select = flam3_quadratic_kernel; + else + fprintf(stderr, "warning: unrecognized kernel shape %s. Using gaussian.\n", att_str); + + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"temporal_filter_type")) { + if (!strcmp("box", att_str)) + cp->temporal_filter_type = flam3_temporal_box; + else if (!strcmp("gaussian", att_str)) + cp->temporal_filter_type = flam3_temporal_gaussian; + else if (!strcmp("exp",att_str)) + cp->temporal_filter_type = flam3_temporal_exp; + else + fprintf(stderr, "warning: unrecognized temporal filter %s. Using box.\n",att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"temporal_filter_width")) { + cp->temporal_filter_width = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"temporal_filter_exp")) { + cp->temporal_filter_exp = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"palette_mode")) { + if (!strcmp("step", att_str)) + cp->palette_mode = flam3_palette_mode_step; + else if (!strcmp("linear", att_str)) + cp->palette_mode = flam3_palette_mode_linear; + else + fprintf(stderr,"warning: unrecognized palette mode %s. Using step.\n",att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"quality")) { + cp->sample_density = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"passes")) { + cp->nbatches = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"temporal_samples")) { + cp->ntemporal_samples = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"background")) { + if (sscanf(att_str, "%lf %lf %lf%1s", &cp->background[0], &cp->background[1], &cp->background[2], tmps) != 3) { + fprintf(stderr,"error: invalid background attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"brightness")) { + cp->brightness = flam3_atof(att_str); +/* } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"contrast")) { + cp->contrast = flam3_atof(att_str);*/ + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"gamma")) { + cp->gamma = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"highlight_power")) { + cp->highlight_power = atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"vibrancy")) { + cp->vibrancy = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"hue")) { + cp->hue_rotation = fmod(flam3_atof(att_str), 1.0); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"estimator_radius")) { + cp->estimator = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"estimator_minimum")) { + cp->estimator_minimum = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"estimator_curve")) { + cp->estimator_curve = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"gamma_threshold")) { + cp->gam_lin_thresh = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"soloxform")) { + solo_xform = flam3_atof(att_str); + } + + xmlFree(att_str); + + } + + /* Finished with flame attributes. Now look at children of flame element. */ + for (chld_node=flame_node->children; chld_node; chld_node = chld_node->next) { + + /* Is this a color node? */ + if (!xmlStrcmp(chld_node->name, (const xmlChar *)"color")) { + int index = -1; + double r=0.0,g=0.0,b=0.0,a=0.0; + + /* Loop through the attributes of the color element */ + att_ptr = chld_node->properties; + + if (att_ptr==NULL) { + fprintf(stderr,"Error: No attributes for color element.\n"); + return(1); + } + + for (cur_att=att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(chld_node,cur_att->name); + + a = 255.0; + + if (!xmlStrcmp(cur_att->name, (const xmlChar *)"index")) { + index = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"rgb")) { + if (sscanf(att_str, "%lf %lf %lf%1s", &r, &g, &b, tmps) != 3) { + fprintf(stderr,"error: invalid rgb attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"rgba")) { + if (sscanf(att_str, "%lf %lf %lf %lf%1s", &r, &g, &b, &a, tmps) != 4) { + fprintf(stderr,"error: invalid rgba attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"a")) { + if (sscanf(att_str, "%lf%1s", &a, tmps) != 1) { + fprintf(stderr,"error: invalid a attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else { + fprintf(stderr,"Error: Unknown color attribute '%s'\n",cur_att->name); + xmlFree(att_str); + return(1); + } + + xmlFree(att_str); + } + + if (index >= 0 && index <= 255) { + cp->palette[index].color[3] = a / 255.0; + /* Don't forget to premultiply the palette... */ + cp->palette[index].color[0] = cp->palette[index].color[3] * r / 255.0; + cp->palette[index].color[1] = cp->palette[index].color[3] * g / 255.0; + cp->palette[index].color[2] = cp->palette[index].color[3] * b / 255.0; + cp->palette[index].index = index; + } else { + fprintf(stderr,"Error: Color element with bad/missing index attribute (%d)\n",index); + return(1); + } + } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"colors")) { + + int count; + + /* Loop through the attributes of the colors element */ + att_ptr = chld_node->properties; + + if (att_ptr==NULL) { + fprintf(stderr,"Error: No attributes for colors element.\n"); + return(1); + } + + for (cur_att=att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(chld_node,cur_att->name); + + if (!xmlStrcmp(cur_att->name, (const xmlChar *)"count")) { + count = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"data")) { + if (flam3_parse_hexformat_colors(att_str, cp, count, -4) > 0) { + fprintf(stderr,"error parsing hexformatted colors\n"); + xmlFree(att_str); + return(1); + } + } else { + fprintf(stderr,"Error: Unknown color attribute '%s'\n",cur_att->name); + xmlFree(att_str); + return(1); + } + + xmlFree(att_str); + } + + + } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"palette")) { + + /* This could be either the old form of palette or the new form */ + /* Make sure BOTH are not specified, otherwise either are ok */ + int numcolors=0; + int numbytes=0; + int old_format=0; + int new_format=0; + int index0, index1; + double hue0, hue1; + double blend = 0.5; + index0 = index1 = flam3_palette_random; + hue0 = hue1 = 0.0; + + /* Loop through the attributes of the palette element */ + att_ptr = chld_node->properties; + + if (att_ptr==NULL) { + fprintf(stderr,"Error: No attributes for palette element.\n"); + return(1); + } + + for (cur_att=att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(chld_node,cur_att->name); + + if (!xmlStrcmp(cur_att->name, (const xmlChar *)"index0")) { + old_format++; + index0 = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"index1")) { + old_format++; + index1 = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"hue0")) { + old_format++; + hue0 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"hue1")) { + old_format++; + hue1 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"blend")) { + old_format++; + blend = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"count")) { + new_format++; + numcolors = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"format")) { + new_format++; + if (!strcmp(att_str,"RGB")) + numbytes=3; + else if (!strcmp(att_str,"RGBA")) + numbytes=4; + else { + fprintf(stderr,"Error: Unrecognized palette format string (%s)\n",att_str); + xmlFree(att_str); + return(1); + } + } else { + fprintf(stderr,"Error: Unknown palette attribute '%s'\n",cur_att->name); + xmlFree(att_str); + return(1); + } + + xmlFree(att_str); + } + + /* Old or new format? */ + if (new_format>0 && old_format>0) { + fprintf(stderr,"Error: mixing of old and new palette tag syntax not allowed.\n"); + return(1); + } + + if (old_format>0) + interpolate_cmap(cp->palette, blend, index0, hue0, index1, hue1); + else { + + char *pal_str; + + /* Read formatted string from contents of tag */ + + pal_str = (char *) xmlNodeGetContent(chld_node); + + if (flam3_parse_hexformat_colors(pal_str, cp, numcolors, numbytes) > 0) { + fprintf(stderr,"error reading hexformatted colors\n"); + xmlFree(pal_str); + return(1); + } + + xmlFree(pal_str); + } + } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"symmetry")) { + + int kind=0; + int bef,aft; + + /* Loop through the attributes of the symmetry element */ + att_ptr = chld_node->properties; + + if (att_ptr==NULL) { + fprintf(stderr,"Error: No attributes for symmetry element.\n"); + return(1); + } + + for (cur_att=att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(chld_node,cur_att->name); + + if (!xmlStrcmp(cur_att->name, (const xmlChar *)"kind")) { + kind = flam3_atoi(att_str); + } else { + fprintf(stderr,"Error: Unknown symmetry attribute '%s'\n",cur_att->name); + xmlFree(att_str); + return(1); + } + + xmlFree(att_str); + } + + bef = cp->num_xforms; + flam3_add_symmetry(cp,kind); + aft = cp->num_xforms; + num_std_xforms += (aft-bef); + + + } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"xform") || + !xmlStrcmp(chld_node->name, (const xmlChar *)"finalxform")) { + + int xf = cp->num_xforms; + + if (!xmlStrcmp(chld_node->name, (const xmlChar *)"finalxform")) { + + if (cp->final_xform_index >=0) { + fprintf(stderr,"Error: Cannot specify more than one final xform.\n"); + return(1); + } + + flam3_add_xforms(cp, 1, 0, 1); + cp->xform[xf].var[0]=0.0; + cp->final_xform_index = xf; + /* Now, if present, the xform enable defaults to on */ + cp->final_xform_enable = 1; + + } else { + + /* Add one to the counter */ + flam3_add_xforms(cp, 1, 0, 0); + + /* If there was already a final xform, we have to change xf to point to the second to last xform */ + if (cp->final_xform_index>=0) + xf--; + + cp->xform[xf].var[0]=0.0; + num_std_xforms++; + + } + + if (parse_xform_xml(chld_node, &(cp->xform[xf]), &num_xaos, &xaos, num_std_xforms, 0) != 0) + return(1); + + if (cp->final_xform_index == xf && cp->xform[xf].density != 0.0) { + fprintf(stderr,"Error: Final xforms should not have weight specified.\n"); + return(1); + } + + /* Check for non-zero motion_* params */ + if (cp->xform[xf].motion_freq != 0 || cp->xform[xf].motion_func != 0) { + fprintf(stderr,"Error: Motion parameters should not be specified in xforms.\n"); + return(1); + } + + + /* Motion Language: Check the xform element for children - should be named 'motion'. */ + for (motion_node=chld_node->children; motion_node; motion_node = motion_node->next) { + + if (!xmlStrcmp(motion_node->name, (const xmlChar *)"motion")) { + + int nm = cp->xform[xf].num_motion; + + /* Add motion element to xform */ + flam3_add_motion_element( &cp->xform[xf] ); + + /* Read motion xml */ + if (parse_xform_xml(motion_node, &(cp->xform[xf].motion[nm]), NULL, NULL, 0, 1) != 0) + return(1); + + } + + } + + } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"edit")) { + + /* Create a new XML document with this edit node as the root node */ + cp->edits = xmlNewDoc( (const xmlChar *)"1.0"); + edit_node = xmlCopyNode( chld_node, 1 ); + xmlDocSetRootElement(cp->edits, edit_node); + + } + } /* Done parsing flame element. */ + + num_std_xforms++; + + for (i=0;i=0 && i!=solo_xform) + cp->xform[i].opacity = 0.0; + + } + + /* Set the chaos array entries with the values in the xaos list */ + for (i=0;ichaos[xaos[i].from][xaos[i].to] = xaos[i].scalar; + + free(xaos); + + /* If there is a final xform in this cp, move it to the end of the list */ + if (cp->final_xform_index >=0 && cp->final_xform_index != (cp->num_xforms-1)) { + /* Make a copy of the final xform */ + tmpcpy = cp->xform[cp->final_xform_index]; + + /* Move each other xform up one */ + for (i=cp->final_xform_index+1;inum_xforms;i++) + cp->xform[i-1] = cp->xform[i]; + + /* Put the final at the end */ + cp->xform[cp->num_xforms-1] = tmpcpy; + + cp->final_xform_index = cp->num_xforms - 1; + } + + /* Check for bad parse */ + if (flam3_conversion_failed) { + fprintf(stderr,"error: parsing a double or int attribute's value.\n"); + return(1); + } + + return(0); + +} + +int parse_xform_xml(xmlNode *chld_node,flam3_xform *this_xform, int *num_xaos, + flam3_chaos_entry **xaos, int numstd, int motionxf) { + + xmlAttrPtr att_ptr, cur_att; + char *att_str, *cpy; + char tmps[2]; + int j,k; + + /* Loop through the attributes of the xform element */ + att_ptr = chld_node->properties; + + if (att_ptr==NULL) { + fprintf(stderr,"Error: No attributes for element.\n"); + return(1); + } + + for (cur_att=att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(chld_node,cur_att->name); + + cpy = att_str; + if (!xmlStrcmp(cur_att->name, (const xmlChar *)"weight")) { + this_xform->density = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"symmetry")) { + /* Deprecated. Set both color_speed and animate to this value. */ + this_xform->color_speed = (1.0-flam3_atof(att_str))/2.0; + this_xform->animate = flam3_atof(att_str)>0 ? 0 : 1; + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"color_speed")) { + this_xform->color_speed = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"animate")) { + this_xform->animate = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"motion_frequency")) { + this_xform->motion_freq = flam3_atoi(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"motion_function")) { + if (!strcmp("sin", att_str)) { + this_xform->motion_func = MOTION_SIN; + } else if (!strcmp("triangle",att_str)) { + this_xform->motion_func = MOTION_TRIANGLE; + } else if (!strcmp("hill",att_str)) { + this_xform->motion_func = MOTION_HILL; + } else { + fprintf(stderr,"Error: unknown motion function '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"color")) { + double tmpc1; + this_xform->color = 0.0; + /* Try two coords first */ + if (sscanf(att_str, "%lf %lf%1s", &this_xform->color, &tmpc1, tmps) != 2) { + /* Try one color */ + if (sscanf(att_str, "%lf%1s", &this_xform->color,tmps) != 1) { + fprintf(stderr,"Error: malformed xform color attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"var1")) { + for (j=0; j < flam3_nvariations; j++) { + this_xform->var[j] = 0.0; + } + j = flam3_atoi(att_str); + + if (j < 0 || j >= flam3_nvariations) { + fprintf(stderr,"Error: Bad variation (%d)\n",j); + xmlFree(att_str); + return(1); + } + + this_xform->var[j] = 1.0; + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"var")) { + for (j=0; j < flam3_nvariations; j++) { + char *cpy2; + errno=0; + this_xform->var[j] = strtod(cpy, &cpy2); + if (errno != 0 || cpy==cpy2) { + fprintf(stderr,"error: bad value in var attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + cpy=cpy2; + } + + if (cpy != att_str+strlen(att_str)) { + fprintf(stderr,"error: extra chars at the end of var attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"chaos")) { + /* Chaos scalars */ + + char *tok; + double scal; + int toi=0; + + if (motionxf==1) { + fprintf(stderr,"error: motion element cannot have a chaos attribute.\n"); + xmlFree(att_str); + return(1); + } + + /* The att string contains at least one value, delimited by a space */ + tok = strtok(cpy," "); + while (tok!=NULL) { + scal = flam3_atof(tok); + + /* Skip 1.0 entries */ + if (scal==1.0) { + toi++; + tok = strtok(NULL," "); + continue; + } + + /* Realloc the xaos list */ + *xaos = realloc((*xaos),(*num_xaos+1) * sizeof(flam3_chaos_entry)); + + /* Populate the xaos list */ + (*xaos)[*num_xaos].from = numstd; + (*xaos)[*num_xaos].to = toi; + (*xaos)[*num_xaos].scalar = scal; + toi++; + (*num_xaos)++; + + /* Get the next token */ + tok = strtok(NULL," "); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"plotmode")) { + + if (motionxf==1) { + fprintf(stderr,"error: motion element cannot have a plotmode attribute.\n"); + xmlFree(att_str); + return(1); + } + + if (!strcmp("off", att_str)) + this_xform->opacity = 0.0; + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"opacity")) { + this_xform->opacity = flam3_atof(att_str); + + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"coefs")) { + for (k=0; k<3; k++) { + for (j=0; j<2; j++) { + char *cpy2; + errno = 0; + this_xform->c[k][j] = strtod(cpy, &cpy2); + if (errno != 0 || cpy==cpy2) { + fprintf(stderr,"error: bad value in coefs attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + cpy=cpy2; + } + } + if (cpy != att_str+strlen(att_str)) { + fprintf(stderr,"error: extra chars at the end of coefs attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"post")) { + for (k = 0; k < 3; k++) { + for (j = 0; j < 2; j++) { + char *cpy2; + errno = 0; + this_xform->post[k][j] = strtod(cpy, &cpy2); + if (errno != 0 || cpy==cpy2) { + fprintf(stderr,"error: bad value in post attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + cpy=cpy2; + } + } + if (cpy != att_str+strlen(att_str)) { + fprintf(stderr,"error: extra chars at end of post attribute '%s'\n",att_str); + xmlFree(att_str); + return(1); + } + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"blob_low")) { + this_xform->blob_low = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"blob_high")) { + this_xform->blob_high = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"blob_waves")) { + this_xform->blob_waves = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pdj_a")) { + this_xform->pdj_a = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pdj_b")) { + this_xform->pdj_b = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pdj_c")) { + this_xform->pdj_c = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pdj_d")) { + this_xform->pdj_d = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"fan2_x")) { + this_xform->fan2_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"fan2_y")) { + this_xform->fan2_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"rings2_val")) { + this_xform->rings2_val = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"perspective_angle")) { + this_xform->perspective_angle = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"perspective_dist")) { + this_xform->perspective_dist = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"julian_power")) { + this_xform->julian_power = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"julian_dist")) { + this_xform->julian_dist = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"juliascope_power")) { + this_xform->juliascope_power = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"juliascope_dist")) { + this_xform->juliascope_dist = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"radial_blur_angle")) { + this_xform->radial_blur_angle = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pie_slices")) { + this_xform->pie_slices = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pie_rotation")) { + this_xform->pie_rotation = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"pie_thickness")) { + this_xform->pie_thickness = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"ngon_sides")) { + this_xform->ngon_sides = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"ngon_power")) { + this_xform->ngon_power = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"ngon_circle")) { + this_xform->ngon_circle = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"ngon_corners")) { + this_xform->ngon_corners = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"curl_c1")) { + this_xform->curl_c1 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"curl_c2")) { + this_xform->curl_c2 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"rectangles_x")) { + this_xform->rectangles_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"rectangles_y")) { + this_xform->rectangles_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"amw_amp")) { + this_xform->amw_amp = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"disc2_rot")) { + this_xform->disc2_rot = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"disc2_twist")) { + this_xform->disc2_twist = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"super_shape_rnd")) { + this_xform->super_shape_rnd = flam3_atof(att_str); + /* Limit to [0,1] */ + if (this_xform->super_shape_rnd<0) + this_xform->super_shape_rnd=0; + else if (this_xform->super_shape_rnd>1) + this_xform->super_shape_rnd=1; + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"super_shape_m")) { + this_xform->super_shape_m = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"super_shape_n1")) { + this_xform->super_shape_n1 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"super_shape_n2")) { + this_xform->super_shape_n2 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"super_shape_n3")) { + this_xform->super_shape_n3 = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"super_shape_holes")) { + this_xform->super_shape_holes = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"flower_petals")) { + this_xform->flower_petals = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"flower_holes")) { + this_xform->flower_holes = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"conic_eccentricity")) { + this_xform->conic_eccentricity = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"conic_holes")) { + this_xform->conic_holes = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"parabola_height")) { + this_xform->parabola_height = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"parabola_width")) { + this_xform->parabola_width = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"bent2_x")) { + this_xform->bent2_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"bent2_y")) { + this_xform->bent2_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"bipolar_shift")) { + this_xform->bipolar_shift = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"cell_size")) { + this_xform->cell_size = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"cpow_i")) { + this_xform->cpow_i = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"cpow_r")) { + this_xform->cpow_r = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"cpow_power")) { + this_xform->cpow_power = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"curve_xamp")) { + this_xform->curve_xamp = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"curve_yamp")) { + this_xform->curve_yamp = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"curve_xlength")) { + this_xform->curve_xlength = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"curve_ylength")) { + this_xform->curve_ylength = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"escher_beta")) { + this_xform->escher_beta = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"lazysusan_x")) { + this_xform->lazysusan_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"lazysusan_y")) { + this_xform->lazysusan_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"lazysusan_spin")) { + this_xform->lazysusan_spin = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"lazysusan_space")) { + this_xform->lazysusan_space = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"lazysusan_twist")) { + this_xform->lazysusan_twist = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"modulus_x")) { + this_xform->modulus_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"modulus_y")) { + this_xform->modulus_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscilloscope_separation")) { + this_xform->oscope_separation = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscilloscope_frequency")) { + this_xform->oscope_frequency = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscilloscope_amplitude")) { + this_xform->oscope_amplitude = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscilloscope_damping")) { + this_xform->oscope_damping = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscope_separation")) { + this_xform->oscope_separation = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscope_frequency")) { + this_xform->oscope_frequency = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscope_amplitude")) { + this_xform->oscope_amplitude = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"oscope_damping")) { + this_xform->oscope_damping = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"popcorn2_x")) { + this_xform->popcorn2_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"popcorn2_y")) { + this_xform->popcorn2_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"popcorn2_c")) { + this_xform->popcorn2_c = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"separation_x")) { + this_xform->separation_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"separation_xinside")) { + this_xform->separation_xinside = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"separation_y")) { + this_xform->separation_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"separation_yinside")) { + this_xform->separation_yinside = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"split_xsize")) { + this_xform->split_xsize = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"split_ysize")) { + this_xform->split_ysize = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"splits_x")) { + this_xform->splits_x = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"splits_y")) { + this_xform->splits_y = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"stripes_space")) { + this_xform->stripes_space = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"stripes_warp")) { + this_xform->stripes_warp = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_angle")) { + this_xform->wedge_angle = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_hole")) { + this_xform->wedge_hole = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_count")) { + this_xform->wedge_count = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_swirl")) { + this_xform->wedge_swirl = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_julia_angle")) { + this_xform->wedge_julia_angle = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_julia_count")) { + this_xform->wedge_julia_count = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_julia_power")) { + this_xform->wedge_julia_power = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_julia_dist")) { + this_xform->wedge_julia_dist = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_sph_angle")) { + this_xform->wedge_sph_angle = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_sph_hole")) { + this_xform->wedge_sph_hole = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_sph_count")) { + this_xform->wedge_sph_count = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"wedge_sph_swirl")) { + this_xform->wedge_sph_swirl = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"whorl_inside")) { + this_xform->whorl_inside = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"whorl_outside")) { + this_xform->whorl_outside = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"waves2_scalex")) { + this_xform->waves2_scalex = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"waves2_scaley")) { + this_xform->waves2_scaley = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"waves2_freqx")) { + this_xform->waves2_freqx = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"waves2_freqy")) { + this_xform->waves2_freqy = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"auger_freq")) { + this_xform->auger_freq = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"auger_weight")) { + this_xform->auger_weight = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"auger_sym")) { + this_xform->auger_sym = flam3_atof(att_str); + } else if (!xmlStrcmp(cur_att->name, (const xmlChar *)"auger_scale")) { + this_xform->auger_scale = flam3_atof(att_str); + } else { + int v = var2n((char *) cur_att->name); + if (v != flam3_variation_none) + this_xform->var[v] = flam3_atof(att_str); + else + fprintf(stderr,"Warning: unrecognized variation %s. Ignoring.\n",(char *)cur_att->name); + } + + + xmlFree(att_str); + } + return(0); +} + +void flam3_edit_print(FILE *f, xmlNodePtr editNode, int tabs, int formatting) { + + char *tab_string = " "; + int ti,strl; + xmlAttrPtr att_ptr=NULL,cur_att=NULL; + xmlNodePtr chld_ptr=NULL, cur_chld=NULL; + int edit_or_sheep = 0, indent_printed = 0; + char *ai; + int tablim = argi("print_edit_depth",0); + + char *att_str,*cont_str,*cpy_string; + + if (tablim>0 && tabs>tablim) + return; + + /* If this node is an XML_ELEMENT_NODE, print it and it's attributes */ + if (editNode->type==XML_ELEMENT_NODE) { + + /* Print the node at the tab specified */ + if (formatting) { + for (ti=0;tiname); + + /* This can either be an edit node or a sheep node */ + /* If it's an edit node, add one to the tab */ + if (!xmlStrcmp(editNode->name, (const xmlChar *)"edit")) { + edit_or_sheep = 1; + tabs ++; + } else if (!xmlStrcmp(editNode->name, (const xmlChar *)"sheep")) + edit_or_sheep = 2; + else + edit_or_sheep = 0; + + + /* Print the attributes */ + att_ptr = editNode->properties; + + for (cur_att = att_ptr; cur_att; cur_att = cur_att->next) { + + att_str = (char *) xmlGetProp(editNode,cur_att->name); + fprintf(f," %s=\"%s\"",cur_att->name,att_str); + xmlFree(att_str); + } + + /* Does this node have children? */ + if (!editNode->children || (tablim>0 && tabs>tablim)) { + /* Close the tag and subtract the tab */ + fprintf(f,"/>"); + if (formatting) + fprintf(f,"\n"); + tabs--; + } else { + + /* Close the tag */ + fprintf(f,">"); + + if (formatting) + fprintf(f,"\n"); + + /* Loop through the children and print them */ + chld_ptr = editNode->children; + + indent_printed = 0; + + for (cur_chld=chld_ptr; cur_chld; cur_chld = cur_chld->next) { + + /* If child is an element, indent first and then print it. */ + if (cur_chld->type==XML_ELEMENT_NODE && + (!xmlStrcmp(cur_chld->name, (const xmlChar *)"edit") || + (!xmlStrcmp(cur_chld->name, (const xmlChar *)"sheep")))) { + + if (indent_printed) { + indent_printed = 0; + fprintf(f,"\n"); + } + + flam3_edit_print(f, cur_chld, tabs, 1); + + } else { + + /* Child is a text node. We don't want to indent more than once. */ + if (xmlIsBlankNode(cur_chld)) + continue; + + if (indent_printed==0 && formatting==1) { + for (ti=0;ti",editNode->name); + + if (formatting) { + fprintf(f,"\n"); + } + } + + } else if (editNode->type==XML_TEXT_NODE) { + + /* Print text node */ + cont_str = (char *) xmlNodeGetContent(editNode); + cpy_string = &(cont_str[0]); + while (isspace(*cpy_string)) + cpy_string++; + + strl = (int)strlen(cont_str)-1; + + while (isspace(cont_str[strl])) + strl--; + + cont_str[strl+1] = 0; + + fprintf(f,"%s",cpy_string); + + } +} + diff --git a/src/parser.h b/src/parser.h new file mode 100644 index 0000000..73d2c68 --- /dev/null +++ b/src/parser.h @@ -0,0 +1,35 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef parser_included +#define parser_included + +#include "private.h" + +int flam3_atoi(char *nstr); +double flam3_atof(char *nstr); +int var2n(const char *s); +int flam3_parse_hexformat_colors(char *colstr, flam3_genome *cp, int numcolors, int chan); + +void scan_for_flame_nodes(xmlNode *cur_node, char *parent_file, int default_flag, flam3_genome **all_cp, int *all_ncps); +int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp); +int parse_xform_xml(xmlNode *chld_node,flam3_xform *this_xform, int *num_xaos, + flam3_chaos_entry **xaos, int numstd, int motionxf); +void flam3_edit_print(FILE *f, xmlNodePtr editNode, int tabs, int formatting); +int flam3_interp_missing_colors(flam3_genome *cp); +#endif diff --git a/src/png.c b/src/png.c new file mode 100755 index 0000000..1bdba5f --- /dev/null +++ b/src/png.c @@ -0,0 +1,229 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#include +#include +#include +#include + +#include "config.h" +#include "img.h" +#include "flam3.h" +#include "private.h" + +#ifdef _WIN32 +#include /* for htons */ +#else +#include +#endif + +void write_png(FILE *file, void *image, int width, int height, flam3_img_comments *fpc, int bpc) { + png_structp png_ptr; + png_infop info_ptr; + png_text text[FLAM3_PNG_COM]; + size_t i; + unsigned short testbe = 1; + void **rows = malloc(sizeof(void *) * height); + char *nick = getenv("nick"); + char *url = getenv("url"); + char *id = getenv("id"); + char *ai; /* For argi */ + int pngcom_enable = argi("enable_png_comments", 1); + + text[0].compression = PNG_TEXT_COMPRESSION_NONE; + text[0].key = "flam3_version"; + text[0].text = flam3_version(); + + text[1].compression = PNG_TEXT_COMPRESSION_NONE; + text[1].key = "flam3_nickname"; + text[1].text = nick; + + text[2].compression = PNG_TEXT_COMPRESSION_NONE; + text[2].key = "flam3_url"; + text[2].text = url; + + text[3].compression = PNG_TEXT_COMPRESSION_NONE; + text[3].key = "flam3_id"; + text[3].text = id; + + text[4].compression = PNG_TEXT_COMPRESSION_NONE; + text[4].key = "flam3_error_rate"; + text[4].text = fpc->badvals; + + text[5].compression = PNG_TEXT_COMPRESSION_NONE; + text[5].key = "flam3_samples"; + text[5].text = fpc->numiters; + + text[6].compression = PNG_TEXT_COMPRESSION_NONE; + text[6].key = "flam3_time"; + text[6].text = fpc->rtime; + + text[7].compression = PNG_TEXT_COMPRESSION_zTXt; + text[7].key = "flam3_genome"; + text[7].text = fpc->genome; + + for (i = 0; i < height; i++) + rows[i] = (unsigned char *)image + i * width * 4 * bpc; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + info_ptr = png_create_info_struct(png_ptr); + + if (setjmp(png_jmpbuf(png_ptr))) { + fclose(file); + png_destroy_write_struct(&png_ptr, &info_ptr); + perror("writing file"); + return; + } + png_init_io(png_ptr, file); + + png_set_IHDR(png_ptr, info_ptr, width, height, 8*bpc, + PNG_COLOR_TYPE_RGBA, + PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_BASE, + PNG_FILTER_TYPE_BASE); + + /* Swap the bytes if we're doing 16bpc and on little-endian platform */ + if (2==bpc && testbe != htons(testbe)) { + unsigned short *im = (unsigned short *)image; + for (i=0; iheight ; y++) + free (png_image[y]); + free (png_image); + } + png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); + perror("reading file"); + return 0; + } + info_ptr = png_create_info_struct (png_ptr); + if (info_ptr == NULL) { + png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL); + fprintf (stderr, "cannot allocate LIBPNG structures\n"); + return 0; + } + + png_init_io (png_ptr, ifp); + png_set_sig_bytes (png_ptr, SIG_CHECK_SIZE); + png_read_info (png_ptr, info_ptr); + + if (8 != info_ptr->bit_depth) { + fprintf(stderr, "bit depth type must be 8, not %d.\n", + info_ptr->bit_depth); + return 0; + } + + *width = info_ptr->width; + *height = info_ptr->height; + p = q = malloc(4 * *width * *height); + png_image = (png_byte **)malloc (info_ptr->height * sizeof (png_byte*)); + + linesize = info_ptr->width; + switch (info_ptr->color_type) { + case PNG_COLOR_TYPE_RGB: + linesize *= 3; + break; + case PNG_COLOR_TYPE_RGBA: + linesize *= 4; + break; + default: + fprintf(stderr, "color type must be RGB or RGBA not %d.\n", + info_ptr->color_type); + return 0; + } + + for (y = 0 ; y < info_ptr->height ; y++) { + png_image[y] = malloc (linesize); + } + png_read_image (png_ptr, png_image); + png_read_end (png_ptr, info_ptr); + + for (y = 0 ; y < info_ptr->height ; y++) { + unsigned char *s = png_image[y]; + for (x = 0 ; x < info_ptr->width ; x++) { + + switch (info_ptr->color_type) { + case PNG_COLOR_TYPE_RGB: + p[0] = s[0]; + p[1] = s[1]; + p[2] = s[2]; + p[3] = 255; + s += 3; + p += 4; + break; + case PNG_COLOR_TYPE_RGBA: + p[0] = s[0]; + p[1] = s[1]; + p[2] = s[2]; + p[3] = s[3]; + s += 4; + p += 4; + break; + } + } + } + + for (y = 0 ; y < info_ptr->height ; y++) + free (png_image[y]); + free (png_image); + png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); + + return q; +} diff --git a/src/private.h b/src/private.h new file mode 100644 index 0000000..156b0d2 --- /dev/null +++ b/src/private.h @@ -0,0 +1,154 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef private_included +#define private_included + +#include "flam3.h" +#include "config.h" +#include + +#include +#include +#include +#include + +#ifdef _WIN32 +#define basename(x) strdup(x) +#define snprintf _snprintf +#define _USE_MATH_DEFINES +#else +#include +#include +#endif + +#include + +#ifdef HAVE_LIBPTHREAD +#include +#endif + +#define PREFILTER_WHITE 255 +#define EPS (1e-10) +#define CMAP_SIZE 256 +#define CMAP_SIZE_M1 255 +#define rbit() (flam3_random_bit()) +#define flam3_variation_none (-1) +#define max_specified_vars (100) +#define vlen(x) (sizeof(x)/sizeof(*x)) + + +#ifdef _WIN32 + +#ifndef M_PI + #define M_PI 3.1415926536 + #define M_1_PI 0.3183098862 + #define M_PI_4 0.7853981634 +#endif +#define random() (rand() ^ (rand()<<15)) +#define srandom(x) (srand(x)) +extern int getpid(); +#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5)) +#endif + +#define argi(s,d) ((ai = getenv(s)) ? atoi(ai) : (d)) +#define argf(s,d) ((ai = getenv(s)) ? atof(ai) : (d)) +#define args(s,d) ((ai = getenv(s)) ? ai : (d)) + +void docstring(); + +/* Structures for passing parameters to iteration threads */ +typedef struct { + unsigned short *xform_distrib; /* Distribution of xforms based on weights */ + flam3_frame *spec; /* Frame contains timing information */ + double bounds[4]; /* Corner coords of viewable area */ + double rot[2][2]; /* Rotation transformation */ + double size[2]; + int width, height; /* buffer width/height */ + double ws0, wb0s0, hs1, hb1s1; /* shortcuts for indexing */ + flam3_palette_entry *dmap; /* palette */ + double color_scalar; /* <1.0 if non-uniform motion blur is set */ + void *buckets; /* Points to the first accumulator */ + double badvals; /* accumulates all badvalue resets */ + double batch_size; + int temporal_sample_num,ntemporal_samples; + int batch_num, nbatches, aborted; + time_t *progress_timer; + time_t *progress_timer_history; + double *progress_history; + int *progress_history_mark; +#ifdef HAVE_LIBPTHREAD + /* mutex for bucket accumulator */ + pthread_mutex_t bucket_mutex; +#endif + +} flam3_iter_constants; + +typedef struct { + + double tx,ty; /* Starting coordinates */ + + double precalc_atan, precalc_sina; /* Precalculated, if needed */ + double precalc_cosa, precalc_sqrt; + double precalc_sumsq,precalc_atanyx; + + flam3_xform *xform; /* For the important values */ + + /* Output Coords */ + + double p0, p1; + + /* Pointer to the isaac RNG state */ + randctx *rc; + +} flam3_iter_helper; + +typedef struct { + double *iter_storage; /* Storage for iteration coordinates */ + randctx rc; /* Thread-unique ISAAC seed */ + flam3_genome cp; /* Full copy of genome for use by the thread */ + int first_thread; + int timer_initialize; + flam3_iter_constants *fic; /* Constants for render */ +} flam3_thread_helper; + +double flam3_sinc(double x); + +#define flam3_num_spatialfilters 14 +double flam3_gaussian_filter(double x); +double flam3_hermite_filter(double t); +double flam3_box_filter(double t); +double flam3_triangle_filter(double t); +double flam3_bell_filter(double t); +double flam3_b_spline_filter(double t); +double flam3_lanczos3_filter(double t); +double flam3_lanczos2_filter(double t); +double flam3_mitchell_filter(double t); +double flam3_blackman_filter(double x); +double flam3_catrom_filter(double x); +double flam3_hamming_filter(double x); +double flam3_hanning_filter(double x); +double flam3_quadratic_filter(double x); + +double flam3_spatial_filter(int knum, double x); + +#define flam3_mitchell_b (1.0 / 3.0) +#define flam3_mitchell_c (1.0 / 3.0) + + +#endif diff --git a/src/rect.c b/src/rect.c new file mode 100644 index 0000000..49a1313 --- /dev/null +++ b/src/rect.c @@ -0,0 +1,1268 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + 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 . +*/ + +/* this file is included into flam3.c once for each buffer bit-width */ + +/* + * for batch + * generate de filters + * for temporal_sample_batch + * interpolate + * compute colormap + * for subbatch + * compute samples + * buckets += cmap[samples] + * accum += time_filter[temporal_sample_batch] * log[buckets] * de_filter + * image = filter(accum) + */ + + +/* allow this many iterations for settling into attractor */ +#define FUSE 100 +#define WHITE_LEVEL 255 + + +typedef struct { + + bucket *b; + abucket *accumulate; + int width, height, oversample; + flam3_de_helper *de; + double k1,k2; + double curve; + int last_thread; + int start_row, end_row; + flam3_frame *spec; + int *aborted; + int progress_size; + +} de_thread_helper; + +static void de_thread(void *dth) { + + de_thread_helper *dthp = (de_thread_helper *)dth; + int oversample = dthp->oversample; + int ss = (int)floor(oversample / 2.0); + int scf = !(oversample & 1); + double scfact = pow(oversample/(oversample+1.0), 2.0); + int wid=dthp->width; + int hig=dthp->height; + int ps =dthp->progress_size; + int str = (oversample-1)+dthp->start_row; + int enr = (oversample-1)+dthp->end_row; + int i,j; + time_t progress_timer=0; + struct timespec pauset; + int progress_count = 0; + int pixel_num; + + pauset.tv_sec = 0; + pauset.tv_nsec = 100000000; + + /* Density estimation code */ + for (j = str; j < enr; j++) { + for (i = oversample-1; i < wid-(oversample-1); i++) { + + int ii,jj; + double f_select=0.0; + int f_select_int,f_coef_idx; + int arr_filt_width; + bucket *b; + double c[4],ls; + + b = dthp->b + i + j*wid; + + /* Don't do anything if there's no hits here */ + if (b[0][4] == 0 || b[0][3] == 0) + continue; + + /* Count density in ssxss area */ + /* Scale if OS>1 for equal iters */ + for (ii=-ss; ii<=ss; ii++) { + for (jj=-ss; jj<=ss; jj++) { + b = dthp->b + (i + ii) + (j + jj)*wid; + f_select += b[0][4]/255.0; + } + } + + if (scf) + f_select *= scfact; + + if (f_select > dthp->de->max_filtered_counts) + f_select_int = dthp->de->max_filter_index; + else if (f_select<=DE_THRESH) + f_select_int = (int)ceil(f_select)-1; + else + f_select_int = (int)DE_THRESH + + (int)floor(pow(f_select-DE_THRESH,dthp->curve)); + + /* If the filter selected below the min specified clamp it to the min */ + if (f_select_int > dthp->de->max_filter_index) + f_select_int = dthp->de->max_filter_index; + + /* We only have to calculate the values for ~1/8 of the square */ + f_coef_idx = f_select_int*dthp->de->kernel_size; + + arr_filt_width = (int)ceil(dthp->de->filter_widths[f_select_int])-1; + + b = dthp->b + i + j*wid; + + for (jj=0; jj<=arr_filt_width; jj++) { + for (ii=0; ii<=jj; ii++) { + + /* Skip if coef is 0 */ + if (dthp->de->filter_coefs[f_coef_idx]==0.0) { + f_coef_idx++; + continue; + } + + c[0] = (double) b[0][0]; + c[1] = (double) b[0][1]; + c[2] = (double) b[0][2]; + c[3] = (double) b[0][3]; + + ls = dthp->de->filter_coefs[f_coef_idx]*(dthp->k1 * log(1.0 + c[3] * dthp->k2))/c[3]; + + c[0] *= ls; + c[1] *= ls; + c[2] *= ls; + c[3] *= ls; + + if (jj==0 && ii==0) { + add_c_to_accum(dthp->accumulate,i,ii,j,jj,wid,hig,c); + } + else if (ii==0) { + add_c_to_accum(dthp->accumulate,i,jj,j,0,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-jj,j,0,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,0,j,jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,0,j,-jj,wid,hig,c); + } else if (jj==ii) { + add_c_to_accum(dthp->accumulate,i,ii,j,jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-ii,j,jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,ii,j,-jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-ii,j,-jj,wid,hig,c); + } else { + add_c_to_accum(dthp->accumulate,i,ii,j,jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-ii,j,jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,ii,j,-jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-ii,j,-jj,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,jj,j,ii,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-jj,j,ii,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,jj,j,-ii,wid,hig,c); + add_c_to_accum(dthp->accumulate,i,-jj,j,-ii,wid,hig,c); + } + + f_coef_idx++; + + } + } + } + + pixel_num = (j-str+1)*wid; + + if (dthp->last_thread) { + /* Standard progress function */ + if (dthp->spec->verbose && time(NULL) != progress_timer) { + progress_timer = time(NULL); + fprintf(stderr, "\rdensity estimation: %d/%d ", j-str, enr-str); + fflush(stderr); + } + + } + /* Custom progress function */ + if (dthp->spec->progress && pixel_num > progress_count + ps) { + + progress_count = ps * floor(pixel_num/(double)ps); + + if (dthp->last_thread) { + + int rv = (*dthp->spec->progress)(dthp->spec->progress_parameter, + 100*(j-str)/(double)(enr-str), 1, 0); + + if (rv==2) { /* PAUSE */ + + *(dthp->aborted) = -1; + + do { +#if defined(_WIN32) /* mingw or msvc */ + Sleep(100); +#else + nanosleep(&pauset,NULL); +#endif + rv = (*dthp->spec->progress)(dthp->spec->progress_parameter, + 100*(j-str)/(double)(enr-str), 1, 0); + } while (rv==2); + + *(dthp->aborted) = 0; + + } + + if (rv==1) { + *(dthp->aborted) = 1; +#ifdef HAVE_LIBPTHREAD + pthread_exit((void *)0); +#else + return; +#endif + } + } else { +#ifdef HAVE_LIBPTHREAD + + if (*(dthp->aborted)<0) { + + do { +#if defined(_WIN32) /* mingw or msvc */ + Sleep(100); +#else + nanosleep(&pauset,NULL); +#endif + } while (*(dthp->aborted)<0); + } + + if (*(dthp->aborted)>0) pthread_exit((void *)0); +#else + if (*(dthp->aborted)>0) return; +#endif + } + } + + } + + #ifdef HAVE_LIBPTHREAD + pthread_exit((void *)0); + #endif + +} + +static void iter_thread(void *fth) { + double sub_batch; + int j; + flam3_thread_helper *fthp = (flam3_thread_helper *)fth; + flam3_iter_constants *ficp = fthp->fic; + struct timespec pauset; + int SBS = ficp->spec->sub_batch_size; + + double eta = 0.0; + + pauset.tv_sec = 0; + pauset.tv_nsec = 100000000; + + + if (fthp->timer_initialize) { + *(ficp->progress_timer) = 0; + memset(ficp->progress_timer_history,0,64*sizeof(time_t)); + memset(ficp->progress_history,0,64*sizeof(double)); + *(ficp->progress_history_mark) = 0; + } + + for (sub_batch = 0; sub_batch < ficp->batch_size; sub_batch+=SBS) { + int sub_batch_size, badcount; + time_t newt = time(NULL); + /* sub_batch is double so this is sketchy */ + sub_batch_size = (sub_batch + SBS > ficp->batch_size) ? + (ficp->batch_size - sub_batch) : SBS; + + if (fthp->first_thread && newt != *(ficp->progress_timer)) { + double percent = 100.0 * + ((((sub_batch / (double) ficp->batch_size) + ficp->temporal_sample_num) + / ficp->ntemporal_samples) + ficp->batch_num)/ficp->nbatches; + int old_mark = 0; + int ticker; + + if (ficp->spec->verbose) + fprintf(stderr, "\rchaos: %5.1f%%", percent); + + *(ficp->progress_timer) = newt; + if (ficp->progress_timer_history[*(ficp->progress_history_mark)] && + ficp->progress_history[*(ficp->progress_history_mark)] < percent) + old_mark = *(ficp->progress_history_mark); + + if (percent > 0) { + eta = (100 - percent) * (*(ficp->progress_timer) - ficp->progress_timer_history[old_mark]) + / (percent - ficp->progress_history[old_mark]); + + if (ficp->spec->verbose) { + ticker = (*(ficp->progress_timer)&1)?':':'.'; + if (eta < 1000) + ticker = ':'; + if (eta > 100) + fprintf(stderr, " ETA%c %.1f minutes", ticker, eta / 60); + else + fprintf(stderr, " ETA%c %ld seconds ", ticker, (long) ceil(eta)); + fprintf(stderr, " \r"); + fflush(stderr); + } + } + + ficp->progress_timer_history[*(ficp->progress_history_mark)] = *(ficp->progress_timer); + ficp->progress_history[*(ficp->progress_history_mark)] = percent; + *(ficp->progress_history_mark) = (*(ficp->progress_history_mark) + 1) % 64; + } + + /* Custom progress function */ + if (ficp->spec->progress) { + if (fthp->first_thread) { + + int rv; + + /* Recalculate % done, as the other calculation only updates once per second */ + double percent = 100.0 * + ((((sub_batch / (double) ficp->batch_size) + ficp->temporal_sample_num) + / ficp->ntemporal_samples) + ficp->batch_num)/ficp->nbatches; + + rv = (*ficp->spec->progress)(ficp->spec->progress_parameter, percent, 0, eta); + + if (rv==2) { /* PAUSE */ + + time_t tnow = time(NULL); + time_t tend; + int lastpt; + + ficp->aborted = -1; + + do { +#if defined(_WIN32) /* mingw or msvc */ + Sleep(100); +#else + nanosleep(&pauset,NULL); +#endif + rv = (*ficp->spec->progress)(ficp->spec->progress_parameter, percent, 0, eta); + } while (rv==2); + + /* modify the timer history to compensate for the pause */ + tend = time(NULL)-tnow; + + ficp->aborted = 0; + + for (lastpt=0;lastpt<64;lastpt++) { + if (ficp->progress_timer_history[lastpt]) { + ficp->progress_timer_history[lastpt] += tend; + } + } + + } + + if (rv==1) { /* ABORT */ + ficp->aborted = 1; +#ifdef HAVE_LIBPTHREAD + pthread_exit((void *)0); +#else + return; +#endif + } + } else { + if (ficp->aborted<0) { + + do { +#if defined(_WIN32) /* mingw or msvc */ + Sleep(100); +#else + nanosleep(&pauset,NULL); +#endif + } while (ficp->aborted==-1); + } +#ifdef HAVE_LIBPTHREAD + if (ficp->aborted>0) pthread_exit((void *)0); +#else + if (ficp->aborted>0) return; +#endif + } + } + + /* Seed iterations */ + fthp->iter_storage[0] = flam3_random_isaac_11(&(fthp->rc)); + fthp->iter_storage[1] = flam3_random_isaac_11(&(fthp->rc)); + fthp->iter_storage[2] = flam3_random_isaac_01(&(fthp->rc)); + fthp->iter_storage[3] = flam3_random_isaac_01(&(fthp->rc)); + + /* Execute iterations */ + badcount = flam3_iterate(&(fthp->cp), sub_batch_size, FUSE, fthp->iter_storage, ficp->xform_distrib, &(fthp->rc)); + + #if defined(HAVE_LIBPTHREAD) && defined(USE_LOCKS) + /* Lock mutex for access to accumulator */ + pthread_mutex_lock(&ficp->bucket_mutex); + #endif + + /* Add the badcount to the counter */ + ficp->badvals += badcount; + + /* Put them in the bucket accumulator */ + for (j = 0; j < sub_batch_size*4; j+=4) { + double p0, p1, p00, p11; + double dbl_index0,dbl_frac; + double interpcolor[4]; + int ci, color_index0; + double *p = &(fthp->iter_storage[j]); + bucket *b; + + if (fthp->cp.rotate != 0.0) { + p00 = p[0] - fthp->cp.rot_center[0]; + p11 = p[1] - fthp->cp.rot_center[1]; + p0 = p00 * ficp->rot[0][0] + p11 * ficp->rot[0][1] + fthp->cp.rot_center[0]; + p1 = p00 * ficp->rot[1][0] + p11 * ficp->rot[1][1] + fthp->cp.rot_center[1]; + } else { + p0 = p[0]; + p1 = p[1]; + } + + if (p0 >= ficp->bounds[0] && p1 >= ficp->bounds[1] && p0 <= ficp->bounds[2] && p1 <= ficp->bounds[3]) { + + double logvis=1.0; + bucket *buckets = (bucket *)(ficp->buckets); + + /* Skip if invisible */ + if (p[3]==0) + continue; + else + logvis = p[3]; + + b = buckets + (int)(ficp->ws0 * p0 - ficp->wb0s0) + + ficp->width * (int)(ficp->hs1 * p1 - ficp->hb1s1); + +#ifdef USE_FLOAT_INDICES + color_index0 = 0; + + //fprintf(stdout,"%.16f\n",p[2]*256.0); + + while(color_index0 < CMAP_SIZE_M1) { + if (ficp->dmap[color_index0+1].index > p[2]) + break; + else + color_index0++; + } + + if (p[3]==1.0) { + bump_no_overflow(b[0][0], ficp->dmap[color_index0].color[0]); + bump_no_overflow(b[0][1], ficp->dmap[color_index0].color[1]); + bump_no_overflow(b[0][2], ficp->dmap[color_index0].color[2]); + bump_no_overflow(b[0][3], ficp->dmap[color_index0].color[3]); + bump_no_overflow(b[0][4], 255.0); + } else { + bump_no_overflow(b[0][0], logvis*ficp->dmap[color_index0].color[0]); + bump_no_overflow(b[0][1], logvis*ficp->dmap[color_index0].color[1]); + bump_no_overflow(b[0][2], logvis*ficp->dmap[color_index0].color[2]); + bump_no_overflow(b[0][3], logvis*ficp->dmap[color_index0].color[3]); + bump_no_overflow(b[0][4], 255.0); +#else + dbl_index0 = p[2] * CMAP_SIZE; + color_index0 = (int) (dbl_index0); + + if (flam3_palette_mode_linear == fthp->cp.palette_mode) { + if (color_index0 < 0) { + color_index0 = 0; + dbl_frac = 0; + } else if (color_index0 >= CMAP_SIZE_M1) { + color_index0 = CMAP_SIZE_M1-1; + dbl_frac = 1.0; + } else { + /* interpolate between color_index0 and color_index0+1 */ + dbl_frac = dbl_index0 - (double)color_index0; + } + + for (ci=0;ci<4;ci++) { + interpcolor[ci] = ficp->dmap[color_index0].color[ci] * (1.0-dbl_frac) + + ficp->dmap[color_index0+1].color[ci] * dbl_frac; + } + + } else { /* Palette mode step */ + + if (color_index0 < 0) { + color_index0 = 0; + } else if (color_index0 >= CMAP_SIZE_M1) { + color_index0 = CMAP_SIZE_M1; + } + + for (ci=0;ci<4;ci++) + interpcolor[ci] = ficp->dmap[color_index0].color[ci]; + } + + if (p[3]==1.0) { + bump_no_overflow(b[0][0], interpcolor[0]); + bump_no_overflow(b[0][1], interpcolor[1]); + bump_no_overflow(b[0][2], interpcolor[2]); + bump_no_overflow(b[0][3], interpcolor[3]); + bump_no_overflow(b[0][4], 255.0); + } else { + bump_no_overflow(b[0][0], logvis*interpcolor[0]); + bump_no_overflow(b[0][1], logvis*interpcolor[1]); + bump_no_overflow(b[0][2], logvis*interpcolor[2]); + bump_no_overflow(b[0][3], logvis*interpcolor[3]); + bump_no_overflow(b[0][4], 255.0); + } +#endif + + } + } + + #if defined(HAVE_LIBPTHREAD) && defined(USE_LOCKS) + /* Release mutex */ + pthread_mutex_unlock(&ficp->bucket_mutex); + #endif + + } + #ifdef HAVE_LIBPTHREAD + pthread_exit((void *)0); + #endif +} + +static int render_rectangle(flam3_frame *spec, void *out, + int field, int nchan, int transp, stat_struct *stats) { + long nbuckets; + int i, j, k, batch_num, temporal_sample_num; + double nsamples, batch_size; + bucket *buckets; + abucket *accumulate; + double *points; + double *filter, *temporal_filter, *temporal_deltas, *batch_filter; + double ppux=0, ppuy=0; + int image_width, image_height; /* size of the image to produce */ + int out_width; + int filter_width=0; + int bytes_per_channel = spec->bytes_per_channel; + int oversample = spec->genomes[0].spatial_oversample; + double highpow = spec->genomes[0].highlight_power; + int nbatches = spec->genomes[0].nbatches; + int ntemporal_samples = spec->genomes[0].ntemporal_samples; + flam3_palette dmap; + int gutter_width; + double vibrancy = 0.0; + double gamma = 0.0; + double background[3]; + int vib_gam_n = 0; + time_t progress_began=0; + int verbose = spec->verbose; + int gnm_idx,max_gnm_de_fw,de_offset; + flam3_genome cp; + unsigned short *xform_distrib; + flam3_iter_constants fic; + flam3_thread_helper *fth; +#ifdef HAVE_LIBPTHREAD + pthread_attr_t pt_attr; + pthread_t *myThreads=NULL; +#endif + int thread_status; + int thi; + time_t tstart,tend; + double sumfilt; + + char *last_block; + size_t memory_rqd; + + /* Per-render progress timers */ + time_t progress_timer=0; + time_t progress_timer_history[64]; + double progress_history[64]; + int progress_history_mark = 0; + + tstart = time(NULL); + + fic.badvals = 0; + fic.aborted = 0; + + stats->num_iters = 0; + + memset(&cp,0, sizeof(flam3_genome)); + + if (nbatches < 1) { + fprintf(stderr, "nbatches must be positive, not %d.\n", nbatches); + return(1); + } + + if (oversample < 1) { + fprintf(stderr, "oversample must be positive, not %d.\n", oversample); + return(1); + } + + /* Initialize the thread helper structures */ + fth = (flam3_thread_helper *)calloc(spec->nthreads,sizeof(flam3_thread_helper)); + for (i=0;inthreads;i++) + fth[i].cp.final_xform_index=-1; + + /* Set up the output image dimensions, adjusted for scanline */ + image_width = spec->genomes[0].width; + out_width = image_width; + if (field) { + image_height = spec->genomes[0].height / 2; + + if (field == flam3_field_odd) + out = (unsigned char *)out + nchan * bytes_per_channel * out_width; + + out_width *= 2; + } else + image_height = spec->genomes[0].height; + + + /* Spatial Filter kernel creation */ + filter_width = flam3_create_spatial_filter(spec, field, &filter); + + /* handle error */ + if (filter_width<0) { + fprintf(stderr,"flam3_create_spatial_filter returned error: aborting\n"); + return(1); + } + + /* note we must free 'filter' at the end */ + + /* batch filter */ + /* may want to revisit this at some point */ + batch_filter = (double *) malloc(sizeof(double) * nbatches); + for (i=0; igenomes[0].temporal_filter_type, + spec->genomes[0].temporal_filter_exp, + spec->genomes[0].temporal_filter_width, + &temporal_filter, &temporal_deltas); + + + /* + the number of additional rows of buckets we put at the edge so + that the filter doesn't go off the edge + */ + gutter_width = (filter_width - oversample) / 2; + + /* + Check the size of the density estimation filter. + If the 'radius' of the density estimation filter is greater than the + gutter width, we have to pad with more. Otherwise, we can use the same value. + */ + max_gnm_de_fw=0; + for (gnm_idx = 0; gnm_idx < spec->ngenomes; gnm_idx++) { + int this_width = (int)ceil(spec->genomes[gnm_idx].estimator) * oversample; + if (this_width > max_gnm_de_fw) + max_gnm_de_fw = this_width; + } + + /* Add OS-1 for the averaging at the edges, if it's > 0 already */ + if (max_gnm_de_fw>0) + max_gnm_de_fw += (oversample-1); + + /* max_gnm_de_fw is now the number of pixels of additional gutter */ + /* necessary to appropriately perform the density estimation filtering */ + /* Check to see if it's greater than the gutter_width */ + if (max_gnm_de_fw > gutter_width) { + de_offset = max_gnm_de_fw - gutter_width; + gutter_width = max_gnm_de_fw; + } else + de_offset = 0; + + + /* Allocate the space required to render the image */ + fic.height = oversample * image_height + 2 * gutter_width; + fic.width = oversample * image_width + 2 * gutter_width; + + nbuckets = (long)fic.width * (long)fic.height; + memory_rqd = (sizeof(bucket) * nbuckets + sizeof(abucket) * nbuckets + + 4 * sizeof(double) * (size_t)(spec->sub_batch_size) * spec->nthreads); + last_block = (char *) malloc(memory_rqd); + if (NULL == last_block) { + fprintf(stderr, "render_rectangle: cannot malloc %g bytes.\n", (double)memory_rqd); + fprintf(stderr, "render_rectangle: w=%d h=%d nb=%ld.\n", fic.width, fic.height, nbuckets); + return(1); + } + + /* Just free buckets at the end */ + buckets = (bucket *) last_block; + accumulate = (abucket *) (last_block + sizeof(bucket) * nbuckets); + points = (double *) (last_block + (sizeof(bucket) + sizeof(abucket)) * nbuckets); + + if (verbose) { + fprintf(stderr, "chaos: "); + progress_began = time(NULL); + } + + background[0] = background[1] = background[2] = 0.0; + memset((char *) accumulate, 0, sizeof(abucket) * nbuckets); + + + /* Batch loop - outermost */ + for (batch_num = 0; batch_num < nbatches; batch_num++) { + double de_time; + double sample_density=0.0; + double k1, area, k2; + flam3_de_helper de; + + de_time = spec->time + temporal_deltas[batch_num*ntemporal_samples]; + + memset((char *) buckets, 0, sizeof(bucket) * nbuckets); + + /* interpolate and get a control point */ + /* ONLY FOR DENSITY FILTER WIDTH PURPOSES */ + /* additional interpolation will be done in the temporal_sample loop */ + flam3_interpolate(spec->genomes, spec->ngenomes, de_time, 0, &cp); + + /* if instructed to by the genome, create the density estimation */ + /* filter kernels. Check boundary conditions as well. */ + if (cp.estimator < 0.0 || cp.estimator_minimum < 0.0) { + fprintf(stderr,"density estimator filter widths must be >= 0\n"); + return(1); + } + + if (spec->bits <= 32) { + if (cp.estimator > 0.0) { + fprintf(stderr, "warning: density estimation disabled with %d bit buffers.\n", spec->bits); + cp.estimator = 0.0; + } + } + + /* Create DE filters */ + if (cp.estimator > 0.0) { + de = flam3_create_de_filters(cp.estimator,cp.estimator_minimum, + cp.estimator_curve,oversample); + if (de.kernel_size<0) { + fprintf(stderr,"de.kernel_size returned 0 - aborting.\n"); + return(1); + } + } else + de.max_filter_index = 0; + + /* Temporal sample loop */ + for (temporal_sample_num = 0; temporal_sample_num < ntemporal_samples; temporal_sample_num++) { + + double temporal_sample_time; + double color_scalar = temporal_filter[batch_num*ntemporal_samples + temporal_sample_num]; + + temporal_sample_time = spec->time + + temporal_deltas[batch_num*ntemporal_samples + temporal_sample_num]; + + /* Interpolate and get a control point */ + flam3_interpolate(spec->genomes, spec->ngenomes, temporal_sample_time, 0, &cp); + + /* Get the xforms ready to render */ + if (prepare_xform_fn_ptrs(&cp, &spec->rc)) { + fprintf(stderr,"prepare xform pointers returned error: aborting.\n"); + return(1); + } + xform_distrib = flam3_create_xform_distrib(&cp); + if (xform_distrib==NULL) { + fprintf(stderr,"create xform distrib returned error: aborting.\n"); + return(1); + } + + /* compute the colormap entries. */ + /* the input colormap is 256 long with entries from 0 to 1.0 */ + for (j = 0; j < CMAP_SIZE; j++) { + dmap[j].index = cp.palette[(j * 256) / CMAP_SIZE].index / 256.0; + for (k = 0; k < 4; k++) + dmap[j].color[k] = (cp.palette[(j * 256) / CMAP_SIZE].color[k] * WHITE_LEVEL) * color_scalar; + } + + /* compute camera */ + if (1) { + double t0, t1, shift=0.0, corner0, corner1; + double scale; + + if (cp.sample_density <= 0.0) { + fprintf(stderr, + "sample density (quality) must be greater than zero," + " not %g.\n", cp.sample_density); + return(1); + } + + scale = pow(2.0, cp.zoom); + sample_density = cp.sample_density * scale * scale; + + ppux = cp.pixels_per_unit * scale; + ppuy = field ? (ppux / 2.0) : ppux; + ppux /= spec->pixel_aspect_ratio; + switch (field) { + case flam3_field_both: shift = 0.0; break; + case flam3_field_even: shift = -0.5; break; + case flam3_field_odd: shift = 0.5; break; + } + shift = shift / ppux; + t0 = (double) gutter_width / (oversample * ppux); + t1 = (double) gutter_width / (oversample * ppuy); + corner0 = cp.center[0] - image_width / ppux / 2.0; + corner1 = cp.center[1] - image_height / ppuy / 2.0; + fic.bounds[0] = corner0 - t0; + fic.bounds[1] = corner1 - t1 + shift; + fic.bounds[2] = corner0 + image_width / ppux + t0; + fic.bounds[3] = corner1 + image_height / ppuy + t1 + shift; + fic.size[0] = 1.0 / (fic.bounds[2] - fic.bounds[0]); + fic.size[1] = 1.0 / (fic.bounds[3] - fic.bounds[1]); + fic.rot[0][0] = cos(cp.rotate * 2 * M_PI / 360.0); + fic.rot[0][1] = -sin(cp.rotate * 2 * M_PI / 360.0); + fic.rot[1][0] = -fic.rot[0][1]; + fic.rot[1][1] = fic.rot[0][0]; + fic.ws0 = fic.width * fic.size[0]; + fic.wb0s0 = fic.ws0 * fic.bounds[0]; + fic.hs1 = fic.height * fic.size[1]; + fic.hb1s1 = fic.hs1 * fic.bounds[1]; + + } + + /* number of samples is based only on the output image size */ + nsamples = sample_density * image_width * image_height; + + /* how many of these samples are rendered in this loop? */ + batch_size = nsamples / (nbatches * ntemporal_samples); + + stats->num_iters += batch_size; + + /* Fill in the iter constants */ + fic.xform_distrib = xform_distrib; + fic.spec = spec; + fic.batch_size = batch_size / (double)spec->nthreads; + fic.temporal_sample_num = temporal_sample_num; + fic.ntemporal_samples = ntemporal_samples; + fic.batch_num = batch_num; + fic.nbatches = nbatches; + + fic.dmap = (flam3_palette_entry *)dmap; + fic.color_scalar = color_scalar; + fic.buckets = (void *)buckets; + + /* Need a timer per job */ + fic.progress_timer = &progress_timer; + fic.progress_timer_history = &(progress_timer_history[0]); + fic.progress_history = &(progress_history[0]); + fic.progress_history_mark = &progress_history_mark; + + /* Initialize the thread helper structures */ + for (thi = 0; thi < spec->nthreads; thi++) { + + int rk; + /* Create a new isaac state for this thread */ + for (rk = 0; rk < RANDSIZ; rk++) + fth[thi].rc.randrsl[rk] = irand(&spec->rc); + + irandinit(&(fth[thi].rc),1); + + if (0==thi) { + + fth[thi].first_thread=1; + if (0==batch_num && 0==temporal_sample_num) + fth[thi].timer_initialize = 1; + else + fth[thi].timer_initialize = 0; + + } else { + fth[thi].first_thread=0; + fth[thi].timer_initialize = 0; + } + + fth[thi].iter_storage = &(points[thi*(spec->sub_batch_size)*4]); + fth[thi].fic = &fic; + flam3_copy(&(fth[thi].cp),&cp); + + } + +#ifdef HAVE_LIBPTHREAD + /* Let's make some threads */ + myThreads = (pthread_t *)malloc(spec->nthreads * sizeof(pthread_t)); + + #if defined(USE_LOCKS) + pthread_mutex_init(&fic.bucket_mutex, NULL); + #endif + + pthread_attr_init(&pt_attr); + pthread_attr_setdetachstate(&pt_attr,PTHREAD_CREATE_JOINABLE); + + for (thi=0; thi nthreads; thi ++) + pthread_create(&myThreads[thi], &pt_attr, (void *)iter_thread, (void *)(&(fth[thi]))); + + pthread_attr_destroy(&pt_attr); + + /* Wait for them to return */ + for (thi=0; thi < spec->nthreads; thi++) + pthread_join(myThreads[thi], (void **)&thread_status); + + #if defined(USE_LOCKS) + pthread_mutex_destroy(&fic.bucket_mutex); + #endif + + free(myThreads); +#else + for (thi=0; thi < spec->nthreads; thi++) + iter_thread( (void *)(&(fth[thi])) ); +#endif + + /* Free the xform_distrib array */ + free(xform_distrib); + + if (fic.aborted) { + if (verbose) fprintf(stderr, "\naborted!\n"); + goto done; + } + + vibrancy += cp.vibrancy; + gamma += cp.gamma; + background[0] += cp.background[0]; + background[1] += cp.background[1]; + background[2] += cp.background[2]; + vib_gam_n++; + + } + + k1 =(cp.contrast * cp.brightness * + PREFILTER_WHITE * 268.0 * batch_filter[batch_num]) / 256; + area = image_width * image_height / (ppux * ppuy); + k2 = (oversample * oversample * nbatches) / + (cp.contrast * area * WHITE_LEVEL * sample_density * sumfilt); +#if 0 + printf("iw=%d,ih=%d,ppux=%f,ppuy=%f\n",image_width,image_height,ppux,ppuy); + printf("contrast=%f, brightness=%f, PREFILTER=%d, temporal_filter=%f\n", + cp.contrast, cp.brightness, PREFILTER_WHITE, temporal_filter[batch_num]); + printf("oversample=%d, nbatches=%d, area = %f, WHITE_LEVEL=%d, sample_density=%f\n", + oversample, nbatches, area, WHITE_LEVEL, sample_density); + printf("k1=%f,k2=%15.12f\n",k1,k2); +#endif + + if (de.max_filter_index == 0) { + + for (j = 0; j < fic.height; j++) { + for (i = 0; i < fic.width; i++) { + + abucket *a = accumulate + i + j * fic.width; + bucket *b = buckets + i + j * fic.width; + double c[4], ls; + + c[0] = (double) b[0][0]; + c[1] = (double) b[0][1]; + c[2] = (double) b[0][2]; + c[3] = (double) b[0][3]; + if (0.0 == c[3]) + continue; + + ls = (k1 * log(1.0 + c[3] * k2))/c[3]; + c[0] *= ls; + c[1] *= ls; + c[2] *= ls; + c[3] *= ls; + + abump_no_overflow(a[0][0], c[0]); + abump_no_overflow(a[0][1], c[1]); + abump_no_overflow(a[0][2], c[2]); + abump_no_overflow(a[0][3], c[3]); + } + } + } else { + + de_thread_helper *deth; + int de_aborted=0; + int myspan = (fic.height-2*(oversample-1)+1); + int swath = myspan/(spec->nthreads); + + /* Create the de helper structures */ + deth = (de_thread_helper *)calloc(spec->nthreads,sizeof(de_thread_helper)); + + for (thi=0;thi<(spec->nthreads);thi++) { + + /* Set up the contents of the helper structure */ + deth[thi].b = buckets; + deth[thi].accumulate = accumulate; + deth[thi].width = fic.width; + deth[thi].height = fic.height; + deth[thi].oversample = oversample; + deth[thi].progress_size = spec->sub_batch_size/10; + deth[thi].de = &de; + deth[thi].k1 = k1; + deth[thi].k2 = k2; + deth[thi].curve = cp.estimator_curve; + deth[thi].spec = spec; + deth[thi].aborted = &de_aborted; + if ( (spec->nthreads)>myspan) { /* More threads than rows */ + deth[thi].start_row=0; + if (thi==spec->nthreads-1) { + deth[thi].end_row=myspan; + deth[thi].last_thread=1; + } else { + deth[thi].end_row=-1; + deth[thi].last_thread=0; + } + } else { /* Normal case */ + deth[thi].start_row=thi*swath; + deth[thi].end_row=(thi+1)*swath; + if (thi==spec->nthreads-1) { + deth[thi].end_row=myspan; + deth[thi].last_thread=1; + } else { + deth[thi].last_thread=0; + } + } + } + +#ifdef HAVE_LIBPTHREAD + /* Let's make some threads */ + myThreads = (pthread_t *)malloc(spec->nthreads * sizeof(pthread_t)); + + pthread_attr_init(&pt_attr); + pthread_attr_setdetachstate(&pt_attr,PTHREAD_CREATE_JOINABLE); + + for (thi=0; thi nthreads; thi ++) + pthread_create(&myThreads[thi], &pt_attr, (void *)de_thread, (void *)(&(deth[thi]))); + + pthread_attr_destroy(&pt_attr); + + /* Wait for them to return */ + for (thi=0; thi < spec->nthreads; thi++) + pthread_join(myThreads[thi], (void **)&thread_status); + + free(myThreads); +#else + for (thi=0; thi nthreads; thi ++) + de_thread((void *)(&(deth[thi]))); +#endif + + free(deth); + + if (de_aborted) { + if (verbose) fprintf(stderr, "\naborted!\n"); + goto done; + } + + } /* End density estimation loop */ + + + /* If allocated, free the de filter memory for the next batch */ + if (de.max_filter_index > 0) { + free(de.filter_coefs); + free(de.filter_widths); + } + + } + + if (verbose) { + fprintf(stderr, "\rchaos: 100.0%% took: %ld seconds \n", time(NULL) - progress_began); + fprintf(stderr, "filtering..."); + } + + + /* filter the accumulation buffer down into the image */ + if (1) { + int x, y; + double t[4],newrgb[3]; + double g = 1.0 / (gamma / vib_gam_n); + double tmp,a; + double alpha,ls; + int rgbi; + + double linrange = cp.gam_lin_thresh; + + vibrancy /= vib_gam_n; + background[0] /= vib_gam_n/256.0; + background[1] /= vib_gam_n/256.0; + background[2] /= vib_gam_n/256.0; + + /* If we're in the early clip mode, perform this first step to */ + /* apply the gamma correction and clipping before the spat filt */ + + if (spec->earlyclip) { + + for (j = 0; j < fic.height; j++) { + for (i = 0; i < fic.width; i++) { + + abucket *ac = accumulate + i + j*fic.width; + + if (ac[0][3]<=0) { + alpha = 0.0; + ls = 0.0; + } else { + tmp=ac[0][3]/PREFILTER_WHITE; + alpha = flam3_calc_alpha(tmp,g,linrange); + ls = vibrancy * 256.0 * alpha / tmp; + if (alpha<0.0) alpha = 0.0; + if (alpha>1.0) alpha = 1.0; + } + + t[0] = (double)ac[0][0]; + t[1] = (double)ac[0][1]; + t[2] = (double)ac[0][2]; + t[3] = (double)ac[0][3]; + + flam3_calc_newrgb(t, ls, highpow, newrgb); + + for (rgbi=0;rgbi<3;rgbi++) { + a = newrgb[rgbi]; + a += (1.0-vibrancy) * 256.0 * pow( t[rgbi] / PREFILTER_WHITE, g); + if (nchan<=3 || transp==0) + a += ((1.0 - alpha) * background[rgbi]); + else { + if (alpha>0) + a /= alpha; + else + a = 0; + } + + /* Clamp here to ensure proper filter functionality */ + if (a>255) a = 255; + if (a<0) a = 0; + + /* Replace values in accumulation buffer with these new ones */ + ac[0][rgbi] = a; + } + + ac[0][3] = alpha; + + } + } + } + + /* Apply the spatial filter */ + y = de_offset; + for (j = 0; j < image_height; j++) { + x = de_offset; + for (i = 0; i < image_width; i++) { + int ii, jj,rgbi; + void *p; + unsigned short *p16; + unsigned char *p8; + t[0] = t[1] = t[2] = t[3] = 0.0; + for (ii = 0; ii < filter_width; ii++) { + for (jj = 0; jj < filter_width; jj++) { + double k = filter[ii + jj * filter_width]; + abucket *ac = accumulate + x+ii + (y+jj)*fic.width; + + + t[0] += k * ac[0][0]; + t[1] += k * ac[0][1]; + t[2] += k * ac[0][2]; + t[3] += k * ac[0][3]; + + + } + } + + p = (unsigned char *)out + nchan * bytes_per_channel * (i + j * out_width); + p8 = (unsigned char *)p; + p16 = (unsigned short *)p; + + /* The old way, spatial filter first and then clip after gamma */ + if (!spec->earlyclip) { + + tmp=t[3]/PREFILTER_WHITE; + + if (t[3]<=0) { + alpha = 0.0; + ls = 0.0; + } else { + alpha = flam3_calc_alpha(tmp,g,linrange); + ls = vibrancy * 256.0 * alpha / tmp; + if (alpha<0.0) alpha = 0.0; + if (alpha>1.0) alpha = 1.0; + } + + flam3_calc_newrgb(t, ls, highpow, newrgb); + + for (rgbi=0;rgbi<3;rgbi++) { + a = newrgb[rgbi]; + a += (1.0-vibrancy) * 256.0 * pow( t[rgbi] / PREFILTER_WHITE, g); + if (nchan<=3 || transp==0) + a += ((1.0 - alpha) * background[rgbi]); + else { + if (alpha>0) + a /= alpha; + else + a = 0; + } + + /* Clamp here to ensure proper filter functionality */ + if (a>255) a = 255; + if (a<0) a = 0; + + /* Replace values in accumulation buffer with these new ones */ + t[rgbi] = a; + } + t[3] = alpha; + } + + for (rgbi=0;rgbi<3;rgbi++) { + + a = t[rgbi]; + + if (a > 255) + a = 255; + if (a < 0) + a = 0; + + if (2==bytes_per_channel) { + a *= 256.0; /* Scales to [0-65280] */ + p16[rgbi] = (unsigned short) a; + } else { + p8[rgbi] = (unsigned char) a; + } + } + + + if (t[3]>1) + t[3]=1; + if (t[3]<0) + t[3]=0; + + /* alpha */ + if (nchan>3) { + if (transp==1) { + if (2==bytes_per_channel) + p16[3] = (unsigned short) (t[3] * 65535); + else + p8[3] = (unsigned char) (t[3] * 255); + } else { + if (2==bytes_per_channel) + p16[3] = 65535; + else + p8[3] = 255; + } + } + + x += oversample; + } + y += oversample; + } + } + + done: + + stats->badvals = fic.badvals; + + free(temporal_filter); + free(temporal_deltas); + free(batch_filter); + free(filter); + free(buckets); +// free(accumulate); +// free(points); + /* We have to clear the cps in fth first */ + for (thi = 0; thi < spec->nthreads; thi++) { + clear_cp(&(fth[thi].cp),0); + } + free(fth); + clear_cp(&cp,0); + + if (getenv("insert_palette")) { + int ph = 100; + if (ph >= image_height) ph = image_height; + /* insert the palette into the image */ + for (j = 0; j < ph; j++) { + for (i = 0; i < image_width; i++) { + unsigned char *p = (unsigned char *)out + nchan * (i + j * out_width); + p[0] = (unsigned char)dmap[i * 256 / image_width].color[0]; + p[1] = (unsigned char)dmap[i * 256 / image_width].color[1]; + p[2] = (unsigned char)dmap[i * 256 / image_width].color[2]; + } + } + } + + tend = time(NULL); + stats->render_seconds = (int)(tend-tstart); + + return(0); + +} diff --git a/src/render.dsp b/src/render.dsp new file mode 100644 index 0000000..bf99407 --- /dev/null +++ b/src/render.dsp @@ -0,0 +1,143 @@ +# Microsoft Developer Studio Project File - Name="hqi" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=hqi - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "render.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "render.mak" CFG="hqi - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "hqi - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "hqi - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "hqi - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "c:\src\libpng" /I "c:\src\zlib" /I "c:\src\libxml2\include" /I "c:\src\jpeg" /I "c:\src\iconv\include" /I "c:\src\pthreads" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib c:\src\pthreads\pthreadVC2.lib /nologo /subsystem:console /machine:I386 /out:"Release/flam3-render.exe" + +!ELSEIF "$(CFG)" == "hqi - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\src\jpeg" /I "c:\src\libpng" /I "c:\src\zlib" /I "c:\src\libxml2\include" /I "c:\src\iconv\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /Zm1000 /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib c:\src\jpeg\libjpeg.lib c:\src\libpng\libpng.lib c:\src\libxml2\lib\libxml2.lib c:\src\zlib\zlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "hqi - Win32 Release" +# Name "hqi - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\docstring.c +# End Source File +# Begin Source File + +SOURCE=".\flam3-palettes.c" +# End Source File +# Begin Source File + +SOURCE=".\flam3-render.c" +# End Source File +# Begin Source File + +SOURCE=.\flam3.c +# End Source File +# Begin Source File + +SOURCE=.\isaac.c +# End Source File +# Begin Source File + +SOURCE=.\jpeg.c +# End Source File +# Begin Source File + +SOURCE=.\png.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=cmap.h +# End Source File +# Begin Source File + +SOURCE=.\jpeg.h +# End Source File +# Begin Source File + +SOURCE=libifs.h +# End Source File +# Begin Source File + +SOURCE=rect.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/test.flam3 b/src/test.flam3 new file mode 100644 index 0000000..62dcc79 --- /dev/null +++ b/src/test.flam3 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/variations.c b/src/variations.c new file mode 100644 index 0000000..c070b0d --- /dev/null +++ b/src/variations.c @@ -0,0 +1,2521 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "variations.h" +#include "interpolation.h" + +#define badvalue(x) (((x)!=(x))||((x)>1e10)||((x)<-1e10)) + +/* Wrap the sincos function for Macs */ +#if defined(__APPLE__) || defined(_MSC_VER) +#define sincos(x,s,c) *(s)=sin(x); *(c)=cos(x); +#else +extern void sincos(double x, double *s, double *c); +#endif + +#ifdef _MSC_VER +#define trunc (int) +#endif + +char *flam3_variation_names[1+flam3_nvariations] = { + "linear", + "sinusoidal", + "spherical", + "swirl", + "horseshoe", + "polar", + "handkerchief", + "heart", + "disc", + "spiral", + "hyperbolic", + "diamond", + "ex", + "julia", + "bent", + "waves", + "fisheye", + "popcorn", + "exponential", + "power", + "cosine", + "rings", + "fan", + "blob", + "pdj", + "fan2", + "rings2", + "eyefish", + "bubble", + "cylinder", + "perspective", + "noise", + "julian", + "juliascope", + "blur", + "gaussian_blur", + "radial_blur", + "pie", + "ngon", + "curl", + "rectangles", + "arch", + "tangent", + "square", + "rays", + "blade", + "secant2", + "twintrian", + "cross", + "disc2", + "super_shape", + "flower", + "conic", + "parabola", + "bent2", + "bipolar", + "boarders", + "butterfly", + "cell", + "cpow", + "curve", + "edisc", + "elliptic", + "escher", + "foci", + "lazysusan", + "loonie", + "pre_blur", + "modulus", + "oscilloscope", + "polar2", + "popcorn2", + "scry", + "separation", + "split", + "splits", + "stripes", + "wedge", + "wedge_julia", + "wedge_sph", + "whorl", + "waves2", + "exp", + "log", + "sin", + "cos", + "tan", + "sec", + "csc", + "cot", + "sinh", + "cosh", + "tanh", + "sech", + "csch", + "coth", + "auger", + 0 +}; + +/* + * VARIATION FUNCTIONS + * must be of the form void (void *, double) + */ +void var0_linear (flam3_iter_helper *f, double weight) { + /* linear */ + /* nx = tx; + ny = ty; + p[0] += v * nx; + p[1] += v * ny; */ + + f->p0 += weight * f->tx; + f->p1 += weight * f->ty; +} + +void var1_sinusoidal (flam3_iter_helper *f, double weight) { + /* sinusoidal */ + /* nx = sin(tx); + ny = sin(ty); + p[0] += v * nx; + p[1] += v * ny; */ + + f->p0 += weight * sin(f->tx); + f->p1 += weight * sin(f->ty); +} + +void var2_spherical (flam3_iter_helper *f, double weight) { + /* spherical */ + /* double r2 = tx * tx + ty * ty + 1e-6; + nx = tx / r2; + ny = ty / r2; + p[0] += v * nx; + p[1] += v * ny; */ + + double r2 = weight / ( f->precalc_sumsq + EPS); + + f->p0 += r2 * f->tx; + f->p1 += r2 * f->ty; +} + +void var3_swirl (flam3_iter_helper *f, double weight) { + /* swirl */ + /* double r2 = tx * tx + ty * ty; /k here is fun + double c1 = sin(r2); + double c2 = cos(r2); + nx = c1 * tx - c2 * ty; + ny = c2 * tx + c1 * ty; + p[0] += v * nx; + p[1] += v * ny; */ + + double r2 = f->precalc_sumsq; + double c1,c2; + double nx,ny; + + sincos(r2,&c1,&c2); +// double c1 = sin(r2); +// double c2 = cos(r2); + nx = c1 * f->tx - c2 * f->ty; + ny = c2 * f->tx + c1 * f->ty; + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var4_horseshoe (flam3_iter_helper *f, double weight) { + /* horseshoe */ + /* a = atan2(tx, ty); + c1 = sin(a); + c2 = cos(a); + nx = c1 * tx - c2 * ty; + ny = c2 * tx + c1 * ty; + p[0] += v * nx; + p[1] += v * ny; */ + + double r = weight / (f->precalc_sqrt + EPS); + + f->p0 += (f->tx - f->ty) * (f->tx + f->ty) * r; + f->p1 += 2.0 * f->tx * f->ty * r; +} + +void var5_polar (flam3_iter_helper *f, double weight) { + /* polar */ + /* nx = atan2(tx, ty) / M_PI; + ny = sqrt(tx * tx + ty * ty) - 1.0; + p[0] += v * nx; + p[1] += v * ny; */ + + double nx = f->precalc_atan * M_1_PI; + double ny = f->precalc_sqrt - 1.0; + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var6_handkerchief (flam3_iter_helper *f, double weight) { + /* folded handkerchief */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty); + p[0] += v * sin(a+r) * r; + p[1] += v * cos(a-r) * r; */ + + double a = f->precalc_atan; + double r = f->precalc_sqrt; + + f->p0 += weight * r * sin(a+r); + f->p1 += weight * r * cos(a-r); +} + +void var7_heart (flam3_iter_helper *f, double weight) { + /* heart */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty); + a *= r; + p[0] += v * sin(a) * r; + p[1] += v * cos(a) * -r; */ + + double a = f->precalc_sqrt * f->precalc_atan; + double ca,sa; + double r = weight * f->precalc_sqrt; + + sincos(a,&sa,&ca); + + f->p0 += r * sa; + f->p1 += (-r) * ca; +} + +void var8_disc (flam3_iter_helper *f, double weight) { + /* disc */ + /* nx = tx * M_PI; + ny = ty * M_PI; + a = atan2(nx, ny); + r = sqrt(nx*nx + ny*ny); + p[0] += v * sin(r) * a / M_PI; + p[1] += v * cos(r) * a / M_PI; */ + + double a = f->precalc_atan * M_1_PI; + double r = M_PI * f->precalc_sqrt; + double sr,cr; + sincos(r,&sr,&cr); + + f->p0 += weight * sr * a; + f->p1 += weight * cr * a; +} + +void var9_spiral (flam3_iter_helper *f, double weight) { + /* spiral */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty) + 1e-6; + p[0] += v * (cos(a) + sin(r)) / r; + p[1] += v * (sin(a) - cos(r)) / r; */ + + double r = f->precalc_sqrt + EPS; + double r1 = weight/r; + double sr,cr; + sincos(r,&sr,&cr); + + f->p0 += r1 * (f->precalc_cosa + sr); + f->p1 += r1 * (f->precalc_sina - cr); +} + +void var10_hyperbolic (flam3_iter_helper *f, double weight) { + /* hyperbolic */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty) + 1e-6; + p[0] += v * sin(a) / r; + p[1] += v * cos(a) * r; */ + + double r = f->precalc_sqrt + EPS; + + f->p0 += weight * f->precalc_sina / r; + f->p1 += weight * f->precalc_cosa * r; +} + +void var11_diamond (flam3_iter_helper *f, double weight) { + /* diamond */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty); + p[0] += v * sin(a) * cos(r); + p[1] += v * cos(a) * sin(r); */ + + double r = f->precalc_sqrt; + double sr,cr; + sincos(r,&sr,&cr); + + f->p0 += weight * f->precalc_sina * cr; + f->p1 += weight * f->precalc_cosa * sr; +} + +void var12_ex (flam3_iter_helper *f, double weight) { + /* ex */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty); + n0 = sin(a+r); + n1 = cos(a-r); + m0 = n0 * n0 * n0 * r; + m1 = n1 * n1 * n1 * r; + p[0] += v * (m0 + m1); + p[1] += v * (m0 - m1); */ + + double a = f->precalc_atan; + double r = f->precalc_sqrt; + + double n0 = sin(a+r); + double n1 = cos(a-r); + + double m0 = n0 * n0 * n0 * r; + double m1 = n1 * n1 * n1 * r; + + f->p0 += weight * (m0 + m1); + f->p1 += weight * (m0 - m1); +} + +void var13_julia (flam3_iter_helper *f, double weight) { + /* julia */ + /* a = atan2(tx, ty)/2.0; + if (flam3_random_bit()) a += M_PI; + r = pow(tx*tx + ty*ty, 0.25); + nx = r * cos(a); + ny = r * sin(a); + p[0] += v * nx; + p[1] += v * ny; */ + + double r; + double a = 0.5 * f->precalc_atan; + double sa,ca; + + if (flam3_random_isaac_bit(f->rc)) //(flam3_random_bit()) + a += M_PI; + + r = weight * sqrt(f->precalc_sqrt); + + sincos(a,&sa,&ca); + + f->p0 += r * ca; + f->p1 += r * sa; +} + +void var14_bent (flam3_iter_helper *f, double weight) { + /* bent */ + /* nx = tx; + ny = ty; + if (nx < 0.0) nx = nx * 2.0; + if (ny < 0.0) ny = ny / 2.0; + p[0] += v * nx; + p[1] += v * ny; */ + + double nx = f->tx; + double ny = f->ty; + + if (nx < 0.0) + nx = nx * 2.0; + if (ny < 0.0) + ny = ny / 2.0; + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var15_waves (flam3_iter_helper *f, double weight) { + /* waves */ + /* dx = coef[2][0]; + dy = coef[2][1]; + nx = tx + coef[1][0]*sin(ty/((dx*dx)+EPS)); + ny = ty + coef[1][1]*sin(tx/((dy*dy)+EPS)); + p[0] += v * nx; + p[1] += v * ny; */ + + double c10 = f->xform->c[1][0]; + double c11 = f->xform->c[1][1]; + + double nx = f->tx + c10 * sin( f->ty * f->xform->waves_dx2 ); + double ny = f->ty + c11 * sin( f->tx * f->xform->waves_dy2 ); + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var16_fisheye (flam3_iter_helper *f, double weight) { + /* fisheye */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty); + r = 2 * r / (r + 1); + nx = r * cos(a); + ny = r * sin(a); + p[0] += v * nx; + p[1] += v * ny; */ + + double r = f->precalc_sqrt; + + r = 2 * weight / (r+1); + + f->p0 += r * f->ty; + f->p1 += r * f->tx; +} + +void var17_popcorn (flam3_iter_helper *f, double weight) { + /* popcorn */ + /* dx = tan(3*ty); + dy = tan(3*tx); + nx = tx + coef[2][0] * sin(dx); + ny = ty + coef[2][1] * sin(dy); + p[0] += v * nx; + p[1] += v * ny; */ + + double dx = tan(3*f->ty); + double dy = tan(3*f->tx); + + double nx = f->tx + f->xform->c[2][0] * sin(dx); + double ny = f->ty + f->xform->c[2][1] * sin(dy); + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var18_exponential (flam3_iter_helper *f, double weight) { + /* exponential */ + /* dx = exp(tx-1.0); + dy = M_PI * ty; + nx = cos(dy) * dx; + ny = sin(dy) * dx; + p[0] += v * nx; + p[1] += v * ny; */ + + double dx = weight * exp(f->tx - 1.0); + double dy = M_PI * f->ty; + double sdy,cdy; + + sincos(dy,&sdy,&cdy); + + + f->p0 += dx * cdy; + f->p1 += dx * sdy; +} + +void var19_power (flam3_iter_helper *f, double weight) { + /* power */ + /* a = atan2(tx, ty); + sa = sin(a); + r = sqrt(tx*tx + ty*ty); + r = pow(r, sa); + nx = r * precalc_cosa; + ny = r * sa; + p[0] += v * nx; + p[1] += v * ny; */ + + double r = weight * pow(f->precalc_sqrt, f->precalc_sina); + + f->p0 += r * f->precalc_cosa; + f->p1 += r * f->precalc_sina; +} + +void var20_cosine (flam3_iter_helper *f, double weight) { + /* cosine */ + /* nx = cos(tx * M_PI) * cosh(ty); + ny = -sin(tx * M_PI) * sinh(ty); + p[0] += v * nx; + p[1] += v * ny; */ + + double a = f->tx * M_PI; + double sa,ca; + double nx,ny; + + sincos(a,&sa,&ca); + nx = ca * cosh(f->ty); + ny = -sa * sinh(f->ty); + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var21_rings (flam3_iter_helper *f, double weight) { + /* rings */ + /* dx = coef[2][0]; + dx = dx * dx + EPS; + r = sqrt(tx*tx + ty*ty); + r = fmod(r + dx, 2*dx) - dx + r*(1-dx); + a = atan2(tx, ty); + nx = cos(a) * r; + ny = sin(a) * r; + p[0] += v * nx; + p[1] += v * ny; */ + + double dx = f->xform->c[2][0] * f->xform->c[2][0] + EPS; + double r = f->precalc_sqrt; + r = weight * (fmod(r+dx, 2*dx) - dx + r * (1 - dx)); + + f->p0 += r * f->precalc_cosa; + f->p1 += r * f->precalc_sina; +} + +void var22_fan (flam3_iter_helper *f, double weight) { + /* fan */ + /* dx = coef[2][0]; + dy = coef[2][1]; + dx = M_PI * (dx * dx + EPS); + dx2 = dx/2; + a = atan(tx,ty); + r = sqrt(tx*tx + ty*ty); + a += (fmod(a+dy, dx) > dx2) ? -dx2 : dx2; + nx = cos(a) * r; + ny = sin(a) * r; + p[0] += v * nx; + p[1] += v * ny; */ + + double dx = M_PI * (f->xform->c[2][0] * f->xform->c[2][0] + EPS); + double dy = f->xform->c[2][1]; + double dx2 = 0.5 * dx; + + double a = f->precalc_atan; + double r = weight * f->precalc_sqrt; + double sa,ca; + + a += (fmod(a+dy,dx) > dx2) ? -dx2 : dx2; + sincos(a,&sa,&ca); + + f->p0 += r * ca; + f->p1 += r * sa; +} + +void var23_blob (flam3_iter_helper *f, double weight) { + /* blob */ + /* a = atan2(tx, ty); + r = sqrt(tx*tx + ty*ty); + r = r * (bloblow + (blobhigh-bloblow) * (0.5 + 0.5 * sin(blobwaves * a))); + nx = sin(a) * r; + ny = cos(a) * r; + + p[0] += v * nx; + p[1] += v * ny; */ + + double r = f->precalc_sqrt; + double a = f->precalc_atan; + double bdiff = f->xform->blob_high - f->xform->blob_low; + + r = r * (f->xform->blob_low + + bdiff * (0.5 + 0.5 * sin(f->xform->blob_waves * a))); + + f->p0 += weight * f->precalc_sina * r; + f->p1 += weight * f->precalc_cosa * r; +} + +void var24_pdj (flam3_iter_helper *f, double weight) { + /* pdj */ + /* nx1 = cos(pdjb * tx); + nx2 = sin(pdjc * tx); + ny1 = sin(pdja * ty); + ny2 = cos(pdjd * ty); + + p[0] += v * (ny1 - nx1); + p[1] += v * (nx2 - ny2); */ + + double nx1 = cos(f->xform->pdj_b * f->tx); + double nx2 = sin(f->xform->pdj_c * f->tx); + double ny1 = sin(f->xform->pdj_a * f->ty); + double ny2 = cos(f->xform->pdj_d * f->ty); + + f->p0 += weight * (ny1 - nx1); + f->p1 += weight * (nx2 - ny2); +} + +void var25_fan2 (flam3_iter_helper *f, double weight) { + /* fan2 */ + /* a = precalc_atan; + r = precalc_sqrt; + + dy = fan2y; + dx = M_PI * (fan2x * fan2x + EPS); + dx2 = dx / 2.0; + + t = a + dy - dx * (int)((a + dy)/dx); + + if (t > dx2) + a = a - dx2; + else + a = a + dx2; + + nx = sin(a) * r; + ny = cos(a) * r; + + p[0] += v * nx; + p[1] += v * ny; */ + + double dy = f->xform->fan2_y; + double dx = M_PI * (f->xform->fan2_x * f->xform->fan2_x + EPS); + double dx2 = 0.5 * dx; + double a = f->precalc_atan; + double sa,ca; + double r = weight * f->precalc_sqrt; + + double t = a + dy - dx * (int)((a + dy)/dx); + + if (t>dx2) + a = a-dx2; + else + a = a+dx2; + + sincos(a,&sa,&ca); + + f->p0 += r * sa; + f->p1 += r * ca; +} + +void var26_rings2 (flam3_iter_helper *f, double weight) { + /* rings2 */ + /* r = precalc_sqrt; + dx = rings2val * rings2val + EPS; + r += dx - 2.0*dx*(int)((r + dx)/(2.0 * dx)) - dx + r * (1.0-dx); + nx = precalc_sina * r; + ny = precalc_cosa * r; + p[0] += v * nx; + p[1] += v * ny; */ + + double r = f->precalc_sqrt; + double dx = f->xform->rings2_val * f->xform->rings2_val + EPS; + + r += -2.0*dx*(int)((r+dx)/(2.0*dx)) + r * (1.0-dx); + + f->p0 += weight * f->precalc_sina * r; + f->p1 += weight * f->precalc_cosa * r; +} + +void var27_eyefish (flam3_iter_helper *f, double weight) { + /* eyefish */ + /* r = 2.0 * v / (precalc_sqrt + 1.0); + p[0] += r*tx; + p[1] += r*ty; */ + + double r = (weight * 2.0) / (f->precalc_sqrt + 1.0); + + f->p0 += r * f->tx; + f->p1 += r * f->ty; +} + +void var28_bubble (flam3_iter_helper *f, double weight) { + /* bubble */ + + double r = weight / (0.25 * (f->precalc_sumsq) + 1); + + f->p0 += r * f->tx; + f->p1 += r * f->ty; +} + +void var29_cylinder (flam3_iter_helper *f, double weight) { + /* cylinder (01/06) */ + + f->p0 += weight * sin(f->tx); + f->p1 += weight * f->ty; +} + +void var30_perspective (flam3_iter_helper *f, double weight) { + /* perspective (01/06) */ + + double t = 1.0 / (f->xform->perspective_dist - f->ty * f->xform->persp_vsin); + + f->p0 += weight * f->xform->perspective_dist * f->tx * t; + f->p1 += weight * f->xform->persp_vfcos * f->ty * t; +} + +void var31_noise (flam3_iter_helper *f, double weight) { + /* noise (03/06) */ + + double tmpr, sinr, cosr, r; + + tmpr = flam3_random_isaac_01(f->rc) * 2 * M_PI; + sincos(tmpr,&sinr,&cosr); + + r = weight * flam3_random_isaac_01(f->rc); + + f->p0 += f->tx * r * cosr; + f->p1 += f->ty * r * sinr; +} + +void var32_juliaN_generic (flam3_iter_helper *f, double weight) { + /* juliaN (03/06) */ + + int t_rnd = trunc((f->xform->julian_rN)*flam3_random_isaac_01(f->rc)); + + double tmpr = (f->precalc_atanyx + 2 * M_PI * t_rnd) / f->xform->julian_power; + + double r = weight * pow(f->precalc_sumsq, f->xform->julian_cn); + double sina, cosa; + sincos(tmpr,&sina,&cosa); + + f->p0 += r * cosa; + f->p1 += r * sina; +} + +void var33_juliaScope_generic (flam3_iter_helper *f, double weight) { + /* juliaScope (03/06) */ + + int t_rnd = trunc((f->xform->juliascope_rN) * flam3_random_isaac_01(f->rc)); + + double tmpr, r; + double sina, cosa; + + if ((t_rnd & 1) == 0) + tmpr = (2 * M_PI * t_rnd + f->precalc_atanyx) / f->xform->juliascope_power; + else + tmpr = (2 * M_PI * t_rnd - f->precalc_atanyx) / f->xform->juliascope_power; + + sincos(tmpr,&sina,&cosa); + + r = weight * pow(f->precalc_sumsq, f->xform->juliascope_cn); + + f->p0 += r * cosa; + f->p1 += r * sina; +} + +void var34_blur (flam3_iter_helper *f, double weight) { + /* blur (03/06) */ + + double tmpr, sinr, cosr, r; + + tmpr = flam3_random_isaac_01(f->rc) * 2 * M_PI; + sincos(tmpr,&sinr,&cosr); + + r = weight * flam3_random_isaac_01(f->rc); + + f->p0 += r * cosr; + f->p1 += r * sinr; +} + +void var35_gaussian (flam3_iter_helper *f, double weight) { + /* gaussian (09/06) */ + + double ang, r, sina, cosa; + + ang = flam3_random_isaac_01(f->rc) * 2 * M_PI; + sincos(ang,&sina,&cosa); + + r = weight * ( flam3_random_isaac_01(f->rc) + flam3_random_isaac_01(f->rc) + + flam3_random_isaac_01(f->rc) + flam3_random_isaac_01(f->rc) - 2.0 ); + + f->p0 += r * cosa; + f->p1 += r * sina; +} + +void var36_radial_blur (flam3_iter_helper *f, double weight) { + /* radial blur (09/06) */ + /* removed random storage 6/07 */ + + double rndG, ra, rz, tmpa, sa, ca; + + /* Get pseudo-gaussian */ + rndG = weight * (flam3_random_isaac_01(f->rc) + flam3_random_isaac_01(f->rc) + + flam3_random_isaac_01(f->rc) + flam3_random_isaac_01(f->rc) - 2.0); + + /* Calculate angle & zoom */ + ra = f->precalc_sqrt; + tmpa = f->precalc_atanyx + f->xform->radialBlur_spinvar*rndG; + sincos(tmpa,&sa,&ca); + rz = f->xform->radialBlur_zoomvar * rndG - 1; + + f->p0 += ra * ca + rz * f->tx; + f->p1 += ra * sa + rz * f->ty; +} + +void var37_pie(flam3_iter_helper *f, double weight) { + /* pie by Joel Faber (June 2006) */ + + double a, r, sa, ca; + int sl; + + sl = (int) (flam3_random_isaac_01(f->rc) * f->xform->pie_slices + 0.5); + a = f->xform->pie_rotation + + 2.0 * M_PI * (sl + flam3_random_isaac_01(f->rc) * f->xform->pie_thickness) / f->xform->pie_slices; + r = weight * flam3_random_isaac_01(f->rc); + sincos(a,&sa,&ca); + + f->p0 += r * ca; + f->p1 += r * sa; +} + +void var38_ngon(flam3_iter_helper *f, double weight) { + /* ngon by Joel Faber (09/06) */ + + double r_factor,theta,phi,b, amp; + + r_factor = pow(f->precalc_sumsq, f->xform->ngon_power/2.0); + + theta = f->precalc_atanyx; + b = 2*M_PI/f->xform->ngon_sides; + + phi = theta - (b*floor(theta/b)); + if (phi > b/2) + phi -= b; + + amp = f->xform->ngon_corners * (1.0 / (cos(phi) + EPS) - 1.0) + f->xform->ngon_circle; + amp /= (r_factor + EPS); + + f->p0 += weight * f->tx * amp; + f->p1 += weight * f->ty * amp; +} + +void var39_curl(flam3_iter_helper *f, double weight) +{ + double re = 1.0 + f->xform->curl_c1 * f->tx + f->xform->curl_c2 * (f->tx * f->tx - f->ty * f->ty); + double im = f->xform->curl_c1 * f->ty + 2.0 * f->xform->curl_c2 * f->tx * f->ty; + + double r = weight / (re*re + im*im); + + f->p0 += (f->tx * re + f->ty * im) * r; + f->p1 += (f->ty * re - f->tx * im) * r; +} + +void var40_rectangles(flam3_iter_helper *f, double weight) +{ + if (f->xform->rectangles_x==0) + f->p0 += weight * f->tx; + else + f->p0 += weight * ((2 * floor(f->tx / f->xform->rectangles_x) + 1) * f->xform->rectangles_x - f->tx); + + if (f->xform->rectangles_y==0) + f->p1 += weight * f->ty; + else + f->p1 += weight * ((2 * floor(f->ty / f->xform->rectangles_y) + 1) * f->xform->rectangles_y - f->ty); + +} + +void var41_arch(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.Arch; + var + sinr, cosr: double; + begin + SinCos(random * vars[29]*pi, sinr, cosr); + FPx := FPx + sinr*vars[29]; + FPy := FPy + sqr(sinr)/cosr*vars[29]; + end; + */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double ang = flam3_random_isaac_01(f->rc) * weight * M_PI; + double sinr,cosr; + sincos(ang,&sinr,&cosr); + + f->p0 += weight * sinr; + f->p1 += weight * (sinr*sinr)/cosr; + +} + +void var42_tangent(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.Tangent; + begin + FPx := FPx + vars[30] * (sin(FTx)/cos(FTy)); + FPy := FPy + vars[30] * (sin(FTy)/cos(FTy)); + end; + */ + + f->p0 += weight * sin(f->tx)/cos(f->ty); + f->p1 += weight * tan(f->ty); + +} + +void var43_square(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.SquareBlur; + begin + FPx := FPx + vars[31] * (random - 0.5); + FPy := FPy + vars[31] * (random - 0.5); + end; + */ + + f->p0 += weight * (flam3_random_isaac_01(f->rc) - 0.5); + f->p1 += weight * (flam3_random_isaac_01(f->rc) - 0.5); + +} + +void var44_rays(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.Rays; + var + r, sinr, cosr, tgr: double; + begin + SinCos(random * vars[32]*pi, sinr, cosr); + r := vars[32] / (sqr(FTx) + sqr(FTy) + EPS); + tgr := sinr/cosr; + FPx := FPx + tgr * (cos(FTx)*vars[32]) * r; + FPy := FPy + tgr * (sin(FTy)*vars[32]) * r; + end; + */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double ang = weight * flam3_random_isaac_01(f->rc) * M_PI; + double r = weight / (f->precalc_sumsq + EPS); + double tanr = weight * tan(ang) * r; + + + f->p0 += tanr * cos(f->tx); + f->p1 += tanr * sin(f->ty); + +} + +void var45_blade(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.Blade; + var + r, sinr, cosr: double; + begin + r := sqrt(sqr(FTx) + sqr(FTy))*vars[33]; + SinCos(r*random, sinr, cosr); + FPx := FPx + vars[33] * FTx * (cosr + sinr); + FPy := FPy + vars[33] * FTx * (cosr - sinr); + end; + */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double r = flam3_random_isaac_01(f->rc) * weight * f->precalc_sqrt; + double sinr,cosr; + + sincos(r,&sinr,&cosr); + + f->p0 += weight * f->tx * (cosr + sinr); + f->p1 += weight * f->tx * (cosr - sinr); + +} + +void var46_secant2(flam3_iter_helper *f, double weight) +{ + /* Intended as a 'fixed' version of secant */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double r = weight * f->precalc_sqrt; + double cr = cos(r); + double icr = 1.0/cr; + + f->p0 += weight * f->tx; + + if (cr<0) + f->p1 += weight*(icr + 1); + else + f->p1 += weight*(icr - 1); +} + +void var47_twintrian(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.TwinTrian; + var + r, diff, sinr, cosr: double; + begin + r := sqrt(sqr(FTx) + sqr(FTy))*vars[35]; + SinCos(r*random, sinr, cosr); + diff := Math.Log10(sinr*sinr)+cosr; + FPx := FPx + vars[35] * FTx * diff; + FPy := FPy + vars[35] * FTx * (diff - (sinr*pi)); + end; + */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double r = flam3_random_isaac_01(f->rc) * weight * f->precalc_sqrt; + double sinr,cosr,diff; + + sincos(r,&sinr,&cosr); + diff = log10(sinr*sinr)+cosr; + + if (badvalue(diff)) + diff = -30.0; + + f->p0 += weight * f->tx * diff; + f->p1 += weight * f->tx * (diff - sinr*M_PI); + +} + +void var48_cross(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + procedure TXForm.Cross; + var + r: double; + begin + r := vars[36]*sqrt(1/(sqr(sqr(FTx)-sqr(FTy))+EPS)); + FPx := FPx + FTx * r; + FPy := FPy + FTy * r; + end; + */ + + double s = f->tx*f->tx - f->ty*f->ty; + double r = weight * sqrt(1.0 / (s*s+EPS)); + + f->p0 += f->tx * r; + f->p1 += f->ty * r; + +} + +void var49_disc2(flam3_iter_helper *f, double weight) +{ + /* Z+ variation Jan 07 + c := vvar/PI; + k := rot*PI; + sinadd := Sin(add); + cosadd := Cos(add); + cosadd := cosadd - 1; + if (add > 2*PI) then begin + cosadd := cosadd * (1 + add - 2*PI); + sinadd := sinadd * (1 + add - 2*PI) + end + else if (add < -2*PI) then begin + cosadd := cosadd * (1 + add + 2*PI); + sinadd := sinadd * (1 + add + 2*PI) + end + end; + procedure TVariationDisc2.CalcFunction; + var + r, sinr, cosr: extended; + begin + SinCos(k * (FTx^+FTy^), sinr, cosr); //rot*PI + r := c * arctan2(FTx^, FTy^); //vvar/PI + FPx^ := FPx^ + (sinr + cosadd) * r; + FPy^ := FPy^ + (cosr + sinadd) * r; + */ + + double r,t,sinr, cosr; + + t = f->xform->disc2_timespi * (f->tx + f->ty); + sincos(t,&sinr,&cosr); + r = weight * f->precalc_atan / M_PI; + + f->p0 += (sinr + f->xform->disc2_cosadd) * r; + f->p1 += (cosr + f->xform->disc2_sinadd) * r; + +} + +void var50_supershape(flam3_iter_helper *f, double weight) { + + double theta; + double t1,t2,r; + double st,ct; + double myrnd; + + theta = f->xform->super_shape_pm_4 * f->precalc_atanyx + M_PI_4; + + sincos(theta,&st,&ct); + + t1 = fabs(ct); + t1 = pow(t1,f->xform->super_shape_n2); + + t2 = fabs(st); + t2 = pow(t2,f->xform->super_shape_n3); + + myrnd = f->xform->super_shape_rnd; + + r = weight * ( (myrnd*flam3_random_isaac_01(f->rc) + (1.0-myrnd)*f->precalc_sqrt) - f->xform->super_shape_holes) + * pow(t1+t2,f->xform->super_shape_pneg1_n1) / f->precalc_sqrt; + + f->p0 += r * f->tx; + f->p1 += r * f->ty; +} + +void var51_flower(flam3_iter_helper *f, double weight) { + /* cyberxaos, 4/2007 */ + /* theta := arctan2(FTy^, FTx^); + r := (random-holes)*cos(petals*theta); + FPx^ := FPx^ + vvar*r*cos(theta); + FPy^ := FPy^ + vvar*r*sin(theta);*/ + + double theta = f->precalc_atanyx; + double r = weight * (flam3_random_isaac_01(f->rc) - f->xform->flower_holes) * + cos(f->xform->flower_petals*theta) / f->precalc_sqrt; + + f->p0 += r * f->tx; + f->p1 += r * f->ty; +} + +void var52_conic(flam3_iter_helper *f, double weight) { + /* cyberxaos, 4/2007 */ + /* theta := arctan2(FTy^, FTx^); + r := (random - holes)*((eccentricity)/(1+eccentricity*cos(theta))); + FPx^ := FPx^ + vvar*r*cos(theta); + FPy^ := FPy^ + vvar*r*sin(theta); */ + + double ct = f->tx / f->precalc_sqrt; + double r = weight * (flam3_random_isaac_01(f->rc) - f->xform->conic_holes) * + f->xform->conic_eccentricity / (1 + f->xform->conic_eccentricity*ct) / f->precalc_sqrt; + + f->p0 += r * f->tx; + f->p1 += r * f->ty; +} + +void var53_parabola(flam3_iter_helper *f, double weight) { + /* cyberxaos, 4/2007 */ + /* r := sqrt(sqr(FTx^) + sqr(FTy^)); + FPx^ := FPx^ + parabola_height*vvar*sin(r)*sin(r)*random; + FPy^ := FPy^ + parabola_width*vvar*cos(r)*random; */ + + double r = f->precalc_sqrt; + double sr,cr; + + sincos(r,&sr,&cr); + + f->p0 += f->xform->parabola_height * weight * sr*sr * flam3_random_isaac_01(f->rc); + f->p1 += f->xform->parabola_width * weight * cr * flam3_random_isaac_01(f->rc); + +} + +void var54_bent2 (flam3_iter_helper *f, double weight) { + + /* Bent2 in the Apophysis Plugin Pack */ + + double nx = f->tx; + double ny = f->ty; + + if (nx < 0.0) + nx = nx * f->xform->bent2_x; + if (ny < 0.0) + ny = ny * f->xform->bent2_y; + + f->p0 += weight * nx; + f->p1 += weight * ny; +} + +void var55_bipolar (flam3_iter_helper *f, double weight) { + + /* Bipolar in the Apophysis Plugin Pack */ + + double x2y2 = f->precalc_sumsq; + double t = x2y2+1; + double x2 = 2*f->tx; + double ps = -M_PI_2 * f->xform->bipolar_shift; + double y = 0.5 * atan2(2.0 * f->ty, x2y2 - 1.0) + ps; + + if (y > M_PI_2) + y = -M_PI_2 + fmod(y + M_PI_2, M_PI); + else if (y < -M_PI_2) + y = M_PI_2 - fmod(M_PI_2 - y, M_PI); + + f->p0 += weight * 0.25 * M_2_PI * log ( (t+x2) / (t-x2) ); + f->p1 += weight * M_2_PI * y; +} + +void var56_boarders (flam3_iter_helper *f, double weight) { + + /* Boarders in the Apophysis Plugin Pack */ + + double roundX, roundY, offsetX, offsetY; + + roundX = rint(f->tx); + roundY = rint(f->ty); + offsetX = f->tx - roundX; + offsetY = f->ty - roundY; + + if (flam3_random_isaac_01(f->rc) >= 0.75) { + f->p0 += weight*(offsetX*0.5 + roundX); + f->p1 += weight*(offsetY*0.5 + roundY); + } else { + + if (fabs(offsetX) >= fabs(offsetY)) { + + if (offsetX >= 0.0) { + f->p0 += weight*(offsetX*0.5 + roundX + 0.25); + f->p1 += weight*(offsetY*0.5 + roundY + 0.25 * offsetY / offsetX); + } else { + f->p0 += weight*(offsetX*0.5 + roundX - 0.25); + f->p1 += weight*(offsetY*0.5 + roundY - 0.25 * offsetY / offsetX); + } + + } else { + + if (offsetY >= 0.0) { + f->p1 += weight*(offsetY*0.5 + roundY + 0.25); + f->p0 += weight*(offsetX*0.5 + roundX + offsetX/offsetY*0.25); + } else { + f->p1 += weight*(offsetY*0.5 + roundY - 0.25); + f->p0 += weight*(offsetX*0.5 + roundX - offsetX/offsetY*0.25); + } + } + } +} + +void var57_butterfly (flam3_iter_helper *f, double weight) { + + /* Butterfly in the Apophysis Plugin Pack */ + + /* wx is weight*4/sqrt(3*pi) */ + double wx = weight*1.3029400317411197908970256609023; + + double y2 = f->ty*2.0; + double r = wx*sqrt(fabs(f->ty * f->tx)/(EPS + f->tx*f->tx + y2*y2)); + + f->p0 += r * f->tx; + f->p1 += r * y2; + +} + +void var58_cell (flam3_iter_helper *f, double weight) { + + /* Cell in the Apophysis Plugin Pack */ + + double inv_cell_size = 1.0/f->xform->cell_size; + + /* calculate input cell */ + int x = floor(f->tx*inv_cell_size); + int y = floor(f->ty*inv_cell_size); + + /* Offset from cell origin */ + double dx = f->tx - x*f->xform->cell_size; + double dy = f->ty - y*f->xform->cell_size; + + /* interleave cells */ + if (y >= 0) { + if (x >= 0) { + y *= 2; + x *= 2; + } else { + y *= 2; + x = -(2*x+1); + } + } else { + if (x >= 0) { + y = -(2*y+1); + x *= 2; + } else { + y = -(2*y+1); + x = -(2*x+1); + } + } + + f->p0 += weight * (dx + x*f->xform->cell_size); + f->p1 -= weight * (dy + y*f->xform->cell_size); + +} + +void var59_cpow (flam3_iter_helper *f, double weight) { + + /* Cpow in the Apophysis Plugin Pack */ + + double a = f->precalc_atanyx; + double lnr = 0.5 * log(f->precalc_sumsq); + double va = 2.0 * M_PI / f->xform->cpow_power; + double vc = f->xform->cpow_r / f->xform->cpow_power; + double vd = f->xform->cpow_i / f->xform->cpow_power; + double ang = vc*a + vd*lnr + va*floor(f->xform->cpow_power*flam3_random_isaac_01(f->rc)); + double sa,ca; + + double m = weight * exp(vc * lnr - vd * a); + + sincos(ang,&sa,&ca); + + f->p0 += m * ca; + f->p1 += m * sa; + +} + +void var60_curve (flam3_iter_helper *f, double weight) { + + /* Curve in the Apophysis Plugin Pack */ + + double pc_xlen = f->xform->curve_xlength*f->xform->curve_xlength; + double pc_ylen = f->xform->curve_ylength*f->xform->curve_ylength; + + if (pc_xlen<1E-20) pc_xlen = 1E-20; + + if (pc_ylen<1E-20) pc_ylen = 1E-20; + + f->p0 += weight * (f->tx + f->xform->curve_xamp * exp(-f->ty*f->ty/pc_xlen)); + f->p1 += weight * (f->ty + f->xform->curve_yamp * exp(-f->tx*f->tx/pc_ylen)); + +} + +void var61_edisc (flam3_iter_helper *f, double weight) { + + /* Edisc in the Apophysis Plugin Pack */ + + double tmp = f->precalc_sumsq + 1.0; + double tmp2 = 2.0 * f->tx; + double r1 = sqrt(tmp+tmp2); + double r2 = sqrt(tmp-tmp2); + double xmax = (r1+r2) * 0.5; + double a1 = log(xmax + sqrt(xmax - 1.0)); + double a2 = -acos(f->tx/xmax); + double w = weight / 11.57034632; + double snv,csv,snhu,cshu; + + sincos(a1,&snv,&csv); + + snhu = sinh(a2); + cshu = cosh(a2); + + if (f->ty > 0.0) snv = -snv; + + f->p0 += w * cshu * csv; + f->p1 += w * snhu * snv; + +} + +void var62_elliptic (flam3_iter_helper *f, double weight) { + + /* Elliptic in the Apophysis Plugin Pack */ + + double tmp = f->precalc_sumsq + 1.0; + double x2 = 2.0 * f->tx; + double xmax = 0.5 * (sqrt(tmp+x2) + sqrt(tmp-x2)); + double a = f->tx / xmax; + double b = 1.0 - a*a; + double ssx = xmax - 1.0; + double w = weight / M_PI_2; + + if (b<0) + b = 0; + else + b = sqrt(b); + + if (ssx<0) + ssx = 0; + else + ssx = sqrt(ssx); + + f->p0 += w * atan2(a,b); + + if (f->ty > 0) + f->p1 += w * log(xmax + ssx); + else + f->p1 -= w * log(xmax + ssx); + +} + +void var63_escher (flam3_iter_helper *f, double weight) { + + /* Escher in the Apophysis Plugin Pack */ + + double seb,ceb; + double vc,vd; + double m,n; + double sn,cn; + + double a = f->precalc_atanyx; + double lnr = 0.5 * log(f->precalc_sumsq); + + sincos(f->xform->escher_beta,&seb,&ceb); + + vc = 0.5 * (1.0 + ceb); + vd = 0.5 * seb; + + m = weight * exp(vc*lnr - vd*a); + n = vc*a + vd*lnr; + + sincos(n,&sn,&cn); + + f->p0 += m * cn; + f->p1 += m * sn; + +} + +void var64_foci (flam3_iter_helper *f, double weight) { + + /* Foci in the Apophysis Plugin Pack */ + + double expx = exp(f->tx) * 0.5; + double expnx = 0.25 / expx; + double sn,cn,tmp; + + sincos(f->ty,&sn,&cn); + tmp = weight/(expx + expnx - cn); + + f->p0 += tmp * (expx - expnx); + f->p1 += tmp * sn; + +} + +void var65_lazysusan (flam3_iter_helper *f, double weight) { + + /* Lazysusan in the Apophysis Plugin Pack */ + + double x = f->tx - f->xform->lazysusan_x; + double y = f->ty + f->xform->lazysusan_y; + double r = sqrt(x*x + y*y); + double sina, cosa; + + if (rxform->lazysusan_spin + + f->xform->lazysusan_twist*(weight-r); + sincos(a,&sina,&cosa); + r = weight * r; + + f->p0 += r*cosa + f->xform->lazysusan_x; + f->p1 += r*sina - f->xform->lazysusan_y; + } else { + + r = weight * (1.0 + f->xform->lazysusan_space / r); + + f->p0 += r*x + f->xform->lazysusan_x; + f->p1 += r*y - f->xform->lazysusan_y; + + } + +} + +void var66_loonie (flam3_iter_helper *f, double weight) { + + /* Loonie in the Apophysis Plugin Pack */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double r2 = f->precalc_sumsq; + double w2 = weight*weight; + + if (r2 < w2) { + double r = weight * sqrt(w2/r2 - 1.0); + f->p0 += r * f->tx; + f->p1 += r * f->ty; + } else { + f->p0 += weight * f->tx; + f->p1 += weight * f->ty; + } + +} + +void var67_pre_blur (flam3_iter_helper *f, double weight) { + + /* pre-xform: PreBlur (Apo 2.08) */ + + /* Get pseudo-gaussian */ + double rndG = weight * (flam3_random_isaac_01(f->rc) + flam3_random_isaac_01(f->rc) + + flam3_random_isaac_01(f->rc) + flam3_random_isaac_01(f->rc) - 2.0); + double rndA = flam3_random_isaac_01(f->rc) * 2.0 * M_PI; + double sinA,cosA; + + sincos(rndA,&sinA,&cosA); + + /* Note: original coordinate changed */ + f->tx += rndG * cosA; + f->ty += rndG * sinA; + +} + +void var68_modulus (flam3_iter_helper *f, double weight) { + + /* Modulus in the Apophysis Plugin Pack */ + + double xr = 2*f->xform->modulus_x; + double yr = 2*f->xform->modulus_y; + + if (f->tx > f->xform->modulus_x) + f->p0 += weight * (-f->xform->modulus_x + fmod(f->tx + f->xform->modulus_x, xr)); + else if (f->tx < -f->xform->modulus_x) + f->p0 += weight * ( f->xform->modulus_x - fmod(f->xform->modulus_x - f->tx, xr)); + else + f->p0 += weight * f->tx; + + if (f->ty > f->xform->modulus_y) + f->p1 += weight * (-f->xform->modulus_y + fmod(f->ty + f->xform->modulus_y, yr)); + else if (f->ty < -f->xform->modulus_y) + f->p1 += weight * ( f->xform->modulus_y - fmod(f->xform->modulus_y - f->ty, yr)); + else + f->p1 += weight * f->ty; + +} + +void var69_oscope (flam3_iter_helper *f, double weight) { + + /* oscilloscope from the apophysis plugin pack */ + + double tpf = 2 * M_PI * f->xform->oscope_frequency; + double t; + + if (f->xform->oscope_damping == 0.0) + t = f->xform->oscope_amplitude * cos(tpf*f->tx) + f->xform->oscope_separation; + else { + t = f->xform->oscope_amplitude * exp(-fabs(f->tx)*f->xform->oscope_damping) + * cos(tpf*f->tx) + f->xform->oscope_separation; + } + + if (fabs(f->ty) <= t) { + f->p0 += weight*f->tx; + f->p1 -= weight*f->ty; + } else { + f->p0 += weight*f->tx; + f->p1 += weight*f->ty; + } +} + +void var70_polar2 (flam3_iter_helper *f, double weight) { + + /* polar2 from the apophysis plugin pack */ + + double p2v = weight / M_PI; + + f->p0 += p2v * f->precalc_atan; + f->p1 += p2v/2.0 * log(f->precalc_sumsq); +} + +void var71_popcorn2 (flam3_iter_helper *f, double weight) { + + /* popcorn2 from the apophysis plugin pack */ + + f->p0 += weight * ( f->tx + f->xform->popcorn2_x * sin(tan(f->ty*f->xform->popcorn2_c))); + f->p1 += weight * ( f->ty + f->xform->popcorn2_y * sin(tan(f->tx*f->xform->popcorn2_c))); + +} + +void var72_scry (flam3_iter_helper *f, double weight) { + + /* scry from the apophysis plugin pack */ + /* note that scry does not multiply by weight, but as the */ + /* values still approach 0 as the weight approaches 0, it */ + /* should be ok */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double t = f->precalc_sumsq; + double r = 1.0 / (f->precalc_sqrt * (t + 1.0/(weight+EPS))); + + f->p0 += f->tx * r; + f->p1 += f->ty * r; + +} + +void var73_separation (flam3_iter_helper *f, double weight) { + + /* separation from the apophysis plugin pack */ + + double sx2 = f->xform->separation_x * f->xform->separation_x; + double sy2 = f->xform->separation_y * f->xform->separation_y; + + if (f->tx > 0.0) + f->p0 += weight * (sqrt(f->tx*f->tx + sx2)- f->tx*f->xform->separation_xinside); + else + f->p0 -= weight * (sqrt(f->tx*f->tx + sx2)+ f->tx*f->xform->separation_xinside); + + if (f->ty > 0.0) + f->p1 += weight * (sqrt(f->ty*f->ty + sy2)- f->ty*f->xform->separation_yinside); + else + f->p1 -= weight * (sqrt(f->ty*f->ty + sy2)+ f->ty*f->xform->separation_yinside); + +} + +void var74_split (flam3_iter_helper *f, double weight) { + + /* Split from apo plugins pack */ + + if (cos(f->tx*f->xform->split_xsize*M_PI) >= 0) + f->p1 += weight*f->ty; + else + f->p1 -= weight*f->ty; + + if (cos(f->ty*f->xform->split_ysize*M_PI) >= 0) + f->p0 += weight * f->tx; + else + f->p0 -= weight * f->tx; + +} + +void var75_splits (flam3_iter_helper *f, double weight) { + + /* Splits from apo plugins pack */ + + if (f->tx >= 0) + f->p0 += weight*(f->tx+f->xform->splits_x); + else + f->p0 += weight*(f->tx-f->xform->splits_x); + + if (f->ty >= 0) + f->p1 += weight*(f->ty+f->xform->splits_y); + else + f->p1 += weight*(f->ty-f->xform->splits_y); + +} + +void var76_stripes (flam3_iter_helper *f, double weight) { + + /* Stripes from apo plugins pack */ + + double roundx,offsetx; + + roundx = floor(f->tx + 0.5); + offsetx = f->tx - roundx; + + f->p0 += weight * (offsetx*(1.0-f->xform->stripes_space)+roundx); + f->p1 += weight * (f->ty + offsetx*offsetx*f->xform->stripes_warp); + +} + +void var77_wedge (flam3_iter_helper *f, double weight) { + + /* Wedge from apo plugins pack */ + + double r = f->precalc_sqrt; + double a = f->precalc_atanyx + f->xform->wedge_swirl * r; + double c = floor( (f->xform->wedge_count * a + M_PI)*M_1_PI*0.5); + + double comp_fac = 1 - f->xform->wedge_angle*f->xform->wedge_count*M_1_PI*0.5; + double sa, ca; + + a = a * comp_fac + c * f->xform->wedge_angle; + + sincos(a,&sa,&ca); + + r = weight * (r + f->xform->wedge_hole); + + f->p0 += r*ca; + f->p1 += r*sa; + +} + +void var78_wedge_julia (flam3_iter_helper *f, double weight) { + + /* wedge_julia from apo plugin pack */ + + double r = weight * pow(f->precalc_sumsq, f->xform->wedgeJulia_cn); + int t_rnd = (int)((f->xform->wedgeJulia_rN)*flam3_random_isaac_01(f->rc)); + double a = (f->precalc_atanyx + 2 * M_PI * t_rnd) / f->xform->wedge_julia_power; + double c = floor( (f->xform->wedge_julia_count * a + M_PI)*M_1_PI*0.5 ); + double sa,ca; + + a = a * f->xform->wedgeJulia_cf + c * f->xform->wedge_julia_angle; + + sincos(a,&sa,&ca); + + f->p0 += r * ca; + f->p1 += r * sa; +} + +void var79_wedge_sph (flam3_iter_helper *f, double weight) { + + /* Wedge_sph from apo plugins pack */ + + double r = 1.0/(f->precalc_sqrt+EPS); + double a = f->precalc_atanyx + f->xform->wedge_sph_swirl * r; + double c = floor( (f->xform->wedge_sph_count * a + M_PI)*M_1_PI*0.5); + + double comp_fac = 1 - f->xform->wedge_sph_angle*f->xform->wedge_sph_count*M_1_PI*0.5; + double sa, ca; + + a = a * comp_fac + c * f->xform->wedge_sph_angle; + + sincos(a,&sa,&ca); + r = weight * (r + f->xform->wedge_sph_hole); + + f->p0 += r*ca; + f->p1 += r*sa; + +} + +void var80_whorl (flam3_iter_helper *f, double weight) { + + /* whorl from apo plugins pack */ + + /* + * !!! Note !!! + * This code uses the variation weight in a non-standard fashion, and + * it may change or even be removed in future versions of flam3. + */ + + double r = f->precalc_sqrt; + double a,sa,ca; + + if (rprecalc_atanyx + f->xform->whorl_inside/(weight-r); + else + a = f->precalc_atanyx + f->xform->whorl_outside/(weight-r); + + sincos(a,&sa,&ca); + + f->p0 += weight*r*ca; + f->p1 += weight*r*sa; + +} + +void var81_waves2 (flam3_iter_helper *f, double weight) { + + /* waves2 from Joel F */ + + f->p0 += weight*(f->tx + f->xform->waves2_scalex*sin(f->ty * f->xform->waves2_freqx)); + f->p1 += weight*(f->ty + f->xform->waves2_scaley*sin(f->tx * f->xform->waves2_freqy)); + +} + +/* complex vars by cothe */ +/* exp log sin cos tan sec csc cot sinh cosh tanh sech csch coth */ + +void var82_exp (flam3_iter_helper *f, double weight) { + //Exponential EXP + double expe = exp(f->tx); + double expcos,expsin; + sincos(f->ty,&expsin,&expcos); + f->p0 += weight * expe * expcos; + f->p1 += weight * expe * expsin; +} + +void var83_log (flam3_iter_helper *f, double weight) { + //Natural Logarithm LOG + // needs precalc_atanyx and precalc_sumsq + f->p0 += weight * 0.5 * log(f->precalc_sumsq); + f->p1 += weight * f->precalc_atanyx; +} + +void var84_sin (flam3_iter_helper *f, double weight) { + //Sine SIN + double sinsin,sinacos,sinsinh,sincosh; + sincos(f->tx,&sinsin,&sinacos); + sinsinh = sinh(f->ty); + sincosh = cosh(f->ty); + f->p0 += weight * sinsin * sincosh; + f->p1 += weight * sinacos * sinsinh; +} + +void var85_cos (flam3_iter_helper *f, double weight) { + //Cosine COS + double cossin,coscos,cossinh,coscosh; + sincos(f->tx,&cossin,&coscos); + cossinh = sinh(f->ty); + coscosh = cosh(f->ty); + f->p0 += weight * coscos * coscosh; + f->p1 -= weight * cossin * cossinh; +} + +void var86_tan (flam3_iter_helper *f, double weight) { + //Tangent TAN + double tansin,tancos,tansinh,tancosh; + double tanden; + sincos(2*f->tx,&tansin,&tancos); + tansinh = sinh(2.0*f->ty); + tancosh = cosh(2.0*f->ty); + tanden = 1.0/(tancos + tancosh); + f->p0 += weight * tanden * tansin; + f->p1 += weight * tanden * tansinh; +} + +void var87_sec (flam3_iter_helper *f, double weight) { + //Secant SEC + double secsin,seccos,secsinh,seccosh; + double secden; + sincos(f->tx,&secsin,&seccos); + secsinh = sinh(f->ty); + seccosh = cosh(f->ty); + secden = 2.0/(cos(2*f->tx) + cosh(2*f->ty)); + f->p0 += weight * secden * seccos * seccosh; + f->p1 += weight * secden * secsin * secsinh; +} + +void var88_csc (flam3_iter_helper *f, double weight) { + //Cosecant CSC + double cscsin,csccos,cscsinh,csccosh; + double cscden; + sincos(f->tx,&cscsin,&csccos); + cscsinh = sinh(f->ty); + csccosh = cosh(f->ty); + cscden = 2.0/(cosh(2.0*f->ty) - cos(2.0*f->tx)); + f->p0 += weight * cscden * cscsin * csccosh; + f->p1 -= weight * cscden * csccos * cscsinh; +} + +void var89_cot (flam3_iter_helper *f, double weight) { + //Cotangent COT + double cotsin,cotcos,cotsinh,cotcosh; + double cotden; + sincos(2.0*f->tx,&cotsin,&cotcos); + cotsinh = sinh(2.0*f->ty); + cotcosh = cosh(2.0*f->ty); + cotden = 1.0/(cotcosh - cotcos); + f->p0 += weight * cotden * cotsin; + f->p1 += weight * cotden * -1 * cotsinh; +} + +void var90_sinh (flam3_iter_helper *f, double weight) { + //Hyperbolic Sine SINH + double sinhsin,sinhcos,sinhsinh,sinhcosh; + sincos(f->ty,&sinhsin,&sinhcos); + sinhsinh = sinh(f->tx); + sinhcosh = cosh(f->tx); + f->p0 += weight * sinhsinh * sinhcos; + f->p1 += weight * sinhcosh * sinhsin; +} + +void var91_cosh (flam3_iter_helper *f, double weight) { + //Hyperbolic Cosine COSH + double coshsin,coshcos,coshsinh,coshcosh; + sincos(f->ty,&coshsin,&coshcos); + coshsinh = sinh(f->tx); + coshcosh = cosh(f->tx); + f->p0 += weight * coshcosh * coshcos; + f->p1 += weight * coshsinh * coshsin; +} + +void var92_tanh (flam3_iter_helper *f, double weight) { + //Hyperbolic Tangent TANH + double tanhsin,tanhcos,tanhsinh,tanhcosh; + double tanhden; + sincos(2.0*f->ty,&tanhsin,&tanhcos); + tanhsinh = sinh(2.0*f->tx); + tanhcosh = cosh(2.0*f->tx); + tanhden = 1.0/(tanhcos + tanhcosh); + f->p0 += weight * tanhden * tanhsinh; + f->p1 += weight * tanhden * tanhsin; +} + +void var93_sech (flam3_iter_helper *f, double weight) { + //Hyperbolic Secant SECH + double sechsin,sechcos,sechsinh,sechcosh; + double sechden; + sincos(f->ty,&sechsin,&sechcos); + sechsinh = sinh(f->tx); + sechcosh = cosh(f->tx); + sechden = 2.0/(cos(2.0*f->ty) + cosh(2.0*f->tx)); + f->p0 += weight * sechden * sechcos * sechcosh; + f->p1 -= weight * sechden * sechsin * sechsinh; +} + +void var94_csch (flam3_iter_helper *f, double weight) { + //Hyperbolic Cosecant CSCH + double cschsin,cschcos,cschsinh,cschcosh; + double cschden; + sincos(f->ty,&cschsin,&cschcos); + cschsinh = sinh(f->tx); + cschcosh = cosh(f->tx); + cschden = 2.0/(cosh(2.0*f->tx) - cos(2.0*f->ty)); + f->p0 += weight * cschden * cschsinh * cschcos; + f->p1 -= weight * cschden * cschcosh * cschsin; +} + +void var95_coth (flam3_iter_helper *f, double weight) { + //Hyperbolic Cotangent COTH + double cothsin,cothcos,cothsinh,cothcosh; + double cothden; + sincos(2.0*f->ty,&cothsin,&cothcos); + cothsinh = sinh(2.0*f->tx); + cothcosh = cosh(2.0*f->tx); + cothden = 1.0/(cothcosh - cothcos); + f->p0 += weight * cothden * cothsinh; + f->p1 += weight * cothden * cothsin; +} + +void var96_auger (flam3_iter_helper *f, double weight) { + + // Auger, by Xyrus01 + double s = sin(f->xform->auger_freq * f->tx); + double t = sin(f->xform->auger_freq * f->ty); + double dy = f->ty + f->xform->auger_weight*(f->xform->auger_scale*s/2.0 + fabs(f->ty)*s); + double dx = f->tx + f->xform->auger_weight*(f->xform->auger_scale*t/2.0 + fabs(f->tx)*t); + + f->p0 += weight * (f->tx + f->xform->auger_sym*(dx-f->tx)); + f->p1 += weight * dy; +} + +/* Precalc functions */ + +void perspective_precalc(flam3_xform *xf) { + double ang = xf->perspective_angle * M_PI / 2.0; + xf->persp_vsin = sin(ang); + xf->persp_vfcos = xf->perspective_dist * cos(ang); +} + +void juliaN_precalc(flam3_xform *xf) { + xf->julian_rN = fabs(xf->julian_power); + xf->julian_cn = xf->julian_dist / (double)xf->julian_power / 2.0; +} + +void wedgeJulia_precalc(flam3_xform *xf) { + xf->wedgeJulia_cf = 1.0 - xf->wedge_julia_angle * xf->wedge_julia_count * M_1_PI * 0.5; + xf->wedgeJulia_rN = fabs(xf->wedge_julia_power); + xf->wedgeJulia_cn = xf->wedge_julia_dist / xf->wedge_julia_power / 2.0; +} + +void juliaScope_precalc(flam3_xform *xf) { + xf->juliascope_rN = fabs(xf->juliascope_power); + xf->juliascope_cn = xf->juliascope_dist / (double)xf->juliascope_power / 2.0; +} + +void radial_blur_precalc(flam3_xform *xf) { + sincos(xf->radial_blur_angle * M_PI / 2.0, + &xf->radialBlur_spinvar, &xf->radialBlur_zoomvar); +} + +void waves_precalc(flam3_xform *xf) { + double dx = xf->c[2][0]; + double dy = xf->c[2][1]; + + xf->waves_dx2 = 1.0/(dx * dx + EPS); + xf->waves_dy2 = 1.0/(dy * dy + EPS); +} + +void disc2_precalc(flam3_xform *xf) { + double add = xf->disc2_twist; + double k; + + xf->disc2_timespi = xf->disc2_rot * M_PI; + + sincos(add,&xf->disc2_sinadd,&xf->disc2_cosadd); + xf->disc2_cosadd -= 1; + + if (add > 2 * M_PI) { + k = (1 + add - 2*M_PI); + xf->disc2_cosadd *= k; + xf->disc2_sinadd *= k; + } + + if (add < -2 * M_PI) { + k = (1 + add + 2*M_PI); + xf->disc2_cosadd *= k; + xf->disc2_sinadd *= k; + } +} + +void supershape_precalc(flam3_xform *xf) { + xf->super_shape_pm_4 = xf->super_shape_m / 4.0; + xf->super_shape_pneg1_n1 = -1.0 / xf->super_shape_n1; +} + +void xform_precalc(flam3_genome *cp, int xi) { + + perspective_precalc(&(cp->xform[xi])); + juliaN_precalc(&(cp->xform[xi])); + juliaScope_precalc(&(cp->xform[xi])); + radial_blur_precalc(&(cp->xform[xi])); + waves_precalc(&(cp->xform[xi])); + disc2_precalc(&(cp->xform[xi])); + supershape_precalc(&(cp->xform[xi])); + wedgeJulia_precalc(&(cp->xform[xi])); +} + +int prepare_xform_fn_ptrs(flam3_genome *cp, randctx *rc) { + + double d; + int i,j,totnum; + + /* Loop over valid xforms */ + for (i = 0; i < cp->num_xforms; i++) { + d = cp->xform[i].density; + if (d < 0.0) { + fprintf(stderr, "xform %d weight must be non-negative, not %g.\n",i,d); + return(1); + } + + if (i != cp->final_xform_index && d == 0.0) + continue; + + totnum = 0; + + cp->xform[i].vis_adjusted = adjust_percentage(cp->xform[i].opacity); + + cp->xform[i].precalc_angles_flag=0; + cp->xform[i].precalc_atan_xy_flag=0; + cp->xform[i].precalc_atan_yx_flag=0; + cp->xform[i].has_preblur=0; + cp->xform[i].has_post = !(id_matrix(cp->xform[i].post)); + + + for (j = 0; j < flam3_nvariations; j++) { + + if (cp->xform[i].var[j]!=0) { + + cp->xform[i].varFunc[totnum] = j; + cp->xform[i].active_var_weights[totnum] = cp->xform[i].var[j]; + + if (j==VAR_POLAR) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_HANDKERCHIEF) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_HEART) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_DISC) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_SPIRAL) { + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_HYPERBOLIC) { + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_DIAMOND) { + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_EX) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_JULIA) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_POWER) { + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_RINGS) { + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_FAN) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_BLOB) { + cp->xform[i].precalc_atan_xy_flag=1; + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_FAN2) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_RINGS2) { + cp->xform[i].precalc_angles_flag=1; + } else if (j==VAR_JULIAN) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_JULIASCOPE) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_RADIAL_BLUR) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_NGON) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_DISC2) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_SUPER_SHAPE) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_FLOWER) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_CONIC) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_CPOW) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_ESCHER) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_PRE_BLUR) { + cp->xform[i].has_preblur=cp->xform[i].var[j]; + } else if (j==VAR_POLAR2) { + cp->xform[i].precalc_atan_xy_flag=1; + } else if (j==VAR_WEDGE) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_WEDGE_JULIA) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_WEDGE_SPH) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_WHORL) { + cp->xform[i].precalc_atan_yx_flag=1; + } else if (j==VAR_LOG) { + cp->xform[i].precalc_atan_yx_flag=1; + } + + totnum++; + } + } + + cp->xform[i].num_active_vars = totnum; + + } + + return(0); +} + + +int apply_xform(flam3_genome *cp, int fn, double *p, double *q, randctx *rc) +{ + flam3_iter_helper f; + int var_n; + double next_color,s,s1; + double weight; + + f.rc = rc; + +// s = 1.0-2.0*cp->xform[fn].color_speed; +// s1 = 0.5 - 0.5 * s; + s1 = cp->xform[fn].color_speed; + s = 1.0 - 2.0*s1; + + next_color = (p[2] + cp->xform[fn].color) * s1 + s * p[2]; + q[2] = next_color; + q[3] = cp->xform[fn].vis_adjusted; + + //fprintf(stderr,"%d : %f %f %f\n",fn,cp->xform[fn].c[0][0],cp->xform[fn].c[1][0],cp->xform[fn].c[2][0]); + + f.tx = cp->xform[fn].c[0][0] * p[0] + cp->xform[fn].c[1][0] * p[1] + cp->xform[fn].c[2][0]; + f.ty = cp->xform[fn].c[0][1] * p[0] + cp->xform[fn].c[1][1] * p[1] + cp->xform[fn].c[2][1]; + + /* Pre-xforms go here, and modify the f.tx and f.ty values */ + if (cp->xform[fn].has_preblur!=0.0) + var67_pre_blur(&f, cp->xform[fn].has_preblur); + + /* Always calculate sumsq and sqrt */ + f.precalc_sumsq = f.tx*f.tx + f.ty*f.ty; + f.precalc_sqrt = sqrt(f.precalc_sumsq); + + /* Check to see if we can precalculate any parts */ + /* Precalculate atanxy, sin, cos */ + if (cp->xform[fn].precalc_atan_xy_flag > 0) { + f.precalc_atan = atan2(f.tx,f.ty); + } + + if (cp->xform[fn].precalc_angles_flag > 0) { + f.precalc_sina = f.tx / f.precalc_sqrt; + f.precalc_cosa = f.ty / f.precalc_sqrt; + } + + /* Precalc atanyx */ + if (cp->xform[fn].precalc_atan_yx_flag > 0) { + f.precalc_atanyx = atan2(f.ty,f.tx); + } + + f.p0 = 0.0; + f.p1 = 0.0; + f.xform = &(cp->xform[fn]); + + + for (var_n=0; var_n < cp->xform[fn].num_active_vars; var_n++) { + + weight = cp->xform[fn].active_var_weights[var_n]; + + switch (cp->xform[fn].varFunc[var_n]) { + + case (VAR_LINEAR): + var0_linear(&f, weight); break; + case (VAR_SINUSOIDAL): + var1_sinusoidal(&f, weight); break; + case (VAR_SPHERICAL): + var2_spherical(&f, weight); break; + case (VAR_SWIRL): + var3_swirl(&f, weight); break; + case (VAR_HORSESHOE): + var4_horseshoe(&f, weight); break; + case (VAR_POLAR): + var5_polar(&f, weight); break; + case (VAR_HANDKERCHIEF): + var6_handkerchief(&f, weight); break; + case (VAR_HEART): + var7_heart(&f, weight); break; + case (VAR_DISC): + var8_disc(&f, weight); break; + case (VAR_SPIRAL): + var9_spiral(&f, weight); break; + case (VAR_HYPERBOLIC): + var10_hyperbolic(&f, weight); break; + case (VAR_DIAMOND): + var11_diamond(&f, weight); break; + case (VAR_EX): + var12_ex(&f, weight); break; + case (VAR_JULIA): + var13_julia(&f, weight); break; + case (VAR_BENT): + var14_bent(&f, weight); break; + case (VAR_WAVES): + var15_waves(&f, weight); break; + case (VAR_FISHEYE): + var16_fisheye(&f, weight); break; + case (VAR_POPCORN): + var17_popcorn(&f, weight); break; + case (VAR_EXPONENTIAL): + var18_exponential(&f, weight); break; + case (VAR_POWER): + var19_power(&f, weight); break; + case (VAR_COSINE): + var20_cosine(&f, weight); break; + case (VAR_RINGS): + var21_rings(&f, weight); break; + case (VAR_FAN): + var22_fan(&f, weight); break; + case (VAR_BLOB): + var23_blob(&f, weight); break; + case (VAR_PDJ): + var24_pdj(&f, weight); break; + case (VAR_FAN2): + var25_fan2(&f, weight); break; + case (VAR_RINGS2): + var26_rings2(&f, weight); break; + case (VAR_EYEFISH): + var27_eyefish(&f, weight); break; + case (VAR_BUBBLE): + var28_bubble(&f, weight); break; + case (VAR_CYLINDER): + var29_cylinder(&f, weight); break; + case (VAR_PERSPECTIVE): + var30_perspective(&f, weight); break; + case (VAR_NOISE): + var31_noise(&f, weight); break; + case (VAR_JULIAN): + var32_juliaN_generic(&f, weight); break; + case (VAR_JULIASCOPE): + var33_juliaScope_generic(&f, weight);break; + case (VAR_BLUR): + var34_blur(&f, weight); break; + case (VAR_GAUSSIAN_BLUR): + var35_gaussian(&f, weight); break; + case (VAR_RADIAL_BLUR): + var36_radial_blur(&f, weight); break; + case (VAR_PIE): + var37_pie(&f, weight); break; + case (VAR_NGON): + var38_ngon(&f, weight); break; + case (VAR_CURL): + var39_curl(&f, weight); break; + case (VAR_RECTANGLES): + var40_rectangles(&f, weight); break; + case (VAR_ARCH): + var41_arch(&f, weight); break; + case (VAR_TANGENT): + var42_tangent(&f, weight); break; + case (VAR_SQUARE): + var43_square(&f, weight); break; + case (VAR_RAYS): + var44_rays(&f, weight); break; + case (VAR_BLADE): + var45_blade(&f, weight); break; + case (VAR_SECANT2): + var46_secant2(&f, weight); break; + case (VAR_TWINTRIAN): + var47_twintrian(&f, weight); break; + case (VAR_CROSS): + var48_cross(&f, weight); break; + case (VAR_DISC2): + var49_disc2(&f, weight); break; + case (VAR_SUPER_SHAPE): + var50_supershape(&f, weight); break; + case (VAR_FLOWER): + var51_flower(&f, weight); break; + case (VAR_CONIC): + var52_conic(&f, weight); break; + case (VAR_PARABOLA): + var53_parabola(&f, weight); break; + case (VAR_BENT2): + var54_bent2(&f, weight); break; + case (VAR_BIPOLAR): + var55_bipolar(&f, weight); break; + case (VAR_BOARDERS): + var56_boarders(&f, weight); break; + case (VAR_BUTTERFLY): + var57_butterfly(&f, weight); break; + case (VAR_CELL): + var58_cell(&f, weight); break; + case (VAR_CPOW): + var59_cpow(&f, weight); break; + case (VAR_CURVE): + var60_curve(&f, weight); break; + case (VAR_EDISC): + var61_edisc(&f, weight); break; + case (VAR_ELLIPTIC): + var62_elliptic(&f, weight); break; + case (VAR_ESCHER): + var63_escher(&f, weight); break; + case (VAR_FOCI): + var64_foci(&f, weight); break; + case (VAR_LAZYSUSAN): + var65_lazysusan(&f, weight); break; + case (VAR_LOONIE): + var66_loonie(&f, weight); break; + case (VAR_MODULUS): + var68_modulus(&f, weight); break; + case (VAR_OSCILLOSCOPE): + var69_oscope(&f, weight); break; + case (VAR_POLAR2): + var70_polar2(&f, weight); break; + case (VAR_POPCORN2): + var71_popcorn2(&f, weight); break; + case (VAR_SCRY): + var72_scry(&f, weight); break; + case (VAR_SEPARATION): + var73_separation(&f, weight); break; + case (VAR_SPLIT): + var74_split(&f, weight); break; + case (VAR_SPLITS): + var75_splits(&f, weight); break; + case (VAR_STRIPES): + var76_stripes(&f, weight); break; + case (VAR_WEDGE): + var77_wedge(&f, weight); break; + case (VAR_WEDGE_JULIA): + var78_wedge_julia(&f, weight); break; + case (VAR_WEDGE_SPH): + var79_wedge_sph(&f, weight); break; + case (VAR_WHORL): + var80_whorl(&f, weight); break; + case (VAR_WAVES2): + var81_waves2(&f, weight); break; + case (VAR_EXP): + var82_exp(&f, weight); break; + case (VAR_LOG): + var83_log(&f, weight); break; + case (VAR_SIN): + var84_sin(&f, weight); break; + case (VAR_COS): + var85_cos(&f, weight); break; + case (VAR_TAN): + var86_tan(&f, weight); break; + case (VAR_SEC): + var87_sec(&f, weight); break; + case (VAR_CSC): + var88_csc(&f, weight); break; + case (VAR_COT): + var89_cot(&f, weight); break; + case (VAR_SINH): + var90_sinh(&f, weight); break; + case (VAR_COSH): + var91_cosh(&f, weight); break; + case (VAR_TANH): + var92_tanh(&f, weight); break; + case (VAR_SECH): + var93_sech(&f, weight); break; + case (VAR_CSCH): + var94_csch(&f, weight); break; + case (VAR_COTH): + var95_coth(&f, weight); break; + case (VAR_AUGER): + var96_auger(&f, weight); break; + } + + } + /* apply the post transform */ + if (cp->xform[fn].has_post) { + q[0] = cp->xform[fn].post[0][0] * f.p0 + cp->xform[fn].post[1][0] * f.p1 + cp->xform[fn].post[2][0]; + q[1] = cp->xform[fn].post[0][1] * f.p0 + cp->xform[fn].post[1][1] * f.p1 + cp->xform[fn].post[2][1]; + } else { + q[0] = f.p0; + q[1] = f.p1; + } + + /* Check for badvalues and return randoms if bad */ + if (badvalue(q[0]) || badvalue(q[1])) { + q[0] = flam3_random_isaac_11(rc); + q[1] = flam3_random_isaac_11(rc); + return(1); + } else + return(0); + +} + +void initialize_xforms(flam3_genome *thiscp, int start_here) { + + int i,j; + for (i = start_here ; i < thiscp->num_xforms ; i++) { + thiscp->xform[i].padding = 0; + thiscp->xform[i].density = 0.0; + thiscp->xform[i].color_speed = 0.5; + thiscp->xform[i].animate = 1.0; + thiscp->xform[i].color = i&1; + thiscp->xform[i].opacity = 1.0; + thiscp->xform[i].var[0] = 1.0; + thiscp->xform[i].motion_freq = 0; + thiscp->xform[i].motion_func = 0; + thiscp->xform[i].num_motion = 0; + thiscp->xform[i].motion = NULL; + for (j = 1; j < flam3_nvariations; j++) + thiscp->xform[i].var[j] = 0.0; + thiscp->xform[i].c[0][0] = 1.0; + thiscp->xform[i].c[0][1] = 0.0; + thiscp->xform[i].c[1][0] = 0.0; + thiscp->xform[i].c[1][1] = 1.0; + thiscp->xform[i].c[2][0] = 0.0; + thiscp->xform[i].c[2][1] = 0.0; + thiscp->xform[i].post[0][0] = 1.0; + thiscp->xform[i].post[0][1] = 0.0; + thiscp->xform[i].post[1][0] = 0.0; + thiscp->xform[i].post[1][1] = 1.0; + thiscp->xform[i].post[2][0] = 0.0; + thiscp->xform[i].post[2][1] = 0.0; + thiscp->xform[i].wind[0] = 0.0; + thiscp->xform[i].wind[1] = 0.0; + thiscp->xform[i].blob_low = 0.0; + thiscp->xform[i].blob_high = 1.0; + thiscp->xform[i].blob_waves = 1.0; + thiscp->xform[i].pdj_a = 0.0; + thiscp->xform[i].pdj_b = 0.0; + thiscp->xform[i].pdj_c = 0.0; + thiscp->xform[i].pdj_d = 0.0; + thiscp->xform[i].fan2_x = 0.0; + thiscp->xform[i].fan2_y = 0.0; + thiscp->xform[i].rings2_val = 0.0; + thiscp->xform[i].perspective_angle = 0.0; + thiscp->xform[i].perspective_dist = 0.0; + thiscp->xform[i].persp_vsin = 0.0; + thiscp->xform[i].persp_vfcos = 0.0; + thiscp->xform[i].radial_blur_angle = 0.0; + thiscp->xform[i].disc2_rot = 0.0; + thiscp->xform[i].disc2_twist = 0.0; + thiscp->xform[i].disc2_sinadd = 0.0; + thiscp->xform[i].disc2_cosadd = 0.0; + thiscp->xform[i].disc2_timespi = 0.0; + thiscp->xform[i].flower_petals = 0.0; + thiscp->xform[i].flower_holes = 0.0; + thiscp->xform[i].parabola_height = 0.0; + thiscp->xform[i].parabola_width = 0.0; + thiscp->xform[i].bent2_x = 1.0; + thiscp->xform[i].bent2_y = 1.0; + thiscp->xform[i].bipolar_shift = 0.0; + thiscp->xform[i].cell_size = 1.0; + thiscp->xform[i].cpow_r = 1.0; + thiscp->xform[i].cpow_i = 0.0; + thiscp->xform[i].cpow_power = 1.0; + thiscp->xform[i].curve_xamp = 0.0; + thiscp->xform[i].curve_yamp = 0.0; + thiscp->xform[i].curve_xlength = 1.0; + thiscp->xform[i].curve_ylength = 1.0; + thiscp->xform[i].escher_beta = 0.0; + thiscp->xform[i].lazysusan_space = 0.0; + thiscp->xform[i].lazysusan_twist = 0.0; + thiscp->xform[i].lazysusan_spin = 0.0; + thiscp->xform[i].lazysusan_x = 0.0; + thiscp->xform[i].lazysusan_y = 0.0; + thiscp->xform[i].modulus_x = 0.0; + thiscp->xform[i].modulus_y = 0.0; + thiscp->xform[i].oscope_separation = 1.0; + thiscp->xform[i].oscope_frequency = M_PI; + thiscp->xform[i].oscope_amplitude = 1.0; + thiscp->xform[i].oscope_damping = 0.0; + thiscp->xform[i].popcorn2_c = 0.0; + thiscp->xform[i].popcorn2_x = 0.0; + thiscp->xform[i].popcorn2_y = 0.0; + thiscp->xform[i].separation_x = 0.0; + thiscp->xform[i].separation_xinside = 0.0; + thiscp->xform[i].separation_y = 0.0; + thiscp->xform[i].separation_yinside = 0.0; + thiscp->xform[i].split_xsize = 0.0; + thiscp->xform[i].split_ysize = 0.0; + thiscp->xform[i].splits_x = 0.0; + thiscp->xform[i].splits_y = 0.0; + thiscp->xform[i].stripes_space = 0.0; + thiscp->xform[i].stripes_warp = 0.0; + thiscp->xform[i].wedge_angle = 0.0; + thiscp->xform[i].wedge_hole = 0.0; + thiscp->xform[i].wedge_count = 1.0; + thiscp->xform[i].wedge_swirl = 0.0; + thiscp->xform[i].wedge_sph_angle = 0.0; + thiscp->xform[i].wedge_sph_hole = 0.0; + thiscp->xform[i].wedge_sph_count = 1.0; + thiscp->xform[i].wedge_sph_swirl = 0.0; + + thiscp->xform[i].wedge_julia_power = 1.0; + thiscp->xform[i].wedge_julia_dist = 0.0; + thiscp->xform[i].wedge_julia_count = 1.0; + thiscp->xform[i].wedge_julia_angle = 0.0; + thiscp->xform[i].wedgeJulia_cf = 0.0; + thiscp->xform[i].wedgeJulia_cn = 0.5; + thiscp->xform[i].wedgeJulia_rN = 1.0; + thiscp->xform[i].whorl_inside = 0.0; + thiscp->xform[i].whorl_outside = 0.0; + + thiscp->xform[i].waves2_scalex = 0.0; + thiscp->xform[i].waves2_scaley = 0.0; + thiscp->xform[i].waves2_freqx = 0.0; + thiscp->xform[i].waves2_freqy = 0.0; + + thiscp->xform[i].auger_freq = 1.0; + thiscp->xform[i].auger_weight = 0.5; + thiscp->xform[i].auger_sym = 0.0; + thiscp->xform[i].auger_scale = 1.0; + + thiscp->xform[i].julian_power = 1.0; + thiscp->xform[i].julian_dist = 1.0; + thiscp->xform[i].julian_rN = 1.0; + thiscp->xform[i].julian_cn = 0.5; + thiscp->xform[i].juliascope_power = 1.0; + thiscp->xform[i].juliascope_dist = 1.0; + thiscp->xform[i].juliascope_rN = 1.0; + thiscp->xform[i].juliascope_cn = 0.5; + thiscp->xform[i].radialBlur_spinvar = 0.0; + thiscp->xform[i].radialBlur_zoomvar = 1.0; + thiscp->xform[i].pie_slices = 6.0; + thiscp->xform[i].pie_rotation = 0.0; + thiscp->xform[i].pie_thickness = 0.5; + thiscp->xform[i].ngon_sides = 5; + thiscp->xform[i].ngon_power = 3; + thiscp->xform[i].ngon_circle = 1; + thiscp->xform[i].ngon_corners = 2; + thiscp->xform[i].curl_c1 = 1.0; + thiscp->xform[i].curl_c2 = 0.0; + thiscp->xform[i].rectangles_x = 1.0; + thiscp->xform[i].rectangles_y = 1.0; + thiscp->xform[i].amw_amp = 1.0; + thiscp->xform[i].super_shape_rnd = 0.0; + thiscp->xform[i].super_shape_m = 0.0; + thiscp->xform[i].super_shape_n1 = 1.0; + thiscp->xform[i].super_shape_n2 = 1.0; + thiscp->xform[i].super_shape_n3 = 1.0; + thiscp->xform[i].super_shape_holes = 0.0; + thiscp->xform[i].conic_eccentricity = 1.0; + thiscp->xform[i].conic_holes = 0.0; + } +} diff --git a/src/variations.h b/src/variations.h new file mode 100644 index 0000000..fdec2ad --- /dev/null +++ b/src/variations.h @@ -0,0 +1,140 @@ +/* + FLAM3 - cosmic recursive fractal flames + Copyright (C) 1992-2009 Spotworks LLC + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef variations_included +#define variations_included + +#include "private.h" + + + +/* Variation functions */ +void var0_linear(flam3_iter_helper *, double); +void var1_sinusoidal(flam3_iter_helper *, double); +void var2_spherical(flam3_iter_helper *, double); +void var3_swirl(flam3_iter_helper *, double); +void var4_horseshoe(flam3_iter_helper *, double); +void var5_polar(flam3_iter_helper *, double); +void var6_handkerchief(flam3_iter_helper *, double); +void var7_heart(flam3_iter_helper *, double); +void var8_disc(flam3_iter_helper *, double); +void var9_spiral(flam3_iter_helper *, double); +void var10_hyperbolic(flam3_iter_helper *, double); +void var11_diamond(flam3_iter_helper *, double); +void var12_ex(flam3_iter_helper *, double); +void var13_julia(flam3_iter_helper *, double); +void var14_bent(flam3_iter_helper *, double); +void var15_waves(flam3_iter_helper *, double); +void var16_fisheye(flam3_iter_helper *, double); +void var17_popcorn(flam3_iter_helper *, double); +void var18_exponential(flam3_iter_helper *, double); +void var19_power(flam3_iter_helper *, double); +void var20_cosine(flam3_iter_helper *, double); +void var21_rings(flam3_iter_helper *, double); +void var22_fan(flam3_iter_helper *, double); +void var23_blob(flam3_iter_helper *, double); +void var24_pdj(flam3_iter_helper *, double); +void var25_fan2(flam3_iter_helper *, double); +void var26_rings2(flam3_iter_helper *, double); +void var27_eyefish(flam3_iter_helper *, double); +void var28_bubble(flam3_iter_helper *, double); +void var29_cylinder(flam3_iter_helper *, double); +void var30_perspective(flam3_iter_helper *, double); +void var31_noise(flam3_iter_helper *, double); +void var32_juliaN_generic(flam3_iter_helper *, double); +void var33_juliaScope_generic(flam3_iter_helper *, double); +void var34_blur(flam3_iter_helper *, double); +void var35_gaussian(flam3_iter_helper *, double); +void var36_radial_blur(flam3_iter_helper *, double); +void var37_pie(flam3_iter_helper *, double); +void var38_ngon(flam3_iter_helper *, double); +void var39_curl(flam3_iter_helper *, double); +void var40_rectangles(flam3_iter_helper *, double); +void var41_arch(flam3_iter_helper *, double); +void var42_tangent(flam3_iter_helper *, double); +void var43_square(flam3_iter_helper *, double); +void var44_rays(flam3_iter_helper *, double); +void var45_blade(flam3_iter_helper *, double); +void var46_secant2(flam3_iter_helper *, double); +void var47_twintrian(flam3_iter_helper *, double); +void var48_cross(flam3_iter_helper *, double); +void var49_disc2(flam3_iter_helper *, double); +void var50_supershape(flam3_iter_helper *, double); +void var51_flower(flam3_iter_helper *, double); +void var52_conic(flam3_iter_helper *, double); +void var53_parabola(flam3_iter_helper *, double); +void var54_bent2(flam3_iter_helper *, double); +void var55_bipolar(flam3_iter_helper *, double); +void var56_boarders(flam3_iter_helper *, double); +void var57_butterfly(flam3_iter_helper *, double); +void var58_cell(flam3_iter_helper *, double); +void var59_cpow(flam3_iter_helper *, double); +void var60_curve(flam3_iter_helper *, double); +void var61_edisc(flam3_iter_helper *, double); +void var62_elliptic(flam3_iter_helper *, double); +void var63_escher(flam3_iter_helper *, double); +void var64_foci(flam3_iter_helper *, double); +void var65_lazysusan(flam3_iter_helper *, double); +void var66_loonie(flam3_iter_helper *, double); +void var67_pre_blur(flam3_iter_helper *, double); +void var68_modulus(flam3_iter_helper *, double); +void var69_oscope(flam3_iter_helper *, double); +void var70_polar2(flam3_iter_helper *, double); +void var71_popcorn2(flam3_iter_helper *, double); +void var72_scry(flam3_iter_helper *, double); +void var73_separation(flam3_iter_helper *, double); +void var74_split(flam3_iter_helper *, double); +void var75_splits(flam3_iter_helper *, double); +void var76_stripes(flam3_iter_helper *, double); +void var77_wedge(flam3_iter_helper *, double); +void var78_wedge_julia(flam3_iter_helper *, double); +void var79_wedge_sph(flam3_iter_helper *, double); +void var80_whorl(flam3_iter_helper *, double); +void var81_waves2(flam3_iter_helper *, double); +void var82_exp (flam3_iter_helper *f, double weight); +void var83_log (flam3_iter_helper *f, double weight); +void var84_sin (flam3_iter_helper *f, double weight); +void var85_cos (flam3_iter_helper *f, double weight); +void var86_tan (flam3_iter_helper *f, double weight); +void var87_sec (flam3_iter_helper *f, double weight); +void var88_csc (flam3_iter_helper *f, double weight); +void var89_cot (flam3_iter_helper *f, double weight); +void var90_sinh (flam3_iter_helper *f, double weight); +void var91_cosh (flam3_iter_helper *f, double weight); +void var92_tanh (flam3_iter_helper *f, double weight); +void var93_sech (flam3_iter_helper *f, double weight); +void var94_csch (flam3_iter_helper *f, double weight); +void var95_coth (flam3_iter_helper *f, double weight); +void var96_auger (flam3_iter_helper *f, double weight); + +/* Precalculation functions */ +void perspective_precalc(flam3_xform *xf); +void juliaN_precalc(flam3_xform *xf); +void juliaScope_precalc(flam3_xform *xf); +void radial_blur_precalc(flam3_xform *xf); +void waves_precalc(flam3_xform *xf); +void disc2_precalc(flam3_xform *xf); +void supershape_precalc(flam3_xform *xf); +void wedgeJulia_precalc(flam3_xform *xf); + +void xform_precalc(flam3_genome *cp, int xi); +int prepare_xform_fn_ptrs(flam3_genome *, randctx *); + +int apply_xform(flam3_genome *cp, int fn, double *p, double *q, randctx *rc); +void initialize_xforms(flam3_genome *thiscp, int start_here); +#endif diff --git a/src/vidres.flam3 b/src/vidres.flam3 new file mode 100755 index 0000000..285b1ce --- /dev/null +++ b/src/vidres.flam3 @@ -0,0 +1,12 @@ + -- cgit v1.2.3