[SCM] givaro: library for arithmetic and algebraic computations branch, upstream, updated. upstream/3.2.13-1-gbd5f523
Lifeng Sun
lifongsun at gmail.com
Tue Aug 9 07:13:01 UTC 2011
The following commit has been merged in the upstream branch:
commit bd5f523b96827ffb4704ba8b2be1e5ced7f04740
Author: Lifeng Sun <lifongsun at gmail.com>
Date: Tue Aug 9 12:25:25 2011 +0800
Imported Upstream version 3.4.2
diff --git a/AUTHORS b/AUTHORS
index 2534dc3..76c8cef 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,7 +1,8 @@
-Authors of givaro library
+Authors of the Givaro library
Thierry Gautier
Jean-Louis Roch
Gilles Villard
Jean-Guillaume Dumas
-Pascal Giorgi
\ No newline at end of file
+Pascal Giorgi
+Clément Pernet
\ No newline at end of file
diff --git a/COPYING b/COPYING
index 623b625..355f45e 100644
--- a/COPYING
+++ b/COPYING
@@ -1,340 +1,519 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 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
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
+
+
+ Avertissement
+
+Ce contrat est une licence de logiciel libre issue d'une concertation
+entre ses auteurs afin que le respect de deux grands principes préside à
+sa rédaction:
+
+ * d'une part, le respect des principes de diffusion des logiciels
+ libres: accès au code source, droits étendus conférés aux
+ utilisateurs,
+ * d'autre part, la désignation d'un droit applicable, le droit
+ français, auquel elle est conforme, tant au regard du droit de la
+ responsabilité civile que du droit de la propriété intellectuelle
+ et de la protection qu'il offre aux auteurs et titulaires des
+ droits patrimoniaux sur un logiciel.
+
+Les auteurs de la licence CeCILL-B (pour Ce[a] C[nrs] I[nria] L[ogiciel]
+L[ibre]) sont:
+
+Commissariat à l'Energie Atomique - CEA, établissement public de
+recherche à caractère scientifique, technique et industriel, dont le
+siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, établissement
+public à caractère scientifique et technologique, dont le siège est
+situé 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, établissement public à caractère scientifique et technologique,
+dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153
+Le Chesnay cedex.
+
+
+ Préambule
+
+Ce contrat est une licence de logiciel libre dont l'objectif est de
+conférer aux utilisateurs une très large liberté de modification et de
+redistribution du logiciel régi par cette licence.
+
+L'exercice de cette liberté est assorti d'une obligation forte de
+citation à la charge de ceux qui distribueraient un logiciel incorporant
+un logiciel régi par la présente licence afin d'assurer que les
+contributions de tous soient correctement identifiées et reconnues.
+
+L'accessibilité au code source et les droits de copie, de modification
+et de redistribution qui découlent de ce contrat ont pour contrepartie
+de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire
+peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et
+les concédants successifs qu'une responsabilité restreinte.
+
+A cet égard l'attention de l'utilisateur est attirée sur les risques
+associés au chargement, à l'utilisation, à la modification et/ou au
+développement et à la reproduction du logiciel par l'utilisateur étant
+donné sa spécificité de logiciel libre, qui peut le rendre complexe à
+manipuler et qui le réserve donc à des développeurs ou des
+professionnels avertis possédant des connaissances informatiques
+approfondies. Les utilisateurs sont donc invités à charger et tester
+l'adéquation du logiciel à leurs besoins dans des conditions permettant
+d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus
+généralement, à l'utiliser et l'exploiter dans les mêmes conditions de
+sécurité. Ce contrat peut être reproduit et diffusé librement, sous
+réserve de le conserver en l'état, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s'appliquer à tout logiciel dont le
+titulaire des droits patrimoniaux décide de soumettre l'exploitation aux
+dispositions qu'il contient.
+
+
+ Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une
+lettre capitale, auront la signification suivante:
+
+Contrat: désigne le présent contrat de licence, ses éventuelles versions
+postérieures et annexes.
+
+Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code
+Source et le cas échéant sa documentation, dans leur état au moment de
+l'acceptation du Contrat par le Licencié.
+
+Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et
+éventuellement de Code Objet et le cas échéant sa documentation, dans
+leur état au moment de leur première diffusion sous les termes du Contrat.
+
+Logiciel Modifié: désigne le Logiciel modifié par au moins une
+Contribution.
+
+Code Source: désigne l'ensemble des instructions et des lignes de
+programme du Logiciel et auquel l'accès est nécessaire en vue de
+modifier le Logiciel.
+
+Code Objet: désigne les fichiers binaires issus de la compilation du
+Code Source.
+
+Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur
+sur le Logiciel Initial.
+
+Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le
+Contrat.
+
+Contributeur: désigne le Licencié auteur d'au moins une Contribution.
+
+Concédant: désigne le Titulaire ou toute personne physique ou morale
+distribuant le Logiciel sous le Contrat.
+
+Contribution: désigne l'ensemble des modifications, corrections,
+traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans
+le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: désigne un ensemble de fichiers sources y compris leur
+documentation qui permet de réaliser des fonctionnalités ou services
+supplémentaires à ceux fournis par le Logiciel.
+
+Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce
+Module et le Logiciel s'exécutent dans des espaces d'adressage
+différents, l'un appelant l'autre au moment de leur exécution.
+
+Module Interne: désigne tout Module lié au Logiciel de telle sorte
+qu'ils s'exécutent dans le même espace d'adressage.
+
+Parties: désigne collectivement le Licencié et le Concédant.
+
+Ces termes s'entendent au singulier comme au pluriel.
+
+
+ Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Concédant au Licencié d'une
+licence non exclusive, cessible et mondiale du Logiciel telle que
+définie ci-après à l'article 5 pour toute la durée de protection des droits
+portant sur ce Logiciel.
+
+
+ Article 3 - ACCEPTATION
+
+3.1 L'acceptation par le Licencié des termes du Contrat est réputée
+acquise du fait du premier des faits suivants:
+
+ * (i) le chargement du Logiciel par tout moyen notamment par
+ téléchargement à partir d'un serveur distant ou par chargement à
+ partir d'un support physique;
+ * (ii) le premier exercice par le Licencié de l'un quelconque des
+ droits concédés par le Contrat.
+
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement
+relatif aux spécificités du Logiciel, à la restriction de garantie et à
+la limitation à un usage par des utilisateurs expérimentés a été mis à
+disposition du Licencié préalablement à son acceptation telle que
+définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris
+connaissance.
+
+
+ Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+
+ 4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur à la date de son acceptation par le Licencié
+telle que définie en 3.1.
+
+
+ 4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la durée légale de
+protection des droits patrimoniaux portant sur le Logiciel.
+
+
+ Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Concédant concède au Licencié, qui accepte, les droits suivants sur
+le Logiciel pour toutes destinations et pour la durée du Contrat dans
+les conditions ci-après détaillées.
+
+Par ailleurs, si le Concédant détient ou venait à détenir un ou
+plusieurs brevets d'invention protégeant tout ou partie des
+fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas
+opposer les éventuels droits conférés par ces brevets aux Licenciés
+successifs qui utiliseraient, exploiteraient ou modifieraient le
+Logiciel. En cas de cession de ces brevets, le Concédant s'engage à
+faire reprendre les obligations du présent alinéa aux cessionnaires.
+
+
+ 5.1 DROIT D'UTILISATION
+
+Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant
+aux domaines d'application, étant ci-après précisé que cela comporte:
+
+ 1. la reproduction permanente ou provisoire du Logiciel en tout ou
+ partie par tout moyen et sous toute forme.
+
+ 2. le chargement, l'affichage, l'exécution, ou le stockage du
+ Logiciel sur tout support.
+
+ 3. la possibilité d'en observer, d'en étudier, ou d'en tester le
+ fonctionnement afin de déterminer les idées et principes qui sont
+ à la base de n'importe quel élément de ce Logiciel; et ceci,
+ lorsque le Licencié effectue toute opération de chargement,
+ d'affichage, d'exécution, de transmission ou de stockage du
+ Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
+
+
+ 5.2 DROIT D'APPORTER DES CONTRIBUTIONS
+
+Le droit d'apporter des Contributions comporte le droit de traduire,
+d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel
+et le droit de reproduire le logiciel en résultant.
+
+Le Licencié est autorisé à apporter toute Contribution au Logiciel sous
+réserve de mentionner, de façon explicite, son nom en tant qu'auteur de
+cette Contribution et la date de création de celle-ci.
+
+
+ 5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de
+transmettre et de communiquer le Logiciel au public sur tout support et
+par tout moyen ainsi que le droit de mettre sur le marché à titre
+onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé.
+
+Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou
+non, à des tiers dans les conditions ci-après détaillées.
+
+
+ 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licencié est autorisé à distribuer des copies conformes du Logiciel,
+sous forme de Code Source ou de Code Objet, à condition que cette
+distribution respecte les dispositions du Contrat dans leur totalité et
+soit accompagnée:
+
+ 1. d'un exemplaire du Contrat,
+
+ 2. d'un avertissement relatif à la restriction de garantie et de
+ responsabilité du Concédant telle que prévue aux articles 8
+ et 9,
+
+et que, dans le cas où seul le Code Objet du Logiciel est redistribué,
+le Licencié permette un accès effectif au Code Source complet du
+Logiciel pendant au moins toute la durée de sa distribution du Logiciel,
+étant entendu que le coût additionnel d'acquisition du Code Source ne
+devra pas excéder le simple coût de transfert des données.
+
+
+ 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licencié apporte une Contribution au Logiciel, le Logiciel
+Modifié peut être distribué sous un contrat de licence autre que le
+présent Contrat sous réserve du respect des dispositions de l'article
+5.3.4.
+
+
+ 5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licencié a développé un Module Externe les conditions du
+Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué
+sous un contrat de licence différent.
+
+
+ 5.3.4 CITATIONS
+
+Le Licencié qui distribue un Logiciel Modifié s'engage expressément:
+
+ 1. à indiquer dans sa documentation qu'il a été réalisé à partir du
+ Logiciel régi par le Contrat, en reproduisant les mentions de
+ propriété intellectuelle du Logiciel,
+
+ 2. à faire en sorte que l'utilisation du Logiciel, ses mentions de
+ propriété intellectuelle et le fait qu'il est régi par le Contrat
+ soient indiqués dans un texte facilement accessible depuis
+ l'interface du Logiciel Modifié,
+
+ 3. à mentionner, sur un site Web librement accessible décrivant le
+ Logiciel Modifié, et pendant au moins toute la durée de sa
+ distribution, qu'il a été réalisé à partir du Logiciel régi par le
+ Contrat, en reproduisant les mentions de propriété intellectuelle
+ du Logiciel,
+
+ 4. lorsqu'il le distribue à un tiers susceptible de distribuer
+ lui-même un Logiciel Modifié, sans avoir à en distribuer le code
+ source, à faire ses meilleurs efforts pour que les obligations du
+ présent article 5.3.4 soient reprises par le dit tiers.
+
+Lorsque le Logiciel modifié ou non est distribué avec un Module Externe
+qui a été conçu pour l'utiliser, le Licencié doit soumettre le dit
+Module Externe aux obligations précédentes.
+
+
+ 5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C
+
+Lorsqu'un Logiciel Modifié contient une Contribution soumise au contrat
+de licence CeCILL, les stipulations prévues à l'article 5.3.4 sont
+facultatives.
+
+Un Logiciel Modifié peut être distribué sous le contrat de licence
+CeCILL-C. Les stipulations prévues à l'article 5.3.4 sont alors
+facultatives.
+
+
+ Article 6 - PROPRIETE INTELLECTUELLE
+
+
+ 6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel
+Initial. Toute utilisation du Logiciel Initial est soumise au respect
+des conditions dans lesquelles le Titulaire a choisi de diffuser son
+oeuvre et nul autre n'a la faculté de modifier les conditions de
+diffusion de ce Logiciel Initial.
+
+Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi
+par le Contrat et ce, pour la durée visée à l'article 4.2.
+
+
+ 6.2 SUR LES CONTRIBUTIONS
+
+Le Licencié qui a développé une Contribution est titulaire sur celle-ci
+des droits de propriété intellectuelle dans les conditions définies par
+la législation applicable.
+
+
+ 6.3 SUR LES MODULES EXTERNES
+
+Le Licencié qui a développé un Module Externe est titulaire sur celui-ci
+des droits de propriété intellectuelle dans les conditions définies par
+la législation applicable et reste libre du choix du contrat régissant
+sa diffusion.
+
+
+ 6.4 DISPOSITIONS COMMUNES
+
+Le Licencié s'engage expressément:
+
+ 1. à ne pas supprimer ou modifier de quelque manière que ce soit les
+ mentions de propriété intellectuelle apposées sur le Logiciel;
+
+ 2. à reproduire à l'identique lesdites mentions de propriété
+ intellectuelle sur les copies du Logiciel modifié ou non.
+
+Le Licencié s'engage à ne pas porter atteinte, directement ou
+indirectement, aux droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs sur le Logiciel et à prendre, le cas échéant, à
+l'égard de son personnel toutes les mesures nécessaires pour assurer le
+respect des dits droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs.
+
+
+ Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de
+prestations d'assistance technique ou de maintenance du Logiciel.
+
+Cependant le Concédant reste libre de proposer ce type de services. Les
+termes et conditions d'une telle assistance technique et/ou d'une telle
+maintenance seront alors déterminés dans un acte séparé. Ces actes de
+maintenance et/ou assistance technique n'engageront que la seule
+responsabilité du Concédant qui les propose.
+
+7.2 De même, tout Concédant est libre de proposer, sous sa seule
+responsabilité, à ses licenciés une garantie, qui n'engagera que lui,
+lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce,
+dans les conditions qu'il souhaite. Cette garantie et les modalités
+financières de son application feront l'objet d'un acte séparé entre le
+Concédant et le Licencié.
+
+
+ Article 8 - RESPONSABILITE
+
+8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la
+faculté, sous réserve de prouver la faute du Concédant concerné, de
+solliciter la réparation du préjudice direct qu'il subirait du fait du
+Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilité du Concédant est limitée aux engagements pris en
+application du Contrat et ne saurait être engagée en raison notamment:
+(i) des dommages dus à l'inexécution, totale ou partielle, de ses
+obligations par le Licencié, (ii) des dommages directs ou indirects
+découlant de l'utilisation ou des performances du Logiciel subis par le
+Licencié et (iii) plus généralement d'un quelconque dommage indirect. En
+particulier, les Parties conviennent expressément que tout préjudice
+financier ou commercial (par exemple perte de données, perte de
+bénéfices, perte d'exploitation, perte de clientèle ou de commandes,
+manque à gagner, trouble commercial quelconque) ou toute action dirigée
+contre le Licencié par un tiers, constitue un dommage indirect et
+n'ouvre pas droit à réparation par le Concédant.
+
+
+ Article 9 - GARANTIE
+
+9.1 Le Licencié reconnaît que l'état actuel des connaissances
+scientifiques et techniques au moment de la mise en circulation du
+Logiciel ne permet pas d'en tester et d'en vérifier toutes les
+utilisations ni de détecter l'existence d'éventuels défauts. L'attention
+du Licencié a été attirée sur ce point sur les risques associés au
+chargement, à l'utilisation, la modification et/ou au développement et à
+la reproduction du Logiciel qui sont réservés à des utilisateurs avertis.
+
+Il relève de la responsabilité du Licencié de contrôler, par tous
+moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et
+de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Concédant déclare de bonne foi être en droit de concéder
+l'ensemble des droits attachés au Logiciel (comprenant notamment les
+droits visés à l'article 5).
+
+9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le
+Concédant sans autre garantie, expresse ou tacite, que celle prévue à
+l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale,
+son caractère sécurisé, innovant ou pertinent.
+
+En particulier, le Concédant ne garantit pas que le Logiciel est exempt
+d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
+avec l'équipement du Licencié et sa configuration logicielle ni qu'il
+remplira les besoins du Licencié.
+
+9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le
+Logiciel ne porte pas atteinte à un quelconque droit de propriété
+intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
+autre droit de propriété. Ainsi, le Concédant exclut toute garantie au
+profit du Licencié contre les actions en contrefaçon qui pourraient être
+diligentées au titre de l'utilisation, de la modification, et de la
+redistribution du Logiciel. Néanmoins, si de telles actions sont
+exercées contre le Licencié, le Concédant lui apportera son aide
+technique et juridique pour sa défense. Cette aide technique et
+juridique est déterminée au cas par cas entre le Concédant concerné et
+le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage
+toute responsabilité quant à l'utilisation de la dénomination du
+Logiciel par le Licencié. Aucune garantie n'est apportée quant à
+l'existence de droits antérieurs sur le nom du Logiciel et sur
+l'existence d'une marque.
+
+
+ Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licencié aux obligations mises à sa
+charge par le Contrat, le Concédant pourra résilier de plein droit le
+Contrat trente (30) jours après notification adressée au Licencié et
+restée sans effet.
+
+10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à
+utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
+licences qu'il aura concédées antérieurement à la résiliation du Contrat
+resteront valides sous réserve qu'elles aient été effectuées en
+conformité avec le Contrat.
+
+
+ Article 11 - DISPOSITIONS DIVERSES
+
+
+ 11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d'un retard ou d'une défaillance
+d'exécution du Contrat qui serait dû à un cas de force majeure, un cas
+fortuit ou une cause extérieure, telle que, notamment, le mauvais
+fonctionnement ou les interruptions du réseau électrique ou de
+télécommunication, la paralysie du réseau liée à une attaque
+informatique, l'intervention des autorités gouvernementales, les
+catastrophes naturelles, les dégâts des eaux, les tremblements de terre,
+le feu, les explosions, les grèves et les conflits sociaux, l'état de
+guerre...
+
+11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
+plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du
+Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
+intéressée à s'en prévaloir ultérieurement.
+
+11.3 Le Contrat annule et remplace toute convention antérieure, écrite
+ou orale, entre les Parties sur le même objet et constitue l'accord
+entier entre les Parties sur cet objet. Aucune addition ou modification
+aux termes du Contrat n'aura d'effet à l'égard des Parties à moins
+d'être faite par écrit et signée par leurs représentants dûment habilités.
+
+11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat
+s'avèrerait contraire à une loi ou à un texte applicable, existants ou
+futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les
+amendements nécessaires pour se conformer à cette loi ou à ce texte.
+Toutes les autres dispositions resteront en vigueur. De même, la
+nullité, pour quelque raison que ce soit, d'une des dispositions du
+Contrat ne saurait entraîner la nullité de l'ensemble du Contrat.
+
+
+ 11.5 LANGUE
+
+Le Contrat est rédigé en langue française et en langue anglaise, ces
+deux versions faisant également foi.
+
+
+ Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autorisée à copier et distribuer des copies de
+ce Contrat.
+
+12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé
+et ne peut être modifié que par les auteurs de la licence, lesquels se
+réservent le droit de publier périodiquement des mises à jour ou de
+nouvelles versions du Contrat, qui posséderont chacune un numéro
+distinct. Ces versions ultérieures seront susceptibles de prendre en
+compte de nouvelles problématiques rencontrées par les logiciels libres.
+
+12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra
+faire l'objet d'une diffusion ultérieure que sous la même version du
+Contrat ou une version postérieure.
+
+
+ Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est régi par la loi française. Les Parties conviennent
+de tenter de régler à l'amiable les différends ou litiges qui
+viendraient à se produire par suite ou à l'occasion du Contrat.
+
+13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter
+de leur survenance et sauf situation relevant d'une procédure d'urgence,
+les différends ou litiges seront portés par la Partie la plus diligente
+devant les Tribunaux compétents de Paris.
+
+
+Version 1.0 du 2006-09-05.
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644
index 0000000..7739355
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,36 @@
+Copyright The Givaro Group 1994-2009
+Main contributors:
+- Jean-Guillaume.Dumas at imag.fr
+- Thierry.Gautier at imag.fr
+- Pascal.Giorgi at lirmm.fr
+- Clement.Pernet at imag.fr
+- Jean-Louis.Roch at imag.fr
+- Gilles.Villard at ens-lyon.fr
+
+Givaro is governed by the CeCILL-B license under French law and
+abiding by the rules of distribution of free software.
+You can use, modify and/ or redistribute the software under the terms
+of the CeCILL-B license as circulated by CEA, CNRS and INRIA at the
+following URL "http://www.cecill.info" ; the full CeCILL-B license can
+also be found in english and in french (Licence_CeCILL-B_V1-en.txt and
+Licence_CeCILL-B_V1-fr.txt) in the root directory of this distribution.
+
+As a counterpart to the access to the source code and rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors have only limited
+liability.
+
+In this respect, the user's attention is drawn to the risks associated
+with loading, using, modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean that it is complicated to manipulate, and that also
+therefore means that it is reserved for developers and experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and, more generally, to use and operate it in the
+same conditions as regards security.
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL-B license and that you accept its terms.
diff --git a/INSTALL b/INSTALL
index 23e5f25..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,16 +1,25 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
Basic Installation
==================
-These are generic installation instructions.
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -23,9 +32,9 @@ debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
+the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -35,30 +44,37 @@ some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
-The simplest way to compile this package is:
+ The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
+ `./configure' to configure the package for your system.
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
- the package.
+ the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
@@ -67,45 +83,69 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
Compilers and Options
=====================
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
-You can compile the package for more than one kind of computer at the
+ You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
+own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
Installation Names
==================
-By default, `make install' installs the package's commands under
+ By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
@@ -116,16 +156,47 @@ Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
+ Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
@@ -137,14 +208,53 @@ find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
Specifying the System Type
==========================
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
@@ -152,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form:
where SYSTEM can have one of these forms:
- OS KERNEL-OS
+ OS
+ KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
@@ -170,9 +281,9 @@ eventually be run) with `--host=TYPE'.
Sharing Defaults
================
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
@@ -181,7 +292,7 @@ A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
-Variables not defined in a site shell script can be set in the
+ Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
@@ -190,21 +301,29 @@ them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script). Here is a another example:
+overridden in the site shell script).
- /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
-`configure' recognizes the following options to control how it operates.
+ `configure' recognizes the following options to control how it
+operates.
`--help'
`-h'
- Print a summary of the options to `configure', and exit.
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
`--version'
`-V'
@@ -231,6 +350,16 @@ configuration-related scripts to be executed by `/bin/bash'.
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
diff --git a/Licence_CeCILL-B_V1-en.txt b/Licence_CeCILL-B_V1-en.txt
new file mode 100644
index 0000000..3ad4dea
--- /dev/null
+++ b/Licence_CeCILL-B_V1-en.txt
@@ -0,0 +1,515 @@
+
+CeCILL-B FREE SOFTWARE LICENSE AGREEMENT
+
+
+ Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+ * firstly, compliance with the principles governing the distribution
+ of Free Software: access to source code, broad rights granted to
+ users,
+ * secondly, the election of a governing law, French law, with which
+ it is conformant, both as regards the law of torts and
+ intellectual property law, and the protection that it offers to
+ both authors and holders of the economic rights over software.
+
+The authors of the CeCILL-B (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
+license are:
+
+Commissariat à l'Energie Atomique - CEA, a public scientific, technical
+and industrial research establishment, having its principal place of
+business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+ Preamble
+
+This Agreement is an open source software license intended to give users
+significant freedom to modify and redistribute the software licensed
+hereunder.
+
+The exercising of this freedom is conditional upon a strong obligation
+of giving credits for everybody that distributes a software
+incorporating a software ruled by the current license so as all
+contributions to be properly identified and acknowledged.
+
+In consideration of access to the source code and the rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+suitability of the software as regards their requirements in conditions
+enabling the security of their systems and/or data to be ensured and,
+more generally, to use and operate it in the same conditions of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+ Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Contribution: means any or all modifications, corrections, translations,
+adaptations and/or new functions integrated into the Software by any or
+all Contributors, as well as any or all Internal Modules.
+
+Module: means a set of sources files including their documentation that
+enables supplementary functions or services in addition to those offered
+by the Software.
+
+External Module: means any or all Modules, not derived from the
+Software, so that this Module and the Software run in separate address
+spaces, with one calling the other when they are run.
+
+Internal Module: means any or all Module, connected to the Software so
+that they both execute in the same address space.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+ Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the
+protection granted by the rights over said Software.
+
+
+ Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+ * (i) loading the Software by any or all means, notably, by
+ downloading from a remote server, or by loading from a physical
+ medium;
+ * (ii) the first time the Licensee exercises any of the rights
+ granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and
+understood it.
+
+
+ Article 4 - EFFECTIVE DATE AND TERM
+
+
+ 4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+ 4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+ Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+ 5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+ 1. permanent or temporary reproduction of all or part of the Software
+ by any or all means and in any or all form.
+
+ 2. loading, displaying, running, or storing the Software on any or
+ all medium.
+
+ 3. entitlement to observe, study or test its operation so as to
+ determine the ideas and principles behind any or all constituent
+ elements of said Software. This shall apply when the Licensee
+ carries out any or all loading, displaying, running, transmission
+ or storage operation as regards the Software, that it is entitled
+ to carry out hereunder.
+
+
+ 5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
+
+The right to make Contributions includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting software.
+
+The Licensee is authorized to make any or all Contributions to the
+Software provided that it includes an explicit notice that it is the
+author of said Contribution and indicates the date of the creation thereof.
+
+
+ 5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+ 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+ 1. a copy of the Agreement,
+
+ 2. a notice relating to the limitation of both the Licensor's
+ warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows effective access to the full Source
+Code of the Software at a minimum during the entire period of its
+distribution of the Software, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+ 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+If the Licensee makes any Contribution to the Software, the resulting
+Modified Software may be distributed under a license agreement other
+than this Agreement subject to compliance with the provisions of Article
+5.3.4.
+
+
+ 5.3.3 DISTRIBUTION OF EXTERNAL MODULES
+
+When the Licensee has developed an External Module, the terms and
+conditions of this Agreement do not apply to said External Module, that
+may be distributed under a separate license agreement.
+
+
+ 5.3.4 CREDITS
+
+Any Licensee who may distribute a Modified Software hereby expressly
+agrees to:
+
+ 1. indicate in the related documentation that it is based on the
+ Software licensed hereunder, and reproduce the intellectual
+ property notice for the Software,
+
+ 2. ensure that written indications of the Software intended use,
+ intellectual property notice and license hereunder are included in
+ easily accessible format from the Modified Software interface,
+
+ 3. mention, on a freely accessible website describing the Modified
+ Software, at least throughout the distribution term thereof, that
+ it is based on the Software licensed hereunder, and reproduce the
+ Software intellectual property notice,
+
+ 4. where it is distributed to a third party that may distribute a
+ Modified Software without having to make its source code
+ available, make its best efforts to ensure that said third party
+ agrees to comply with the obligations set forth in this Article .
+
+If the Software, whether or not modified, is distributed with an
+External Module designed for use in connection with the Software, the
+Licensee shall submit said External Module to the foregoing obligations.
+
+
+ 5.3.5 COMPATIBILITY WITH THE CeCILL AND CeCILL-C LICENSES
+
+Where a Modified Software contains a Contribution subject to the CeCILL
+license, the provisions set forth in Article 5.3.4 shall be optional.
+
+A Modified Software may be distributed under the CeCILL-C license. In
+such a case the provisions set forth in Article 5.3.4 shall be optional.
+
+
+ Article 6 - INTELLECTUAL PROPERTY
+
+
+ 6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by this Agreement, for the duration set forth in Article 4.2.
+
+
+ 6.2 OVER THE CONTRIBUTIONS
+
+The Licensee who develops a Contribution is the owner of the
+intellectual property rights over this Contribution as defined by
+applicable law.
+
+
+ 6.3 OVER THE EXTERNAL MODULES
+
+The Licensee who develops an External Module is the owner of the
+intellectual property rights over this External Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution.
+
+
+ 6.4 JOINT PROVISIONS
+
+The Licensee expressly undertakes:
+
+ 1. not to remove, or modify, in any manner, the intellectual property
+ notices attached to the Software;
+
+ 2. to reproduce said notices, in an identical manner, in the copies
+ of the Software modified or not.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-à-vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+ Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+ Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+ Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the suitability of the product for its requirements, its good working
+order, and for ensuring that it shall not cause damage to either persons
+or properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+ Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+ Article 11 - MISCELLANEOUS
+
+
+ 11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+ 11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+ Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version.
+
+
+ Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 1.0 dated 2006-09-05.
diff --git a/Licence_CeCILL-B_V1-fr.txt b/Licence_CeCILL-B_V1-fr.txt
new file mode 100644
index 0000000..355f45e
--- /dev/null
+++ b/Licence_CeCILL-B_V1-fr.txt
@@ -0,0 +1,519 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
+
+
+ Avertissement
+
+Ce contrat est une licence de logiciel libre issue d'une concertation
+entre ses auteurs afin que le respect de deux grands principes préside à
+sa rédaction:
+
+ * d'une part, le respect des principes de diffusion des logiciels
+ libres: accès au code source, droits étendus conférés aux
+ utilisateurs,
+ * d'autre part, la désignation d'un droit applicable, le droit
+ français, auquel elle est conforme, tant au regard du droit de la
+ responsabilité civile que du droit de la propriété intellectuelle
+ et de la protection qu'il offre aux auteurs et titulaires des
+ droits patrimoniaux sur un logiciel.
+
+Les auteurs de la licence CeCILL-B (pour Ce[a] C[nrs] I[nria] L[ogiciel]
+L[ibre]) sont:
+
+Commissariat à l'Energie Atomique - CEA, établissement public de
+recherche à caractère scientifique, technique et industriel, dont le
+siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, établissement
+public à caractère scientifique et technologique, dont le siège est
+situé 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, établissement public à caractère scientifique et technologique,
+dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153
+Le Chesnay cedex.
+
+
+ Préambule
+
+Ce contrat est une licence de logiciel libre dont l'objectif est de
+conférer aux utilisateurs une très large liberté de modification et de
+redistribution du logiciel régi par cette licence.
+
+L'exercice de cette liberté est assorti d'une obligation forte de
+citation à la charge de ceux qui distribueraient un logiciel incorporant
+un logiciel régi par la présente licence afin d'assurer que les
+contributions de tous soient correctement identifiées et reconnues.
+
+L'accessibilité au code source et les droits de copie, de modification
+et de redistribution qui découlent de ce contrat ont pour contrepartie
+de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire
+peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et
+les concédants successifs qu'une responsabilité restreinte.
+
+A cet égard l'attention de l'utilisateur est attirée sur les risques
+associés au chargement, à l'utilisation, à la modification et/ou au
+développement et à la reproduction du logiciel par l'utilisateur étant
+donné sa spécificité de logiciel libre, qui peut le rendre complexe à
+manipuler et qui le réserve donc à des développeurs ou des
+professionnels avertis possédant des connaissances informatiques
+approfondies. Les utilisateurs sont donc invités à charger et tester
+l'adéquation du logiciel à leurs besoins dans des conditions permettant
+d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus
+généralement, à l'utiliser et l'exploiter dans les mêmes conditions de
+sécurité. Ce contrat peut être reproduit et diffusé librement, sous
+réserve de le conserver en l'état, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s'appliquer à tout logiciel dont le
+titulaire des droits patrimoniaux décide de soumettre l'exploitation aux
+dispositions qu'il contient.
+
+
+ Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une
+lettre capitale, auront la signification suivante:
+
+Contrat: désigne le présent contrat de licence, ses éventuelles versions
+postérieures et annexes.
+
+Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code
+Source et le cas échéant sa documentation, dans leur état au moment de
+l'acceptation du Contrat par le Licencié.
+
+Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et
+éventuellement de Code Objet et le cas échéant sa documentation, dans
+leur état au moment de leur première diffusion sous les termes du Contrat.
+
+Logiciel Modifié: désigne le Logiciel modifié par au moins une
+Contribution.
+
+Code Source: désigne l'ensemble des instructions et des lignes de
+programme du Logiciel et auquel l'accès est nécessaire en vue de
+modifier le Logiciel.
+
+Code Objet: désigne les fichiers binaires issus de la compilation du
+Code Source.
+
+Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur
+sur le Logiciel Initial.
+
+Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le
+Contrat.
+
+Contributeur: désigne le Licencié auteur d'au moins une Contribution.
+
+Concédant: désigne le Titulaire ou toute personne physique ou morale
+distribuant le Logiciel sous le Contrat.
+
+Contribution: désigne l'ensemble des modifications, corrections,
+traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans
+le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: désigne un ensemble de fichiers sources y compris leur
+documentation qui permet de réaliser des fonctionnalités ou services
+supplémentaires à ceux fournis par le Logiciel.
+
+Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce
+Module et le Logiciel s'exécutent dans des espaces d'adressage
+différents, l'un appelant l'autre au moment de leur exécution.
+
+Module Interne: désigne tout Module lié au Logiciel de telle sorte
+qu'ils s'exécutent dans le même espace d'adressage.
+
+Parties: désigne collectivement le Licencié et le Concédant.
+
+Ces termes s'entendent au singulier comme au pluriel.
+
+
+ Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Concédant au Licencié d'une
+licence non exclusive, cessible et mondiale du Logiciel telle que
+définie ci-après à l'article 5 pour toute la durée de protection des droits
+portant sur ce Logiciel.
+
+
+ Article 3 - ACCEPTATION
+
+3.1 L'acceptation par le Licencié des termes du Contrat est réputée
+acquise du fait du premier des faits suivants:
+
+ * (i) le chargement du Logiciel par tout moyen notamment par
+ téléchargement à partir d'un serveur distant ou par chargement à
+ partir d'un support physique;
+ * (ii) le premier exercice par le Licencié de l'un quelconque des
+ droits concédés par le Contrat.
+
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement
+relatif aux spécificités du Logiciel, à la restriction de garantie et à
+la limitation à un usage par des utilisateurs expérimentés a été mis à
+disposition du Licencié préalablement à son acceptation telle que
+définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris
+connaissance.
+
+
+ Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+
+ 4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur à la date de son acceptation par le Licencié
+telle que définie en 3.1.
+
+
+ 4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la durée légale de
+protection des droits patrimoniaux portant sur le Logiciel.
+
+
+ Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Concédant concède au Licencié, qui accepte, les droits suivants sur
+le Logiciel pour toutes destinations et pour la durée du Contrat dans
+les conditions ci-après détaillées.
+
+Par ailleurs, si le Concédant détient ou venait à détenir un ou
+plusieurs brevets d'invention protégeant tout ou partie des
+fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas
+opposer les éventuels droits conférés par ces brevets aux Licenciés
+successifs qui utiliseraient, exploiteraient ou modifieraient le
+Logiciel. En cas de cession de ces brevets, le Concédant s'engage à
+faire reprendre les obligations du présent alinéa aux cessionnaires.
+
+
+ 5.1 DROIT D'UTILISATION
+
+Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant
+aux domaines d'application, étant ci-après précisé que cela comporte:
+
+ 1. la reproduction permanente ou provisoire du Logiciel en tout ou
+ partie par tout moyen et sous toute forme.
+
+ 2. le chargement, l'affichage, l'exécution, ou le stockage du
+ Logiciel sur tout support.
+
+ 3. la possibilité d'en observer, d'en étudier, ou d'en tester le
+ fonctionnement afin de déterminer les idées et principes qui sont
+ à la base de n'importe quel élément de ce Logiciel; et ceci,
+ lorsque le Licencié effectue toute opération de chargement,
+ d'affichage, d'exécution, de transmission ou de stockage du
+ Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
+
+
+ 5.2 DROIT D'APPORTER DES CONTRIBUTIONS
+
+Le droit d'apporter des Contributions comporte le droit de traduire,
+d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel
+et le droit de reproduire le logiciel en résultant.
+
+Le Licencié est autorisé à apporter toute Contribution au Logiciel sous
+réserve de mentionner, de façon explicite, son nom en tant qu'auteur de
+cette Contribution et la date de création de celle-ci.
+
+
+ 5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de
+transmettre et de communiquer le Logiciel au public sur tout support et
+par tout moyen ainsi que le droit de mettre sur le marché à titre
+onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé.
+
+Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou
+non, à des tiers dans les conditions ci-après détaillées.
+
+
+ 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licencié est autorisé à distribuer des copies conformes du Logiciel,
+sous forme de Code Source ou de Code Objet, à condition que cette
+distribution respecte les dispositions du Contrat dans leur totalité et
+soit accompagnée:
+
+ 1. d'un exemplaire du Contrat,
+
+ 2. d'un avertissement relatif à la restriction de garantie et de
+ responsabilité du Concédant telle que prévue aux articles 8
+ et 9,
+
+et que, dans le cas où seul le Code Objet du Logiciel est redistribué,
+le Licencié permette un accès effectif au Code Source complet du
+Logiciel pendant au moins toute la durée de sa distribution du Logiciel,
+étant entendu que le coût additionnel d'acquisition du Code Source ne
+devra pas excéder le simple coût de transfert des données.
+
+
+ 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licencié apporte une Contribution au Logiciel, le Logiciel
+Modifié peut être distribué sous un contrat de licence autre que le
+présent Contrat sous réserve du respect des dispositions de l'article
+5.3.4.
+
+
+ 5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licencié a développé un Module Externe les conditions du
+Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué
+sous un contrat de licence différent.
+
+
+ 5.3.4 CITATIONS
+
+Le Licencié qui distribue un Logiciel Modifié s'engage expressément:
+
+ 1. à indiquer dans sa documentation qu'il a été réalisé à partir du
+ Logiciel régi par le Contrat, en reproduisant les mentions de
+ propriété intellectuelle du Logiciel,
+
+ 2. à faire en sorte que l'utilisation du Logiciel, ses mentions de
+ propriété intellectuelle et le fait qu'il est régi par le Contrat
+ soient indiqués dans un texte facilement accessible depuis
+ l'interface du Logiciel Modifié,
+
+ 3. à mentionner, sur un site Web librement accessible décrivant le
+ Logiciel Modifié, et pendant au moins toute la durée de sa
+ distribution, qu'il a été réalisé à partir du Logiciel régi par le
+ Contrat, en reproduisant les mentions de propriété intellectuelle
+ du Logiciel,
+
+ 4. lorsqu'il le distribue à un tiers susceptible de distribuer
+ lui-même un Logiciel Modifié, sans avoir à en distribuer le code
+ source, à faire ses meilleurs efforts pour que les obligations du
+ présent article 5.3.4 soient reprises par le dit tiers.
+
+Lorsque le Logiciel modifié ou non est distribué avec un Module Externe
+qui a été conçu pour l'utiliser, le Licencié doit soumettre le dit
+Module Externe aux obligations précédentes.
+
+
+ 5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C
+
+Lorsqu'un Logiciel Modifié contient une Contribution soumise au contrat
+de licence CeCILL, les stipulations prévues à l'article 5.3.4 sont
+facultatives.
+
+Un Logiciel Modifié peut être distribué sous le contrat de licence
+CeCILL-C. Les stipulations prévues à l'article 5.3.4 sont alors
+facultatives.
+
+
+ Article 6 - PROPRIETE INTELLECTUELLE
+
+
+ 6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel
+Initial. Toute utilisation du Logiciel Initial est soumise au respect
+des conditions dans lesquelles le Titulaire a choisi de diffuser son
+oeuvre et nul autre n'a la faculté de modifier les conditions de
+diffusion de ce Logiciel Initial.
+
+Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi
+par le Contrat et ce, pour la durée visée à l'article 4.2.
+
+
+ 6.2 SUR LES CONTRIBUTIONS
+
+Le Licencié qui a développé une Contribution est titulaire sur celle-ci
+des droits de propriété intellectuelle dans les conditions définies par
+la législation applicable.
+
+
+ 6.3 SUR LES MODULES EXTERNES
+
+Le Licencié qui a développé un Module Externe est titulaire sur celui-ci
+des droits de propriété intellectuelle dans les conditions définies par
+la législation applicable et reste libre du choix du contrat régissant
+sa diffusion.
+
+
+ 6.4 DISPOSITIONS COMMUNES
+
+Le Licencié s'engage expressément:
+
+ 1. à ne pas supprimer ou modifier de quelque manière que ce soit les
+ mentions de propriété intellectuelle apposées sur le Logiciel;
+
+ 2. à reproduire à l'identique lesdites mentions de propriété
+ intellectuelle sur les copies du Logiciel modifié ou non.
+
+Le Licencié s'engage à ne pas porter atteinte, directement ou
+indirectement, aux droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs sur le Logiciel et à prendre, le cas échéant, à
+l'égard de son personnel toutes les mesures nécessaires pour assurer le
+respect des dits droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs.
+
+
+ Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de
+prestations d'assistance technique ou de maintenance du Logiciel.
+
+Cependant le Concédant reste libre de proposer ce type de services. Les
+termes et conditions d'une telle assistance technique et/ou d'une telle
+maintenance seront alors déterminés dans un acte séparé. Ces actes de
+maintenance et/ou assistance technique n'engageront que la seule
+responsabilité du Concédant qui les propose.
+
+7.2 De même, tout Concédant est libre de proposer, sous sa seule
+responsabilité, à ses licenciés une garantie, qui n'engagera que lui,
+lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce,
+dans les conditions qu'il souhaite. Cette garantie et les modalités
+financières de son application feront l'objet d'un acte séparé entre le
+Concédant et le Licencié.
+
+
+ Article 8 - RESPONSABILITE
+
+8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la
+faculté, sous réserve de prouver la faute du Concédant concerné, de
+solliciter la réparation du préjudice direct qu'il subirait du fait du
+Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilité du Concédant est limitée aux engagements pris en
+application du Contrat et ne saurait être engagée en raison notamment:
+(i) des dommages dus à l'inexécution, totale ou partielle, de ses
+obligations par le Licencié, (ii) des dommages directs ou indirects
+découlant de l'utilisation ou des performances du Logiciel subis par le
+Licencié et (iii) plus généralement d'un quelconque dommage indirect. En
+particulier, les Parties conviennent expressément que tout préjudice
+financier ou commercial (par exemple perte de données, perte de
+bénéfices, perte d'exploitation, perte de clientèle ou de commandes,
+manque à gagner, trouble commercial quelconque) ou toute action dirigée
+contre le Licencié par un tiers, constitue un dommage indirect et
+n'ouvre pas droit à réparation par le Concédant.
+
+
+ Article 9 - GARANTIE
+
+9.1 Le Licencié reconnaît que l'état actuel des connaissances
+scientifiques et techniques au moment de la mise en circulation du
+Logiciel ne permet pas d'en tester et d'en vérifier toutes les
+utilisations ni de détecter l'existence d'éventuels défauts. L'attention
+du Licencié a été attirée sur ce point sur les risques associés au
+chargement, à l'utilisation, la modification et/ou au développement et à
+la reproduction du Logiciel qui sont réservés à des utilisateurs avertis.
+
+Il relève de la responsabilité du Licencié de contrôler, par tous
+moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et
+de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Concédant déclare de bonne foi être en droit de concéder
+l'ensemble des droits attachés au Logiciel (comprenant notamment les
+droits visés à l'article 5).
+
+9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le
+Concédant sans autre garantie, expresse ou tacite, que celle prévue à
+l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale,
+son caractère sécurisé, innovant ou pertinent.
+
+En particulier, le Concédant ne garantit pas que le Logiciel est exempt
+d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
+avec l'équipement du Licencié et sa configuration logicielle ni qu'il
+remplira les besoins du Licencié.
+
+9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le
+Logiciel ne porte pas atteinte à un quelconque droit de propriété
+intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
+autre droit de propriété. Ainsi, le Concédant exclut toute garantie au
+profit du Licencié contre les actions en contrefaçon qui pourraient être
+diligentées au titre de l'utilisation, de la modification, et de la
+redistribution du Logiciel. Néanmoins, si de telles actions sont
+exercées contre le Licencié, le Concédant lui apportera son aide
+technique et juridique pour sa défense. Cette aide technique et
+juridique est déterminée au cas par cas entre le Concédant concerné et
+le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage
+toute responsabilité quant à l'utilisation de la dénomination du
+Logiciel par le Licencié. Aucune garantie n'est apportée quant à
+l'existence de droits antérieurs sur le nom du Logiciel et sur
+l'existence d'une marque.
+
+
+ Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licencié aux obligations mises à sa
+charge par le Contrat, le Concédant pourra résilier de plein droit le
+Contrat trente (30) jours après notification adressée au Licencié et
+restée sans effet.
+
+10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à
+utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
+licences qu'il aura concédées antérieurement à la résiliation du Contrat
+resteront valides sous réserve qu'elles aient été effectuées en
+conformité avec le Contrat.
+
+
+ Article 11 - DISPOSITIONS DIVERSES
+
+
+ 11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d'un retard ou d'une défaillance
+d'exécution du Contrat qui serait dû à un cas de force majeure, un cas
+fortuit ou une cause extérieure, telle que, notamment, le mauvais
+fonctionnement ou les interruptions du réseau électrique ou de
+télécommunication, la paralysie du réseau liée à une attaque
+informatique, l'intervention des autorités gouvernementales, les
+catastrophes naturelles, les dégâts des eaux, les tremblements de terre,
+le feu, les explosions, les grèves et les conflits sociaux, l'état de
+guerre...
+
+11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
+plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du
+Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
+intéressée à s'en prévaloir ultérieurement.
+
+11.3 Le Contrat annule et remplace toute convention antérieure, écrite
+ou orale, entre les Parties sur le même objet et constitue l'accord
+entier entre les Parties sur cet objet. Aucune addition ou modification
+aux termes du Contrat n'aura d'effet à l'égard des Parties à moins
+d'être faite par écrit et signée par leurs représentants dûment habilités.
+
+11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat
+s'avèrerait contraire à une loi ou à un texte applicable, existants ou
+futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les
+amendements nécessaires pour se conformer à cette loi ou à ce texte.
+Toutes les autres dispositions resteront en vigueur. De même, la
+nullité, pour quelque raison que ce soit, d'une des dispositions du
+Contrat ne saurait entraîner la nullité de l'ensemble du Contrat.
+
+
+ 11.5 LANGUE
+
+Le Contrat est rédigé en langue française et en langue anglaise, ces
+deux versions faisant également foi.
+
+
+ Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autorisée à copier et distribuer des copies de
+ce Contrat.
+
+12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé
+et ne peut être modifié que par les auteurs de la licence, lesquels se
+réservent le droit de publier périodiquement des mises à jour ou de
+nouvelles versions du Contrat, qui posséderont chacune un numéro
+distinct. Ces versions ultérieures seront susceptibles de prendre en
+compte de nouvelles problématiques rencontrées par les logiciels libres.
+
+12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra
+faire l'objet d'une diffusion ultérieure que sous la même version du
+Contrat ou une version postérieure.
+
+
+ Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est régi par la loi française. Les Parties conviennent
+de tenter de régler à l'amiable les différends ou litiges qui
+viendraient à se produire par suite ou à l'occasion du Contrat.
+
+13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter
+de leur survenance et sauf situation relevant d'une procédure d'urgence,
+les différends ou litiges seront portés par la Partie la plus diligente
+devant les Tribunaux compétents de Paris.
+
+
+Version 1.0 du 2006-09-05.
diff --git a/Makefile.am b/Makefile.am
index 59763f8..75d5ad5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,17 +1,50 @@
-SUBDIRS=src macros examples
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-bin_SCRIPTS=givaro-config givaro-makefile
+ACLOCAL_AMFLAGS = -I macros
+
+SUBDIRS=src macros tests docs
include_HEADERS=givaro-config.h
-DISTCLEANFILES = src/kernel/system/givaro
-DISTCLEANFILES += src/kernel/bstruct/givaro
-DISTCLEANFILES += src/kernel/integer/givaro
-DISTCLEANFILES += src/kernel/memory/givaro
-DISTCLEANFILES += src/kernel/rational/givaro
-DISTCLEANFILES += src/kernel/zpz/givaro
-DISTCLEANFILES += src/kernel/gmp++/gmp++
-DISTCLEANFILES += src/library/matrix/givaro
-DISTCLEANFILES += src/library/poly1/givaro
-DISTCLEANFILES += src/library/tools/givaro
-DISTCLEANFILES += src/library/vector/givaro
+docs:docs/givaro-html/index.html
+
+docs/givaro-html/index.html:
+ (cd docs; make docs)
+
+.PHONY:examples
+
+examples:
+ (cd examples; make examples)
+
+
+bin_SCRIPTS=givaro-config givaro-makefile
+
+EXTRA_DIST=COPYRIGHT Licence_CeCILL-B_V1-en.txt Licence_CeCILL-B_V1-fr.txt \
+ givaro.doxy
+
+DIST_SUBDIRS=examples ${SUBDIRS}
+
+DISTCLEANFILES = src/kernel/system/givaro \
+ src/kernel/bstruct/givaro \
+ src/kernel/integer/givaro \
+ src/kernel/memory/givaro \
+ src/kernel/rational/givaro \
+ src/kernel/zpz/givaro \
+ src/kernel/gmp++/gmp++ \
+ src/library/matrix/givaro \
+ src/library/poly1/givaro \
+ src/library/tools/givaro \
+ src/library/vector/givaro
+
+
+# docs_dev:docs/givaro-dev-html/index.html
+
+# doc/givaro-dev-html/index.html:
+# (cd docs; make docs_dev)
+
+VERSION=3.4.2
+
diff --git a/Makefile.in b/Makefile.in
index 837686c..137d19b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -38,12 +45,20 @@ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(srcdir)/givaro-config.in \
$(srcdir)/givaro-makefile.in $(top_srcdir)/configure AUTHORS \
- COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \
- install-sh ltmain.sh missing
+ COPYING ChangeLog INSTALL NEWS build-aux/config.guess \
+ build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \
+ build-aux/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -54,6 +69,8 @@ CONFIG_CLEAN_FILES = givaro-config givaro-makefile
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -75,7 +92,6 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -95,26 +111,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -124,40 +141,55 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
-VERSION = @VERSION@
+TESTS_CFLAGS = @TESTS_CFLAGS@
+
+# docs_dev:docs/givaro-dev-html/index.html
+
+# doc/givaro-dev-html/index.html:
+# (cd docs; make docs_dev)
+VERSION = 3.4.2
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -197,17 +229,29 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = src macros examples
-bin_SCRIPTS = givaro-config givaro-makefile
+ACLOCAL_AMFLAGS = -I macros
+SUBDIRS = src macros tests docs
include_HEADERS = givaro-config.h
-DISTCLEANFILES = src/kernel/system/givaro src/kernel/bstruct/givaro \
- src/kernel/integer/givaro src/kernel/memory/givaro \
- src/kernel/rational/givaro src/kernel/zpz/givaro \
- src/kernel/gmp++/gmp++ src/library/matrix/givaro \
- src/library/poly1/givaro src/library/tools/givaro \
- src/library/vector/givaro
+bin_SCRIPTS = givaro-config givaro-makefile
+EXTRA_DIST = COPYRIGHT Licence_CeCILL-B_V1-en.txt Licence_CeCILL-B_V1-fr.txt \
+ givaro.doxy
+
+DIST_SUBDIRS = examples ${SUBDIRS}
+DISTCLEANFILES = src/kernel/system/givaro \
+ src/kernel/bstruct/givaro \
+ src/kernel/integer/givaro \
+ src/kernel/memory/givaro \
+ src/kernel/rational/givaro \
+ src/kernel/zpz/givaro \
+ src/kernel/gmp++/gmp++ \
+ src/library/matrix/givaro \
+ src/library/poly1/givaro \
+ src/library/tools/givaro \
+ src/library/vector/givaro
+
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -218,15 +262,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
- cd $(srcdir) && $(AUTOMAKE) --gnu \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps'; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu Makefile
+ $(AUTOMAKE) --gnu --ignore-deps Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -293,7 +337,7 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
- -rm -f libtool
+ -rm -f libtool config.lt
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@@ -319,7 +363,7 @@ uninstall-includeHEADERS:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -344,7 +388,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -387,7 +431,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -487,7 +531,8 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ -find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
@@ -639,6 +684,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -647,18 +694,28 @@ install-data-am: install-includeHEADERS
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am: install-binSCRIPTS
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -702,6 +759,16 @@ uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS
uninstall uninstall-am uninstall-binSCRIPTS \
uninstall-includeHEADERS
+
+docs:docs/givaro-html/index.html
+
+docs/givaro-html/index.html:
+ (cd docs; make docs)
+
+.PHONY:examples
+
+examples:
+ (cd examples; make examples)
# 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/README b/README
index 2bba3a8..2de39ad 100644
--- a/README
+++ b/README
@@ -1 +1,30 @@
-Readme for givaro library
\ No newline at end of file
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+Q: How to install Givaro?
+A: Quick Start
+
+> tar -zxvf Givaro.tar.gz
+> cd givaro-3.XX
+> configure --prefix=/tmp/givaro-exec
+> make; make install
+
+ Configuration can be adapted. > configure --help, will print the parameter choices.
+ In particular if GMP is not installed to the default location you might need to add e.g. --with-gmp=/mypathforgmp/gmp-4.3.1 to the configure line.
+ Also, on non-Linux systems you might need to use 'gmake' instead of 'make'.
+
+Q: Compilation?
+A: An optional compilation help file is provided : just add the following line to your Makefile !
+
+include ##GIVAROROOT##/bin/givaro-makefile
+
+A: Then a simple call will compile your C and C++ files (here ifactor.C, with a gazillion number of optional optimization flags):
+
+> cd examples/Integer; make ifactor "OPTFLAGS=-O7 -funroll-all-loops -felide-constructors -fstrict-aliasing -frerun-loop-opt -fexpensive-optimizations -fforce-addr -fforce-mem -fstrength-reduce -march=i686"
+
+
+Q: Without the givaro compilation file?
+A: You should add -Igivaropath/include to the CXX compilation flags, -Lgivaropath/lib -lgivaro to the LD link flags, toghether with those for GMP.
diff --git a/aclocal.m4 b/aclocal.m4
index e8e531f..bf13095 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.3 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -13,6665 +13,13 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
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'.])])
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-
-# serial 52 Debian 1.5.26-4 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
- [],
- [m4_define([AC_PROVIDE_IFELSE],
- [m4_ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [AC_LIBTOOL_CXX],
- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
- ])])
-dnl And a similar setup for Fortran 77 support
- AC_PROVIDE_IFELSE([AC_PROG_F77],
- [AC_LIBTOOL_F77],
- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
- AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([LT_AC_PROG_GCJ],
- [define([LT_AC_PROG_GCJ],
- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-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.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# 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
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- AC_PATH_MAGIC
- fi
- ;;
-esac
-
-_LT_REQUIRED_DARWIN_CHECKS
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
- [AC_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# --------------------------
-# Check for some things on darwin
-AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- echo "int foo(void){return 1;}" > conftest.c
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib ${wl}-single_module conftest.c
- if test -f libconftest.dylib; then
- lt_cv_apple_cc_single_mod=yes
- rm -rf libconftest.dylib*
- fi
- rm conftest.c
- fi])
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
- ])
- case $host_os in
- rhapsody* | darwin1.[[0123]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*)
- # 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
-])
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-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],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-echo=${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 <<EOF
-[$]*
-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 "$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 &&
- echo_test_string=`eval $cmd` &&
- (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.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) 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*
- ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
- ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "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
- $2=yes
- fi
- fi
- $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$5], , :, [$5])
-else
- ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "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
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $rm -r conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$4], , :, [$4])
-else
- ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # 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
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#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
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#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 ());
-
- exit (status);
-}]
-EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_AC_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_AC_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-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"
-m4_if($1,[],[
-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])
-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<name>.so
- # instead of lib<name>.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*)
- 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'
- ;;
-
-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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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*)
- # 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}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- 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
- # 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=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
- ;;
-
-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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- 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'
- ;;
-
-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
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
-[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
-[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-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
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_ARG_WITH([tags],
- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
- [include additional configurations @<:@automatic@:>@])],
- [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- AC_MSG_WARN([output file `$ofile' does not exist])
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
- else
- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
- "") ;;
- *) AC_MSG_ERROR([invalid tag name: $tagname])
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- AC_MSG_ERROR([tag name \"$tagname\" already exists])
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_LIBTOOL_LANG_CXX_CONFIG
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
- AC_LIBTOOL_LANG_F77_CONFIG
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- AC_LIBTOOL_LANG_GCJ_CONFIG
- else
- tagname=""
- fi
- ;;
-
- RC)
- AC_LIBTOOL_LANG_RC_CONFIG
- ;;
-
- *)
- AC_MSG_ERROR([Unsupported tag name: $tagname])
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- AC_MSG_ERROR([unable to update list of available tagged configurations.])
- fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognize shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<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 at gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognize a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
- [AC_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-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
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[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
- ;;
-
-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=unknown
- ;;
-
-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
- ;;
-
-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
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-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
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!). If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, lt_dlinit,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLINCL=
- fi
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- AC_PROG_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
- if test "$GXX" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- freebsd-elf*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*) ;;
- *)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- interix[[3-9]]*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # 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.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_AC_TAGVAR(predep_objects,$1)=
- _LT_AC_TAGVAR(postdep_objects,$1)=
- _LT_AC_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- #
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
- if test "$solaris_use_stlport4" != yes; then
- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
- program t
- end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _LT_AC_TAGVAR(predep_objects, $1) \
- _LT_AC_TAGVAR(postdep_objects, $1) \
- _LT_AC_TAGVAR(predeps, $1) \
- _LT_AC_TAGVAR(postdeps, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
- _LT_AC_TAGVAR(hardcode_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(fix_srcfile_path, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 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.
-
-# 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//"
-
-# 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
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# 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_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# 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
-
-# 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=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
- case $host_os in
- aix3*)
- cat <<\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
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-])
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([LT_AC_PROG_SED])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux* | k*bsd*-gnu)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDGIRSTW]]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- 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
-
-# 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
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, 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.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-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_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
- amigaos*)
- # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # 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*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler.
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- ;;
- linux* | k*bsd*-gnu)
- _LT_AC_TAGVAR(link_all_deplibs, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
- _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-],[
- runpath_var=
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)=
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_AC_TAGVAR(hardcode_automatic, $1)=no
- _LT_AC_TAGVAR(module_cmds, $1)=
- _LT_AC_TAGVAR(module_expsym_cmds, $1)=
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_AC_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- _LT_CC_BASENAME([$compiler])
- case $host_os in
- cygwin* | mingw* | pw32*)
- # 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
-
- _LT_AC_TAGVAR(ld_shlibs, $1)=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
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` 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
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<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.
-
-EOF
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
- # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- interix[[3-9]]*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${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
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${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' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=no
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<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.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- # see comment about different semantics on the GNU ld section
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- bsdi[[45]]*)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # 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.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$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
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$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*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_AC_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
- ;;
- esac
- fi
- ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-
-# Cheap backport of AS_EXECUTABLE_P and required macros
-# from Autoconf 2.59; we should not use $as_executable_p directly.
-
-# _AS_TEST_PREPARE
-# ----------------
-m4_ifndef([_AS_TEST_PREPARE],
-[m4_defun([_AS_TEST_PREPARE],
-[if test -x / >/dev/null 2>&1; then
- as_executable_p='test -x'
-else
- as_executable_p='test -f'
-fi
-])])# _AS_TEST_PREPARE
-
-# AS_EXECUTABLE_P
-# ---------------
-# Check whether a file is executable.
-m4_ifndef([AS_EXECUTABLE_P],
-[m4_defun([AS_EXECUTABLE_P],
-[AS_REQUIRE([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
-])])# AS_EXECUTABLE_P
-
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 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,
@@ -6686,7 +34,7 @@ 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.1], [],
+m4_if([$1], [1.10.3], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -6700,12 +48,12 @@ 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 AC_INIT_AUTOMAKE.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
+[AM_AUTOMAKE_VERSION([1.10.3])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@@ -6795,14 +143,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
+# serial 10
# 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,
@@ -6859,6 +207,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
@@ -6876,7 +234,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
@@ -6886,19 +254,23 @@ AC_CACHE_CHECK([dependency style of $depcc],
break
fi
;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
none) break ;;
esac
- # 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} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
@@ -6955,57 +327,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# 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 3
+#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; 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"
+[{
+ # 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
-done
+}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -7037,7 +420,7 @@ 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.
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -7111,8 +494,8 @@ 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_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -7224,58 +607,6 @@ AC_DEFUN([AM_MAINTAINER_MODE],
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-# 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
@@ -7340,13 +671,13 @@ esac
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+# 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 3
+# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@@ -7363,7 +694,7 @@ AC_DEFUN([_AM_SET_OPTION],
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
@@ -7561,4 +892,11 @@ AC_SUBST([am__untar])
m4_include([macros/aclocal-include.m4])
m4_include([macros/config-header.m4])
+m4_include([macros/debug.m4])
+m4_include([macros/givaro-doc.m4])
m4_include([macros/gmp-check.m4])
+m4_include([macros/libtool.m4])
+m4_include([macros/ltoptions.m4])
+m4_include([macros/ltsugar.m4])
+m4_include([macros/ltversion.m4])
+m4_include([macros/lt~obsolete.m4])
diff --git a/config.guess b/build-aux/config.guess
similarity index 84%
rename from config.guess
rename to build-aux/config.guess
index f32079a..40eaed4 100755
--- a/config.guess
+++ b/build-aux/config.guess
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
-timestamp='2008-01-23'
+timestamp='2011-05-11'
# 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
@@ -27,16 +27,16 @@ timestamp='2008-01-23'
# the same distribution terms that you use for the rest of that program.
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +56,9 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 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
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
@@ -223,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# 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 ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
@@ -324,14 +328,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@@ -375,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# 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}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@@ -461,8 +484,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # 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 ] || \
@@ -475,7 +498,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -532,7 +555,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -575,52 +598,52 @@ EOF
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" ;;
+ 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
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ 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);
- }
+ 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
@@ -640,7 +663,7 @@ EOF
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
@@ -711,22 +734,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@@ -750,14 +773,14 @@ EOF
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 ;;
+ 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}"
+ 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}
@@ -785,18 +808,18 @@ EOF
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # 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
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
- EM64T | authenticamd)
+ authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
@@ -806,6 +829,9 @@ EOF
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -835,6 +861,20 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -842,7 +882,13 @@ EOF
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
@@ -855,7 +901,18 @@ EOF
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo frv-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -866,74 +923,33 @@ EOF
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:*:*)
+ mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef mips64
- #undef mips64el
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
+ CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
+ CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ padre:Linux:*:*)
+ echo sparc-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}
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
@@ -943,14 +959,17 @@ EOF
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -958,6 +977,9 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-tilera-linux-gnu
+ exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
@@ -965,71 +987,8 @@ EOF
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-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 <features.h>
- #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
@@ -1037,11 +996,11 @@ EOF
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,
+ # 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.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@@ -1058,7 +1017,7 @@ EOF
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
@@ -1073,7 +1032,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1101,10 +1060,13 @@ EOF
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 ;;
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1139,8 +1101,18 @@ EOF
/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; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
@@ -1153,7 +1125,7 @@ EOF
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
@@ -1173,10 +1145,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel at ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel at ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes at openmarket.com>.
# How about differentiating between stratus architectures? -djm
@@ -1202,11 +1174,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1216,6 +1188,9 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1243,6 +1218,16 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1258,6 +1243,9 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
@@ -1303,13 +1291,13 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ 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`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@@ -1324,6 +1312,9 @@ EOF
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1346,11 +1337,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
diff --git a/config.sub b/build-aux/config.sub
similarity index 88%
rename from config.sub
rename to build-aux/config.sub
index 6759825..30fdca8 100755
--- a/config.sub
+++ b/build-aux/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
-timestamp='2008-01-16'
+timestamp='2011-03-23'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@ timestamp='2008-01-16'
# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -72,8 +75,9 @@ Report bugs and patches to <config-patches at gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,8 +124,10 @@ esac
# 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* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -148,10 +154,13 @@ case $os in
-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)
+ -apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
+ -bluegene*)
+ os=-cnk
+ ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -166,10 +175,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -249,13 +258,16 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
+ | maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
- | mips64vr | mips64vrel \
+ | mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
@@ -268,28 +280,42 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | moxie \
| mt \
| msp430 \
+ | nds32 | nds32le | nds32be \
| nios | nios2 \
| ns16k | ns32k \
+ | open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
| v850 | v850e \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
@@ -300,6 +326,18 @@ case $basic_machine in
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -320,7 +358,7 @@ case $basic_machine in
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
@@ -329,14 +367,17 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
+ | mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
@@ -351,27 +392,31 @@ case $basic_machine in
| mmix-* \
| mt-* \
| msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile-* | tilegx-* \
| tron-* \
+ | ubicom32-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
- | z8k-*)
+ | z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
@@ -393,7 +438,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@@ -439,6 +484,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -455,10 +504,27 @@ case $basic_machine in
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -487,7 +553,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@@ -526,6 +592,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@@ -699,6 +769,9 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -803,6 +876,12 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -885,9 +964,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@@ -981,6 +1061,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
@@ -1037,17 +1120,10 @@ case $basic_machine in
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
+ # This must be matched before tile*.
+ tilegx*)
+ basic_machine=tilegx-unknown
+ os=-linux-gnu
;;
tile*)
basic_machine=tile-unknown
@@ -1120,6 +1196,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
@@ -1128,6 +1207,10 @@ case $basic_machine in
basic_machine=z8k-unknown
os=-sim
;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
none)
basic_machine=none-none
os=-none
@@ -1166,7 +1249,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1213,9 +1296,12 @@ esac
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
@@ -1236,10 +1322,11 @@ case $os in
# 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* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1248,9 +1335,10 @@ case $os in
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1258,7 +1346,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1297,7 +1385,7 @@ case $os in
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
@@ -1346,7 +1434,7 @@ case $os in
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
@@ -1388,6 +1476,11 @@ case $os in
-zvmoe)
os=-zvmoe
;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1410,10 +1503,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
@@ -1425,8 +1518,17 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1453,7 +1555,7 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
@@ -1480,7 +1582,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
@@ -1585,7 +1687,7 @@ case $basic_machine in
-sunos*)
vendor=sun
;;
- -aix*)
+ -cnk*|-aix*)
vendor=ibm
;;
-beos*)
diff --git a/build-aux/install-sh b/build-aux/install-sh
new file mode 100755
index 0000000..6781b98
--- /dev/null
+++ b/build-aux/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
new file mode 100755
index 0000000..6f650ae
--- /dev/null
+++ b/build-aux/ltmain.sh
@@ -0,0 +1,9642 @@
+
+# libtool (GNU libtool) 2.4
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4 Debian-2.4-2
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4 Debian-2.4-2"
+TIMESTAMP=""
+package_revision=1.3293
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/bin/sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "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;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link)
+ libs="$deplibs %DEPLIBS%"
+ test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+ ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ 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 I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ 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 a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_apped 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
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ 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
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/missing b/build-aux/missing
similarity index 85%
rename from missing
rename to build-aux/missing
index 894e786..28055d2 100755
--- a/missing
+++ b/build-aux/missing
@@ -1,10 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2005-06-08.21
+scriptversion=2009-04-28.21; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@ scriptversion=2005-06-08.21
# 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.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -33,6 +31,8 @@ if test $# -eq 0; then
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +44,7 @@ fi
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -77,6 +77,7 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -86,6 +87,9 @@ Supported PROGRAM values:
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
Send bug reports to <bug-automake at gnu.org>."
exit $?
;;
@@ -103,15 +107,22 @@ Send bug reports to <bug-automake at gnu.org>."
esac
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
- lex|yacc)
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
- tar)
+ tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
@@ -135,7 +146,7 @@ esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case "$1" in
+case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -145,7 +156,7 @@ WARNING: \`$1' is $msg. You should only need it if
touch aclocal.m4
;;
- autoconf)
+ autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
@@ -154,7 +165,7 @@ WARNING: \`$1' is $msg. You should only need it if
touch configure
;;
- autoheader)
+ autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
@@ -164,7 +175,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -184,7 +195,7 @@ WARNING: \`$1' is $msg. You should only need it if
while read f; do touch "$f"; done
;;
- autom4te)
+ autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
@@ -192,8 +203,8 @@ WARNING: \`$1' is needed, but is $msg.
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'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -207,80 +218,78 @@ WARNING: \`$1' is needed, but is $msg.
fi
;;
- bison|yacc)
+ 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
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
- lex|flex)
+ 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
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
- help2man)
+ 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
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
- exit 1
+ exit $?
fi
;;
- makeinfo)
+ 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
@@ -289,11 +298,17 @@ WARNING: \`$1' is $msg. You should only need it if
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@@ -303,7 +318,7 @@ WARNING: \`$1' is $msg. You should only need it if
touch $file
;;
- tar)
+ tar*)
shift
# We have already tried tar in the generic part.
@@ -317,13 +332,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
@@ -356,5 +371,6 @@ exit 0
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff --git a/config.h.in b/config.h.in
index e70baec..d4d560d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,4 +1,7 @@
-/* config.h.in. Generated from configure.in by autoheader. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
/* Define if GMP has no <gmpxx.h> */
#undef GMP_NO_CXX
@@ -12,18 +15,46 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the `floor' function. */
+#undef HAVE_FLOOR
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
/* Define if GMP is installed */
#undef HAVE_GMP
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
/* Define that architecture uses little endian storage */
#undef HAVE_LITTLE_ENDIAN
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#undef HAVE_MALLOC
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `pow' function. */
+#undef HAVE_POW
+
+/* Define to 1 if you have the `sqrt' function. */
+#undef HAVE_SQRT
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -39,12 +70,18 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
/* Canonical 16-bit data type */
#undef INT16
@@ -57,6 +94,10 @@
/* Canonical 8-bit data type */
#undef INT8
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Name of package */
#undef PACKAGE
@@ -72,6 +113,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -96,5 +140,32 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
/* Version number of package */
#undef VERSION
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
diff --git a/configure b/configure
index d51b0c7..370ec49 100755
--- a/configure
+++ b/configure
@@ -1,60 +1,85 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated by GNU Autoconf 2.68 for Givaro 3.4.2.
+#
+# Report bugs to <Jean-Guillaume.Dumas at imag.fr>.
+#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+## -------------------- ##
+## 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
+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
+ # 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 ;;
+ 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
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ 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
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# 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
@@ -63,20 +88,19 @@ fi
# 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.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -87,32 +111,286 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ 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
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ $as_echo "$0: Please tell bug-autoconf at gnu.org and
+$0: Jean-Guillaume.Dumas at imag.fr about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
fi
-done
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
-# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -126,13 +404,17 @@ else
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -147,568 +429,131 @@ echo X/"$0" |
}
s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
+# 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
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
- if 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
+ # 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
}
-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
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
-if as_func_ret_success; then
- :
+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
- exitcode=1
- echo as_func_ret_success failed.
+ as_ln_s='cp -p'
fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
fi
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
else
- exitcode=1
- echo positional parameters were not saved.
+ 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
-test \$exitcode = 0) || { (exit 1); exit 1; }
+# 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'"
-(
- 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
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+SHELL=${CONFIG_SHELL-/bin/sh}
- 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=:
- # 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
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
-
-:
-_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=:
- # 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
-
-
-:
-(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 autoconf at gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- 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" ||
- { 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
-fi
-echo >conf$$.file
-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
-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$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
- ;;
-esac
-
-echo=${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 <<EOF
-$*
-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 "$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 &&
- echo_test_string=`eval $cmd` &&
- (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.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
-exec 7<&0 </dev/null 6>&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`
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
@@ -721,14 +566,14 @@ 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=
+PACKAGE_NAME='Givaro'
+PACKAGE_TARNAME='givaro'
+PACKAGE_VERSION='3.4.2'
+PACKAGE_STRING='Givaro 3.4.2'
+PACKAGE_BUGREPORT='Jean-Guillaume.Dumas at imag.fr'
+PACKAGE_URL='http://ljk.imag.fr/CASYS/LOGICIELS/givaro'
# Factoring default headers for most tests.
ac_includes_default="\
@@ -766,141 +611,172 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-am__isrc
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-MAINTAINER_MODE_TRUE
-MAINTAINER_MODE_FALSE
-MAINT
-INSIDE_GNOME_COMMON_TRUE
-INSIDE_GNOME_COMMON_FALSE
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
+ac_subst_vars='LTLIBOBJS
+GIVARO_BUILD_DOC_FALSE
+GIVARO_BUILD_DOC_TRUE
+GIVARO_DOC_PATH
+GMP_VERSION
+GMP_LIBS
+GMP_CFLAGS
+LIBOBJS
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
ac_ct_CC
-EXEEXT
-OBJEXT
-DEPDIR
-am__include
-am__quote
-AMDEP_TRUE
-AMDEP_FALSE
-AMDEPBACKSLASH
-CCDEPMODE
-am__fastdepCC_TRUE
-am__fastdepCC_FALSE
-CXX
-CXXFLAGS
-ac_ct_CXX
-CXXDEPMODE
-am__fastdepCXX_TRUE
-am__fastdepCXX_FALSE
-CPP
-GREP
-EGREP
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
+CFLAGS
+CC
host_os
-SED
-LN_S
-ECHO
-AR
-RANLIB
-DSYMUTIL
-NMEDIT
-CXXCPP
-F77
-FFLAGS
-ac_ct_F77
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
LIBTOOL
-GMP_CFLAGS
-GMP_LIBS
-GMP_VERSION
-LIBOBJS
-LTLIBOBJS'
+EGREP
+GREP
+CXXCPP
+TESTS_CFLAGS
+DEBUG_CFLAGS
+DEFAULT_CFLAGS
+CCNAM
+OBJEXT
+EXEEXT
+ac_ct_CXX
+CPPFLAGS
+LDFLAGS
+CXXFLAGS
+CXX
+WARN
+WARNINGS_FALSE
+WARNINGS_TRUE
+DBG
+DEBUG_FALSE
+DEBUG_TRUE
+INSIDE_GNOME_COMMON_FALSE
+INSIDE_GNOME_COMMON_TRUE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+RM
+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_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_debug
+enable_warnings
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_gmp
+with_docdir
+with_doxygen
+enable_docs
+'
ac_precious_vars='build_alias
host_alias
target_alias
-CC
-CFLAGS
+CXX
+CXXFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CXX
-CXXFLAGS
CCC
-CPP
CXXCPP
-F77
-FFLAGS'
+CC
+CFLAGS'
# 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
@@ -934,7 +810,7 @@ sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
@@ -956,8 +832,9 @@ do
fi
case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -999,13 +876,20 @@ do
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
@@ -1018,13 +902,20 @@ do
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1215,22 +1106,36 @@ do
ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
@@ -1250,26 +1155,26 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
@@ -1277,23 +1182,36 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
fi
-# Be sure to have absolute directory names.
+# 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
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1307,8 +1225,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- 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
+ $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
@@ -1323,23 +1241,21 @@ 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 .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+ 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
@@ -1366,13 +1282,11 @@ else
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1398,7 +1312,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
+\`configure' configures Givaro 3.4.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1412,7 +1326,7 @@ Configuration:
--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
+ -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
@@ -1420,9 +1334,9 @@ Configuration:
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -1432,25 +1346,25 @@ 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]
+ --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/givaro]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -1467,55 +1381,64 @@ _ACEOF
fi
if test -n "$ac_init_help"; then
-
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of Givaro 3.4.2:";;
+ esac
cat <<\_ACEOF
Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--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-debug enable debugging options in library
+ --enable-warnings enable warings when compiling the library
+ --enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-doc Enable building documentation
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-pic try to use only PIC/non-PIC objects [default=use
both]
- --with-tags[=TAGS] include additional configurations [automatic]
- --with-gmp= <path>|yes|no
- Use GMP library.
- If argument is no, you do not have the library installed on your machine.
- If argument is yes or <empty> that means the library is reachable with the standard
- search path "/usr" or "/usr/local" (set as default).
- Otherwise you give the <path> to the directory which contain the library.
-
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --with-gmp=<path>|yes|no
+ Use GMP library. If argument is no, you do not have
+ the library installed on your machine. If argument
+ is yes or <empty> that means the library is
+ reachable with the standard search path "/usr" or
+ "/usr/local" (set as default). Otherwise you give
+ the <path> to the directory which contain the
+ library.
+ --with-docdir=<path> Where the Givaro documentation should be installed
+ --with-doxygen=<path> Give the path to Doxygen. Note: --enable-doc needed
Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CPP C preprocessor
CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
+ CC C compiler command
+ CFLAGS C compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
+Report bugs to <Jean-Guillaume.Dumas at imag.fr>.
+Givaro home page: <http://ljk.imag.fr/CASYS/LOGICIELS/givaro>.
_ACEOF
ac_status=$?
fi
@@ -1523,15 +1446,17 @@ 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" || 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=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ 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/ ;;
@@ -1567,7 +1492,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1576,1298 +1501,1944 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
+Givaro configure 3.4.2
+generated by GNU Autoconf 2.68
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_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.61. Invocation command line was
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
- $ $0 $@
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-_ACEOF
-exec 5>>config.log
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_cxx_try_run LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_cxx_try_run ()
{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-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`
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+} # ac_fn_cxx_try_run
-/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
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-} >&5
+} # ac_fn_cxx_try_cpp
-cat >&5 <<_ACEOF
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-## ----------- ##
-## Core tests. ##
-## ----------- ##
+} # ac_fn_c_try_compile
-_ACEOF
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-# 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=`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; }
+} # ac_fn_c_try_link
-# 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
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $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
+} # ac_fn_c_check_header_compile
- 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=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
- 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=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- 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
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
+#undef $2
-# Predefined preprocessor variables.
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+} # ac_fn_c_check_func
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+} # ac_fn_cxx_try_link
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
+# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
+# ---------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_cxx_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
+ ac_header_preproc=no
fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-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
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------------------- ##
+## Report this to Jean-Guillaume.Dumas at imag.fr ##
+## ------------------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
+ eval "$3=\$ac_header_compiler"
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,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-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
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`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
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+} # ac_fn_cxx_check_header_mongrel
+# ac_fn_cxx_check_func LINENO FUNC VAR
+# ------------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_cxx_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef $2
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+} # ac_fn_cxx_check_func
+# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES
+# ---------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_cxx_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+} # ac_fn_cxx_check_type
+# ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES
+# ----------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_cxx_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
-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
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
-am__api_version='1.10'
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
-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
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
- { (exit 1); exit 1; }; }
-fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
-# 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.
+} # ac_fn_cxx_compute_int
+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 Givaro $as_me 3.4.2, which was
+generated by GNU Autoconf 2.68. Invocation command line was
-# 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.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-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
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$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'
-
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&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".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-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
+ $ $0 $@
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}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 $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
-
-# 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=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
-if test -z "$MKDIR_P"; then
- if test "${ac_cv_path_mkdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
+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`
-fi
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
- 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
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
+/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`
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
+_ASUNAME
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
+ $as_echo "PATH: $as_dir"
+ done
IFS=$as_save_IFS
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`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
- echo $ECHO_N "(cached) $ECHO_C" >&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
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SET_MAKE=
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-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=givaro
- VERSION=3.2.13
+} >&5
+cat >&5 <<_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+## ----------- ##
+## Core tests. ##
+## ----------- ##
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
_ACEOF
-# Some tools Automake needs.
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+$as_echo "/* confdefs.h */" > confdefs.h
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+# Predefined preprocessor variables.
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
-# 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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ 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
- 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
fi
done
-done
-IFS=$as_save_IFS
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
fi
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
fi
-else
- STRIP="$ac_cv_prog_STRIP"
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
-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 -'
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-ac_config_headers="$ac_config_headers config.h"
-ac_config_headers="$ac_config_headers "
+am__api_version='1.10'
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { 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
-ac_config_commands="$ac_config_commands givaro-config.h"
+ done
+IFS=$as_save_IFS
+rm -rf conftest.one conftest.two conftest.dir
-{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
fi
-
- { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
- MAINT=$MAINTAINER_MODE_TRUE
-
+# 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}'
-# Give a sane default for CFLAGS and CXXFLAGS
-DEFAULT_CFLAGS="-g -O2 -Wall"
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-CFLAGS=${CFLAGS:-$DEFAULT_CFLAGS}
-CXXFLAGS=${CXXFLAGS:-$DEFAULT_CFLAGS}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
- if test x = y; then
- INSIDE_GNOME_COMMON_TRUE=
- INSIDE_GNOME_COMMON_FALSE='#'
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
else
- INSIDE_GNOME_COMMON_TRUE='#'
- INSIDE_GNOME_COMMON_FALSE=
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
- test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
-
- for k in macros ; do ACLOCAL="$ACLOCAL -I $k" ; done
+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:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
+ 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
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+ 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
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_CC" = x; then
- CC=""
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- CC=$ac_ct_CC
+ STRIP=$ac_ct_STRIP
fi
else
- CC="$ac_cv_prog_CC"
+ STRIP="$ac_cv_prog_STRIP"
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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ 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_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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
+ 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
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
fi
fi
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # 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
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ 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
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
+ test -n "$AWK" && break
done
-IFS=$as_save_IFS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ am__leading_dot=_
fi
+rmdir .tst 2>/dev/null
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
- test -n "$CC" && break
- done
+# 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
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+
+
+# Define the identity of the package.
+ PACKAGE='givaro'
+ VERSION='3.4.2'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_config_headers="$ac_config_headers "
+
+
+ac_config_commands="$ac_config_commands givaro-config.h"
+
+# Extract the first word of "rm", so it can be a program name with args.
+set dummy rm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_RM+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ case $RM in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_RM="$RM" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
+ test -z "$ac_cv_path_RM" && ac_cv_path_RM="$FALSE"
+ ;;
+esac
fi
+RM=$ac_cv_path_RM
+if test -n "$RM"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5
+$as_echo "$RM" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+
+
+RM="$RM -f"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ USE_MAINTAINER_MODE=no
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
- test -n "$ac_ct_CC" && break
-done
+ MAINT=$MAINTAINER_MODE_TRUE
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
+
+# 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
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ac_config_commands="$ac_config_commands depfiles"
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- 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.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
+ if test x = y; then
+ INSIDE_GNOME_COMMON_TRUE=
+ INSIDE_GNOME_COMMON_FALSE='#'
+else
+ INSIDE_GNOME_COMMON_TRUE='#'
+ INSIDE_GNOME_COMMON_FALSE=
+fi
+
+
+ test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+
+ for k in macros ; do ACLOCAL="$ACLOCAL -I $k" ; done
+
+
+# work around to fix the backward compatibility issue of automake 1.10 with 1.9 (pb with MKDIR_P)
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging options in the library" >&5
+$as_echo_n "checking whether to enable debugging options in the library... " >&6; }
+ # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+ enableval=$enable_debug; USE_DEBUG=$enableval
+else
+ USE_DEBUG=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_DEBUG" >&5
+$as_echo "$USE_DEBUG" >&6; }
+ if test $USE_DEBUG = yes; then
+ DEBUG_TRUE=
+ DEBUG_FALSE='#'
+else
+ DEBUG_TRUE='#'
+ DEBUG_FALSE=
+fi
+
+ DBG=$USE_DEBUG
+
+
+# AC_FULL_DEBUG
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable warnings when compiling the library" >&5
+$as_echo_n "checking whether to enable warnings when compiling the library... " >&6; }
+ # Check whether --enable-warnings was given.
+if test "${enable_warnings+set}" = set; then :
+ enableval=$enable_warnings; USE_WARNINGS=$enableval
+else
+ USE_WARNINGS=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_WARNINGS" >&5
+$as_echo "$USE_WARNINGS" >&6; }
+ if test $USE_WARNINGS = yes; then
+ WARNINGS_TRUE=
+ WARNINGS_FALSE='#'
+else
+ WARNINGS_TRUE='#'
+ WARNINGS_FALSE=
+fi
+
+ WARN=$USE_WARNINGS
+
+
+
+# CFLAGS=${CFLAGS:-$DEFAULT_CFLAGS}
+# CXXFLAGS=${CXXFLAGS:-$DEFAULT_CXXFLAGS}
+
+######################################################
+# Try and pass different flags according to compiler #
+######################################################
+
+# disable default -g -O2 CXXFLAGS
+: ${CXXFLAGS=""}
+
+#set CXX
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
+$as_echo_n "checking whether the C++ compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$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"
+if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
@@ -2877,14 +3448,14 @@ 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 | *.o | *.obj )
+ *.$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;
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
@@ -2903,78 +3474,41 @@ test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C++ compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
+$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- 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
- { { 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
-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
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+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.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2982,37 +3516,90 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
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 | *.o | *.obj ) ;;
+ *.$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
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3024,51 +3611,46 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
fi
-
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3082,54 +3664,34 @@ 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 "echo \"\$as_me:$LINENO: $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
- 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
+if ac_fn_cxx_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
else
- 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
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3140,34 +3702,11 @@ 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 "echo \"\$as_me:$LINENO: $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
- 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
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
else
- 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
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3178,35 +3717,12 @@ 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 "echo \"\$as_me:$LINENO: $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
- 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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_compile "$LINENO"; then :
- 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
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -3217,346 +3733,151 @@ 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 "echo \"\$as_me:$LINENO: $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
- 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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$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"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
else
- CFLAGS="-g"
+ CXXFLAGS="-g"
fi
else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
else
- CFLAGS=
+ CXXFLAGS=
fi
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for family name of compiler" >&5
+$as_echo_n "checking for family name of compiler... " >&6; }
+if test "$cross_compiling" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+ CCNAM=unknown
+
+
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
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
+ #ifdef __INTEL_COMPILER
+ int main() { return 0 ; }
+ #else
+ pas intel
+ #endif
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: icc" >&5
+$as_echo "icc" >&6; }
+ CCNAM=icc
-/* 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];
+else
+ if test "$cross_compiling" = yes; then :
-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;
-}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+ CCNAM=unknown
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __GNUC__
+ int main() { return 0 ; }
+ #else
+ pas gcc non plus.
+ #endif
_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 "echo \"\$as_me:$LINENO: $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
- 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
+if ac_fn_cxx_try_run "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5
+$as_echo "gcc" >&6; }
+ CCNAM=gcc
+
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+ CCNAM=unknown
fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+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)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+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
-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.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&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
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_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
+TESTS_CFLAGS="-O0 -g"
+DEBUG_CFLAGS="-g"
+DEFAULT_CFLAGS="-pipe"
+WARN_CFLAGS="-Wall"
-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='#'
+if test "x$DBG" = "xyes" ; then
+ DEFAULT_CFLAGS="-O0 ${DEFAULT_CFLAGS} -g -pg" #those are CXXFLAGS
+ DEBUG_CFLAGS="${DEBUG_CFLAGS} -DDEBUG -DGIVARO_DEBUG" #those are CPPFLAGS
else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
+ DEFAULT_CFLAGS="-O2 ${DEFAULT_CFLAGS} -DNDEBUG -U_LB_DEBUG"
fi
-depcc="$CC" am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
+if test "x$WARN" = "xyes" ; then
+ # if test "x${CXX}" = "xicpc" -o "x${CXX}" = "xicc" ; then
+ if test "x${CCNAM}" = "xicc" ; then
+ WARN_CFLAGS="${WARN_CFLAGS} -Wcheck"
+ # DEBUG_CFLAGS="-fast"
+ else
+ if test "x${CCNAM}" = "xgcc" ; then
+ # WARN_CFLAGS="${WARN_CFLAGS} -Wextra -Wno-unused-parameter -Wuninitialized -Wconversion -Wcast-qual"
+ WARN_CFLAGS="${WARN_CFLAGS} -Wextra -Wno-unused-parameter -Wuninitialized -Wconversion -Wcast-qual -ansi -pedantic -Wno-long-long -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings"
+ else
+ echo
+ echo "*******************************************************"
+ echo "unsupported compiler ($CCNAM). Please file a bug."
+ echo "*******************************************************"
+ echo
+ WARN_CFLAGS="${WARN_CFLAGS}"
+ fi
+ fi
fi
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$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
+DEFAULT_CFLAGS="${DEFAULT_CFLAGS} ${WARN_CFLAGS} ${DEBUG_CFLAGS}"
+TESTS_CFLAGS="${TESTS_CFLAGS} ${WARN_CFLAGS} ${DEBUG_CFLAGS}"
ac_ext=cpp
@@ -3564,222 +3885,276 @@ ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ # Broken: fails on valid input.
+continue
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
done
-IFS=$as_save_IFS
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ # Broken: fails on valid input.
+continue
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
- test -n "$ac_ct_CXX" && break
done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
fi
- fi
-fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- 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;;
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ ac_cv_path_GREP=$GREP
+fi
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
- ;
- 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;;
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-eval "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_path_EGREP=$EGREP
+fi
- ac_compiler_gnu=no
+ fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
int
main ()
@@ -3789,1653 +4164,962 @@ 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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
else
- 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
- CXXFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <string.h>
-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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
-
- ;
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
return 0;
}
_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_cxx_try_run "$LINENO"; then :
+else
+ ac_cv_header_stdc=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
-depcc="$CXX" am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- 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_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
fi
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
+macro_version='2.4'
+macro_revision='1.3293'
-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
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 "echo \"\$as_me:$LINENO: $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
- 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
- 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 <ac_nonexistent.h>
-_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 "echo \"\$as_me:$LINENO: $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
- 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
- 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
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 "echo \"\$as_me:$LINENO: $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
- 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
- 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 <ac_nonexistent.h>
-_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 "echo \"\$as_me:$LINENO: $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
- 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
+
+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_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
- # Passes both tests.
-ac_preproc_ok=:
-break
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-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
- :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
-
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
- 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
+for as_dir in $PATH
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
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- 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
-
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
done
+ done
IFS=$as_save_IFS
-
fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
fi
-
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- ac_cv_path_GREP=$GREP
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
- 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
+for as_dir in $PATH
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
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- 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
-
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
done
+ done
IFS=$as_save_IFS
-
fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
fi
-
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.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;;
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
esac
-eval "echo \"\$as_me:$LINENO: $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
- 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
+ CC=$ac_ct_CC
+ fi
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
+ CC="$ac_cv_prog_CC"
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 <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
fi
-
-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 <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- ac_cv_header_stdc=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
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
- :
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- enable_shared=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
fi
-
-
-# Check whether --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
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- enable_fast_install=yes
-fi
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
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 &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-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` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-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
-
-
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
fi
-
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-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
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
+done
done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
done
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
fi
-SED=$lt_cv_path_SED
+fi
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
-# 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.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
else
- lt_cv_ld_reload_flag='-r'
+ ac_compiler_gnu=no
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
+ GCC=
fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
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.
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-case $host_os in
-aix[4-9]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+int
+main ()
+{
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
-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
- ;;
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-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'
- ;;
+int
+main ()
+{
-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'
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ CFLAGS="-g"
fi
- ;;
-
-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
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
else
- lt_cv_deplibs_check_method=pass_all
+ CFLAGS=
fi
- ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+/* 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];
-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
- ;;
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
*)
- 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
- ;;
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
-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)$'
- ;;
+fi
-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
- ;;
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
-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)$'
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
fi
- ;;
+else
+ ac_cv_path_SED=$SED
+fi
-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
- ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
-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
- ;;
-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
- ;;
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$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
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+test -z "$GREP" && GREP=grep
-# 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 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=$?
- 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 5248 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- 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*|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=$?
- 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*)
- 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"
- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- lt_cv_cc_needs_belf=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- lt_cv_cc_needs_belf=no
-fi
-
-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
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$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=$?
- 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"
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
@@ -5445,707 +5129,336 @@ need_locks="$enable_libtool_lock"
-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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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
- 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"
+# 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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
+ with_gnu_ld=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
-done
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-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 "echo \"\$as_me:$LINENO: $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
- 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_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_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 "echo \"\$as_me:$LINENO: $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
- 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
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
- if test "${ac_cv_prog_CXXCPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- 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 <ac_nonexistent.h>
-_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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
else
- 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
-
+ 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
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
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 <ac_nonexistent.h>
-_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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- 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
- :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
else
- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-fi
-
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
+ 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
+ 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_F77="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- test -n "$F77" && break
+ test -n "$DUMPBIN" && break
done
fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+ 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
+ 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_F77="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- test -n "$ac_ct_F77" && break
+ test -n "$ac_ct_DUMPBIN" && break
done
- if test "x$ac_ct_F77" = x; then
- F77=""
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- F77=$ac_ct_F77
+ DUMPBIN=$ac_ct_DUMPBIN
fi
fi
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
fi
+test -z "$NM" && NM=nm
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
- end
-_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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_f77_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_prog_f77_g=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
fi
+ rm -f conftest*
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
else
i=0
teststring="ABCD"
@@ -6166,7 +5479,7 @@ else
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw*)
+ 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,
@@ -6177,6 +5490,11 @@ else
lt_cv_sys_max_cmd_len=8192;
;;
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
@@ -6221,7 +5539,7 @@ else
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/.*[ ]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@@ -6232,20 +5550,28 @@ else
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}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
+ # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
+ # 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
;;
@@ -6254,1000 +5580,797 @@ else
fi
if test -n $lt_cv_sys_max_cmd_len ; then
- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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?!! ;)]
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
-# 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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux* | k*bsd*-gnu)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- 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]'
+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'
;;
-sysv4)
- symcode='[DFNSTU]'
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
;;
esac
-# 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
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-# Try without a prefix undercore, 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.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- # Check to see that the pipe works correctly.
- pipe_works=no
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- 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=$?
- 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 <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+fi
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-#ifdef __cplusplus
-}
-#endif
-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=$?
- 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
- { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-fi
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${lt_cv_objdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
-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
- ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
esac
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-# Constants:
-rm="rm -f"
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+
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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
+ 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
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+ 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
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_AR" = x; then
- AR="false"
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- AR=$ac_ct_AR
+ OBJDUMP=$ac_ct_OBJDUMP
fi
else
- AR="$ac_cv_prog_AR"
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+test -z "$OBJDUMP" && OBJDUMP=objdump
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- 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
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- 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
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+ 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.
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
-else
- STRIP="$ac_cv_prog_STRIP"
-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'
+ ;;
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
+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
+ ;;
-# 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=
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ 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
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
+ ;;
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
+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
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+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
;;
-*)
- 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 <<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 at gnu.org
+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
+ ;;
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
;;
-esac
-fi
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+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
+ ;;
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
;;
-*)
- 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 <<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 at gnu.org
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
;;
-esac
-fi
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
- else
- MAGIC_CMD=:
- fi
-fi
+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
+ ;;
- fi
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
;;
esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
case $host_os in
- 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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
-echo "${ECHO_T}$DSYMUTIL" >&6; }
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
-echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; }
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- DSYMUTIL=$ac_ct_DSYMUTIL
+ DLLTOOL=$ac_ct_DLLTOOL
fi
else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
fi
fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
- { echo "$as_me:$LINENO: result: $NMEDIT" >&5
-echo "${ECHO_T}$NMEDIT" >&6; }
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+ test -n "$AR" && break
+ done
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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_NMEDIT"; then
- ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+ 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
+ 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"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
- { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
-echo "${ECHO_T}$ac_ct_NMEDIT" >&6; }
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- if test "x$ac_ct_NMEDIT" = x; then
- NMEDIT=":"
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- NMEDIT=$ac_ct_NMEDIT
+ AR=$ac_ct_AR
fi
-else
- NMEDIT="$ac_cv_prog_NMEDIT"
fi
+: ${AR=ar}
+: ${AR_FLAGS=cru}
- { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
-echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; }
-if test "${lt_cv_apple_cc_single_mod+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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.
- echo "int foo(void){return 1;}" > conftest.c
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib ${wl}-single_module conftest.c
- if test -f libconftest.dylib; then
- lt_cv_apple_cc_single_mod=yes
- rm -rf libconftest.dylib*
- fi
- rm conftest.c
- fi
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
-echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; }
- { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
-echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; }
-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- lt_cv_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
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -7258,5639 +6381,3852 @@ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- 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 &&
- $as_test_x conftest$ac_exeext; then
- lt_cv_ld_exported_symbols_list=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
- lt_cv_ld_exported_symbols_list=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
-echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }
- case $host_os in
- rhapsody* | darwin1.[0123])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*)
- # 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
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
-enable_dlopen=no
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
fi
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# 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
-# Use C for the default configuration in the libtool script
-tagname=
-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
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
-# Allow CC to be a program name with arguments.
-compiler=$CC
+test -z "$STRIP" && STRIP=:
-# 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*
-lt_prog_compiler_no_builtin_flag=
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- 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:7423: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:7427: \$? = $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*
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$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"
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
else
- :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
fi
-lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
+test -z "$RANLIB" && RANLIB=:
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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*)
- # 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'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | pw32* | os2*)
- # 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'
- ;;
+# 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=
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
+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
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
- 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
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
- hpux*)
- # 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='-fPIC'
- ;;
- esac
- ;;
- *)
- 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
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
- mingw* | cygwin* | pw32* | os2*)
- # 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'
- ;;
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- 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'
- ;;
- *)
- 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
- ;;
- 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
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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:7713: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:7717: \$? = $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
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$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
-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
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; }
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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:7817: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:7821: \$? = $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 ..
- rmdir conftest
- $rm conftest*
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$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
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-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
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
- runpath_var=
- allow_undefined_flag=
- enable_shared_with_static_runtimes=no
- archive_cmds=
- archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
- hardcode_libdir_separator=
- hardcode_direct=no
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- link_all_deplibs=unknown
- hardcode_automatic=no
- module_cmds=
- module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # 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=
- # Just being paranoid about ensuring that cc_basename is set.
- 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-%%"`
- case $host_os in
- cygwin* | mingw* | pw32*)
- # 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>/dev/null` 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
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
- # 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 <<EOF 1>&2
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-*** 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.
+# Allow CC to be a program name with arguments.
+compiler=$CC
-EOF
- fi
- ;;
- amigaos*)
- 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
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
- # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
- ;;
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3 at best.com> 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
- ;;
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
- cygwin* | mingw* | pw32*)
- # _LT_AC_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/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
- 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
- ;;
+# 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
- 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'
- ;;
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- 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' ;;
- 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'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+# 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'"
- if test $supports_anon_versioning = yes; 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
- link_all_deplibs=no
- else
- ld_shlibs=no
- fi
- ;;
+# 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'"
- 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
- ;;
+# 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
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<EOF 1>&2
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
-*** 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.
+ # 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
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
-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'
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
else
- ld_shlibs=no
+ rm -f "$nlist"T
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
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
-*** 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.
+#ifdef __cplusplus
+extern "C" {
+#endif
_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
+ cat <<_LT_EOF >> conftest.$ac_ext
- *)
- 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'
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
else
- ld_shlibs=no
+ echo "cannot find nm_test_var in $nlist" >&5
fi
- ;;
- esac
-
- if test "$ld_shlibs" = no; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
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
- ;;
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
- 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
+ # 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
- # 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
+fi
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
- # 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.
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
- archive_cmds=''
- hardcode_direct=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- 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
- 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
- # 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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-fi
-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 "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- 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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-fi
-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*)
- 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
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
- cygwin* | mingw* | pw32*)
- # 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 "$deplibs" | $SED -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*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = 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
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- 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_separator=:
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
- # 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 ${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_libdir_flag_spec_ld='+b $libdir'
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=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
- ;;
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- link_all_deplibs=yes
- ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
- 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
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- 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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- 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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
- solaris*)
- no_undefined_flag=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared ${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}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- 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'
- 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
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
;;
- 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???
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
;;
- 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
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
;;
esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
+ 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*
+ ;;
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
- 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
- ;;
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
- 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'
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- 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
- ;;
+int
+main ()
+{
- 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='`test -z "$SCOABSPATH" && echo ${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,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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
- ;;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
- *)
- ld_shlibs=no
- ;;
- esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-#
-# 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.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- 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=$?
- 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*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) 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
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_locks="$enable_libtool_lock"
-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"`
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- # 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
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`
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-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
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
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<name>.so
- # instead of lib<name>.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
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
fi
- ;;
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
-amigaos*)
- 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'
- ;;
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
-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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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*)
- # 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
- ;;
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
- 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
- ;;
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-freebsd1*)
- dynamic_linker=no
- ;;
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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`
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
fi
- 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
- ;;
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
-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
- ;;
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-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'
- ;;
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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
- ;;
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# 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
- # 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
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
- # 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"
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+ done
+IFS=$as_save_IFS
- # 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'
- ;;
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- 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
- ;;
+done
+ done
+IFS=$as_save_IFS
-nto-qnx*)
- 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
- ;;
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
else
- shlibpath_overrides_runpath=yes
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
fi
- ;;
-
-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
- ;;
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
-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"
- ;;
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-rdos*)
- dynamic_linker=no
- ;;
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- 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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- ;;
+done
+ done
+IFS=$as_save_IFS
-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
- ;;
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-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
- 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'
- shlibpath_overrides_runpath=no
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- 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'
- ;;
-
-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
- ;;
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ OTOOL=$ac_ct_OTOOL
+ fi
else
- lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+ OTOOL="$ac_cv_prog_OTOOL"
fi
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
else
- lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-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 -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var" || \
- test "X$hardcode_automatic" = "Xyes" ; then
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
- # We can hardcode non-existant 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
fi
else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
+ OTOOL64="$ac_cv_prog_OTOOL64"
fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
-if test "$hardcode_action" = relink; 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
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}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"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- ;;
- *)
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- ;;
- esac
-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*)
- 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
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- 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
+ 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:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* 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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dl_dlopen=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
+ lt_cv_ld_exported_symbols_list=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
-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
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
- ;;
+done
- *)
- { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
+fi
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+done
-#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 ()
+func_stripname_cnf ()
{
-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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
- ac_cv_func_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
- lt_cv_dlopen="shl_load"
-else
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_dld_shl_load=no
-fi
-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
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
- { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
-if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 <limits.h> declares dlopen.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define dlopen innocuous_dlopen
+# Set options
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-#undef dlopen
+ enable_dlopen=no
-/* 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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ enable_win32_dll=no
- ac_cv_func_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
- lt_cv_dlopen="dlopen"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ # 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
- 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. */
+ enable_shared=yes
+fi
-/* 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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_dl_dlopen=no
-fi
-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
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_svld_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_svld_dlopen=no
-fi
-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
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_dld_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_dld_dld_link=no
-fi
-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
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+ # 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
-fi
-fi
-fi
-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
- ;;
- esac
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
+test -z "$pic_mode" && pic_mode=default
- 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"
- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
+
+
+
+ # 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
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 10194 "configure"
-#include "confdefs.h"
+ enable_fast_install=yes
+fi
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-#include <stdio.h>
-#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
-#ifdef __cplusplus
-extern "C" void exit (int);
-#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 ());
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- 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
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$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\"
- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
-#line 10294 "configure"
-#include "confdefs.h"
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-#include <stdio.h>
-#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
-#ifdef __cplusplus
-extern "C" void exit (int);
-#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 ());
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- 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
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$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
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- compiler_lib_search_dirs \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- fix_srcfile_path \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 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.
-# 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//"
-# 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
-# The names of the tagged configurations supported by this script.
-available_tags=
-# ### BEGIN LIBTOOL CONFIG
+test -z "$LN_S" && LN_S="ln -s"
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-# 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
-# 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
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-# A C compiler.
-LTCC=$lt_LTCC
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-# A language-specific compiler.
-CC=$lt_compiler
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
-# An ERE matcher.
-EGREP=$lt_EGREP
-# The linker used to build libraries.
-LD=$lt_LD
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-# A BSD-compatible nm program.
-NM=$lt_NM
-# A symbol stripping program
-STRIP=$lt_STRIP
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-# Used on cygwin: assembler.
-AS="$AS"
+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
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+# Global variables:
+ofile=libtool
+can_build_shared=yes
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
+with_gnu_ld="$lt_cv_prog_gnu_ld"
-# Object file suffix (normally "o").
-objext="$ac_objext"
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
-# Old archive suffix (normally "a").
-libext="$libext"
+# 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
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-# Executable file suffix (normally "").
-exeext="$exeext"
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+*** 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 at gnu.org
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# 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
-# 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
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
+*** 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 at gnu.org
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
+ else
+ MAGIC_CMD=:
+ fi
+fi
-# Library versioning type.
-version_type=$version_type
+ fi
+ ;;
+esac
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+# Use C for the default configuration in the libtool script
-# 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
+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
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
+# Source file extension for C test sources.
+ac_ext=c
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+# Allow CC to be a program name with arguments.
+compiler=$CC
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
+# 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
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
+# 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*
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
+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*
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+## 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
-# 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
+lt_prog_compiler_no_builtin_flag=
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
-# 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
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
+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
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+fi
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-# 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
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
-# 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
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
-# 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
+ 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
+ ;;
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+ 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
+ ;;
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+ 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'
+ ;;
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
+ 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
+ ;;
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+ 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
+ ;;
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
-# ### END LIBTOOL CONFIG
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
-__EOF__
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -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'
+ ;;
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
+ 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'
+ ;;
-# 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
-EOF
- ;;
- esac
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
+ *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'
+ ;;
-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
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
-CC="$lt_save_CC"
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
- withval=$with_tags; tagnames="$withval"
-fi
+ 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
+ ;;
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
esac
+ fi
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-compiler_lib_search_dirs_CXX=
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-# Source file extension for C++ test sources.
-ac_ext=cpp
+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
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
+fi
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-# Allow CC to be a program name with arguments.
-compiler=$CC
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
else
- lt_prog_compiler_no_builtin_flag_CXX=
+ lt_prog_compiler_static=
fi
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix[4-9]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- 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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $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
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ need_locks=no
+fi
-fi
-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_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- 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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-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
+ 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=
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
+ 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
;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ link_all_deplibs=no
+ ;;
+ esac
- chorus*)
- case $cc_basename in
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
+ lt_use_gnu_ld_interface=yes
;;
esac
- ;;
+ fi
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
- ld_shlibs_CXX=no
+ whole_archive_flag_spec=
fi
- ;;
- darwin* | rhapsody*)
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
- allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
- if test "$GXX" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
fi
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
+ ;;
+
+ 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 <jrb3 at best.com> 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
- ;;
+ ;;
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ 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
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
+ ld_shlibs=no
fi
;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- case $host_cpu in
- hppa*64*|ia64*) ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
+
+ 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'
;;
- esac
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
;;
esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix[3-9]*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ ld_shlibs=no
fi
- output_verbose_link_cmd='echo'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+*** 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.
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ 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
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
+*** 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.
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
+_LT_EOF
;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ *)
+ # 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
;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ esac
+ ;;
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
+ 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
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
- ;;
+ 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
- link_all_deplibs_CXX=yes
- output_verbose_link_cmd='echo'
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ # 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.
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ 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
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ # 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
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # 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.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
+ 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
-GCC_CXX="$GXX"
-LD_CXX="$LD"
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-cat > conftest.$ac_ext <<EOF
-class Foo
+int
+main ()
{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
+fi
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
+ aix_libpath=$lt_cv_aix_libpath_
+fi
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- *) ;; # Ignore the rest.
+int
+main ()
+{
- esac
- done
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
-$rm -f confest.$objext
+fi
-compiler_lib_search_dirs_CXX=
-if test -n "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ aix_libpath=$lt_cv_aix_libpath_
fi
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- #
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
+ 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
;;
- esac
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
;;
- esac
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
+ darwin* | rhapsody*)
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
+ else
+ ld_shlibs=no
+ fi
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
;;
- mingw* | cygwin* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+
+ freebsd1*)
+ ld_shlibs=no
;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
+
+ # 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
;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
+
+ # 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
;;
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
;;
- hpux*)
- # 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*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_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
;;
- esac
- else
- case $host_os in
- aix[4-9]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
esac
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- esac
- ;;
+ 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
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
+ fi
+ ;;
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
else
- lt_cv_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12695: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:12699: \$? = $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_CXX=yes
- fi
- fi
- $rm conftest*
-
+ lt_cv_irix_exported_symbol=no
fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
+ 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
+ ;;
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "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_CXX=yes
- fi
- else
- lt_cv_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ 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
+ ;;
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; }
+ *nto* | *qnx*)
+ ;;
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
+ 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'
+ ;;
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
- 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:12799: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:12803: \$? = $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_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-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
+ 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
+ ;;
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix[4-9]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ 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
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- ;;
- linux* | k*bsd*-gnu)
- link_all_deplibs_CXX=no
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
- exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
#
# Do we need to explicitly link libc?
#
-case "x$archive_cmds_need_lc_CXX" in
+case "x$archive_cmds_need_lc" in
x|xyes)
# Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
+ archive_cmds_need_lc=yes
if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
+ case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
@@ -12898,86 +10234,312 @@ x|xyes)
# 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.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- 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_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
;;
esac
fi
;;
esac
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-case $host_os in
-aix3*)
- version_type=linux
- 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]*)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ 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
@@ -12996,7 +10558,7 @@ aix[4-9]*)
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
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
@@ -13022,9 +10584,18 @@ aix[4-9]*)
;;
amigaos*)
- 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'
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
;;
beos*)
@@ -13047,76 +10618,128 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32*)
+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*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ 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'
+ 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'
+ $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"
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
- mingw*)
+ 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
+ dynamic_linker='Win32 ld.exe'
;;
- *)
- 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
- ;;
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -13184,6 +10807,20 @@ gnu*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -13209,18 +10846,18 @@ hpux9* | hpux10* | hpux11*)
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
- ;;
- *)
+ 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
@@ -13229,8 +10866,10 @@ hpux9* | hpux10* | hpux11*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
;;
interix[3-9]*)
@@ -13288,7 +10927,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -13297,6 +10936,41 @@ linux* | k*bsd*-gnu)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
@@ -13304,7 +10978,7 @@ linux* | k*bsd*-gnu)
# 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' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -13333,7 +11007,7 @@ netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ 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'
@@ -13354,14 +11028,16 @@ newsos6)
shlibpath_overrides_runpath=yes
;;
-nto-qnx*)
- version_type=linux
+*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=yes
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
;;
openbsd*)
@@ -13370,13 +11046,13 @@ openbsd*)
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 ;;
+ 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
+ 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
@@ -13448,7 +11124,6 @@ sysv4 | sysv4.3*)
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
runpath_var=LD_RUN_PATH
;;
siemens)
@@ -13479,13 +11154,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
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'
- shlibpath_overrides_runpath=no
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -13495,6 +11169,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
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}'
@@ -13506,10963 +11191,8041 @@ uts4*)
dynamic_linker=no
;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
test "$dynamic_linker" = no && can_build_shared=no
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+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
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+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
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-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
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
-if test "$hardcode_action_CXX" = relink; 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
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- compiler_lib_search_dirs_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- fix_srcfile_path_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-cfgfile="$ofile"
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-# 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
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-# A C compiler.
-LTCC=$lt_LTCC
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-# An ERE matcher.
-EGREP=$lt_EGREP
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-# A BSD-compatible nm program.
-NM=$lt_NM
-# A symbol stripping program
-STRIP=$lt_STRIP
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-# Used on cygwin: assembler.
-AS="$AS"
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-# Object file suffix (normally "o").
-objext="$ac_objext"
-# Old archive suffix (normally "a").
-libext="$libext"
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-# Executable file suffix (normally "").
-exeext="$exeext"
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-# 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
-# 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
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-# Library versioning type.
-version_type=$version_type
-# 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
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-# 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
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-# 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
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-# 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_CXX
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+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
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-# 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_CXX
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
+ 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=
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
-# ### END LIBTOOL TAG CONFIG: $tagname
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
-__EOF__
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
-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
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+ ;;
- else
- tagname=""
- fi
- ;;
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
- program t
- end
-"
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+fi
-# Allow CC to be a program name with arguments.
-compiler=$CC
+fi
-# 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*
+fi
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+fi
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
+fi
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
+ ;;
+ esac
-# 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
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-static'
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
- 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_F77='-Bstatic'
- fi
- ;;
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
- amigaos*)
- # 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_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
- mingw* | cygwin* | pw32* | os2*)
- # 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_F77='-DDLL_EXPORT'
- ;;
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
+#include <stdio.h>
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
- 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_F77=no
- enable_shared=no
- ;;
+/* 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
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
- hpux*)
- # 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_F77='-fPIC'
- ;;
- esac
- ;;
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
- mingw* | cygwin* | pw32* | os2*)
- # 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_F77='-DDLL_EXPORT'
- ;;
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-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_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- lt_prog_compiler_wl_F77=''
- ;;
- esac
- ;;
- esac
- ;;
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
+#include <stdio.h>
- rdos*)
- lt_prog_compiler_static_F77='-non_shared'
- ;;
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
+/* 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
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
fi
+fi
+rm -fr conftest*
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # 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:14397: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:14401: \$? = $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_F77=yes
- fi
- fi
- $rm conftest*
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; }
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
-if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
+ 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
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
- ;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
- ;;
-esac
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_static_works_F77=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_F77=yes
- fi
- else
- lt_cv_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm -r conftest*
- LDFLAGS="$save_LDFLAGS"
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; }
-if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
- :
-else
- lt_prog_compiler_static_F77=
-fi
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_F77=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:14501: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:14505: \$? = $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_F77=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 ..
- rmdir conftest
- $rm conftest*
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-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
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
- runpath_var=
- allow_undefined_flag_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # 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_F77='_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=
- # Just being paranoid about ensuring that cc_basename is set.
- 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-%%"`
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
- cygwin* | mingw* | pw32*)
- # 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
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
;;
esac
+fi
- ld_shlibs_F77=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_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` 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_F77=no
- cat <<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.
-EOF
- fi
- ;;
- amigaos*)
- archive_cmds_F77='$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_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$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_F77='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_F77=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${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_F77='$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_F77='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* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${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_F77='${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' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec_F77='${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'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$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
- link_all_deplibs_F77=no
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$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_F77=no
- cat <<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.
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=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
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
+ # 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
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$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_F77=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_F77=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_F77='$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_F77='$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
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
- # 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
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
- 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_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- 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_F77=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_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- # 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_F77=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_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
+CC="$lt_save_CC"
- end
-_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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $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
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+else
+ # Broken: fails on valid input.
+continue
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-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_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$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
- program main
-
- end
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $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
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
else
- 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.i conftest.$ac_ext
-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_F77='${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_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$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*)
- archive_cmds_F77='$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_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
- cygwin* | mingw* | pw32*)
- # 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_F77=' '
- allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds_F77="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_F77="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
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
- freebsd1*)
- ld_shlibs_F77=no
- ;;
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
- # 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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
+else
+ _lt_caught_CXX_error=yes
+fi
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$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_F77='$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_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
+# Source file extension for C++ test sources.
+ac_ext=cpp
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+# Allow CC to be a program name with arguments.
+compiler=$CC
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$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'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=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_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs_F77=yes
- ;;
+ # 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*
- 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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+ else
+ lt_prog_compiler_no_builtin_flag_CXX=
+ fi
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$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_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
+# 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
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 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.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$?
- 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_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
-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
- :
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
else
- can_build_shared=no
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
fi
- ;;
- 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<name>.so
- # instead of lib<name>.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}'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
else
- # 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'
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
fi
- shlibpath_var=LIBPATH
- fi
- ;;
-amigaos*)
- 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'
- ;;
+ # PORTME: fill in a description of your system's C++ link characteristics
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
-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
- ;;
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ file_list_spec_CXX='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
+ export_dynamic_flag_spec_CXX='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
+int
+main ()
+{
- 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*)
- # 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
- ;;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
- *)
- 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
- ;;
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
+fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
-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
- ;;
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-freebsd1*)
- dynamic_linker=no
- ;;
+ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-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
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
fi
- 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
- ;;
+fi
-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'
- ;;
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
-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
- ;;
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ fi
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
- 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
- ;;
+ ld_shlibs_CXX=no
+ fi
+ ;;
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
-# 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
- # 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
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX=' '
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=yes
+ file_list_spec_CXX='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+ enable_shared_with_static_runtimes_CXX=yes
+ # Don't use ranlib
+ old_postinstall_cmds_CXX='chmod 644 $oldlib'
+ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
- # 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"
+
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec_CXX=''
fi
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
- # 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'
+ ld_shlibs_CXX=no
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=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
- ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
-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
- ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ ld_shlibs_CXX=no
+ ;;
-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
- ;;
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
-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"
- ;;
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
-rdos*)
- dynamic_linker=no
- ;;
+ gnu*)
+ ;;
-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'
- ;;
+ haiku*)
+ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_CXX=yes
+ ;;
-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
- ;;
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
-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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
-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
- ;;
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
-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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ inherit_rpath_CXX=yes
+ ;;
-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
- ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_CXX=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
-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
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; 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
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- compiler_lib_search_dirs_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- fix_srcfile_path_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
+ *nto* | *qnx*)
+ ld_shlibs_CXX=yes
+ ;;
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
-cfgfile="$ofile"
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ hardcode_direct_absolute_CXX=yes
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ ;;
+ esac
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+ hardcode_libdir_separator_CXX=:
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+ output_verbose_link_cmd='func_echo_all'
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
-# A C compiler.
-LTCC=$lt_LTCC
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+ '"$old_archive_cmds_CXX"
+ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+ '"$reload_cmds_CXX"
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
-# A language-specific compiler.
-CC=$lt_compiler_F77
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
-# An ERE matcher.
-EGREP=$lt_EGREP
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
-# The linker used to build libraries.
-LD=$lt_LD_F77
+ GCC_CXX="$GXX"
+ LD_CXX="$LD"
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
-# A BSD-compatible nm program.
-NM=$lt_NM
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
-# A symbol stripping program
-STRIP=$lt_STRIP
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
-# Used on cygwin: assembler.
-AS="$AS"
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
-# Object file suffix (normally "o").
-objext="$ac_objext"
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
-# Old archive suffix (normally "a").
-libext="$libext"
+ *) ;; # Ignore the rest.
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+ esac
+ done
-# Executable file suffix (normally "").
-exeext="$exeext"
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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_F77
-
-# 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_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# 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_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# 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
-
-# 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_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
-# ### END LIBTOOL TAG CONFIG: $tagname
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
-__EOF__
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
fi
-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"
- else
- tagname=""
- fi
- ;;
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-# Source file extension for Java test sources.
-ac_ext=java
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-# Allow CC to be a program name with arguments.
-compiler=$CC
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-old_archive_cmds_GCJ=$old_archive_cmds
-lt_prog_compiler_no_builtin_flag_GCJ=
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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:16721: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16725: \$? = $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
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
- :
-fi
-fi
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-static'
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
case $host_os in
- aix*)
+ aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_static_CXX='-Bstatic'
fi
;;
amigaos*)
- # 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_GCJ='-m68020 -resident32 -malways-restore-a4'
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
-
- mingw* | cygwin* | pw32* | os2*)
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
-
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
;;
-
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
;;
-
interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
-
- 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_GCJ=no
- enable_shared=no
- ;;
-
sysv4*MP*)
if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
+ lt_prog_compiler_pic_CXX=-Kconform_pic
fi
;;
-
hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
+ # 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*|ia64*)
- # +Z the default
+ hppa*64*)
;;
*)
- lt_prog_compiler_pic_GCJ='-fPIC'
+ lt_prog_compiler_pic_CXX='-fPIC'
;;
esac
;;
-
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
*)
- lt_prog_compiler_pic_GCJ='-fPIC'
+ lt_prog_compiler_pic_CXX='-fPIC'
;;
esac
else
- # PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # 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).
-
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-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
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
;;
- *)
- lt_prog_compiler_pic_GCJ='+Z'
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- lt_prog_compiler_wl_GCJ=''
- ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
esac
;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # 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:17011: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:17015: \$? = $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_GCJ=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
- ;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_static_works_GCJ=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_GCJ=yes
- fi
- else
- lt_cv_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=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:17115: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:17119: \$? = $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_GCJ=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 ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-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
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # 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_GCJ='_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=
- # Just being paranoid about ensuring that cc_basename is set.
- 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-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # 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_GCJ=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_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` 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_GCJ=no
- cat <<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.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$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_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$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_GCJ='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_GCJ=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${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_GCJ='${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' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec_GCJ='${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'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$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
- link_all_deplibs_GCJ=no
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$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_GCJ=no
- cat <<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.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=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
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=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_GCJ='$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_GCJ='$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_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
-
- 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_GCJ=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_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # 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_GCJ=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_GCJ='-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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-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_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$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 "echo \"\$as_me:$LINENO: $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
- 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 &&
- $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
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-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_GCJ='${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_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$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*)
- archive_cmds_GCJ='$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_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # 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_GCJ=' '
- allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds_GCJ="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_GCJ="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
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$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'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=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_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$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_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ 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.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$?
- 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_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- 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<name>.so
- # instead of lib<name>.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*)
- 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'
- ;;
-
-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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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*)
- # 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}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- 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
- # 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=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
- ;;
-
-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
+ psos*)
;;
- *)
- shlibpath_overrides_runpath=yes
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
;;
- 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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
;;
esac
fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-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
- ;;
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
-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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
-if test "$hardcode_action_GCJ" = relink; 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
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- compiler_lib_search_dirs_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- fix_srcfile_path_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
-# 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
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-# A C compiler.
-LTCC=$lt_LTCC
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-# An ERE matcher.
-EGREP=$lt_EGREP
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-# A BSD-compatible nm program.
-NM=$lt_NM
-# A symbol stripping program
-STRIP=$lt_STRIP
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-# Used on cygwin: assembler.
-AS="$AS"
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ link_all_deplibs_CXX=no
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
-# Object file suffix (normally "o").
-objext="$ac_objext"
+with_gnu_ld_CXX=$with_gnu_ld
-# Old archive suffix (normally "a").
-libext="$libext"
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-# Executable file suffix (normally "").
-exeext="$exeext"
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc_CXX=no
+ else
+ lt_cv_archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
-# Do we need a version for libraries?
-need_version=$need_version
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+ ;;
+ esac
+ fi
+ ;;
+esac
-# 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
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-# Library versioning type.
-version_type=$version_type
-# 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
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-# 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
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-# 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
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-# 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_GCJ
-# 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_GCJ
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-# 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_GCJ
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-# 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
-# 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_GCJ
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-# ### END LIBTOOL TAG CONFIG: $tagname
-__EOF__
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-CC="$lt_save_CC"
- else
- tagname=""
- fi
- ;;
- RC)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
-# Source file extension for RC test sources.
-ac_ext=rc
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+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<name>.so
+ # instead of lib<name>.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
+ ;;
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+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
+ ;;
-# Allow CC to be a program name with arguments.
-compiler=$CC
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
-# 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*
+ 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}'
-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*
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- compiler_lib_search_dirs_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- fix_srcfile_path_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
;;
*)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
;;
esac
- done
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+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`'
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+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
+ ;;
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+freebsd1*)
+ dynamic_linker=no
+ ;;
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+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
+ ;;
-# A C compiler.
-LTCC=$lt_LTCC
+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
+ ;;
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
-# A language-specific compiler.
-CC=$lt_compiler_RC
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
+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
+ ;;
-# An ERE matcher.
-EGREP=$lt_EGREP
+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
+ ;;
-# The linker used to build libraries.
-LD=$lt_LD_RC
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-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
-# A BSD-compatible nm program.
-NM=$lt_NM
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-# A symbol stripping program
-STRIP=$lt_STRIP
+int
+main ()
+{
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+fi
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-# Used on cygwin: assembler.
-AS="$AS"
+ # 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
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+ # 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'
+ ;;
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
+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'
+ ;;
-# Object file suffix (normally "o").
-objext="$ac_objext"
+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
+ ;;
-# Old archive suffix (normally "a").
-libext="$libext"
+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
+ ;;
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+*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'
+ ;;
-# Executable file suffix (normally "").
-exeext="$exeext"
+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
+ ;;
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
+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
+ ;;
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+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"
+ ;;
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+rdos*)
+ dynamic_linker=no
+ ;;
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+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'
+ ;;
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
+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
+ ;;
-# Do we need a version for libraries?
-need_version=$need_version
+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
+ ;;
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+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
+ ;;
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+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'
+ ;;
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
+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
+ ;;
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
+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
+ ;;
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+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
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+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
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-# Library versioning type.
-version_type=$version_type
-# 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
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-# 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
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-# 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
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-# 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_RC
-# 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_RC
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-# 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_RC
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+ test -n "$runpath_var_CXX" ||
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
+if test "$hardcode_action_CXX" = relink ||
+ test "$inherit_rpath_CXX" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
-# 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
-# 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_RC
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
+ fi # test -n "$compiler"
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
-# ### END LIBTOOL TAG CONFIG: $tagname
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-__EOF__
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-CC="$lt_save_CC"
- ;;
- *)
- { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+ ac_config_commands="$ac_config_commands libtool"
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-# Prevent multiple expansion
+# Only expand once:
+# newer libtool...
+#check lib
+# AC_CHECK_LIB([givaro], [main])
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+fi
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+fi
-# Check machine characteristics
-{ echo "$as_me:$LINENO: checking for char" >&5
-echo $ECHO_N "checking for char... $ECHO_C" >&6; }
-if test "${ac_cv_type_char+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+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
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
-typedef char ac__type_new_;
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
+ 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_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $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
- 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_type_char=yes
+if ac_fn_cxx_try_run "$LINENO"; then :
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
- ac_cv_type_char=no
fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
-echo "${ECHO_T}$ac_cv_type_char" >&6; }
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of char" >&5
-echo $ECHO_N "checking size of char... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_char+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+for ac_header in float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+fi
+
+done
+
+# Checks for library functions.
+for ac_header in stdlib.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_malloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
int
main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
+{
+return ! malloc (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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid; break
+if ac_fn_cxx_try_run "$LINENO"; then :
+ ac_cv_func_malloc_0_nonnull=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" malloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
+
+fi
+
+
+for ac_func in floor gettimeofday pow sqrt
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+
+fi
+done
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
;
return 0;
}
_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- 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_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
+
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
+/* 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=$ac_mid; break
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
else
- 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:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
- ac_lo= ac_hi=
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
+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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
else
- 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:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
- ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') if test "$ac_cv_type_char" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+# Check machine characteristics
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
+$as_echo_n "checking size of char... " >&6; }
+if ${ac_cv_sizeof_char+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_char" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (char)
+See \`config.log' for more details" "$LINENO" 5; }
else
ac_cv_sizeof_char=0
- fi ;;
-esac
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
+$as_echo "$ac_cv_sizeof_char" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHAR $ac_cv_sizeof_char
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+ if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
- ;
- return 0;
-}
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_char=`cat conftest.val`
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
-( exit $ac_status )
-if test "$ac_cv_type_char" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
else
- ac_cv_sizeof_char=0
+ ac_cv_sizeof_long_long=0
fi
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
fi
-rm -f conftest.val
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
+$as_echo_n "checking size of __int64... " >&6; }
+if ${ac_cv_sizeof___int64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type___int64" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (__int64)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof___int64=0
+ fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char" >&6; }
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5
+$as_echo "$ac_cv_sizeof___int64" >&6; }
cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
+#define SIZEOF___INT64 $ac_cv_sizeof___int64
_ACEOF
-{ echo "$as_me:$LINENO: checking for short" >&5
-echo $ECHO_N "checking for short... $ECHO_C" >&6; }
-if test "${ac_cv_type_short+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+# and check (not so usefull since we have stdint.h)
+# Besides, it seems it breaks givaro-config.h leaving oprhaned #endif and dubious code...
+# AC_TYPE_SIZE_T
+# AC_TYPE_INT8_T
+# AC_TYPE_INT16_T
+# AC_TYPE_INT32_T
+# AC_TYPE_INT64_T
+# AC_TYPE_UINT8_T
+# AC_TYPE_UINT16_T
+# AC_TYPE_UINT32_T
+# AC_TYPE_UINT64_T
+
+# check endianness of the architecture
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
-typedef short ac__type_new_;
+#include <sys/types.h>
+ #include <sys/param.h>
+
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
;
return 0;
}
_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- 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_type_short=yes
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_short=no
+ ac_cv_c_bigendian=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
-echo "${ECHO_T}$ac_cv_type_short" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of short" >&5
-echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_short+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
+#include <limits.h>
+
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #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 "echo \"\$as_me:$LINENO: $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
- 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_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
+#include <limits.h>
+
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+#ifndef _BIG_ENDIAN
+ not big endian
+ #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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid; break
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ ac_cv_c_bigendian=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
+return use_ascii (foo) == use_ebcdic (foo);
;
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 "echo \"\$as_me:$LINENO: $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
- 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_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
- typedef short ac__type_sizeof_;
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- 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_lo=$ac_mid; break
+if ac_fn_cxx_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+
+$as_echo "#define HAVE_BIG_ENDIAN 1" >>confdefs.h
+;; #(
+ no)
+
+$as_echo "#define HAVE_LITTLE_ENDIAN 1" >>confdefs.h
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+echo "Creating symbolic link for compilation"
+if test ! -L src/kernel/system/givaro ; then ln -s . src/kernel/system/givaro ; fi
+if test ! -L src/kernel/bstruct/givaro ; then ln -s . src/kernel/bstruct/givaro ; fi
+if test ! -L src/kernel/integer/givaro ; then ln -s . src/kernel/integer/givaro ; fi
+if test ! -L src/kernel/memory/givaro ; then ln -s . src/kernel/memory/givaro ; fi
+if test ! -L src/kernel/rational/givaro; then ln -s . src/kernel/rational/givaro; fi
+if test ! -L src/kernel/zpz/givaro ; then ln -s . src/kernel/zpz/givaro ; fi
+if test ! -L src/kernel/gmp++/gmp++ ; then ln -s . src/kernel/gmp++/gmp++ ; fi
+if test ! -L src/library/matrix/givaro ; then ln -s . src/library/matrix/givaro ; fi
+if test ! -L src/library/poly1/givaro ; then ln -s . src/library/poly1/givaro ; fi
+if test ! -L src/library/tools/givaro ; then ln -s . src/library/tools/givaro ; fi
+if test ! -L src/library/vector/givaro ; then ln -s . src/library/vector/givaro ; fi
+
+
+# Create some useful data types of fixed, known lengths
+
+case 1 in
+ $ac_cv_sizeof_char)
+ GIVARO_INT8="char";
+ ;;
+esac
+
+case 2 in
+ $ac_cv_sizeof_short)
+ GIVARO_INT16="short";
+ ;;
+ $ac_cv_sizeof_int)
+ GIVARO_INT16="int";
+ ;;
+esac
+
+case 4 in
+ $ac_cv_sizeof_short)
+ GIVARO_INT32="short";
+ ;;
+ $ac_cv_sizeof_int)
+ GIVARO_INT32="int";
+ ;;
+ $ac_cv_sizeof_long)
+ GIVARO_INT32="long";
+ ;;
+esac
+
+case 8 in
+ $ac_cv_sizeof_short)
+ GIVARO_INT64="short";
+ ;;
+ $ac_cv_sizeof_int)
+ GIVARO_INT64="int";
+ ;;
+ $ac_cv_sizeof_long)
+ GIVARO_INT64="long";
+ ;;
+ $ac_cv_sizeof_long_long)
+ GIVARO_INT64="long long";
+ ;;
+ $ac_cv_sizeof___int64)
+ GIVARO_INT64="__int64";
+ ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define INT8 $GIVARO_INT8
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define INT16 $GIVARO_INT16
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define INT32 $GIVARO_INT32
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define INT64 $GIVARO_INT64
+_ACEOF
+
+
+# This is weird
+#case $ac_cv_sizeof_long in
+# $ac_cv_sizeof_long_long)
+# AC_DEFINE_UNQUOTED(_DONOTUSE_longlong__,1, long long is equal to long)
+# ;;
+#esac
+
+# Feature checks
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+# Check whether --with-gmp was given.
+if test "${with_gmp+set}" = set; then :
+ withval=$with_gmp; if test "$withval" = yes ; then
+ GMP_HOME_PATH="/usr"
+ elif test "$withval" != no ; then
+ GMP_HOME_PATH="$withval"
+ fi
+else
+ GMP_HOME_PATH=" /usr"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo= ac_hi=
-fi
+min_gmp_version=3.1.1
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+BACKUP_CXXFLAGS=${CXXFLAGS}
+BACKUP_LIBS=${LIBS}
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+
+for GMP_HOME in ${GMP_HOME_PATH}
+ do
+ if test "x$GMP_HOME" != "x/usr" -a "x$GMP_HOME" != "x/usr/local"; then
+ if test -r "$GMP_HOME/include/gmp.h" ; then
+ GMP_CFLAGS="-I${GMP_HOME}/include"
+ GMP_LIBS="-L${GMP_HOME}/lib -lgmp"
+ else
+ if test -r "$GMP_HOME/gmp.h" ; then
+ GMP_CFLAGS="-I${GMP_HOME}"
+ GMP_LIBS="-L${GMP_HOME} -lgmp"
+ else
+ echo "($GMP_HOME) seems an invalid GMP prefix"
+ echo "Searching GMP in PATH"
+ GMP_CFLAGS=
+ GMP_LIBS="-lgmp"
+ fi
+ fi
+ else
+ GMP_CFLAGS=
+ GMP_LIBS="-lgmp"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMP >= $min_gmp_version" >&5
+$as_echo_n "checking for GMP >= $min_gmp_version... " >&6; }
+ CXXFLAGS="${CXXFLAGS} ${GMP_CFLAGS}"
+ LIBS="${LIBS} ${GMP_LIBS}"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
+#include <gmp.h>
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
+mpz_t a; mpz_init (a);
;
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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_link "$LINENO"; then :
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
+ if test "$cross_compiling" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+ echo "WARNING: You appear to be cross compiling, so there is no way to determine"
+ echo "whether your GMP version is new enough. I am assuming it is."
+
+
+
+$as_echo "#define HAVE_GMP 1" >>confdefs.h
+
+ :
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_short=$ac_lo;;
-'') if test "$ac_cv_type_short" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_short=0
- fi ;;
-esac
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
+#include <gmp.h>
+ int main () { if (__GNU_MP_VERSION < 3) return -1; else return 0; }
- ;
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_short=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_run "$LINENO"; then :
-( exit $ac_status )
-if test "$ac_cv_type_short" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_short=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
-_ACEOF
+$as_echo "#define HAVE_GMP 1" >>confdefs.h
+
+ # See if we are running GMP 4.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GMP is 4.0 or greater" >&5
+$as_echo_n "checking whether GMP is 4.0 or greater... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
-{ echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6; }
-if test "${ac_cv_type_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
-typedef int ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
+#include <gmp.h>
+ int main () { if (__GNU_MP_VERSION < 4) return -1; else 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 "echo \"\$as_me:$LINENO: $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
- 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_type_int=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_run "$LINENO"; then :
- ac_cv_type_int=no
-fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ # See if GMP was compiled with --enable-cxx
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GMP was compiled with --enable-cxx" >&5
+$as_echo_n "checking whether GMP was compiled with --enable-cxx... " >&6; }
+ if test "$cross_compiling" = yes; then :
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
+#include <gmpxx.h>
+ int main () { mpz_class a(2),b(3),c(5); if ( a+b == c ) return 0; else return -1; }
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=0 ac_mid=0
- while :; do
- 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
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+if ac_fn_cxx_try_run "$LINENO"; then :
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ GMP_VERSION=""
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- 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
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=-1 ac_mid=-1
- while :; do
- 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
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
+$as_echo "#define GMP_NO_CXX 1" >>confdefs.h
+
+ GMP_VERSION="-DGMP_NO_CXX"
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo= ac_hi=
-fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+$as_echo "#define GMP_VERSION_3 1" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- 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
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+ GMP_VERSION="-DGMP_VERSION_3"
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') if test "$ac_cv_type_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_int=0
- fi ;;
-esac
+ :
+
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
- typedef int ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: problem" >&5
+$as_echo "problem" >&6; }
+ echo "Sorry, your GMP version is too old. Disabling."
+ unset GMP_CFLAGS
+ unset GMP_LIBS
+
+
+echo '*******************************************************************************'
+echo ' ERROR: GMP not found!'
+echo
+echo ' GMP version 3.1.1 or greater is required for this library to compile. Please'
+echo ' make sure GMP is installed and specify its location with the option'
+echo ' --with-gmp=<prefix> when running configure.'
+echo '*******************************************************************************'
+exit 1
- ;
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_int=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-if test "$ac_cv_type_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_int=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.val
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+ break
+else
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ unset GMP_CFLAGS
+ unset GMP_LIBS
+echo '*******************************************************************************'
+echo ' ERROR: GMP not found!'
+echo
+echo ' GMP version 3.1.1 or greater is required for this library to compile. Please'
+echo ' make sure GMP is installed and specify its location with the option'
+echo ' --with-gmp=<prefix> when running configure.'
+echo '*******************************************************************************'
+exit 1
-{ echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
-typedef long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- 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 "echo \"\$as_me:$LINENO: $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
- 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_type_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_long=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+done
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6; }
+CXXFLAGS=${BACKUP_CXXFLAGS}
+LIBS=${BACKUP_LIBS}
+#unset LD_LIBRARY_PATH
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-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
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=0 ac_mid=0
- while :; do
- 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
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid; break
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5
+$as_echo_n "checking whether to build documentation... " >&6; }
+
+
+
+# Check whether --with-docdir was given.
+if test "${with_docdir+set}" = set; then :
+ withval=$with_docdir;
+ GIVARO_DOC_PATH="$withval"
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ eval GIVARO_DOC_PATH="${prefix}/docs"
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- 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
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=-1 ac_mid=-1
- while :; do
- 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
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=$ac_mid; break
+
+# Check whether --with-doxygen was given.
+if test "${with_doxygen+set}" = set; then :
+ withval=$with_doxygen;
+ DOXYGEN_PATH="$PATH $withval"
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ DOXYGEN_PATH="$PATH"
+
+fi
+
+
+# Check whether --enable-docs was given.
+if test "${enable_docs+set}" = set; then :
+ enableval=$enable_docs;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether doxygen works" >&5
+$as_echo_n "checking whether doxygen works... " >&6; }
+export PATH=$DOXYGEN_PATH
+(doxygen --version) < /dev/null > /dev/null 2>&1 || {
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ echo
+ echo "You must have doxygen installed to create documentation for"
+ echo "Givaro. This error only happens if you use --enable-doc."
+ echo "Download the appropriate package for your distribution, or get"
+ echo "the source tarball from http://www.stack.nl/~dimitri/doxygen/"
+ exit -1
+}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ if true; then
+ GIVARO_BUILD_DOC_TRUE=
+ GIVARO_BUILD_DOC_FALSE='#'
+else
+ GIVARO_BUILD_DOC_TRUE='#'
+ GIVARO_BUILD_DOC_FALSE=
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo= ac_hi=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ if false; then
+ GIVARO_BUILD_DOC_TRUE=
+ GIVARO_BUILD_DOC_FALSE='#'
+else
+ GIVARO_BUILD_DOC_TRUE='#'
+ GIVARO_BUILD_DOC_FALSE=
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- 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
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
- ;
- return 0;
-}
+
+CXXFLAGS="${GMP_CFLAGS} ${CXXFLAGS}"
+LIBS="${GMP_LIBS}"
+
+
+ac_config_files="$ac_config_files Makefile givaro-config givaro-makefile src/Makefile src/kernel/Makefile src/kernel/system/Makefile src/kernel/memory/Makefile src/kernel/gmp++/Makefile src/kernel/integer/Makefile src/kernel/bstruct/Makefile src/kernel/rational/Makefile src/kernel/zpz/Makefile src/library/Makefile src/library/vector/Makefile src/library/tools/Makefile src/library/poly1/Makefile src/library/matrix/Makefile macros/Makefile examples/Makefile examples/FiniteField/Makefile examples/Integer/Makefile examples/Rational/Makefile examples/Polynomial/Makefile tests/Makefile docs/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr '(' $ac_mid ')' + 1`
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
fi
+rm -f confcache
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
-case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') if test "$ac_cv_type_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long=0
- fi ;;
-esac
-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
- typedef long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
+LIBOBJS=$ac_libobjs
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
+LTLIBOBJS=$ac_ltlibobjs
- ;
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-if test "$ac_cv_type_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long=0
- fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-rm -f conftest.val
+if test -z "${INSIDE_GNOME_COMMON_TRUE}" && test -z "${INSIDE_GNOME_COMMON_FALSE}"; then
+ as_fn_error $? "conditional \"INSIDE_GNOME_COMMON\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
+ as_fn_error $? "conditional \"DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WARNINGS_TRUE}" && test -z "${WARNINGS_FALSE}"; then
+ as_fn_error $? "conditional \"WARNINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+if test -z "${GIVARO_BUILD_DOC_TRUE}" && test -z "${GIVARO_BUILD_DOC_FALSE}"; then
+ as_fn_error $? "conditional \"GIVARO_BUILD_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GIVARO_BUILD_DOC_TRUE}" && test -z "${GIVARO_BUILD_DOC_FALSE}"; then
+ as_fn_error $? "conditional \"GIVARO_BUILD_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
-{ echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# 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
- 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
-typedef long long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- 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;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-eval "echo \"\$as_me:$LINENO: $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
- 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_type_long_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
- ac_cv_type_long_long=no
+ ;;
+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
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-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
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=0 ac_mid=0
- while :; do
- 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
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- 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
- typedef long long ac__type_sizeof_;
-int
-main ()
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=-1 ac_mid=-1
- while :; do
- 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
- typedef long long ac__type_sizeof_;
-int
-main ()
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
+ return $1
+} # as_fn_set_status
- ;
- return 0;
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
}
-_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 "echo \"\$as_me:$LINENO: $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
- 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_lo=$ac_mid; break
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ as_expr=false
+fi
- ac_lo= ac_hi=
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- 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
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+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'`
- ;
- 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;;
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-eval "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr '(' $ac_mid ')' + 1`
+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
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') if test "$ac_cv_type_long_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long=0
- fi ;;
-esac
-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
- typedef long long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
{
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
- ;
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long_long=`cat conftest.val`
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
fi
-rm -f conftest.val
+
+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
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+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'"
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-{ echo "$as_me:$LINENO: checking for __int64" >&5
-echo $ECHO_N "checking for __int64... $ECHO_C" >&6; }
-if test "${ac_cv_type___int64+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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
-typedef __int64 ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- 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 "echo \"\$as_me:$LINENO: $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
- 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_type___int64=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by Givaro $as_me 3.4.2, which was
+generated by GNU Autoconf 2.68. Invocation command line was
- ac_cv_type___int64=no
-fi
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5
-echo "${ECHO_T}$ac_cv_type___int64" >&6; }
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of __int64" >&5
-echo $ECHO_N "checking size of __int64... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof___int64+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-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
- typedef __int64 ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 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;;
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
-eval "echo \"\$as_me:$LINENO: $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
- 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_lo=0 ac_mid=0
- while :; do
- 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
- typedef __int64 ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 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;;
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
-eval "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+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"
- 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
- typedef __int64 ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
- ;
- return 0;
-}
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <Jean-Guillaume.Dumas at imag.fr>.
+Givaro home page: <http://ljk.imag.fr/CASYS/LOGICIELS/givaro>."
+
_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 "echo \"\$as_me:$LINENO: $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
- 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_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+Givaro config.status 3.4.2
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef __int64 ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 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 "echo \"\$as_me:$LINENO: $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
- 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_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
+ esac
+ shift
+done
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ac_configure_extra_args=
- ac_lo= ac_hi=
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+_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
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- 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
- typedef __int64 ac__type_sizeof_;
-int
-main ()
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+PACKAGE="$PACKAGE"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof___int64=$ac_lo;;
-'') if test "$ac_cv_type___int64" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (__int64)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof___int64=0
- fi ;;
-esac
-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
- typedef __int64 ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
- ;
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof___int64=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
-( exit $ac_status )
-if test "$ac_cv_type___int64" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (__int64)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof___int64=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+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
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5
-echo "${ECHO_T}$ac_cv_sizeof___int64" >&6; }
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF___INT64 $ac_cv_sizeof___int64
-_ACEOF
-# check endianness of the architecture
-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/param.h>
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
- && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
- bogus endian macros
-#endif
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $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
- 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
- # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/param.h>
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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_bigendian=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# 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" ;;
+ "givaro-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS givaro-config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "givaro-config") CONFIG_FILES="$CONFIG_FILES givaro-config" ;;
+ "givaro-makefile") CONFIG_FILES="$CONFIG_FILES givaro-makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "src/kernel/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/Makefile" ;;
+ "src/kernel/system/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/system/Makefile" ;;
+ "src/kernel/memory/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/memory/Makefile" ;;
+ "src/kernel/gmp++/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/gmp++/Makefile" ;;
+ "src/kernel/integer/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/integer/Makefile" ;;
+ "src/kernel/bstruct/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/bstruct/Makefile" ;;
+ "src/kernel/rational/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/rational/Makefile" ;;
+ "src/kernel/zpz/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/zpz/Makefile" ;;
+ "src/library/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/Makefile" ;;
+ "src/library/vector/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/vector/Makefile" ;;
+ "src/library/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/tools/Makefile" ;;
+ "src/library/poly1/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/poly1/Makefile" ;;
+ "src/library/matrix/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/matrix/Makefile" ;;
+ "macros/Makefile") CONFIG_FILES="$CONFIG_FILES macros/Makefile" ;;
+ "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+ "examples/FiniteField/Makefile") CONFIG_FILES="$CONFIG_FILES examples/FiniteField/Makefile" ;;
+ "examples/Integer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Integer/Makefile" ;;
+ "examples/Rational/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Rational/Makefile" ;;
+ "examples/Polynomial/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Polynomial/Makefile" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
- ac_cv_c_bigendian=no
-fi
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- # It does not; compile a test program.
-if test "$cross_compiling" = yes; then
- # try to guess the endianness by grepping values into an object file
- ac_cv_c_bigendian=unknown
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-int
-main ()
-{
- _ascii (); _ebcdic ();
- ;
- 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 "echo \"\$as_me:$LINENO: $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
- 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
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
- ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
+# 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
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
-fi
+# 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
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
+
+
{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
- ;
- return 0;
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_bigendian=no
+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
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
fi
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
-fi
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
-case $ac_cv_c_bigendian in
- yes)
+# 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.
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIG_ENDIAN 1
-_ACEOF
- ;;
- no)
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LITTLE_ENDIAN 1
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
_ACEOF
- ;;
- *)
- { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
-echo "Creating symbolic link for compilation"
-if test ! -L src/kernel/system/givaro ; then ln -s . src/kernel/system/givaro; fi
-if test ! -L src/kernel/bstruct/givaro ; then ln -s . src/kernel/bstruct/givaro; fi
-if test ! -L src/kernel/integer/givaro ; then ln -s . src/kernel/integer/givaro; fi
-if test ! -L src/kernel/memory/givaro ; then ln -s . src/kernel/memory/givaro; fi
-if test ! -L src/kernel/rational/givaro ; then ln -s . src/kernel/rational/givaro; fi
-if test ! -L src/kernel/zpz/givaro ; then ln -s . src/kernel/zpz/givaro; fi
-if test ! -L src/kernel/gmp++/gmp++ ; then ln -s . src/kernel/gmp++/gmp++; fi
-if test ! -L src/library/matrix/givaro ; then ln -s . src/library/matrix/givaro; fi
-if test ! -L src/library/poly1/givaro ; then ln -s . src/library/poly1/givaro; fi
-if test ! -L src/library/tools/givaro ; then ln -s . src/library/tools/givaro; fi
-if test ! -L src/library/vector/givaro ; then ln -s . src/library/vector/givaro; fi
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
-# Create some useful data types of fixed, known lengths
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
-case 1 in
- $ac_cv_sizeof_char)
- GIVARO_INT8="char";
- ;;
-esac
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
-case 2 in
- $ac_cv_sizeof_short)
- GIVARO_INT16="short";
- ;;
- $ac_cv_sizeof_int)
- GIVARO_INT16="int";
- ;;
+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 4 in
- $ac_cv_sizeof_short)
- GIVARO_INT32="short";
- ;;
- $ac_cv_sizeof_int)
- GIVARO_INT32="int";
- ;;
- $ac_cv_sizeof_long)
- GIVARO_INT32="long";
- ;;
+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 8 in
- $ac_cv_sizeof_short)
- GIVARO_INT64="short";
- ;;
- $ac_cv_sizeof_int)
- GIVARO_INT64="int";
- ;;
- $ac_cv_sizeof_long)
- GIVARO_INT64="long";
- ;;
- $ac_cv_sizeof_long_long)
- GIVARO_INT64="long long";
- ;;
- $ac_cv_sizeof___int64)
- GIVARO_INT64="__int64";
- ;;
-esac
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
-cat >>confdefs.h <<_ACEOF
-#define INT8 $GIVARO_INT8
+ 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 >>confdefs.h <<_ACEOF
-#define INT16 $GIVARO_INT16
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define INT32 $GIVARO_INT32
+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
-
-cat >>confdefs.h <<_ACEOF
-#define INT64 $GIVARO_INT64
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
-# This is weird
-#case $ac_cv_sizeof_long in
-# $ac_cv_sizeof_long_long)
-# AC_DEFINE_UNQUOTED(_DONOTUSE_longlong__,1, long long is equal to long)
-# ;;
-#esac
-
-# Feature checks
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
-# Check whether --with-gmp was given.
-if test "${with_gmp+set}" = set; then
- withval=$with_gmp; if test "$withval" = yes ; then
- GMP_HOME_PATH="/usr"
- elif test "$withval" != no ; then
- GMP_HOME_PATH="$withval"
- fi
-else
- GMP_HOME_PATH=" /usr"
+ case $ac_file$ac_mode in
+ "givaro-config.h":C) ac_prefix_conf_OUT=`echo givaro-config.h`
+ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"`
+ac_prefix_conf_PKG=`echo __GIVARO`
+ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"`
+ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:" -e "/^[0123456789]/s/^/_/"`
+ac_prefix_conf_INP=`echo "" | sed -e 's/ *//'`
+if test ".$ac_prefix_conf_INP" = "."; then
+ for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
+ case "$ac_file" in
+ *.h) ac_prefix_conf_INP=$ac_file ;;
+ *)
+ esac
+ test ".$ac_prefix_conf_INP" != "." && break
+ done
fi
+if test ".$ac_prefix_conf_INP" = "."; then
+ case "$ac_prefix_conf_OUT" in
+ */*) ac_prefix_conf_INP=`basename "$ac_prefix_conf_OUT"`
+ ;;
+ *-*) ac_prefix_conf_INP=`echo "$ac_prefix_conf_OUT" | sed -e "s/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*-//"`
+ ;;
+ *) ac_prefix_conf_INP=config.h
+ ;;
+ esac
+fi
+if test -z "$ac_prefix_conf_PKG" ; then
+ as_fn_error $? "no prefix for _PREFIX_PKG_CONFIG_H" "$LINENO" 5
+else
+ if test ! -f "$ac_prefix_conf_INP" ; then if test -f "$srcdir/$ac_prefix_conf_INP" ; then
+ ac_prefix_conf_INP="$srcdir/$ac_prefix_conf_INP"
+ fi fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&5
+$as_echo "$as_me: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&6;}
+ if test -f $ac_prefix_conf_INP ; then
+ echo "s/#undef *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]\\)/#undef $ac_prefix_conf_UPP""_\\1/" > conftest.prefix
+ echo "s/#undef *\\([abcdefghijklmnopqrstuvwxyz]\\)/#undef $ac_prefix_conf_LOW""_\\1/" >> conftest.prefix
+ echo "s/#define *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_UPP""_\\1 \\" >> conftest.prefix
+ echo "#define $ac_prefix_conf_UPP""_\\1 \\2 \\" >> conftest.prefix
+ echo "#endif/" >>conftest.prefix
+ echo "s/#define *\\([abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_LOW""_\\1 \\" >> conftest.prefix
+ echo "#define $ac_prefix_conf_LOW""_\\1 \\2 \\" >> conftest.prefix
+ echo "#endif/" >> conftest.prefix
+ # now executing _script on _DEF input to create _OUT output file
+ echo "#ifndef $ac_prefix_conf_DEF" >$tmp/pconfig.h
+ echo "#define $ac_prefix_conf_DEF 1" >>$tmp/pconfig.h
+ echo ' ' >>$tmp/pconfig.h
+ echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
-
-min_gmp_version=3.1.1
-
-BACKUP_CXXFLAGS=${CXXFLAGS}
-BACKUP_LIBS=${LIBS}
-
-
-for GMP_HOME in ${GMP_HOME_PATH}
+ sed -f conftest.prefix $ac_prefix_conf_INP >>$tmp/pconfig.h
+ echo ' ' >>$tmp/pconfig.h
+ echo '/* once:' $ac_prefix_conf_DEF '*/' >>$tmp/pconfig.h
+ echo "#endif" >>$tmp/pconfig.h
+ if cmp -s $ac_prefix_conf_OUT $tmp/pconfig.h 2>/dev/null; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_prefix_conf_OUT is unchanged" >&5
+$as_echo "$as_me: $ac_prefix_conf_OUT is unchanged" >&6;}
+ else
+ ac_dir=`$as_dirname -- "$ac_prefix_conf_OUT" ||
+$as_expr X"$ac_prefix_conf_OUT" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_prefix_conf_OUT" : 'X\(//\)[^/]' \| \
+ X"$ac_prefix_conf_OUT" : 'X\(//\)$' \| \
+ X"$ac_prefix_conf_OUT" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_prefix_conf_OUT" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ rm -f "$ac_prefix_conf_OUT"
+ mv $tmp/pconfig.h "$ac_prefix_conf_OUT"
+ fi
+ else
+ as_fn_error $? "input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" "$LINENO" 5
+ fi
+ rm -f conftest.*
+fi
+ ;;
+ "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
- if test "x$GMP_HOME" != "x/usr" -a "x$GMP_HOME" != "x/usr/local"; then
- if test -r "$GMP_HOME/include/gmp.h" ; then
- GMP_CFLAGS="-I${GMP_HOME}/include"
- GMP_LIBS="-L${GMP_HOME}/lib -lgmp"
- else
- echo "($GMP_HOME) seems an invalid GMP prefix"
- echo "Searching GMP in PATH"
- GMP_CFLAGS=
- GMP_LIBS="-lgmp"
- fi
- else
- GMP_CFLAGS=
- GMP_LIBS="-lgmp"
- fi
- { echo "$as_me:$LINENO: checking for GMP >= $min_gmp_version" >&5
-echo $ECHO_N "checking for GMP >= $min_gmp_version... $ECHO_C" >&6; }
- CXXFLAGS="${CXXFLAGS} ${GMP_CFLAGS}"
- LIBS="${LIBS} ${GMP_LIBS}"
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <gmp.h>
-int
-main ()
-{
-mpz_t a; mpz_init (a);
- ;
- return 0;
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
}
-_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 "echo \"\$as_me:$LINENO: $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
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
- if test "$cross_compiling" = yes; then
-
- { echo "$as_me:$LINENO: result: unknown" >&5
-echo "${ECHO_T}unknown" >&6; }
- echo "WARNING: You appear to be cross compiling, so there is no way to determine"
- echo "whether your GMP version is new enough. I am assuming it is."
-
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GMP 1
-_ACEOF
-
- :
+ ;;
+ "libtool":C)
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <gmp.h>
- int main () { if (__GNU_MP_VERSION < 3) return -1; else return 0; }
+ # 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
-_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
- { echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6; }
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 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.
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GMP 1
-_ACEOF
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
- # See if we are running GMP 4.0
- { echo "$as_me:$LINENO: checking whether GMP is 4.0 or greater" >&5
-echo $ECHO_N "checking whether GMP is 4.0 or greater... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
+# ### BEGIN LIBTOOL CONFIG
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <gmp.h>
- int main () { if (__GNU_MP_VERSION < 4) return -1; else return 0; }
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
-_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- # See if GMP was compiled with --enable-cxx
- { echo "$as_me:$LINENO: checking whether GMP was compiled with --enable-cxx" >&5
-echo $ECHO_N "checking whether GMP was compiled with --enable-cxx... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
+# What type of objects to build.
+pic_mode=$pic_mode
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <gmpxx.h>
- int main () { mpz_class a(2),b(3),c(5); if ( a+b == c ) return 0; else return -1; }
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
-_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- GMP_VERSION=""
+# 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
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# A sed program that does not truncate output.
+SED=$lt_SED
-( exit $ac_status )
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+# A grep program that handles long lines.
+GREP=$lt_GREP
-cat >>confdefs.h <<\_ACEOF
-#define GMP_NO_CXX 1
-_ACEOF
+# An ERE matcher.
+EGREP=$lt_EGREP
- GMP_VERSION="-DGMP_NO_CXX"
+# A literal string matcher.
+FGREP=$lt_FGREP
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+# 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
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Executable file suffix (normally "").
+exeext=$exeext
-( exit $ac_status )
+# whether the shell understands "unset".
+lt_unset=$lt_unset
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
-cat >>confdefs.h <<\_ACEOF
-#define GMP_VERSION_3 1
-_ACEOF
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
- GMP_VERSION="-DGMP_VERSION_3"
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+# 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
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
-( exit $ac_status )
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
- { echo "$as_me:$LINENO: result: problem" >&5
-echo "${ECHO_T}problem" >&6; }
- echo "Sorry, your GMP version is too old. Disabling."
- unset GMP_CFLAGS
- unset GMP_LIBS
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-echo '*******************************************************************************'
-echo ' ERROR: GMP not found!'
-echo
-echo ' GMP version 3.1.1 or greater is required for this library to compile. Please'
-echo ' make sure GMP is installed and specify its location with the option'
-echo ' --with-gmp=<prefix> when running configure.'
-echo '*******************************************************************************'
-exit 1
+# The archiver.
+AR=$lt_AR
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+# A symbol stripping program.
+STRIP=$lt_STRIP
- break
+# 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
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+# A C compiler.
+LTCC=$lt_CC
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- unset GMP_CFLAGS
- unset GMP_LIBS
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
-echo '*******************************************************************************'
-echo ' ERROR: GMP not found!'
-echo
-echo ' GMP version 3.1.1 or greater is required for this library to compile. Please'
-echo ' make sure GMP is installed and specify its location with the option'
-echo ' --with-gmp=<prefix> when running configure.'
-echo '*******************************************************************************'
-exit 1
+# 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
-fi
+# 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
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-done
+# 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
-CXXFLAGS=${BACKUP_CXXFLAGS}
-LIBS=${BACKUP_LIBS}
-#unset LD_LIBRARY_PATH
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
-CXXFLAGS="${GMP_CFLAGS} ${CXXFLAGS}"
-LIBS="${GMP_LIBS}"
+# 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
-ac_config_files="$ac_config_files Makefile givaro-config givaro-makefile src/Makefile src/kernel/Makefile src/kernel/system/Makefile src/kernel/memory/Makefile src/kernel/gmp++/Makefile src/kernel/integer/Makefile src/kernel/bstruct/Makefile src/kernel/rational/Makefile src/kernel/zpz/Makefile src/library/Makefile src/library/vector/Makefile src/library/tools/Makefile src/library/poly1/Makefile src/library/matrix/Makefile macros/Makefile examples/Makefile examples/FiniteField/Makefile examples/Integer/Makefile examples/Rational/Makefile examples/Polynomial/Makefile"
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-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.
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
-_ACEOF
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
-# 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
- (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" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
-DEFS=-DHAVE_CONFIG_H
+# Old archive suffix (normally "a").
+libext=$libext
-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=`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
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
-LTLIBOBJS=$ac_ltlibobjs
+# 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
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${INSIDE_GNOME_COMMON_TRUE}" && test -z "${INSIDE_GNOME_COMMON_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"INSIDE_GNOME_COMMON\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSIDE_GNOME_COMMON\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-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
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-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
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $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.
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
+# Do we need a version for libraries?
+need_version=$need_version
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+# Library versioning type.
+version_type=$version_type
-# 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=:
- # 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
+# Shared library runtime path variable.
+runpath_var=$runpath_var
-fi
+# 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
-# 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
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
+# 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
-# 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.)
-as_nl='
-'
-IFS=" "" $as_nl"
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
-# 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
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
- ;;
-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
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
-# 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='+ '
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-# 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
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
+# 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
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
-# CDPATH.
-$as_unset CDPATH
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
- 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" || {
+# A language specific compiler.
+CC=$lt_compiler
- # 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" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
- # 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
-}
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
-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
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-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
-fi
-echo >conf$$.file
-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
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-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
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-# 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'"
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+# 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
-exec 6>&1
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-# 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.61. Invocation command line was
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
+# 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
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
-_ACEOF
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
-_ACEOF
+# 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
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+# 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
-Usage: $0 [OPTIONS] [FILE]...
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet 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
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
-Configuration files:
-$config_files
+# 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
-Configuration headers:
-$config_headers
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
-Configuration commands:
-$config_commands
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
-Report bugs to <bug-autoconf at gnu.org>."
+# 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
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-_ACEOF
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-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
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
- 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 )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
- esac
- shift
-done
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
-ac_configure_extra_args=
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
fi
+_LT_EOF
+ ;;
+ esac
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS
-#
-PACKAGE="$PACKAGE"
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+ltmain="$ac_aux_dir/ltmain.sh"
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
-# 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" ;;
- "givaro-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS givaro-config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "givaro-config") CONFIG_FILES="$CONFIG_FILES givaro-config" ;;
- "givaro-makefile") CONFIG_FILES="$CONFIG_FILES givaro-makefile" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "src/kernel/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/Makefile" ;;
- "src/kernel/system/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/system/Makefile" ;;
- "src/kernel/memory/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/memory/Makefile" ;;
- "src/kernel/gmp++/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/gmp++/Makefile" ;;
- "src/kernel/integer/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/integer/Makefile" ;;
- "src/kernel/bstruct/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/bstruct/Makefile" ;;
- "src/kernel/rational/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/rational/Makefile" ;;
- "src/kernel/zpz/Makefile") CONFIG_FILES="$CONFIG_FILES src/kernel/zpz/Makefile" ;;
- "src/library/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/Makefile" ;;
- "src/library/vector/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/vector/Makefile" ;;
- "src/library/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/tools/Makefile" ;;
- "src/library/poly1/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/poly1/Makefile" ;;
- "src/library/matrix/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/matrix/Makefile" ;;
- "macros/Makefile") CONFIG_FILES="$CONFIG_FILES macros/Makefile" ;;
- "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
- "examples/FiniteField/Makefile") CONFIG_FILES="$CONFIG_FILES examples/FiniteField/Makefile" ;;
- "examples/Integer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Integer/Makefile" ;;
- "examples/Rational/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Rational/Makefile" ;;
- "examples/Polynomial/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Polynomial/Makefile" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
+ cat <<_LT_EOF >> "$ofile"
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
-# 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
+# The linker used to build libraries.
+LD=$lt_LD_CXX
-# 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.
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
+# A language specific compiler.
+CC=$lt_compiler_CXX
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
-_ACEOF
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-am__isrc!$am__isrc$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
-MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
-MAINT!$MAINT$ac_delim
-INSIDE_GNOME_COMMON_TRUE!$INSIDE_GNOME_COMMON_TRUE$ac_delim
-INSIDE_GNOME_COMMON_FALSE!$INSIDE_GNOME_COMMON_FALSE$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-CXXDEPMODE!$CXXDEPMODE$ac_delim
-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-_ACEOF
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-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
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
-_ACEOF
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SED!$SED$ac_delim
-LN_S!$LN_S$ac_delim
-ECHO!$ECHO$ac_delim
-AR!$AR$ac_delim
-RANLIB!$RANLIB$ac_delim
-DSYMUTIL!$DSYMUTIL$ac_delim
-NMEDIT!$NMEDIT$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-GMP_CFLAGS!$GMP_CFLAGS$ac_delim
-GMP_LIBS!$GMP_LIBS$ac_delim
-GMP_VERSION!$GMP_VERSION$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-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
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
-# 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
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-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
+# 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_CXX
- 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 ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
- # 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 "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
- esac
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
- 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 ||
-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=`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 ||
-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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`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
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-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
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
- 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
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
-cat >>$CONFIG_STATUS <<\_ACEOF
-# 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=
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- 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
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
-# 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
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;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
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
-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"; } &&
- { 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
-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
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then 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.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
- if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
- fi
- else
- echo "/* $configure_input */"
- cat "$ac_result"
- fi
- rm -f "$tmp/out12"
-# 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 ||
-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
- ;;
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
- case $ac_file$ac_mode in
- "givaro-config.h":C) ac_prefix_conf_OUT=`echo givaro-config.h`
-ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"`
-ac_prefix_conf_PKG=`echo __GIVARO`
-ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"`
-ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:" -e "/^[0123456789]/s/^/_/"`
-ac_prefix_conf_INP=`echo "" | sed -e 's/ *//'`
-if test ".$ac_prefix_conf_INP" = "."; then
- for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
- case "$ac_file" in
- *.h) ac_prefix_conf_INP=$ac_file ;;
- *)
- esac
- test ".$ac_prefix_conf_INP" != "." && break
- done
-fi
-if test ".$ac_prefix_conf_INP" = "."; then
- case "$ac_prefix_conf_OUT" in
- */*) ac_prefix_conf_INP=`basename "$ac_prefix_conf_OUT"`
- ;;
- *-*) ac_prefix_conf_INP=`echo "$ac_prefix_conf_OUT" | sed -e "s/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*-//"`
- ;;
- *) ac_prefix_conf_INP=config.h
- ;;
- esac
-fi
-if test -z "$ac_prefix_conf_PKG" ; then
- { { echo "$as_me:$LINENO: error: no prefix for _PREFIX_PKG_CONFIG_H" >&5
-echo "$as_me: error: no prefix for _PREFIX_PKG_CONFIG_H" >&2;}
- { (exit 1); exit 1; }; }
-else
- if test ! -f "$ac_prefix_conf_INP" ; then if test -f "$srcdir/$ac_prefix_conf_INP" ; then
- ac_prefix_conf_INP="$srcdir/$ac_prefix_conf_INP"
- fi fi
- { echo "$as_me:$LINENO: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&5
-echo "$as_me: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&6;}
- if test -f $ac_prefix_conf_INP ; then
- echo "s/#undef *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]\\)/#undef $ac_prefix_conf_UPP""_\\1/" > conftest.prefix
- echo "s/#undef *\\([abcdefghijklmnopqrstuvwxyz]\\)/#undef $ac_prefix_conf_LOW""_\\1/" >> conftest.prefix
- echo "s/#define *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_UPP""_\\1 \\" >> conftest.prefix
- echo "#define $ac_prefix_conf_UPP""_\\1 \\2 \\" >> conftest.prefix
- echo "#endif/" >>conftest.prefix
- echo "s/#define *\\([abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_LOW""_\\1 \\" >> conftest.prefix
- echo "#define $ac_prefix_conf_LOW""_\\1 \\2 \\" >> conftest.prefix
- echo "#endif/" >> conftest.prefix
- # now executing _script on _DEF input to create _OUT output file
- echo "#ifndef $ac_prefix_conf_DEF" >$tmp/pconfig.h
- echo "#define $ac_prefix_conf_DEF 1" >>$tmp/pconfig.h
- echo ' ' >>$tmp/pconfig.h
- echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
- sed -f conftest.prefix $ac_prefix_conf_INP >>$tmp/pconfig.h
- echo ' ' >>$tmp/pconfig.h
- echo '/* once:' $ac_prefix_conf_DEF '*/' >>$tmp/pconfig.h
- echo "#endif" >>$tmp/pconfig.h
- if cmp -s $ac_prefix_conf_OUT $tmp/pconfig.h 2>/dev/null; then
- { echo "$as_me:$LINENO: $ac_prefix_conf_OUT is unchanged" >&5
-echo "$as_me: $ac_prefix_conf_OUT is unchanged" >&6;}
- else
- ac_dir=`$as_dirname -- "$ac_prefix_conf_OUT" ||
-$as_expr X"$ac_prefix_conf_OUT" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_prefix_conf_OUT" : 'X\(//\)[^/]' \| \
- X"$ac_prefix_conf_OUT" : 'X\(//\)$' \| \
- X"$ac_prefix_conf_OUT" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_prefix_conf_OUT" |
- 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=`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 ||
-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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- rm -f "$ac_prefix_conf_OUT"
- mv $tmp/pconfig.h "$ac_prefix_conf_OUT"
- fi
- cp conftest.prefix _configs.sed
- else
- { { echo "$as_me:$LINENO: error: input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" >&5
-echo "$as_me: error: input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" >&2;}
- { (exit 1); exit 1; }; }
- fi
- rm -f conftest.*
-fi
- ;;
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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 ||
-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 ||
-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=`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 ||
-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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
;;
esac
done # for ac_tag
-{ (exit 0); exit 0; }
+as_fn_exit 0
_ACEOF
-chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -24482,6 +19245,10 @@ if test "$no_create" != yes; then
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; }
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..d88831a
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,261 @@
+# Copyright(c)'1994-2011 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+AC_PREREQ(2.61)
+
+AC_INIT([Givaro],[3.4.2],[Jean-Guillaume.Dumas at imag.fr],[givaro],
+ [http://ljk.imag.fr/CASYS/LOGICIELS/givaro])
+AC_CONFIG_MACRO_DIR([macros])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([1.8 gnu no-dependencies -Wall -Wno-portability])
+AM_CONFIG_HEADER([config.h])
+AX_PREFIX_CONFIG_H(givaro-config.h, __GIVARO)
+AC_PATH_PROG(RM, rm, $FALSE)
+RM="$RM -f"
+
+
+AM_MAINTAINER_MODE
+AM_DEP_TRACK
+AM_OUTPUT_DEPENDENCY_COMMANDS
+
+AM_ACLOCAL_INCLUDE(macros)
+
+# work around to fix the backward compatibility issue of automake 1.10 with 1.9 (pb with MKDIR_P)
+AC_SUBST([MKDIR_P])
+
+AC_LANG([C++])
+
+AC_DEBUG
+# AC_FULL_DEBUG
+AC_WARNINGS
+
+# CFLAGS=${CFLAGS:-$DEFAULT_CFLAGS}
+# CXXFLAGS=${CXXFLAGS:-$DEFAULT_CXXFLAGS}
+
+######################################################
+# Try and pass different flags according to compiler #
+######################################################
+
+# disable default -g -O2 CXXFLAGS
+: ${CXXFLAGS=""}
+
+#set CXX
+AC_PROG_CXX
+
+AC_COMPILER_NAME
+
+AC_SUBST([DEFAULT_CFLAGS])
+AC_SUBST([DEBUG_CFLAGS])
+AC_SUBST([TESTS_CFLAGS])
+
+TESTS_CFLAGS="-O0 -g"
+DEBUG_CFLAGS="-g"
+DEFAULT_CFLAGS="-pipe"
+WARN_CFLAGS="-Wall"
+
+if test "x$DBG" = "xyes" ; then
+ DEFAULT_CFLAGS="-O0 ${DEFAULT_CFLAGS} -g -pg" #those are CXXFLAGS
+ DEBUG_CFLAGS="${DEBUG_CFLAGS} -DDEBUG -DGIVARO_DEBUG" #those are CPPFLAGS
+else
+ DEFAULT_CFLAGS="-O2 ${DEFAULT_CFLAGS} -DNDEBUG -U_LB_DEBUG"
+fi
+
+
+
+if test "x$WARN" = "xyes" ; then
+ # if test "x${CXX}" = "xicpc" -o "x${CXX}" = "xicc" ; then
+ if test "x${CCNAM}" = "xicc" ; then
+ WARN_CFLAGS="${WARN_CFLAGS} -Wcheck"
+ # DEBUG_CFLAGS="-fast"
+ else
+ if test "x${CCNAM}" = "xgcc" ; then
+ # WARN_CFLAGS="${WARN_CFLAGS} -Wextra -Wno-unused-parameter -Wuninitialized -Wconversion -Wcast-qual"
+ WARN_CFLAGS="${WARN_CFLAGS} -Wextra -Wno-unused-parameter -Wuninitialized -Wconversion -Wcast-qual -ansi -pedantic -Wno-long-long -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings"
+ else
+ echo
+ echo "*******************************************************"
+ echo "unsupported compiler ($CCNAM). Please file a bug."
+ echo "*******************************************************"
+ echo
+ WARN_CFLAGS="${WARN_CFLAGS}"
+ fi
+ fi
+fi
+
+
+DEFAULT_CFLAGS="${DEFAULT_CFLAGS} ${WARN_CFLAGS} ${DEBUG_CFLAGS}"
+TESTS_CFLAGS="${TESTS_CFLAGS} ${WARN_CFLAGS} ${DEBUG_CFLAGS}"
+
+
+AC_HEADER_STDC
+AC_PROG_LIBTOOL
+AM_PROG_LIBTOOL
+
+# newer libtool...
+LT_PREREQ([2.2])
+LT_INIT
+
+#check lib
+# AC_CHECK_LIB([givaro], [main])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h])
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([floor gettimeofday pow sqrt])
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_HEADER_TIME
+# Check machine characteristics
+AC_CHECK_SIZEOF(char, 8)
+AC_CHECK_SIZEOF(short, 16)
+AC_CHECK_SIZEOF(int, 32)
+AC_CHECK_SIZEOF(long, 32)
+AC_CHECK_SIZEOF(long long, 64)
+AC_CHECK_SIZEOF(__int64, 64)
+
+# and check (not so usefull since we have stdint.h)
+# Besides, it seems it breaks givaro-config.h leaving oprhaned #endif and dubious code...
+# AC_TYPE_SIZE_T
+# AC_TYPE_INT8_T
+# AC_TYPE_INT16_T
+# AC_TYPE_INT32_T
+# AC_TYPE_INT64_T
+# AC_TYPE_UINT8_T
+# AC_TYPE_UINT16_T
+# AC_TYPE_UINT32_T
+# AC_TYPE_UINT64_T
+
+# check endianness of the architecture
+AC_C_BIGENDIAN(
+ [AC_DEFINE(HAVE_BIG_ENDIAN, 1, [Define that architecture uses big endian storage])],
+ [AC_DEFINE(HAVE_LITTLE_ENDIAN, 1, [Define that architecture uses little endian storage])],
+ [])
+
+echo "Creating symbolic link for compilation"
+if test ! -L src/kernel/system/givaro ; then ln -s . src/kernel/system/givaro ; fi
+if test ! -L src/kernel/bstruct/givaro ; then ln -s . src/kernel/bstruct/givaro ; fi
+if test ! -L src/kernel/integer/givaro ; then ln -s . src/kernel/integer/givaro ; fi
+if test ! -L src/kernel/memory/givaro ; then ln -s . src/kernel/memory/givaro ; fi
+if test ! -L src/kernel/rational/givaro; then ln -s . src/kernel/rational/givaro; fi
+if test ! -L src/kernel/zpz/givaro ; then ln -s . src/kernel/zpz/givaro ; fi
+if test ! -L src/kernel/gmp++/gmp++ ; then ln -s . src/kernel/gmp++/gmp++ ; fi
+if test ! -L src/library/matrix/givaro ; then ln -s . src/library/matrix/givaro ; fi
+if test ! -L src/library/poly1/givaro ; then ln -s . src/library/poly1/givaro ; fi
+if test ! -L src/library/tools/givaro ; then ln -s . src/library/tools/givaro ; fi
+if test ! -L src/library/vector/givaro ; then ln -s . src/library/vector/givaro ; fi
+
+
+# Create some useful data types of fixed, known lengths
+
+case 1 in
+ $ac_cv_sizeof_char)
+ GIVARO_INT8="char";
+ ;;
+esac
+
+case 2 in
+ $ac_cv_sizeof_short)
+ GIVARO_INT16="short";
+ ;;
+ $ac_cv_sizeof_int)
+ GIVARO_INT16="int";
+ ;;
+esac
+
+case 4 in
+ $ac_cv_sizeof_short)
+ GIVARO_INT32="short";
+ ;;
+ $ac_cv_sizeof_int)
+ GIVARO_INT32="int";
+ ;;
+ $ac_cv_sizeof_long)
+ GIVARO_INT32="long";
+ ;;
+esac
+
+case 8 in
+ $ac_cv_sizeof_short)
+ GIVARO_INT64="short";
+ ;;
+ $ac_cv_sizeof_int)
+ GIVARO_INT64="int";
+ ;;
+ $ac_cv_sizeof_long)
+ GIVARO_INT64="long";
+ ;;
+ $ac_cv_sizeof_long_long)
+ GIVARO_INT64="long long";
+ ;;
+ $ac_cv_sizeof___int64)
+ GIVARO_INT64="__int64";
+ ;;
+esac
+
+AC_DEFINE_UNQUOTED(INT8, $GIVARO_INT8, Canonical 8-bit data type)
+AC_DEFINE_UNQUOTED(INT16, $GIVARO_INT16, Canonical 16-bit data type)
+AC_DEFINE_UNQUOTED(INT32, $GIVARO_INT32, Canonical 32-bit data type)
+AC_DEFINE_UNQUOTED(INT64, $GIVARO_INT64, Canonical 64-bit data type)
+
+# This is weird
+#case $ac_cv_sizeof_long in
+# $ac_cv_sizeof_long_long)
+# AC_DEFINE_UNQUOTED(_DONOTUSE_longlong__,1, long long is equal to long)
+# ;;
+#esac
+
+# Feature checks
+
+AC_LANG_CPLUSPLUS
+LB_CHECK_GMP(,,[
+echo '*******************************************************************************'
+echo ' ERROR: GMP not found!'
+echo
+echo ' GMP version 3.1.1 or greater is required for this library to compile. Please'
+echo ' make sure GMP is installed and specify its location with the option'
+echo ' --with-gmp=<prefix> when running configure.'
+echo '*******************************************************************************'
+exit 1
+])
+
+GIV_DOC
+
+CXXFLAGS="${GMP_CFLAGS} ${CXXFLAGS}"
+LIBS="${GMP_LIBS}"
+AC_SUBST(CXXFLAGS)
+
+AC_CONFIG_FILES([
+Makefile
+givaro-config
+givaro-makefile
+src/Makefile
+src/kernel/Makefile
+src/kernel/system/Makefile
+src/kernel/memory/Makefile
+src/kernel/gmp++/Makefile
+src/kernel/integer/Makefile
+src/kernel/bstruct/Makefile
+src/kernel/rational/Makefile
+src/kernel/zpz/Makefile
+src/library/Makefile
+src/library/vector/Makefile
+src/library/tools/Makefile
+src/library/poly1/Makefile
+src/library/matrix/Makefile
+macros/Makefile
+examples/Makefile
+examples/FiniteField/Makefile
+examples/Integer/Makefile
+examples/Rational/Makefile
+examples/Polynomial/Makefile
+tests/Makefile
+docs/Makefile
+])
+AC_OUTPUT
diff --git a/configure.in b/configure.in
deleted file mode 100755
index 4e10a25..0000000
--- a/configure.in
+++ /dev/null
@@ -1,151 +0,0 @@
-AC_PREREQ(2.50)
-AC_INIT()
-AM_INIT_AUTOMAKE(givaro, 3.2.13)
-AM_CONFIG_HEADER(config.h)
-AX_PREFIX_CONFIG_H(givaro-config.h, __GIVARO)
-
-AM_MAINTAINER_MODE
-
-# Give a sane default for CFLAGS and CXXFLAGS
-DEFAULT_CFLAGS="-g -O2 -Wall"
-
-CFLAGS=${CFLAGS:-$DEFAULT_CFLAGS}
-CXXFLAGS=${CXXFLAGS:-$DEFAULT_CFLAGS}
-
-AM_ACLOCAL_INCLUDE(macros)
-
-AC_PROG_CC
-AC_PROG_CXX
-AC_STDC_HEADERS
-AC_DISABLE_SHARED
-AM_PROG_LIBTOOL
-
-# Check machine characteristics
-AC_CHECK_SIZEOF(char, 8)
-AC_CHECK_SIZEOF(short, 16)
-AC_CHECK_SIZEOF(int, 32)
-AC_CHECK_SIZEOF(long, 32)
-AC_CHECK_SIZEOF(long long, 64)
-AC_CHECK_SIZEOF(__int64, 64)
-# check endianness of the architecture
-AC_C_BIGENDIAN(
- [AC_DEFINE(HAVE_BIG_ENDIAN, 1, [Define that architecture uses big endian storage])],
- [AC_DEFINE(HAVE_LITTLE_ENDIAN, 1, [Define that architecture uses little endian storage])],
- [])
-
-echo "Creating symbolic link for compilation"
-if test ! -L src/kernel/system/givaro ; then ln -s . src/kernel/system/givaro; fi
-if test ! -L src/kernel/bstruct/givaro ; then ln -s . src/kernel/bstruct/givaro; fi
-if test ! -L src/kernel/integer/givaro ; then ln -s . src/kernel/integer/givaro; fi
-if test ! -L src/kernel/memory/givaro ; then ln -s . src/kernel/memory/givaro; fi
-if test ! -L src/kernel/rational/givaro ; then ln -s . src/kernel/rational/givaro; fi
-if test ! -L src/kernel/zpz/givaro ; then ln -s . src/kernel/zpz/givaro; fi
-if test ! -L src/kernel/gmp++/gmp++ ; then ln -s . src/kernel/gmp++/gmp++; fi
-if test ! -L src/library/matrix/givaro ; then ln -s . src/library/matrix/givaro; fi
-if test ! -L src/library/poly1/givaro ; then ln -s . src/library/poly1/givaro; fi
-if test ! -L src/library/tools/givaro ; then ln -s . src/library/tools/givaro; fi
-if test ! -L src/library/vector/givaro ; then ln -s . src/library/vector/givaro; fi
-
-
-# Create some useful data types of fixed, known lengths
-
-case 1 in
- $ac_cv_sizeof_char)
- GIVARO_INT8="char";
- ;;
-esac
-
-case 2 in
- $ac_cv_sizeof_short)
- GIVARO_INT16="short";
- ;;
- $ac_cv_sizeof_int)
- GIVARO_INT16="int";
- ;;
-esac
-
-case 4 in
- $ac_cv_sizeof_short)
- GIVARO_INT32="short";
- ;;
- $ac_cv_sizeof_int)
- GIVARO_INT32="int";
- ;;
- $ac_cv_sizeof_long)
- GIVARO_INT32="long";
- ;;
-esac
-
-case 8 in
- $ac_cv_sizeof_short)
- GIVARO_INT64="short";
- ;;
- $ac_cv_sizeof_int)
- GIVARO_INT64="int";
- ;;
- $ac_cv_sizeof_long)
- GIVARO_INT64="long";
- ;;
- $ac_cv_sizeof_long_long)
- GIVARO_INT64="long long";
- ;;
- $ac_cv_sizeof___int64)
- GIVARO_INT64="__int64";
- ;;
-esac
-
-AC_DEFINE_UNQUOTED(INT8, $GIVARO_INT8, Canonical 8-bit data type)
-AC_DEFINE_UNQUOTED(INT16, $GIVARO_INT16, Canonical 16-bit data type)
-AC_DEFINE_UNQUOTED(INT32, $GIVARO_INT32, Canonical 32-bit data type)
-AC_DEFINE_UNQUOTED(INT64, $GIVARO_INT64, Canonical 64-bit data type)
-
-# This is weird
-#case $ac_cv_sizeof_long in
-# $ac_cv_sizeof_long_long)
-# AC_DEFINE_UNQUOTED(_DONOTUSE_longlong__,1, long long is equal to long)
-# ;;
-#esac
-
-# Feature checks
-AC_LANG_CPLUSPLUS
-
-LB_CHECK_GMP(,,[
-echo '*******************************************************************************'
-echo ' ERROR: GMP not found!'
-echo
-echo ' GMP version 3.1.1 or greater is required for this library to compile. Please'
-echo ' make sure GMP is installed and specify its location with the option'
-echo ' --with-gmp=<prefix> when running configure.'
-echo '*******************************************************************************'
-exit 1
-])
-
-CXXFLAGS="${GMP_CFLAGS} ${CXXFLAGS}"
-LIBS="${GMP_LIBS}"
-AC_SUBST(CXXFLAGS)
-
-AC_OUTPUT([
-Makefile
-givaro-config
-givaro-makefile
-src/Makefile
-src/kernel/Makefile
-src/kernel/system/Makefile
-src/kernel/memory/Makefile
-src/kernel/gmp++/Makefile
-src/kernel/integer/Makefile
-src/kernel/bstruct/Makefile
-src/kernel/rational/Makefile
-src/kernel/zpz/Makefile
-src/library/Makefile
-src/library/vector/Makefile
-src/library/tools/Makefile
-src/library/poly1/Makefile
-src/library/matrix/Makefile
-macros/Makefile
-examples/Makefile
-examples/FiniteField/Makefile
-examples/Integer/Makefile
-examples/Rational/Makefile
-examples/Polynomial/Makefile
-])
diff --git a/depcomp b/depcomp
deleted file mode 100755
index 04701da..0000000
--- a/depcomp
+++ /dev/null
@@ -1,530 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2005-07-09.11
-
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 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 Alexandre Oliva <oliva at dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake at gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
- if test "$libtool" = yes; then
- "$@" -Wc,-M
- else
- "$@" -M
- fi
- stat=$?
-
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
-
- if test -f "$tmpdepfile"; then
- outname="$stripped.o"
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mecanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
- "$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- "$@" || exit $?
- IFS=" "
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/docs/Doxyfile b/docs/Doxyfile
new file mode 100755
index 0000000..0a0fb07
--- /dev/null
+++ b/docs/Doxyfile
@@ -0,0 +1,1649 @@
+# Doxyfile 1.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = Givaro
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES = "bib=\xrefitem bib \"Bibliography\" \"Bibliography\""
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = YES
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = YES
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = YES
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE = doxy.debug
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = .. \
+ ../src \
+ ../docs \
+ ../examples \
+ ../tests
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.cc \
+ *.cpp \
+ *.C \
+ *.h \
+ *.inl \
+ *.doxy
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE = CVS *_src.inl Attic
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */CVS/* *_src.inl */Attic/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = ..
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *.C *.inl *INSTALL *COPYING *HACKING *AUTHORS *.html
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = givaro-html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES = stmaryrd amsmath
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans.ttf
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 1000
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/docs/DoxyfileDev b/docs/DoxyfileDev
new file mode 100755
index 0000000..89688f7
--- /dev/null
+++ b/docs/DoxyfileDev
@@ -0,0 +1,1649 @@
+# Doxyfile 1.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = Givaro
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES = "bib=\xrefitem bib \"Bibliography\" \"Bibliography\""
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = YES
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = YES
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = YES
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE = doxydev.debug
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = .. \
+ ../src \
+ ../docs \
+ ../examples \
+ ../tests
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.cc \
+ *.cpp \
+ *.C \
+ *.h \
+ *.inl \
+ *.doxy
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE = CVS *_src.inl Attic
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */CVS/* *_src.inl */Attic/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = *__GIVARO_*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = ..
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *.C *.inl *INSTALL *COPYING *HACKING *AUTHORS *.html
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = givaro-dev-html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 110
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES = stmaryrd amsmath
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans.ttf
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 1000
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/docs/Makefile.am b/docs/Makefile.am
new file mode 100755
index 0000000..ef1c5ba
--- /dev/null
+++ b/docs/Makefile.am
@@ -0,0 +1,72 @@
+# Copyright(c)'2010 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+
+if GIVARO_BUILD_DOC
+USE_TARGETS = docs
+INSTALL_TARGETS = install-doc
+endif
+docdir=$(GIVARO_DOC_PATH)
+
+#man1_MANS = givaro-config.1
+
+all all-local: $(USE_TARGETS)
+
+install install-data-local: $(INSTALL_TARGETS)
+
+docs:
+ sed -i 's/^\\version.*/\\version\ $(VERSION)/' mainpage.doxy
+ if test -d givaro-html ; then echo exists; else mkdir givaro-html ; fi
+ cp ../INSTALL givaro-html/
+ cp ../COPYING givaro-html/
+ cp ../AUTHORS givaro-html/
+ doxygen Doxyfile
+
+# if test -d givaro-dev-html ; then echo exists; else mkdir givaro-dev-html ; fi
+# cp index-dev.html givaro-dev-html/index.html
+# cp tutorial.html givaro-html/
+# cp install-dist.html givaro-html/
+# cp install-dev.html givaro-html/
+
+docs_dev:
+ make docs
+ cp ../INSTALL givaro-dev-html/
+ cp ../COPYING givaro-dev-html/
+ cp ../AUTHORS givaro-dev-html/
+ doxygen DoxyfileDev
+
+# cp tutorial.html givaro-dev-html/
+# cp install-dist.html givaro-dev-html/
+# cp install-dev.html givaro-dev-html/
+
+
+
+install-doc:
+ mkdir $(docdir)
+ cp -r givaro-html $(docdir)/givaro-html
+ cp -r givaro-dev-html $(docdir)/givaro-dev-html
+ cp givaro.html $(docdir)/givaro.html
+
+EXTRA_DIST= \
+ Doxyfile \
+ DoxyfileDev \
+ mainpage.doxy
+#Â \
+# doc.doxy \
+# tutorial.doxy \
+# givaro.html \
+# givaro-config.1 \
+#tutorial.html \
+# install-dev.html \
+# index-dev.html \
+# install-dist.html
+
+
+clean-local :
+ rm -rf givaro-html
+ rm -rf givaro-dev-html
+
+
diff --git a/macros/Makefile.in b/docs/Makefile.in
similarity index 67%
copy from macros/Makefile.in
copy to docs/Makefile.in
index a81912b..62b00ad 100644
--- a/macros/Makefile.in
+++ b/docs/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -13,6 +14,12 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+# Copyright(c)'2010 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -31,17 +38,26 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-subdir = macros
+subdir = docs
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -53,26 +69,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -82,40 +99,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -127,7 +154,7 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
-docdir = @docdir@
+docdir = $(GIVARO_DOC_PATH)
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
@@ -155,12 +182,15 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+ at GIVARO_BUILD_DOC_TRUE@USE_TARGETS = docs
+ at GIVARO_BUILD_DOC_TRUE@INSTALL_TARGETS = install-doc
EXTRA_DIST = \
- aclocal-include.m4 \
- gmp-check.m4 \
- config-header.m4
+ Doxyfile \
+ DoxyfileDev \
+ mainpage.doxy
all: all-am
@@ -169,14 +199,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu macros/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps docs/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu macros/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps docs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -263,7 +293,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
@@ -275,6 +305,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -283,18 +315,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -318,16 +360,67 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-
+ clean-local distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am
+
+
+#man1_MANS = givaro-config.1
+
+all all-local: $(USE_TARGETS)
+
+install install-data-local: $(INSTALL_TARGETS)
+
+docs:
+ sed -i 's/^\\version.*/\\version\ $(VERSION)/' mainpage.doxy
+ if test -d givaro-html ; then echo exists; else mkdir givaro-html ; fi
+ cp ../INSTALL givaro-html/
+ cp ../COPYING givaro-html/
+ cp ../AUTHORS givaro-html/
+ doxygen Doxyfile
+
+# if test -d givaro-dev-html ; then echo exists; else mkdir givaro-dev-html ; fi
+# cp index-dev.html givaro-dev-html/index.html
+# cp tutorial.html givaro-html/
+# cp install-dist.html givaro-html/
+# cp install-dev.html givaro-html/
+
+docs_dev:
+ make docs
+ cp ../INSTALL givaro-dev-html/
+ cp ../COPYING givaro-dev-html/
+ cp ../AUTHORS givaro-dev-html/
+ doxygen DoxyfileDev
+
+# cp tutorial.html givaro-dev-html/
+# cp install-dist.html givaro-dev-html/
+# cp install-dev.html givaro-dev-html/
+
+install-doc:
+ mkdir $(docdir)
+ cp -r givaro-html $(docdir)/givaro-html
+ cp -r givaro-dev-html $(docdir)/givaro-dev-html
+ cp givaro.html $(docdir)/givaro.html
+#Â \
+# doc.doxy \
+# tutorial.doxy \
+# givaro.html \
+# givaro-config.1 \
+#tutorial.html \
+# install-dev.html \
+# index-dev.html \
+# install-dist.html
+
+clean-local :
+ rm -rf givaro-html
+ rm -rf givaro-dev-html
# 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/docs/mainpage.doxy b/docs/mainpage.doxy
new file mode 100755
index 0000000..7f9a926
--- /dev/null
+++ b/docs/mainpage.doxy
@@ -0,0 +1,35 @@
+/** @mainpage Givaro Documentation.
+ Givaro is a C++ library for arithmetic and algebraic computations.
+
+\section intro Introduction
+
+Givaro can do fast arithmetic computations with
+- Integers. The Integer class uses GMP integers.
+- Rationals.
+- Rings of the form \f$\mathbf{Z}/m\mathbf{Z}\f$.
+- Prime fields and extensions.
+- Polynomials.
+.
+
+Non-standard arithmetic tools include trucated arithmetic.
+
+\section goals Goals
+
+\section desig Design
+
+\section using Using Givaro
+- \subpage copy.
+- \subpage tuto. This is a brief introduction to %LinBox capabilities.
+- \subpage inst. Explains how to install from sources or from the latest cvs version.
+- \subpage arch. Describes how Givaro is organized
+- <a href="../givaro-html/index.html" style="color: blue ; font-weight: bold">
+Documentation for Users</a>. If everything around is blue, then you are reading
+the lighter, user-oriented, documentation.
+- <a href="../givaro-dev-html/index.html" style="color: green ; font-weight: bold">
+Documentation for Developers</a>. If everything around is green, then you can
+get to everything (not necessarily yet) documented.
+.
+\section contrib Contributing to Givaro, getting assistance.
+\version 3.3.5
+ */
+// vim:syn=doxygen
diff --git a/examples/FiniteField/ChineseRemaindering.C b/examples/FiniteField/ChineseRemaindering.C
deleted file mode 100644
index cc055a3..0000000
--- a/examples/FiniteField/ChineseRemaindering.C
+++ /dev/null
@@ -1,121 +0,0 @@
-#include <iostream>
-#include <givaro/givintprime.h>
-#include <givaro/givmontg32.h>
-#include <givaro/givzpz.h>
-#include <givaro/givgfq.h>
-#include <givaro/givcra.h> // Chinese Remainder of two elements
-#include <givaro/givrns.h> // Chinese Remainder of an array of elements
-#include <givaro/givtimer.h>
-#include <givaro/givrandom.h>
-
-
-typedef GFqDom<long> Field1;
-typedef ZpzDom<Std16> Field2;
-typedef ZpzDom<Log16> Field3;
-typedef ZpzDom<Std32> Field4;
-typedef ZpzDom<Std64> Field5;
-typedef ZpzDom<Unsigned32> Field6;
-typedef Montgomery<Std32> Field7;
-typedef ZpzDom<Integer> Field8;
-
-template <typename Field>
-Integer tmain(int argc, char ** argv, const GivRandom& generator) {
- typedef RNSsystem<Integer, Field > CRTSystem;
- typedef typename CRTSystem::domains Domains;
- typedef typename CRTSystem::array Elements;
- typedef typename CRTSystem::ring Ring;
-
- IntPrimeDom ID;
- Integer a( generator() >>(argc>2?atoi(argv[2]):17) ), M(1);
-
- Domains Primes( argc>1 ? atoi(argv[1]):15);
- Elements Moduli( Primes.size() );
-
- typename Domains::iterator i = Primes.begin();
- typename Elements::iterator e = Moduli.begin();
- for(; i != Primes.end(); ++i, ++e) {
- *i = Field( ID.nextprimein( a ) );
-// i->random( generator, *e );
- i->init(*e, generator() );
- M *= a;
- }
-
-
- CRTSystem CRT( Primes );
-
- Timer tim; tim.clear(); tim.start();
- CRT.RnsToRing( a, Moduli );
- tim.stop();
- Field().write( std::cerr << tim << " using ") << std::endl;
-
- if (Primes.size() < 50) {
- i = Primes.begin();
- e = Moduli.begin();
- for( ; i != Primes.end(); ++i, ++e)
- i->write(std::cout << a << " mod " << i->characteristic() << " = ", *e) << ";" << std::endl;
- }
-
-
- Elements Verifs( Primes.size() );
- CRT.RingToRns( Verifs, a );
- typename Elements::const_iterator v = Verifs.begin();
- i = Primes.begin();
- e = Moduli.begin();
- for( ; i != Primes.end(); ++i, ++e, ++v)
- if (! i->areEqual(*e, *v) ) {
- i->write( std::cerr << "incoherency within ") << std::endl;
- break;
- }
-
-
-
- Integer p( generator() >>(argc>2?atoi(argv[2]):17) ), res;
- Field F( ID.nextprimein(p) );
- typename Field::Element el;
- F.init(el, generator() );
-
- ChineseRemainder<IntPrimeDom, Field> CRA(ID, M, F);
- CRA( res, a, el);
-
- std::cout << res << " mod " << M << " = " << a << ";" << std::endl;
- std::cout << res << " mod " << F.characteristic() << " = " << F.convert(a, el) << ";" << std::endl;
-
-
- return res;
-}
-
-
-
-int main(int argc, char ** argv) {
- // argv[1] : number of primes
- // argv[2] : 2^{32-j} is size of primes
- // argv[3] : seed for generator
-
- GivRandom seedor( argc>3 ? atoi(argv[3]):1234 );
- unsigned long seed = seedor.seed();
-
-
- Integer a1 = tmain<Field1>(argc, argv, GivRandom(seed));
- Integer a2 = tmain<Field2>(argc, argv, GivRandom(seed));
- Integer a3 = tmain<Field3>(argc, argv, GivRandom(seed));
- Integer a4 = tmain<Field4>(argc, argv, GivRandom(seed));
- Integer a5 = tmain<Field5>(argc, argv, GivRandom(seed));
- Integer a6 = tmain<Field6>(argc, argv, GivRandom(seed));
- Integer a7 = tmain<Field7>(argc, argv, GivRandom(seed));
- Integer a8 = tmain<Field8>(argc, argv, GivRandom(seed));
-
- if (a1 != a2) std::cerr << "ERROR a1 != a2" << std::endl;
- if (a3 != a4) std::cerr << "ERROR a3 != a4" << std::endl;
- if (a6 != a5) std::cerr << "ERROR a5 != a6" << std::endl;
- if (a7 != a8) std::cerr << "ERROR a7 != a8" << std::endl;
- if (a1 != a3) std::cerr << "ERROR a1 != a3" << std::endl;
- if (a5 != a7) std::cerr << "ERROR a5 != a7" << std::endl;
- if (a1 != a5) std::cerr << "ERROR a1 != a5" << std::endl;
-
-
-
-
-
-
- return 0;
-}
diff --git a/examples/FiniteField/GF128.C b/examples/FiniteField/GF128.C
index af4db4c..a1cfa84 100644
--- a/examples/FiniteField/GF128.C
+++ b/examples/FiniteField/GF128.C
@@ -1,10 +1,26 @@
// ========================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Time-stamp: <21 Nov 07 11:34:43 Jean-Guillaume.Dumas at imag.fr>
// Thanks to Dieter Schuster
// ========================================================== //
+
+/*! @file examples/FiniteField/GF128.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/GF128.C
+ * @brief NO DOC
+ */
#include <givaro/givgfq.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
GFqDom<long> GF128(2, 7);
@@ -24,51 +40,51 @@ int main(int argc, char** argv)
GF128.init(f, P);
GF128.write(std::cout << "2-adic representation of 1+X is: ", f)
<< std::endl
- << " ... while its internal representation is: "
+ << " ... while its internal representation is: "
<< f << std::endl;
GF128.write(std::cout << "Indeed, we are in ") <<std::endl;
GF128.generator(gen);
- GF128.write(std::cout <<
+ GF128.write(std::cout <<
"In this field, the generator used is (in 2-adic): ", gen)
<< std::endl
- << " whose internal representation is "
+ << " whose internal representation is "
<< gen << std::endl;
Poly1PadicDom< GFqDom<long>, Dense > Padic2(Pol2);
- //
+ //
- std::cout << "Irreducible (in 2-adic): "
+ std::cout << "Irreducible (in 2-adic): "
<< GF128.irreducible() << std::endl;
GF128.init(g, Padic2.radix( Q, Integer(5) ));
- GF128.write(std::cout
- << "2-adic representation of 1+X^2 is: ", g)
+ GF128.write(std::cout
+ << "2-adic representation of 1+X^2 is: ", g)
<< std::endl;
GF128.init(h);
GF128.add(h, g, f);
- GF128.write(std::cout
- << "2-adic representation of X+X^2 is: ", h)
- << std::endl;
+ GF128.write(std::cout
+ << "2-adic representation of X+X^2 is: ", h)
+ << std::endl;
GF128.mul(h, g, f);
- GF128.write(std::cout
- << "2-adic representation of 1+X+X^2+X^3 is: ", h)
- << std::endl;
+ GF128.write(std::cout
+ << "2-adic representation of 1+X+X^2+X^3 is: ", h)
+ << std::endl;
GF128.div(h, g, f);
- GF128.write(std::cout
- << "2-adic representation of 1+X is: ", h)
+ GF128.write(std::cout
+ << "2-adic representation of 1+X is: ", h)
<< std::endl;
-
+
GF128.init(j, Padic2.radix( Q, Integer(213) ));
- GF128.write(std::cout
- << "2-adic representation of the moding out of X^7+X^6+X^4+X^2+1 by the irreducible is: ", j)
+ GF128.write(std::cout
+ << "2-adic representation of the moding out of X^7+X^6+X^4+X^2+1 by the irreducible is: ", j)
<< std::endl;
return 0;
-
+
}
diff --git a/examples/FiniteField/GFirreducible.C b/examples/FiniteField/GFirreducible.C
index 0abaee9..1acbbe3 100644
--- a/examples/FiniteField/GFirreducible.C
+++ b/examples/FiniteField/GFirreducible.C
@@ -1,11 +1,27 @@
// ========================================================== //
-// Time-stamp: <09 Apr 08 15:35:30 Jean-Guillaume.Dumas at imag.fr>
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <03 May 11 17:30:35 Jean-Guillaume.Dumas at imag.fr>
// Check of irreducible polynomial and generators of GFq
// ========================================================== //
+//
+/*! @file examples/FiniteField/GFirreducible.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/GFirreducible.C
+ * @brief NO DOC
+ */
#include <givaro/givgfq.h>
#include <givaro/givpower.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
@@ -15,53 +31,54 @@ int main(int argc, char** argv)
GFqDom<long> PrimeField(p,1);
std::cout << "Working in GF(" << p << '^' << e << ')' << std::endl;
std::cout << "Elements are polynomials in X modulo " << p << std::endl;
-
+
Poly1Dom< GFqDom<long>, Dense > Pdom( PrimeField, Indeter("X") );
-
+
// First get the irreducible polynomial irred
// via irred = X^e - mQ
// and X^e = X^(e-1) * X
GFqDom<long>::Element temo, t, tmp;
Poly1Dom< GFqDom<long>, Dense >::Element G, H, J, mQ, irred, modP;
-
+
Pdom.init(G, Degree(GFq.exponent()-1)); // X^(e-1)
GFq.init(temo,G); // internal representation
-
+
Pdom.init(H, Degree(1) ); // X
GFq.init(t,H); // internal representation
-
+
GFq.init(tmp);
GFq.mul(tmp, temo, t); // internal representation of X^e
- GFq.negin(tmp);
+ GFq.negin(tmp); // internal representation of -X^e, i.e. of the irreducible polynomial without the largest monomial, X^e
- long irreducible;
- GFq.convert(irreducible,tmp);
- std::cout << irreducible << std::endl;
-
- long ptoe = power(p,e);
-
- std::cout << "Computed irreducible: " << ptoe+irreducible << std::endl;
- std::cout << "Stored irreducible: " << GFq.irreducible() << std::endl;
-
+ long lowerpart;
+ // p-adic value of the lower part of the irreducible polynomial
+ GFq.convert(lowerpart, tmp);
+ std::cout << ' ' << p << "-adic value of the lower part of the irreducible : " << lowerpart << std::endl;
+ long ptoe = power(p,e); // p-adic value of X^e
+ std::cout << ' ' << p << '^' << e << " is : " << ptoe << std::endl;
+
+ std::cout << " --> Computed irreducible: " << ptoe+lowerpart << std::endl;
+ std::cout << "Stored irreducible: " << GFq.irreducible() << std::endl;
Poly1PadicDom< GFqDom<long>, Dense > PAD(Pdom);
- Poly1PadicDom< GFqDom<long>, Dense >::Element Polynomial, Generator;
-
+ Poly1PadicDom< GFqDom<long>, Dense >::Element Polynomial;
+
PAD.radix(Polynomial, GFq.irreducible());
+ std::cout << "Irreducible polynomial coefficients: ";
for(Poly1PadicDom< GFqDom<long>, Dense >::Element::iterator it = Polynomial.begin(); it != Polynomial.end(); ++it)
- std::cout << ' ' << *it;
+ PrimeField.write(std::cout << ' ', *it);
std::cout << std::endl;
-
-
- PAD.write(std::cout << "The latter represents: ", Polynomial)
- << " in p-adic"
+
+
+ PAD.write(std::cout << "The latter " << GFq.irreducible() << " represents: ", Polynomial)
+ << " in " << p << "-adic"
<< std::endl;
-
-
+
+
return 0;
-
+
}
diff --git a/examples/FiniteField/GaloisFields.C b/examples/FiniteField/GaloisFields.C
new file mode 100644
index 0000000..0711449
--- /dev/null
+++ b/examples/FiniteField/GaloisFields.C
@@ -0,0 +1,64 @@
+// Copyright(c)'1994-2011 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#include <iostream>
+#include <givaro/givgfq.h>
+#include <givaro/givextension.h>
+#include <givaro/givzpz64std.h>
+
+using namespace Givaro;
+
+int main (int argc, char * * argv) {
+ unsigned long q = (argc>1?atoi(argv[1]):13);
+ unsigned long expo = (argc>2?atoi(argv[2]):8);
+
+ {
+ // This is the field with 11^2=121 éléments
+ // Using a generator representation and tables
+ GFqDom<long> F1(11,2);
+ F1.write(std::cout << "This is the field with 121 elements: ") << std::endl;
+ }
+
+ {
+ // This is the field with q^expo éléments using the best
+ // possible base field
+
+ std::cout << "Exponent max for zech logs " << q << '^' << expo << " : " << FF_EXPONENT_MAX(q,expo) << std::endl;
+ std::cout << "NEED polynomial representation : " << NEED_POLYNOMIAL_REPRESENTATION(q,expo) << std::endl;
+
+ if ( NEED_POLYNOMIAL_REPRESENTATION(q,expo) ) {
+ // The template parameter if the type of the base field
+ // By default GFqDom<long> is used.
+ Extension<> Fqe(q, expo);
+ Fqe.write(std::cout << "This is the field with " << q << '^' << expo << " elements: ") << std::endl;
+ } else {
+ GFqDom<long> Fqe(q, expo);
+ Fqe.write(std::cout << "This is the field with " << q << '^' << expo << " elements: ") << std::endl;
+ }
+ }
+
+
+ // This is the field with 11^2=121 éléments
+ // Using a polynomial representation
+ {
+ GFqDom<long> F11(11);
+ Extension< GFqDom<long> > F121(F11, 2);
+ F121.write(std::cout << "This is the field with 121 elements: ") << std::endl;
+ }
+
+ // This is the field with 11^2=121 éléments
+ // Using a polynomial representation
+ // And an alternative field, works only with Givaro >= 3.5.0
+ {
+
+ ZpzDom<Std64> F11(11);
+ Extension< ZpzDom<Std64> > F121(F11, 2);
+ F121.write(std::cout << "This is the field with 121 elements: ") << std::endl;
+ }
+
+
+ return 0;
+}
diff --git a/examples/FiniteField/Makefile.am b/examples/FiniteField/Makefile.am
old mode 100644
new mode 100755
index 6874ff0..686384f
--- a/examples/FiniteField/Makefile.am
+++ b/examples/FiniteField/Makefile.am
@@ -1,6 +1,11 @@
-check: $(EXTRA_PROGRAMS)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
-INCLUDES=-I$(top_srcdir)
+AM_CPPFLAGS=-I$(top_srcdir)
OPTFLAGS=
OPTLINKS=
@@ -21,27 +26,31 @@ OPTLINKS=
#OPTFLAGS+= -parallel -par_report1
#OPTLINKS+= -parallel
# icc for itanium2
-#OPTFLAGS+= -tpp2 -mcpu=itanium2
+#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/library/tools
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS += $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/library/tools
-LDADD = $(OPTLINKS) -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+LDADD = $(OPTLINKS) -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS=-static
-EXTRA_PROGRAMS=gfq_atomic Test_Extension zpz_atomic ff_arith exponentiation domain_to_operatorstyle all_field ChineseRemaindering GF128 GFirreducible
+EXTRA_PROGRAMS=gfq_atomic GaloisFields Test_Extension zpz_atomic ff_arith exponentiation domain_to_operatorstyle all_field GF128 GFirreducible
+CLEANFILES=$(EXTRA_PROGRAMS)
-GFirreducible_SOURCES=GFirreducible.C
-GF128_SOURCES=GF128.C
-ChineseRemaindering_SOURCES=ChineseRemaindering.C
-domain_to_operatorstyle_SOURCES=domain_to_operatorstyle.C
-all_field_SOURCES=all_field.C
-gfq_atomic_SOURCES=gfq_atomic.C
-Test_Extension_SOURCES=Test_Extension.C
-zpz_atomic_SOURCES=zpz_atomic.C
-ff_arith_SOURCES=ff_arith.C
-exponentiation_SOURCES=exponentiation.C
+GFirreducible_SOURCES = GFirreducible.C
+GF128_SOURCES = GF128.C
+domain_to_operatorstyle_SOURCES = domain_to_operatorstyle.C
+all_field_SOURCES = all_field.C
+gfq_atomic_SOURCES = gfq_atomic.C
+GaloisFields_SOURCES = GaloisFields.C
+Test_Extension_SOURCES = Test_Extension.C
+zpz_atomic_SOURCES = zpz_atomic.C
+ff_arith_SOURCES = ff_arith.C
+exponentiation_SOURCES = exponentiation.C
# for compilation of new examples
GIVARO_BIN=@bindir@
%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+
diff --git a/examples/FiniteField/Makefile.in b/examples/FiniteField/Makefile.in
index 4fdacbc..94cd9be 100644
--- a/examples/FiniteField/Makefile.in
+++ b/examples/FiniteField/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -31,37 +32,43 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-EXTRA_PROGRAMS = gfq_atomic$(EXEEXT) Test_Extension$(EXEEXT) \
- zpz_atomic$(EXEEXT) ff_arith$(EXEEXT) exponentiation$(EXEEXT) \
- domain_to_operatorstyle$(EXEEXT) all_field$(EXEEXT) \
- ChineseRemaindering$(EXEEXT) GF128$(EXEEXT) \
- GFirreducible$(EXEEXT)
+EXTRA_PROGRAMS = gfq_atomic$(EXEEXT) GaloisFields$(EXEEXT) \
+ Test_Extension$(EXEEXT) zpz_atomic$(EXEEXT) ff_arith$(EXEEXT) \
+ exponentiation$(EXEEXT) domain_to_operatorstyle$(EXEEXT) \
+ all_field$(EXEEXT) GF128$(EXEEXT) GFirreducible$(EXEEXT)
subdir = examples/FiniteField
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-am_ChineseRemaindering_OBJECTS = ChineseRemaindering.$(OBJEXT)
-ChineseRemaindering_OBJECTS = $(am_ChineseRemaindering_OBJECTS)
-ChineseRemaindering_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
-ChineseRemaindering_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
am_GF128_OBJECTS = GF128.$(OBJEXT)
GF128_OBJECTS = $(am_GF128_OBJECTS)
GF128_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
GF128_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_GFirreducible_OBJECTS = GFirreducible.$(OBJEXT)
GFirreducible_OBJECTS = $(am_GFirreducible_OBJECTS)
GFirreducible_LDADD = $(LDADD)
GFirreducible_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
+am_GaloisFields_OBJECTS = GaloisFields.$(OBJEXT)
+GaloisFields_OBJECTS = $(am_GaloisFields_OBJECTS)
+GaloisFields_LDADD = $(LDADD)
+GaloisFields_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
am_Test_Extension_OBJECTS = Test_Extension.$(OBJEXT)
Test_Extension_OBJECTS = $(am_Test_Extension_OBJECTS)
Test_Extension_LDADD = $(LDADD)
@@ -96,8 +103,8 @@ zpz_atomic_OBJECTS = $(am_zpz_atomic_OBJECTS)
zpz_atomic_LDADD = $(LDADD)
zpz_atomic_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -107,13 +114,13 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(ChineseRemaindering_SOURCES) $(GF128_SOURCES) \
- $(GFirreducible_SOURCES) $(Test_Extension_SOURCES) \
+SOURCES = $(GF128_SOURCES) $(GFirreducible_SOURCES) \
+ $(GaloisFields_SOURCES) $(Test_Extension_SOURCES) \
$(all_field_SOURCES) $(domain_to_operatorstyle_SOURCES) \
$(exponentiation_SOURCES) $(ff_arith_SOURCES) \
$(gfq_atomic_SOURCES) $(zpz_atomic_SOURCES)
-DIST_SOURCES = $(ChineseRemaindering_SOURCES) $(GF128_SOURCES) \
- $(GFirreducible_SOURCES) $(Test_Extension_SOURCES) \
+DIST_SOURCES = $(GF128_SOURCES) $(GFirreducible_SOURCES) \
+ $(GaloisFields_SOURCES) $(Test_Extension_SOURCES) \
$(all_field_SOURCES) $(domain_to_operatorstyle_SOURCES) \
$(exponentiation_SOURCES) $(ff_arith_SOURCES) \
$(gfq_atomic_SOURCES) $(zpz_atomic_SOURCES)
@@ -128,26 +135,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -157,40 +165,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -230,9 +248,17 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) $(OPTFLAGS) $(GMP_CFLAGS) \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/zpz \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/library/poly1 \
+ -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/library/tools
OPTFLAGS =
OPTLINKS =
@@ -252,15 +278,17 @@ OPTLINKS =
#OPTFLAGS+= -parallel -par_report1
#OPTLINKS+= -parallel
# icc for itanium2
-#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/library/tools
-LDADD = $(OPTLINKS) -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+#OPTFLAGS+= -tpp2 -mcpu=itanium2
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+LDADD = $(OPTLINKS) -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS = -static
+CLEANFILES = $(EXTRA_PROGRAMS)
GFirreducible_SOURCES = GFirreducible.C
GF128_SOURCES = GF128.C
-ChineseRemaindering_SOURCES = ChineseRemaindering.C
domain_to_operatorstyle_SOURCES = domain_to_operatorstyle.C
all_field_SOURCES = all_field.C
gfq_atomic_SOURCES = gfq_atomic.C
+GaloisFields_SOURCES = GaloisFields.C
Test_Extension_SOURCES = Test_Extension.C
zpz_atomic_SOURCES = zpz_atomic.C
ff_arith_SOURCES = ff_arith.C
@@ -276,14 +304,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/FiniteField/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps examples/FiniteField/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu examples/FiniteField/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps examples/FiniteField/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -301,15 +329,15 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-ChineseRemaindering$(EXEEXT): $(ChineseRemaindering_OBJECTS) $(ChineseRemaindering_DEPENDENCIES)
- @rm -f ChineseRemaindering$(EXEEXT)
- $(CXXLINK) $(ChineseRemaindering_OBJECTS) $(ChineseRemaindering_LDADD) $(LIBS)
GF128$(EXEEXT): $(GF128_OBJECTS) $(GF128_DEPENDENCIES)
@rm -f GF128$(EXEEXT)
$(CXXLINK) $(GF128_OBJECTS) $(GF128_LDADD) $(LIBS)
GFirreducible$(EXEEXT): $(GFirreducible_OBJECTS) $(GFirreducible_DEPENDENCIES)
@rm -f GFirreducible$(EXEEXT)
$(CXXLINK) $(GFirreducible_OBJECTS) $(GFirreducible_LDADD) $(LIBS)
+GaloisFields$(EXEEXT): $(GaloisFields_OBJECTS) $(GaloisFields_DEPENDENCIES)
+ @rm -f GaloisFields$(EXEEXT)
+ $(CXXLINK) $(GaloisFields_OBJECTS) $(GaloisFields_LDADD) $(LIBS)
Test_Extension$(EXEEXT): $(Test_Extension_OBJECTS) $(Test_Extension_DEPENDENCIES)
@rm -f Test_Extension$(EXEEXT)
$(CXXLINK) $(Test_Extension_OBJECTS) $(Test_Extension_LDADD) $(LIBS)
@@ -338,37 +366,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChineseRemaindering.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GF128.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GFirreducible.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Test_Extension.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/all_field.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/domain_to_operatorstyle.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/exponentiation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ff_arith.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gfq_atomic.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zpz_atomic.Po at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -381,7 +386,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -470,6 +475,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -482,7 +488,6 @@ clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -493,6 +498,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -501,22 +508,31 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -550,9 +566,15 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
-check: $(EXTRA_PROGRAMS)
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
# 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/examples/FiniteField/Test_Extension.C b/examples/FiniteField/Test_Extension.C
index d5743d5..f75f420 100644
--- a/examples/FiniteField/Test_Extension.C
+++ b/examples/FiniteField/Test_Extension.C
@@ -1,7 +1,23 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/FiniteField/Test_Extension.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/Test_Extension.C
+ * @brief NO DOC
+ */
+
using namespace std;
#include "givaro/givpoly1.h"
#include "givaro/givextension.h"
+using namespace Givaro;
+
+
+
template<class FField>
void FaireEssai(const FField & F) {
@@ -10,20 +26,20 @@ void FaireEssai(const FField & F) {
typename FField::Element a, b, r;
- std::cout << "Enter an Element of this field: "; F.read( std::cin , a );
+ std::cout << "Enter an Element of this field: "; F.read( std::cin , a );
// F.init( a, "1+3*X+5*X^2" );
F.init( b, (Integer)23 );
F.add(r, a, b);
- F.write( F.write( F.write( F.write(std::cout, a) << " + " , b ) << " = " , r) << " with ") << endl ;
+ F.write( F.write( F.write( F.write(std::cout, a) << " + " , b ) << " = " , r) << " with ") << endl ;
}
int main (int argc, char * * argv) {
-
+
unsigned long q = (argc>1?atoi(argv[1]):13);
unsigned long expo = (argc>2?atoi(argv[2]):8);
@@ -37,7 +53,7 @@ int main (int argc, char * * argv) {
FaireEssai( Extension<>(q, expo) );
else
FaireEssai( GFqDom<long>(q, expo) );
-
-
+
+
return 0;
}
diff --git a/examples/FiniteField/all_field.C b/examples/FiniteField/all_field.C
index 1309de9..158a9bd 100644
--- a/examples/FiniteField/all_field.C
+++ b/examples/FiniteField/all_field.C
@@ -1,9 +1,25 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/FiniteField/all_field.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/all_field.C
+ * @brief NO DOC
+ */
+
#include <iostream>
-#include <givaro/givzpz32uns.h>
#include <givaro/givgfq.h>
#include <givaro/givmontg32.h>
-#include <givaro/givzpzInt.h>
-#include "StaticElement.h"
+#include <givaro/givzpz.h>
+#include <givaro/StaticElement.h>
+
+using namespace Givaro;
+
+
// Domain kind
typedef ZpzDom<Unsigned32> Field1; typedef StaticElement< Field1 > Element1; template<> Field1 Element1::_domain(2);
@@ -20,32 +36,33 @@ typedef ZpzDom<Std64> Field8; typedef StaticElement< Field8 > Element8; templa
template<class Field, class Element>
-void TestField() {
+void TestField()
+{
unsigned long P = 251;
// Initialization of static member
- Element::setDomain( Field(P) );
+ Element::setDomain( Field( typename Field::Element(P)) );
// Initialisations of elements
Element a(2),b(-29.8),c(33),d(Integer("123456789012345678901234567890")),e(0);
-
+
e += (a = b); std::cout << a << " = " << b << " mod " << P << ";" << std::endl;
e += (a = b + c); std::cout << a << " = " << b << " + " << c << " mod " << P << ";" << std::endl;
e += (a = b - c); std::cout << a << " = " << b << " - " << c << " mod " << P << ";" << std::endl;
e += (a = b * c); std::cout << a << " = " << b << " * " << c << " mod " << P << ";" << std::endl;
e += (a = b / c); std::cout << a << " = " << b << " / " << c << " mod " << P << ";" << std::endl;
-
+
std::cout << d << " + " << a << " mod " << P << " = "; e += (d += a); std::cout << d << ";" << std::endl;
std::cout << d << " - " << a << " mod " << P << " = "; e += (d -= a); std::cout << d << ";" << std::endl;
std::cout << d << " * " << a << " mod " << P << " = "; e += (d *= a); std::cout << d << ";" << std::endl;
std::cout << d << " / " << a << " mod " << P << " = "; e += (d /= a); std::cout << d << ";" << std::endl;
-
+
std::cout << a << " is non zero ? " << (a != Element(0) ) << std::endl;
- a = 0; std::cout << a << " is zero ? " << (a == Element(0) ) << std::endl;
+ a = 0; std::cout << a << " is zero ? " << (a == Element(0) ) << std::endl;
- double dd(0.0); dd += (double)(e); dd += (float)e; dd += (unsigned int)e;
+ double dd(0.0); dd += (double)(e); dd += (float)e; dd += (unsigned int)e;
Element::getDomain().write( std::cerr << "Test: " << dd << " within ") << std::endl;
}
@@ -61,7 +78,7 @@ int main(int argc, char ** argv) {
TestField<Field6, Element6>();
TestField<Field7, Element7>();
#ifdef GIVARO_USE_SIXTYFOUR
- TestField<Field8, Element8>();
+ TestField<Field8, Element8>();
#endif
return 0;
diff --git a/examples/FiniteField/domain_to_operatorstyle.C b/examples/FiniteField/domain_to_operatorstyle.C
index cd04711..2fce98f 100644
--- a/examples/FiniteField/domain_to_operatorstyle.C
+++ b/examples/FiniteField/domain_to_operatorstyle.C
@@ -1,7 +1,24 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/FiniteField/domain_to_operatorstyle.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/domain_to_operatorstyle.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <givaro/givgfq.h>
#include <givaro/StaticElement.h>
+using namespace Givaro;
+
+
+
// Finite Field with Domain style
typedef GFqDom<long> Field;
@@ -29,23 +46,23 @@ int main(int argc, char ** argv) {
a = b * c; std::cerr << a << " = " << b << " * " << c << " mod " << P << ";" << std::endl;
a = b / c; std::cerr << a << " = " << b << " / " << c << " mod " << P << ";" << std::endl;
- // Computations in place
- std::cerr << d << " + " << a << " mod " << P << " = ";
+ // Computations in place
+ std::cerr << d << " + " << a << " mod " << P << " = ";
d += a; std::cerr << d << ";" << std::endl;
- std::cerr << d << " - " << a << " mod " << P << " = ";
+ std::cerr << d << " - " << a << " mod " << P << " = ";
d -= a; std::cerr << d << ";" << std::endl;
- std::cerr << d << " * " << a << " mod " << P << " = ";
+ std::cerr << d << " * " << a << " mod " << P << " = ";
d *= a; std::cerr << d << ";" << std::endl;
- std::cerr << d << " / " << a << " mod " << P << " = ";
+ std::cerr << d << " / " << a << " mod " << P << " = ";
d /= a; std::cerr << d << ";" << std::endl;
-
+
// Tests
std::cerr << a << " is non zero is " << (a != Element(0) ) << std::endl;
- a = 0; std::cerr << a << " is zero is " << (a == Element(0) ) << std::endl;
+ a = 0; std::cerr << a << " is zero is " << (a == Element(0) ) << std::endl;
// Access to Field object
diff --git a/examples/FiniteField/exponentiation.C b/examples/FiniteField/exponentiation.C
index 3f8232d..a2ef967 100644
--- a/examples/FiniteField/exponentiation.C
+++ b/examples/FiniteField/exponentiation.C
@@ -1,8 +1,25 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/FiniteField/exponentiation.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/exponentation.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <givaro/givpower.h>
#include <givaro/givzpz.h>
#include <givaro/givgfq.h>
+using namespace Givaro;
+
+
+
int main(int argc, char ** argv) {
{
@@ -11,14 +28,14 @@ int main(int argc, char ** argv) {
Z13.init(a, 7);
long l = 29;
- dom_power(c, a, l, Z13); // c = 7^29 modulo 13 by squaring
-
- std::cerr << "Within ";
+ dom_power(c, a, l, Z13); // c = 7^29 modulo 13 by squaring
+
+ std::cerr << "Within ";
Z13.write( std::cerr );
std::cerr << " : " << std::flush;
// Separate output writing
- Z13.write( std::cout, a) << " ^ " << l << " = " << std::flush;
+ Z13.write( std::cout, a) << " ^ " << l << " = " << std::flush;
Z13.write( std::cerr, c) << std::endl;
}
@@ -28,17 +45,17 @@ int main(int argc, char ** argv) {
GFqDom<int> GF13( Mod, exponent ); // finite field with 13 elements
GFqDom<int>::Element a, c;
- GF13.init(a, 7); // 7 modulo 13
+ GF13.init(a, 7); // 7 modulo 13
long l = 29;
- dom_power(c, a, l, GF13); // c = 7^29 modulo 13 by squaring
+ dom_power(c, a, l, GF13); // c = 7^29 modulo 13 by squaring
// Writing all outputs in a single command line
GF13.write( std::cerr << "Within " ) << " : " << std::flush;
- GF13.write( GF13.write(
+ GF13.write( GF13.write(
std::cout, a) << " ^ " << l << " = ", c) << std::endl;
- }
+ }
return 0;
}
diff --git a/examples/FiniteField/ff_arith.C b/examples/FiniteField/ff_arith.C
index 0d44471..ceb71c6 100644
--- a/examples/FiniteField/ff_arith.C
+++ b/examples/FiniteField/ff_arith.C
@@ -1,3 +1,16 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/FiniteField/ff_arith.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/ff_arith.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <givaro/givzpz64std.h>
#include <givaro/givzpz.h>
@@ -5,9 +18,13 @@
#include <givaro/givmontg32.h>
#include <givaro/givgfqext.h>
+using namespace Givaro;
+
+
+
template<class Field>
void TestField(const Field& F) {
- std::cerr << "Within " ;
+ std::cerr << "Within " ;
F.write(std::cerr );
std::cerr << " : " << std::flush;
@@ -17,14 +34,14 @@ void TestField(const Field& F) {
F.init(c); // empty constructor
F.init(d); // empty constructor
-
+
F.add(c, a, b); // c = a+b
-
+
// Separate output writing
- F.write( std::cout, a) << " + " << std::flush;
- F.write( std::cout, b) << " = " << std::flush;
+ F.write( std::cout, a) << " + " << std::flush;
+ F.write( std::cout, b) << " = " << std::flush;
F.write( std::cerr, c) << std::endl;
-
+
F.mul(c, a, b); // c = a*b
F.axpy(d, a, b, c); // d = a*b + c;
@@ -34,6 +51,51 @@ void TestField(const Field& F) {
F.write( F.write( F.write( F.write(
std::cout, c) << " + ", a) << " * ", b) << " = ", d) << std::endl;
+ {
+ typename Field::Element e;
+ F.init(e); F.assign(e,d);
+ F.maxpy(e, a, b, d); // e = d-a*b
+
+ // Writing all outputs in a single command line
+ F.write( std::cerr << "Within " ) << " : " << std::flush;
+ F.write( F.write( F.write( F.write(
+ std::cout, d) << " - ", a) << " * ", b) << " = ", e) << std::endl;
+ }
+
+ {
+ typename Field::Element e;
+ F.init(e); F.assign(e,d);
+ F.maxpyin(e, a, b); // e = d - a*b;
+
+ // Writing all outputs in a single command line
+ F.write( std::cerr << "Within " ) << " : " << std::flush;
+ F.write( F.write( F.write( F.write(
+ std::cout, d) << " - ", a) << " * ", b) << " = ", e) << std::endl;
+ }
+
+ {
+ typename Field::Element e;
+ F.init(e); F.assign(e,d);
+ F.axmy(e, a, b, d); // e = a*b -d;
+
+ // Writing all outputs in a single command line
+ F.write( std::cerr << "Within " ) << " : " << std::flush;
+ F.write( F.write( F.write( F.write(
+ std::cout, a) << " * ", b) << " - ", d) << " = ", e) << std::endl;
+ }
+
+ {
+ typename Field::Element e;
+ F.init(e); F.assign(e,d);
+ F.maxpyin(e, a, b); // e = d - a*b;
+
+ // Writing all outputs in a single command line
+ F.write( std::cerr << "Within " ) << " : " << std::flush;
+ F.write( F.write( F.write( F.write(
+ std::cout, d) << " - ", a) << " * ", b) << " = ", e) << std::endl;
+ }
+
+
// Four operations
F.write( F.write( std::cout, a) << " += ", b) << " is " ;
@@ -71,7 +133,7 @@ void TestField(const Field& F) {
F.write( std::cout, a) << std::endl;
F.mulin(a,b);
F.write( std::cout << "1 is ", a) << std::endl;
-
+
}
extern "C" {
@@ -84,7 +146,7 @@ int main(int argc, char ** argv) {
// modulo 13 over 16 bits
ZpzDom<Std16> C13(13); TestField( C13 );
-
+
// modulo 13 over 32 bits
ZpzDom<Std32> Z13(13); TestField( Z13 );
@@ -102,25 +164,25 @@ int main(int argc, char ** argv) {
// modulo 13 over 32 bits with Montgomery reduction
Montgomery<Std32> M13(13); TestField( M13 );
Montgomery<Std32> M3(39989); TestField( M3 );
-
+
// modulo 13 with primitive root representation
GFqDom<int> GF13( 13 ); TestField( GF13 );
-
+
// modulo 13 over arbitrary size
ZpzDom<Integer> IntZ13(13); TestField( IntZ13 );
// Zech log finite field with 5^4 elements
GFqDom<int> GF625( 5, 4 ); TestField( GF625 );
-
+
// Zech log finite field with 3^4 elements
// Using the Q-adic Transform
GFqExt<int> GF81( 3, 4 ); TestField( GF81 );
-
+
// Zech log finite field with 2Mb tables
- struct rusage tmp1 ;
+ struct rusage tmp1 ;
getrusage (RUSAGE_SELF, &tmp1) ;
// user time
- double tim = (double) tmp1.ru_utime.tv_sec + ((double) tmp1.ru_utime.tv_usec)/ ( 1000000.0 ) ;
+ double tim = (double) tmp1.ru_utime.tv_sec + ((double) tmp1.ru_utime.tv_usec)/ ( 1000000.0 ) ;
;
#ifndef __GIVARO__DONOTUSE_longlong__
GFqDom<long long> GF2M( 2, (argc > 1 ? atoi(argv[1]) : 20) );
diff --git a/examples/FiniteField/gfq_atomic.C b/examples/FiniteField/gfq_atomic.C
index e90cf79..eedb36f 100644
--- a/examples/FiniteField/gfq_atomic.C
+++ b/examples/FiniteField/gfq_atomic.C
@@ -1,9 +1,25 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/FiniteField/gfq_atomic.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/gfq_atomic.C
+ * @brief NO DOC
+ */
#include <stdio.h>
#include <stdlib.h>
#include <givaro/givtimer.h>
#include <givaro/givrandom.h>
#include <givaro/givgfq.h>
+using namespace Givaro;
+
+
+
#ifndef GIVMIN
#define GIVMIN(a,b) (((a)<(b))?(a):(b))
#endif
@@ -19,131 +35,134 @@ typedef GFqDom<long>::Element Modulo;
#define TAILLE 256
#endif
-int main(int argc, char ** argv) {
-
- GivRandom generator;
- long P (65521); // argv[1] : characteristic
- long expo(1); // argv[2] : exponent
- int offset = 0;
- if (argc > ++offset) P = atoi( argv[ offset ] );
- if (argc > ++offset) expo = atoi( argv[ offset ] );
-
- Timer inver;
- inver.clear();
- inver.start();
- Domain GFq(P, expo); // Buiding of finite field with P^expo Elements
-
- int i;
- std::cout << "."<< std::flush;
-
- Modulo z1, z2, z23, z3;
-
-// long seuil = GIVMIN(P*2,TAILLE);
-
- std::cout << "."<< std::flush;
-
- GFq.random(generator,z1) ;
- GFq.nonzerorandom(generator,z2) ;
- GFq.random(generator,z23) ;
-
- std::cout << "."<< std::flush;
- inver.stop();
-
- std::cout << "Init et Tableaux des modulo " << P << " :\n" << inver << std::endl << std::flush;
-
- double coef = (double)NB*TAILLE / 1e6;
-
- int k;
- Timer tim;tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.mul(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Mul: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.add(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.axpyin(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd IN place: " << 2*coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.axpy(z3, z1, z2, z23);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.sub(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-/*
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.div(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Div: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-*/
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.neg(z3, z1);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Neg: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- GFq.random(generator,z1) ;
- GFq.nonzerorandom(generator,z2) ;
- GFq.random(generator,z23) ;
-
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.add(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.sub(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.axpyin(z3, z1, z2);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd IN place: " << 2*coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.axpy(z3, z1, z2, z23);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- tim.clear();tim.start();
- for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
- GFq.neg(z3, z1);
- tim.stop();
- std::cout << NB << " * " << TAILLE << " Neg: " << coef / tim.usertime()
- << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-
- return 0;
+int main(int argc, char ** argv)
+{
+
+ GivRandom generator;
+ long P (65521); // argv[1] : characteristic
+ long expo(1); // argv[2] : exponent
+ int offset = 0;
+ if (argc > ++offset) P = atoi( argv[ offset ] );
+ if (argc > ++offset) expo = atoi( argv[ offset ] );
+
+ Timer inver;
+ inver.clear();
+ inver.start();
+ Domain GFq(P, expo); // Buiding of finite field with P^expo Elements
+
+ int i;
+ std::cout << "."<< std::flush;
+
+ Modulo z1, z2, z23, z3;
+
+ // long seuil = GIVMIN(P*2,TAILLE);
+
+ std::cout << "."<< std::flush;
+
+ GFq.random(generator,z1) ;
+ GFq.nonzerorandom(generator,z2) ;
+ GFq.random(generator,z23) ;
+
+ std::cout << "."<< std::flush;
+ inver.stop();
+
+ std::cout << "Init et Tableaux des modulo " << P << " :\n" << inver << std::endl << std::flush;
+
+ double coef = (double)NB*TAILLE / 1e6;
+
+ int k;
+ Timer tim;tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.mul(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Mul: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.add(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.axpyin(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " MulAdd IN place: " << 2*coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.axpy(z3, z1, z2, z23);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.sub(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+ /*
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.div(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Div: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+ */
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.neg(z3, z1);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Neg: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ GFq.random(generator,z1) ;
+ GFq.nonzerorandom(generator,z2) ;
+ GFq.random(generator,z23) ;
+
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.add(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.sub(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.axpyin(z3, z1, z2);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " MulAdd IN place: " << 2*coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.axpy(z3, z1, z2, z23);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ tim.clear();tim.start();
+ for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
+ GFq.neg(z3, z1);
+ tim.stop();
+ std::cout << NB << " * " << TAILLE << " Neg: " << coef / tim.usertime()
+ << "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
+
+ return 0;
}
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/examples/FiniteField/zpz_atomic.C b/examples/FiniteField/zpz_atomic.C
index 9415e0e..d9f673c 100644
--- a/examples/FiniteField/zpz_atomic.C
+++ b/examples/FiniteField/zpz_atomic.C
@@ -1,9 +1,25 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/FiniteField/zpz_atomic.C
+ * @ingroup examples
+ * @ingroup finitefields
+ * @example examples/FiniteField/zpz_atomic.C
+ * @brief NO DOC
+ */
#include <stdio.h>
#include <stdlib.h>
#include <givaro/givtimer.h>
#include <givaro/givrandom.h>
#include <givaro/givzpz.h>
+using namespace Givaro;
+
+
+
#ifndef GIVMIN
#define GIVMIN(a,b) (((a)<(b))?(a):(b))
#endif
@@ -18,31 +34,32 @@ typedef Domain::Element Modulo;
#define TAILLE 256
#endif
-int main(int argc, char ** argv) {
+int main(int argc, char ** argv)
+{
GivRandom generator;
long P (32749); // argv[1] : Modulus
- // int TAILLE (256); // argv[2] : Vector size
+ // int TAILLE (256); // argv[2] : Vector size
// long NB (500000); // argv[3] : Number of iterations
int offset = 0;
if (argc > ++offset) P = atoi( argv[ offset ] );
// if (argc > ++offset) TAILLE = atoi( argv[ offset ] );
// if (argc > ++offset) NB = atoi( argv[ offset ] );
-
+
Timer inver;
inver.clear();
inver.start();
- Domain GFq(P);
-
+ Domain GFq((Domain::Element)P);
+
int i;
std::cout << "."<< std::flush;
Modulo z1, z2, z23, z3;
-
+
// long seuil = GIVMIN(P*2,TAILLE);
-
+
std::cout << "."<< std::flush;
-
+
GFq.random(generator,z1) ;
GFq.nonzerorandom(generator,z2) ;
GFq.random(generator,z23) ;
@@ -59,50 +76,50 @@ int main(int argc, char ** argv) {
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.mul(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Mul: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Mul: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.add(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.axpyin(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd IN place: " << 2*coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " MulAdd IN place: " << 2*coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.axpy(z3, z1, z2, z23);
tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.sub(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-/*
+#if 0
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.div(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Div: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Div: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
-*/
+#endif
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.neg(z3, z1);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Neg: " << (coef / tim.usertime())
+ std::cout << NB << " * " << TAILLE << " Neg: " << (coef / tim.usertime())
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
GFq.random(generator,z1) ;
@@ -114,14 +131,14 @@ int main(int argc, char ** argv) {
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.add(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Add: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.sub(z3, z1, z2);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Sub: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
@@ -135,16 +152,19 @@ int main(int argc, char ** argv) {
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.axpy(z3, z1, z2, z23);
tim.stop();
- std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " MulAdd: " << 2*coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
tim.clear();tim.start();
for (k=0; k<NB; ++k) for(i=0; i<TAILLE; ++i)
GFq.neg(z3, z1);
tim.stop();
- std::cout << NB << " * " << TAILLE << " Neg: " << coef / tim.usertime()
+ std::cout << NB << " * " << TAILLE << " Neg: " << coef / tim.usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
return 0;
}
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen:foldmethod=syntax
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
diff --git a/examples/Integer/Makefile.am b/examples/Integer/Makefile.am
old mode 100644
new mode 100755
index ffc6a68..92ca5b9
--- a/examples/Integer/Makefile.am
+++ b/examples/Integer/Makefile.am
@@ -1,5 +1,10 @@
-check: $(EXTRA_PROGRAMS)
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
+AM_CPPFLAGS=-I$(top_srcdir)
#OPTFLAGS = -O7 -funroll-all-loops -felide-constructors -fstrict-aliasing
#OPTFLAGS+= -frerun-loop-opt -fexpensive-optimizations
@@ -18,41 +23,44 @@ INCLUDES=-I$(top_srcdir)
#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS)
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS += $(OPTFLAGS) $(GMP_CFLAGS)
AM_CPPFLAGS += -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/bstruct
-LDADD = -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+LDADD = -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS=-static
EXTRA_PROGRAMS=ifactor ifactor_lenstra igcd igcdext ilcm isproot nb_primes isprime nextprime order prevprime RSA_breaking RSA_keys_generator primitiveroot primitiveelement phi lambda lambda_inv iexponentiation RSA_decipher RSA_encipher ispower probable_primroot ProbLucas ModularSquareRoot
-ModularSquareRoot_SOURCES=ModularSquareRoot.C
-ProbLucas_SOURCES=ProbLucas.C
-probable_primroot_SOURCES=probable_primroot.C
-ispower_SOURCES=ispower.C
-ifactor_SOURCES = ifactor.C
-ifactor_lenstra_SOURCES = ifactor_lenstra.C
-igcd_SOURCES = igcd.C
-lambda_SOURCES = lambda.C
-lambda_inv_SOURCES = lambda_inv.C
-phi_SOURCES = phi.C
-igcdext_SOURCES = igcdext.C
-ilcm_SOURCES = ilcm.C
-isproot_SOURCES = isproot.C
-primitiveroot_SOURCES = primitiveroot.C
-primitiveelement_SOURCES = primitiveelement.C
-nb_primes_SOURCES = nb_primes.C
-isprime_SOURCES = isprime.C
-nextprime_SOURCES = nextprime.C
-order_SOURCES = order.C
-prevprime_SOURCES = prevprime.C
-RSA_breaking_SOURCES = RSA_breaking.C
+CLEANFILES=$(EXTRA_PROGRAMS)
+
+ModularSquareRoot_SOURCES = ModularSquareRoot.C
+ProbLucas_SOURCES = ProbLucas.C
+probable_primroot_SOURCES = probable_primroot.C
+ispower_SOURCES = ispower.C
+ifactor_SOURCES = ifactor.C
+ifactor_lenstra_SOURCES = ifactor_lenstra.C
+igcd_SOURCES = igcd.C
+lambda_SOURCES = lambda.C
+lambda_inv_SOURCES = lambda_inv.C
+phi_SOURCES = phi.C
+igcdext_SOURCES = igcdext.C
+ilcm_SOURCES = ilcm.C
+isproot_SOURCES = isproot.C
+primitiveroot_SOURCES = primitiveroot.C
+primitiveelement_SOURCES = primitiveelement.C
+nb_primes_SOURCES = nb_primes.C
+isprime_SOURCES = isprime.C
+nextprime_SOURCES = nextprime.C
+order_SOURCES = order.C
+prevprime_SOURCES = prevprime.C
+RSA_breaking_SOURCES = RSA_breaking.C
RSA_keys_generator_SOURCES = RSA_keys_generator.C
-RSA_encipher_SOURCES = RSA_encipher.C
-RSA_decipher_SOURCES = RSA_decipher.C
-iexponentiation_SOURCES = iexponentiation.C
+RSA_encipher_SOURCES = RSA_encipher.C
+RSA_decipher_SOURCES = RSA_decipher.C
+iexponentiation_SOURCES = iexponentiation.C
# for compilation of new examples
GIVARO_BIN=@bindir@
%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
-
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
diff --git a/examples/Integer/Makefile.in b/examples/Integer/Makefile.in
index 7e7de2c..d85fcc6 100644
--- a/examples/Integer/Makefile.in
+++ b/examples/Integer/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -46,7 +47,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -154,8 +162,8 @@ probable_primroot_OBJECTS = $(am_probable_primroot_OBJECTS)
probable_primroot_LDADD = $(LDADD)
probable_primroot_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -198,26 +206,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -227,40 +236,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -300,9 +319,15 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) $(OPTFLAGS) $(GMP_CFLAGS) \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/kernel/zpz \
+ -I$(top_srcdir)/src/kernel/bstruct
#OPTFLAGS = -O7 -funroll-all-loops -felide-constructors -fstrict-aliasing
#OPTFLAGS+= -frerun-loop-opt -fexpensive-optimizations
@@ -319,13 +344,10 @@ INCLUDES = -I$(top_srcdir)
#OPTFLAGS+= -parallel -par_report1
# icc for itanium2
#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS) \
- -I$(top_srcdir)/src/kernel/system \
- -I$(top_srcdir)/src/kernel/memory \
- -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
- -I$(top_srcdir)/src/kernel/zpz \
- -I$(top_srcdir)/src/kernel/bstruct
-LDADD = -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+LDADD = -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS = -static
+CLEANFILES = $(EXTRA_PROGRAMS)
ModularSquareRoot_SOURCES = ModularSquareRoot.C
ProbLucas_SOURCES = ProbLucas.C
probable_primroot_SOURCES = probable_primroot.C
@@ -362,14 +384,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Integer/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps examples/Integer/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu examples/Integer/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps examples/Integer/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -469,52 +491,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ModularSquareRoot.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ProbLucas.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RSA_breaking.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RSA_decipher.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RSA_encipher.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RSA_keys_generator.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/iexponentiation.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ifactor.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ifactor_lenstra.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/igcd.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/igcdext.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ilcm.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ispower.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isprime.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isproot.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lambda.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lambda_inv.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nb_primes.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nextprime.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/order.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/phi.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/prevprime.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/primitiveelement.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/primitiveroot.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/probable_primroot.Po at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -527,7 +511,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -616,6 +600,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -628,7 +613,6 @@ clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -639,6 +623,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -647,22 +633,31 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -696,9 +691,15 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
-check: $(EXTRA_PROGRAMS)
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
# 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/examples/Integer/ModularSquareRoot.C b/examples/Integer/ModularSquareRoot.C
index 378530c..5ed3b51 100644
--- a/examples/Integer/ModularSquareRoot.C
+++ b/examples/Integer/ModularSquareRoot.C
@@ -1,55 +1,49 @@
+// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <11 Dec 09 21:07:13 Jean-Guillaume.Dumas at imag.fr>
+// Givaro : Modular square roots
+// =================================================================== //
+
+/*! @file examples/Integer/ModularSquareRoot.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ModularSquareRoot.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <stdlib.h>
-#include <givaro/givintprime.h>
-#include <givaro/givrandom.h>
+#include <givaro/givintsqrootmod.h>
#include <givaro/givtimer.h>
-// Algorithm 3.34 (Square Root Mod p) of
+using namespace Givaro;
+
+
+
+// Algorithm 3.34 (Square Root Mod p) of
// Handbook of Applied Cryptography
// by Menezes, van Oorschot, Vanstone
int main(int argc, char** argv)
{
- Integer a(argv[1]), p(argv[2]);
- std::cerr << "p: " << p << std::endl;
+ Integer a(argv[1]), n(argv[2]);
+ std::cerr << "n: " << n << std::endl;
std::cerr << "a: " << a << std::endl;
- if ( legendre( a , p ) == -1 )
- std::cerr << "Not a quadratic residue" << std::endl;
- else {
- Timer chrono; chrono.start();
-
- Integer t(p-1);
- size_t s=0;
- for( ; ((t>>1)<<1) == t ; ++s) t>>=1;
-
- size_t l=(size_t)ceil(logtwo(p));
-
- Integer::seeding( BaseTimer::seed() );
- Integer b;
- while ( legendre( Integer::random(b,l), p ) != -1 ) ;
-
- Integer inva; inv(inva, a, p);
-
- Integer c; powmod(c, b, t, p);
- Integer r; powmod(r, a, (t+1)>>1, p);
-
- for(size_t i=1; i<s; ++i) {
- Integer d(r);
- d *= d; d %= p;
- d *= inva; d %= p;
- powmod(d, d, 1<<(s-i-1), p);
- if (d == p-1) {
- r *= c; r %= p;
- }
- c *= c ; c %= p;
- }
- chrono.stop();
-
- std::cout << r << std::endl;
- std::cerr << chrono << std::endl;
-
- std::cerr << "Check, " << r << "^2 mod " << p << " = " << ( (r*r)%p) << std::endl;
- }
-
+
+ Integer::seeding (BaseTimer::seed ());
+ IntSqrtModDom<> ISM;
+
+ Integer r;
+ Timer chrono; chrono.start();
+ ISM.sqrootmod(r,a,n);
+ chrono.stop();
+ std::cout << r << std::endl;
+ std::cerr << chrono << std::endl;
+
+ std::cerr << "Check, (" << r << ")^2 mod " << n << " = " << ( (r*r)%n) << std::endl;
+
return 0;
}
diff --git a/examples/Integer/ProbLucas.C b/examples/Integer/ProbLucas.C
index 07d29ba..f65ca19 100644
--- a/examples/Integer/ProbLucas.C
+++ b/examples/Integer/ProbLucas.C
@@ -1,12 +1,22 @@
-///////////////////////////////////////////////////////////////////////////////
-//////// Primality check using Probabilistic Lucas /////////////////////////
-//////// i.e. Primitive Root with choosen probability /////////////////////////
-///////////////////////////////////////////////////////////////////////////////
// =================================================================== //
-// Jack Dubrois < Jacques.Dubrois at imag.fr>
-// Time-stamp: <11 Oct 04 13:42:42 Jean-Guillaume.Dumas at imag.fr>
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Contributor: Jack Dubrois < Jacques.Dubrois at imag.fr>
+// Time-stamp: <11 Oct 04 13:42:42 Jean-Guillaume.Dumas at imag.fr>
+//
+// Primality check using Probabilistic Lucas /////////////////////////
+// i.e. Primitive Root with choosen probability /////////////////////////
// =================================================================== //
+/*! @file examples/Integer/ProbLucas.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ProbLucas.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <fstream>
#include <stdlib.h>
@@ -24,6 +34,10 @@ using namespace std;
#include <givaro/givinteger.h>
+using namespace Givaro;
+
+
+
IntFactorDom<> IP;
@@ -39,33 +53,33 @@ IntFactorDom<> IP;
Integer& MyPollard(GivRandom& gen, Integer& g, const Integer& n, const unsigned long threshold)
{
- g=1;
- Integer m(0UL), x, y, t;
-static Integer PROD_first_primes(223092870);
-static Integer PROD_second_primes("10334565887047481278774629361");
-if (isOne(gcd(y,n,PROD_first_primes))) {
- if (isOne(gcd(y,n,PROD_second_primes))) {
-
- IP.random(gen, y, n);
- unsigned long p(1);
- for(unsigned long c = 0; isOne(g) && (++c < threshold); ) {
- if( p == c ) {
- x=y;
- p <<= 1;
- }
- // Pollard fctin
- IP.mulin(y,y);
- IP.addin(y,1UL);
- IP.modin(y,n);
- gcd(g,IP.sub(t,y,x),n);
- }
- return g;
- } else {
- return ProbLucas_factor_second_primes(g,n);
- }
-} else {
- return ProbLucas_factor_first_primes(g,n);
-}
+ g=1;
+ Integer m(0UL), x, y, t;
+ static Integer PROD_first_primes(223092870);
+ static Integer PROD_second_primes("10334565887047481278774629361");
+ if (isOne(gcd(y,n,PROD_first_primes))) {
+ if (isOne(gcd(y,n,PROD_second_primes))) {
+
+ IP.random(gen, y, n);
+ unsigned long p(1);
+ for(unsigned long c = 0; isOne(g) && (++c < threshold); ) {
+ if( p == c ) {
+ x=y;
+ p <<= 1;
+ }
+ // Pollard fctin
+ IP.mulin(y,y);
+ IP.addin(y,1UL);
+ IP.modin(y,n);
+ gcd(g,IP.sub(t,y,x),n);
+ }
+ return g;
+ } else {
+ return ProbLucas_factor_second_primes(g,n);
+ }
+ } else {
+ return ProbLucas_factor_first_primes(g,n);
+ }
}
@@ -75,174 +89,181 @@ if (isOne(gcd(y,n,PROD_first_primes))) {
-unsigned long Revert(const Integer p, const double epsilon, double firstguess) {
- unsigned long L;
- double t1,t3, t4, t5, t7, t8, t9, t11, t12, t18, t22, t23, t34(firstguess), dL;
- t1 = (double)p-1.0;
- t4 = 2.0/t1+1.0;
- t8 = logtwo(p)*log(2.0)-log(2.0); // log( p/2 )
- do {
-// std::cerr << "dL: " << t34 << std::endl;
- dL = t34;
- t3 = 1.0/dL;
- t5 = t3*t3;
- t7 = 1.0-t5;
- t9 = 2.0*log(dL);
- t11 = t8/t9;
- t12 = ::pow(t7,t11);
- t18 = t9*t9;
- t22 = log(t7);
- t23 = (-t8/t18*t3*t22+t11*t5*t3/t7);
- t34 = dL-( 1.0 - (1.0-epsilon)/(t4*t12))/(2.0*t23);
- } while( (GIVABSDIV(t34,dL) < 0.95) && (dL<1048576.0) );
- return L = (unsigned long)GIVMIN(dL,1048576.0);
+unsigned long Revert(const Integer p, const double epsilon, double firstguess)
+{
+ unsigned long L;
+ double t1,t3, t4, t5, t7, t8, t9, t11, t12, t18, t22, t23, t34(firstguess), dL;
+ t1 = (double)p-1.0;
+ t4 = 2.0/t1+1.0;
+ t8 = logtwo(p)*log(2.0)-log(2.0); // log( p/2 )
+ do {
+ // std::cerr << "dL: " << t34 << std::endl;
+ dL = t34;
+ t3 = 1.0/dL;
+ t5 = t3*t3;
+ t7 = 1.0-t5;
+ t9 = 2.0*log(dL);
+ t11 = t8/t9;
+ t12 = ::pow(t7,t11);
+ t18 = t9*t9;
+ t22 = log(t7);
+ t23 = (-t8/t18*t3*t22+t11*t5*t3/t7);
+ t34 = dL-( 1.0 - (1.0-epsilon)/(t4*t12))/(2.0*t23);
+ } while( (GIVABSDIV(t34,dL) < 0.95) && (dL<1048576.0) );
+ return L = (unsigned long)GIVMIN(dL,1048576.0);
}
-unsigned long Revert(const Integer p, const double epsilon) {
- return Revert(p, epsilon, ::sqrt(1.2/epsilon));
-}
+unsigned long Revert(const Integer p, const double epsilon)
+{
+ return Revert(p, epsilon, ::sqrt(1.2/epsilon));
+}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////// Recherche de la racine primitive ///////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ProbLucas(const Integer n, const double orig_epsilon)
-{
+{
#ifdef __GMP_PLUSPLUS__
- Integer::seeding( BaseTimer::seed() );
+ Integer::seeding( BaseTimer::seed() );
#endif
- GivRandom generator;
-
- Integer Q=n-1,a,q,tmp(1);
- Integer nmu=Q;
-
- double P = 1.0;
- double epsilon = orig_epsilon;
-
- // Miller-Rabin
- unsigned long s=0;
- for( ; !( (int)Q & 0x1) ; Q>>=1, ++s) { }
- for(unsigned int i=0; ; ) {
- IP.random(generator,a,n);
- IP.powmod(tmp,a,Q,n);
- if (tmp!=1) {
- if (tmp != nmu) {
- for(i=s; (--i>0);) {
- tmp *= tmp;
- tmp %= n;
- if ((tmp == 1) || (tmp == nmu)) break;
- }
- if (tmp != nmu) return 0;
- if (i == 0) break;
- } else {
- if (s == 1) break;
- }
- }
- epsilon *= 4.0;
- P /= 2.0;
- }
-
- unsigned long L = Revert(Q,epsilon);
- Integer trn, r, b, expo; root( trn, n, 3); trn *= trn;
- q = 2;
- expo = nmu;
- MyPollard(generator, q, Q, L);
- if (q == 1) {
- q = Q;
- expo = nmu; expo /= q;
- IP.random(generator, a, n);
- IP.powmod(tmp,a,expo,n);
- if (tmp == 1) {
- P /= (double)(q);
- if (P < epsilon) {
- std::cerr << "Composite with probability > 1-" << P << std::endl;
- return 0;
- }
- }
- Q = 1;
- } else {
- expo = nmu; expo /= q;
- r=0;
- Integer::divexact(b, Q, q);
- while( isZero(r) ) {
- Q.copy(b);
- Integer::divmod( b, r, Q, q );
- }
- L = Revert(Q,epsilon, (double)L);
- }
-
- while ( Q > trn ) {
-
- IP.random(generator, a, n);
- IP.powmod(tmp,a,expo,n);
- if (tmp == 1) {
- P /= (double)(q);
- if (P < epsilon) {
- std::cerr << "Composite with probability > 1-" << P << std::endl;
- return 0;
- }
- } else {
- if (IP.gcd(q,(tmp-1UL),n) != 1) {
- std::cerr << "Factor found : " << q << std::endl;
- return 0;
- }
- MyPollard(generator, q, Q, L);
- if (q == 1) {
- q = Q;
- expo = nmu; expo /= q;
- IP.random(generator, a, n);
- IP.powmod(tmp,a,expo,n);
- if (tmp == 1) {
- P /= (double)(q);
- if (P < epsilon) {
- std::cerr << "Composite with probability > 1-" << P << std::endl;
- return 0;
- }
- }
- break;
- } else {
- expo = nmu; expo /= q;
- r=0;
- Integer::divexact(b, Q, q);
- while( isZero(r) ) {
- Q.copy(b);
- Integer::divmod( b, r, Q, q );
- }
- L = Revert(Q,epsilon, (double)L);
- }
- }
- }
- if (! IP.isprime(q))
- std::cerr << "Prime with probability > 1-" << orig_epsilon << std::endl;
- return 1;
+ GivRandom generator;
+
+ Integer Q=n-1,a,q,tmp(1);
+ Integer nmu=Q;
+
+ double P = 1.0;
+ double epsilon = orig_epsilon;
+
+ // Miller-Rabin
+ unsigned long s=0;
+ for( ; !( (int)Q & 0x1) ; Q>>=1, ++s) { }
+ for(unsigned int i=0; ; ) {
+ IP.random(generator,a,n);
+ IP.powmod(tmp,a,Q,n);
+ if (tmp!=1) {
+ if (tmp != nmu) {
+ for(i=(unsigned int) s; --i>0;) {
+ tmp *= tmp;
+ tmp %= n;
+ if ((tmp == 1) || (tmp == nmu))
+ break;
+ }
+ if (tmp != nmu)
+ return 0;
+ if (i == 0)
+ break;
+ }
+ else {
+ if (s == 1) break;
+ }
+ }
+ epsilon *= 4.0;
+ P /= 2.0;
+ }
+
+ unsigned long L = Revert(Q,epsilon);
+ Integer trn, r, b, expo; root( trn, n, 3); trn *= trn;
+ q = 2;
+ expo = nmu;
+ MyPollard(generator, q, Q, L);
+ if (q == 1) {
+ q = Q;
+ expo = nmu; expo /= q;
+ IP.random(generator, a, n);
+ IP.powmod(tmp,a,expo,n);
+ if (tmp == 1) {
+ P /= (double)(q);
+ if (P < epsilon) {
+ std::cerr << "Composite with probability > 1-" << P << std::endl;
+ return 0;
+ }
+ }
+ Q = 1;
+ } else {
+ expo = nmu; expo /= q;
+ r=0;
+ Integer::divexact(b, Q, q);
+ while( isZero(r) ) {
+ Q.copy(b);
+ Integer::divmod( b, r, Q, q );
+ }
+ L = Revert(Q,epsilon, (double)L);
+ }
+
+ while ( Q > trn ) {
+
+ IP.random(generator, a, n);
+ IP.powmod(tmp,a,expo,n);
+ if (tmp == 1) {
+ P /= (double)(q);
+ if (P < epsilon) {
+ std::cerr << "Composite with probability > 1-" << P << std::endl;
+ return 0;
+ }
+ } else {
+ if (IP.gcd(q,(tmp-1UL),n) != 1) {
+ std::cerr << "Factor found : " << q << std::endl;
+ return 0;
+ }
+ MyPollard(generator, q, Q, L);
+ if (q == 1) {
+ q = Q;
+ expo = nmu; expo /= q;
+ IP.random(generator, a, n);
+ IP.powmod(tmp,a,expo,n);
+ if (tmp == 1) {
+ P /= (double)(q);
+ if (P < epsilon) {
+ std::cerr << "Composite with probability > 1-" << P << std::endl;
+ return 0;
+ }
+ }
+ break;
+ } else {
+ expo = nmu; expo /= q;
+ r=0;
+ Integer::divexact(b, Q, q);
+ while( isZero(r) ) {
+ Q.copy(b);
+ Integer::divmod( b, r, Q, q );
+ }
+ L = Revert(Q,epsilon, (double)L);
+ }
+ }
+ }
+ if (! IP.isprime(q))
+ std::cerr << "Prime with probability > 1-" << orig_epsilon << std::endl;
+ return 1;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main (int argc, char * * argv)
{
- Integer P;
- if (argc > 1) P = Integer(argv[1]); else std::cin >> P;
- double epsilon = argc > 2 ? atof(argv[2]) : 0.000001;
- unsigned int NB = argc > 3 ? atoi(argv[3]) : 1;
-
-// std::cerr << "P: " << P << " ; proba: " << epsilon << std::endl;
-
- bool a1(true);
- Timer tim; tim.clear();
- for(unsigned int i = 0; i < NB; ++i) {
- Timer tt; tt.clear(); tt.start();
- a1 = ProbLucas(P, epsilon);
- tt.stop();
-// std::cout << a1 << std::endl;
-// std::cerr << tt << std::endl;
- tim += tt;
- }
- std::cout << (a1?"prime":"composite") << endl;
- std::cerr << tim << std::endl;
- return 0;
+ Integer P;
+ if (argc > 1) P = Integer(argv[1]); else std::cin >> P;
+ double epsilon = argc > 2 ? atof(argv[2]) : 0.000001;
+ unsigned int NB = argc > 3 ? atoi(argv[3]) : 1;
+
+ // std::cerr << "P: " << P << " ; proba: " << epsilon << std::endl;
+
+ bool a1(true);
+ Timer tim; tim.clear();
+ for(unsigned int i = 0; i < NB; ++i) {
+ Timer tt; tt.clear(); tt.start();
+ a1 = ProbLucas(P, epsilon);
+ tt.stop();
+ // std::cout << a1 << std::endl;
+ // std::cerr << tt << std::endl;
+ tim += tt;
+ }
+ std::cout << (a1?"prime":"composite") << endl;
+ std::cerr << tim << std::endl;
+ return 0;
}
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/examples/Integer/RSA_breaking.C b/examples/Integer/RSA_breaking.C
index dcfede9..61d3282 100644
--- a/examples/Integer/RSA_breaking.C
+++ b/examples/Integer/RSA_breaking.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/RSA_breaking.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/RSA_breaking.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#define GIVARO_LENSTRA
@@ -5,27 +17,31 @@ using namespace std;
#include "givaro/givtimer.h"
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
Timer tim;
tim.clear();
-
+
IntRSADom<>::Element m,k,u;
if (argc > 1)
m = IntRSADom<>::Element( argv[1] );
- else
+ else
cin >> m;
if (argc > 2)
k = IntRSADom<>::Element( argv[2] );
- else
+ else
cin >> k;
-
+
IntRSADom<> IR(m,k);
tim.start();
IR.point_break(u);
tim.stop();
-
+
/* For a factored output :
IR.write( cerr << "m=pq: ", IR.getm()) ;
@@ -35,7 +51,7 @@ int main(int argc, char** argv)
*/
// Unfactored output
- cerr << "m=pq: " << IR.getm() << ", cipher k: " << IR.getk() << " ----> decipering key: ";
+ cerr << "n=pq: " << IR.getn() << ", cipher key: " << IR.gete() << " ----> decipering key: ";
cout << u << endl;
diff --git a/examples/Integer/RSA_decipher.C b/examples/Integer/RSA_decipher.C
index f16ded3..1c2ec2d 100644
--- a/examples/Integer/RSA_decipher.C
+++ b/examples/Integer/RSA_decipher.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/RSA_decipher.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/RSA_decipher.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <fstream>
#include "givaro/givintrsa.h"
@@ -7,39 +19,47 @@
// RSA, in CBC mode, deciphering of files
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
Timer tim;
tim.clear();
-
- IntRSADom<GivRandom>::Rep m,k,u;
+
+ IntRSADom<GivRandom>::Rep n,e,d;
if (argc > 3)
- m = Integer( argv[3] );
- else
- std::cin >> m;
+ n = Integer( argv[3] );
+ else
+ std::cin >> e;
if (argc > 4)
- k = Integer( argv[4] );
- else
- std::cin >> k;
+ e = Integer( argv[4] );
+ else
+ std::cin >> e;
if (argc > 5)
- u = Integer( argv[5] );
- else
- std::cin >> u;
-
- IntRSADom<GivRandom> IR(m,k,u);
+ d = Integer( argv[5] );
+ else
+ std::cin >> d;
+
+ IntRSADom<GivRandom> IR(n,e,d);
- tim.start();
std::ifstream TXT(argv[1]);
+ if (!TXT) { std::cerr << "Error opening input file: " << argv[1] << std::endl; return -1; }
std::ofstream OUT(argv[2]);
+ if (!OUT) { std::cerr << "Error opening output file: " << argv[2] << std::endl; return -1; }
+
+
+ tim.start();
IR.decipher( OUT, TXT );
OUT.close();
TXT.close();
tim.stop();
std::cerr << tim << std::endl;
-
-
+
+
return 0;
}
diff --git a/examples/Integer/RSA_encipher.C b/examples/Integer/RSA_encipher.C
index 734d710..8b16870 100644
--- a/examples/Integer/RSA_encipher.C
+++ b/examples/Integer/RSA_encipher.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/RSA_encipher.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/RSA_encipher.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <fstream>
#include "givaro/givintrsa.h"
@@ -6,35 +18,41 @@
// RSA, in CBC mode, enciphering of files
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
Timer tim;
tim.clear();
-
- IntRSADom<GivRandom>::Rep m,k;
+
+ IntRSADom<GivRandom>::Rep n,e;
if (argc > 3)
- m = Integer( argv[3] );
- else
- std::cin >> m;
+ n = Integer( argv[3] );
+ else
+ std::cin >> n;
if (argc > 4)
- k = Integer( argv[4] );
- else
- std::cin >> k;
-
- IntRSADom<GivRandom> IR(m,k);
+ e = Integer( argv[4] );
+ else
+ std::cin >> e;
+
+ IntRSADom<GivRandom> IR(n,e);
- tim.start();
std::ifstream TXT(argv[1]);
+ if (!TXT) { std::cerr << "Error opening input file: " << argv[1] << std::endl; return -1; }
std::ofstream OUT(argv[2]);
- IR.encipher( OUT, TXT );
+ if (!OUT) { std::cerr << "Error opening output file: " << argv[2] << std::endl; return -1; }
+ tim.start();
+ IR.encipher( OUT, TXT );
OUT.close();
TXT.close();
tim.stop();
std::cerr << tim << std::endl;
-
-
+
+
return 0;
}
diff --git a/examples/Integer/RSA_keys_generator.C b/examples/Integer/RSA_keys_generator.C
index 7c690b3..c3183c3 100644
--- a/examples/Integer/RSA_keys_generator.C
+++ b/examples/Integer/RSA_keys_generator.C
@@ -1,34 +1,50 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/RSA_keys_generator.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/RSA_keys_generator.C
+ * @brief NO DOC
+ */
#include <iostream>
#include "givaro/givintrsa.h"
#include "givaro/givrandom.h"
#include "givaro/givtimer.h"
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
Timer tim;
tim.clear();
-
+
// m will be p times q
// Sizes are in number of int to compose the big integer
long keysize;
if (argc > 1)
keysize = atoi( argv[1] );
- else
+ else
std::cin >> keysize;
GivRandom generator;
- IntRSADom<GivRandom>::Rep m,k,u;
+ Integer::seeding(generator.seed());
tim.start();
IntRSADom<GivRandom> IR(keysize,true,generator);
tim.stop();
-
- std::cout << IR.getm() << " " << IR.getk() << " " << IR.getu() << std::endl;
+
+ std::cout << IR.getn() << " " << IR.gete() << " " << IR.getd() << std::endl;
std::cerr << tim << std::endl;
-
+
return 0;
}
diff --git a/examples/Integer/iexponentiation.C b/examples/Integer/iexponentiation.C
index e9e6440..a8145ae 100644
--- a/examples/Integer/iexponentiation.C
+++ b/examples/Integer/iexponentiation.C
@@ -1,8 +1,23 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/iexponentiation.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/iexponentiation.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givzpz.h>
#include <givaro/givpower.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
// Modular exponentiation
// argv[1] : a
// argv[2] : e
@@ -12,7 +27,7 @@ int main(int argc, char ** argv) {
{
ZpzDom<Integer>::Element a, b, p(argv[3]);
- ZpzDom<Integer> Zp( p );
+ ZpzDom<Integer> Zp( p );
unsigned long e = atoi(argv[2]) ;
Zp.init(a, Integer(argv[1]));
Zp.init(b);
@@ -21,14 +36,14 @@ int main(int argc, char ** argv) {
dom_power(b, a, e, Zp);
tim.stop();
- Zp.write( std::cout, a) << " ^ " << e << " % " << p << " = " << std::flush;
+ Zp.write( std::cout, a) << " ^ " << e << " % " << p << " = " << std::flush;
Zp.write( std::cerr, b) << std::endl;
std::cerr << tim << std::endl;
-
+
}
-
-
+
+
return 0;
diff --git a/examples/Integer/ifactor.C b/examples/Integer/ifactor.C
index e777336..859ecd7 100644
--- a/examples/Integer/ifactor.C
+++ b/examples/Integer/ifactor.C
@@ -1,9 +1,25 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/ifactor.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ifactor.C
+ * @brief NO DOC
+ */
#include <iostream>
-using namespace std;
+
#include <givaro/givinit.h>
#include <givaro/givintfactor.h>
#include <givaro/givtimer.h>
+using namespace std;
+using namespace Givaro;
+
+
int main(int argc, char** argv)
{
@@ -16,7 +32,7 @@ int main(int argc, char** argv)
if (IP.islt(m,0) ) {
cerr << "-";
IP.negin(m);
- }
+ }
if (IP.islt(m,4))
IP.write(cerr,m) << endl;
else {
@@ -27,4 +43,3 @@ int main(int argc, char** argv)
}
return 0;
}
-
diff --git a/examples/Integer/ifactor_lenstra.C b/examples/Integer/ifactor_lenstra.C
index 44158bb..e7606bc 100644
--- a/examples/Integer/ifactor_lenstra.C
+++ b/examples/Integer/ifactor_lenstra.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/ifactor_lenstra.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ifactor_lenstra.C
+ * @brief NO DOC
+ */
#define GIVARO_LENSTRA
#include <iostream>
using namespace std;
@@ -7,6 +19,10 @@ using namespace std;
#include <givaro/givintfactor.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
IntFactorDom<> IP;
@@ -22,7 +38,7 @@ int main(int argc, char** argv)
if (IP.islt(m,0) ) {
cerr << "-";
IP.negin(m);
- }
+ }
if (IP.islt(m,4))
IP.write(cerr,m) << endl;
else {
diff --git a/examples/Integer/igcd.C b/examples/Integer/igcd.C
index a1c1d83..b6bdda5 100644
--- a/examples/Integer/igcd.C
+++ b/examples/Integer/igcd.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/igcd.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/igcd.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
@@ -6,6 +18,10 @@ using namespace std;
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
@@ -17,14 +33,14 @@ int main(int argc, char** argv)
int offset = 0;
if (argc > ++offset) a = Integer(argv[offset]); else cin >> a;
if (argc > ++offset) b = Integer(argv[offset]); else cin >> b;
-
+
Timer tim; tim.clear(); tim.start();
IP.gcd(GG,a,b);
for ( ; argc > ++offset; ) {
a = Integer(argv[offset]);
IP.gcd(g, GG, a);
GG = g;
- }
+ }
tim.stop();
cout << GG << endl;
cerr << tim << endl;
diff --git a/examples/Integer/igcdext.C b/examples/Integer/igcdext.C
index 728d1b5..416111b 100644
--- a/examples/Integer/igcdext.C
+++ b/examples/Integer/igcdext.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/igcdext.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/igcdext.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
@@ -6,6 +18,10 @@ using namespace std;
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
@@ -16,7 +32,7 @@ int main(int argc, char** argv)
IntegerDom::Element g,a,b,u,v;
if (argc > 1) a = Integer(argv[1]); else cin >> a;
if (argc > 2) b = Integer(argv[2]); else cin >> b;
-
+
Timer tim; tim.clear(); tim.start();
IP.gcd(g,u,v,a,b);
tim.stop();
diff --git a/examples/Integer/ilcm.C b/examples/Integer/ilcm.C
index 253c860..8e2bdf0 100644
--- a/examples/Integer/ilcm.C
+++ b/examples/Integer/ilcm.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/ilcm.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ilcm.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
@@ -6,6 +18,10 @@ using namespace std;
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
@@ -17,7 +33,7 @@ int main(int argc, char** argv)
int offset = 0;
if (argc > ++offset) a = Integer(argv[offset]); else cin >> a;
if (argc > ++offset) b = Integer(argv[offset]); else cin >> b;
-
+
Timer tim; tim.clear(); tim.start();
IP.gcd(g,a,b);
IP.mul(CM, a, b);
@@ -27,7 +43,7 @@ int main(int argc, char** argv)
IP.gcd(g, CM, c);
IP.divin(CM, g);
IP.mulin(CM, c);
- }
+ }
tim.stop();
cout << CM << endl;
cerr << "gcd+mul: " << tim << endl;
@@ -40,7 +56,7 @@ int main(int argc, char** argv)
// cerr << "lcm(" << c << "," << CM << ") = " ;
IP.lcmin(CM, c);
// cerr << CM << endl;
- }
+ }
tim.stop();
cout << CM << endl;
cerr << "lcm: " << tim << endl;
diff --git a/examples/Integer/ispower.C b/examples/Integer/ispower.C
index bc67cb3..d8da725 100644
--- a/examples/Integer/ispower.C
+++ b/examples/Integer/ispower.C
@@ -1,16 +1,32 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/ispower.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ispower.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <stdlib.h>
#include <givaro/givinteger.h>
#include <givaro/givintprime.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
Integer m, p;
if (argc > 1) m = Integer(argv[1]);
IntPrimeDom IP;
-
+
{
Timer tim; tim.clear(); tim.start();
int a = isperfectpower(m);
diff --git a/examples/Integer/isprime.C b/examples/Integer/isprime.C
index d2b03de..cf0a073 100644
--- a/examples/Integer/isprime.C
+++ b/examples/Integer/isprime.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/ispower.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/isprime.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
@@ -5,6 +17,10 @@ using namespace std;
#include <givaro/givtimer.h>
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
@@ -12,11 +28,11 @@ int main(int argc, char** argv)
// Givaro::Init(&argc, &argv);
- IntPrimeDom IP;
+ IntPrimeDom IP;
IntPrimeDom::Element m;
if (argc > 1) m = Integer(argv[1]);
unsigned int r = argc > 2 ? atoi(argv[2]) : 5;
-
+
Timer tim; tim.clear(); tim.start();
bool a = IP.isprime(m,r);
tim.stop();
diff --git a/examples/Integer/isproot.C b/examples/Integer/isproot.C
index 373049b..e58bbc7 100644
--- a/examples/Integer/isproot.C
+++ b/examples/Integer/isproot.C
@@ -1,7 +1,23 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/isproot.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/isproot.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
//----------------------------------------------------------
// Deterministic, non-polynomial (factor b-1 for the order),
// test for primitive roots.
@@ -13,7 +29,7 @@ int main(int argc, char** argv)
IntNumTheoDom<>::Element a,b;
if (argc > 1) a = Integer(argv[1]); else std::cin >> a;
if (argc > 2) b = Integer(argv[2]); else std::cin >> b;
-
+
Timer tim; tim.clear(); tim.start();
bool f = IP.is_prim_root(a,b);
tim.stop();
diff --git a/examples/Integer/lambda.C b/examples/Integer/lambda.C
index 2da09f2..ea444ef 100644
--- a/examples/Integer/lambda.C
+++ b/examples/Integer/lambda.C
@@ -1,7 +1,23 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/lambda.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/lambda.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
// Lambda function : order of a primitive Element
// (Element of maximal orbit size)
//
@@ -11,7 +27,7 @@ int main(int argc, char** argv)
IntNumTheoDom<> IP;
IntNumTheoDom<>::Element a,pr;
if (argc > 1) a = IntNumTheoDom<>::Element(argv[1]); else std::cin >> a;
-
+
Timer tim; tim.clear(); tim.start();
IP.lambda(pr, a);
tim.stop();
diff --git a/examples/Integer/lambda_inv.C b/examples/Integer/lambda_inv.C
index f7722be..d196e6a 100644
--- a/examples/Integer/lambda_inv.C
+++ b/examples/Integer/lambda_inv.C
@@ -1,7 +1,23 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/lambda_inv.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/lambda_inv.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
// Lambda function : order of a primitive invertible
// (invertible Element of maximal orbit size)
//
@@ -12,7 +28,7 @@ int main(int argc, char** argv)
IntNumTheoDom<> IP;
IntNumTheoDom<>::Element a,pr;
if (argc > 1) a = IntNumTheoDom<>::Element(argv[1]); else std::cin >> a;
-
+
Timer tim; tim.clear(); tim.start();
IP.lambda_inv(pr, a);
tim.stop();
diff --git a/examples/Integer/nb_primes.C b/examples/Integer/nb_primes.C
index 98191a3..343da7e 100644
--- a/examples/Integer/nb_primes.C
+++ b/examples/Integer/nb_primes.C
@@ -1,8 +1,24 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/nb_primes.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/nb_primes.C
+ * @brief NO DOC
+ */
#include <iostream>
#include "givaro/givintprime.h"
#include "givaro/givtimer.h"
+using namespace Givaro;
+
+
+
inline Integer GIVMAX(const Integer& a, const Integer& b) { return (a<b?b:a); }
int main(int argc, char** argv)
@@ -18,13 +34,13 @@ int main(int argc, char** argv)
else
m = 2;
Integer nf = m;
- unsigned long long nb = (IPD.isprime(m)?1:0);
+ unsigned long long nb = (IPD.isprime(m)?1:0);
Timer tim; tim.clear(); tim.start();
for (;m < np; tp *= 2) {
std::cout << nb << " primes between " << nf << " and " << m << "\t\t == nextprime(" << (ttp+nf-1) << ")" << std::endl; ttp = tp;
- for (;(m < np) && (m < (nf+tp)); ++nb)
+ for (;(m < np) && (m < (nf+tp)); ++nb)
IPD.nextprimein(m);
- }
+ }
tim.stop();
std::cout << (m>np?nb-1:nb) << " primes between " << nf << " and " << np << std::endl << tim << std::endl;
return 0;
diff --git a/examples/Integer/nextprime.C b/examples/Integer/nextprime.C
index 6ed38a7..53e289f 100644
--- a/examples/Integer/nextprime.C
+++ b/examples/Integer/nextprime.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/nextprime.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/nextprime.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
@@ -6,6 +18,10 @@ using namespace std;
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
@@ -16,7 +32,7 @@ int main(int argc, char** argv)
IntPrimeDom::Element m, ff;
if (argc > 1) m = Integer(argv[1]);
else std::cin >> m;
-
+
Timer tim; tim.clear(); tim.start();
IP.nextprimein(m,1);
tim.stop();
diff --git a/examples/Integer/order.C b/examples/Integer/order.C
index d4547dc..c09ac03 100644
--- a/examples/Integer/order.C
+++ b/examples/Integer/order.C
@@ -1,12 +1,27 @@
// ========================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Time-stamp: <04 Sep 02 18:10:22 Jean-Guillaume.Dumas at imag.fr>
// ========================================================== //
+/*! @file examples/Integer/order.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/order.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
int main(int argc, char ** argv)
{
diff --git a/examples/Integer/phi.C b/examples/Integer/phi.C
index 772f5d0..15259e9 100644
--- a/examples/Integer/phi.C
+++ b/examples/Integer/phi.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/phi.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/phi.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
@@ -5,12 +17,16 @@
// Euler's phi function (totient)
//
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
IntNumTheoDom<> IP;
IntNumTheoDom<>::Element a,pr;
if (argc > 1) a = IntNumTheoDom<>::Element(argv[1]); else std::cin >> a;
-
+
Timer tim; tim.clear(); tim.start();
IP.phi(pr, a);
tim.stop();
diff --git a/examples/Integer/prevprime.C b/examples/Integer/prevprime.C
index cb26d30..54bf03b 100644
--- a/examples/Integer/prevprime.C
+++ b/examples/Integer/prevprime.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/prevprime.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/prevprime.C
+ * @brief NO DOC
+ */
#include <iostream>
using namespace std;
#include <stdlib.h>
@@ -6,6 +18,10 @@ using namespace std;
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
@@ -15,7 +31,7 @@ int main(int argc, char** argv)
IntPrimeDom IP;
IntPrimeDom::Element m, ff;
if (argc > 1) m = Integer(argv[1]);
- else std::cin >> m;
+ else std::cin >> m;
Timer tim; tim.clear(); tim.start();
IP.prevprimein(m);
tim.stop();
diff --git a/examples/Integer/primitiveelement.C b/examples/Integer/primitiveelement.C
index ce32f1f..2ba8ccd 100644
--- a/examples/Integer/primitiveelement.C
+++ b/examples/Integer/primitiveelement.C
@@ -1,15 +1,31 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/primitiveelement.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/primitiveelement.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
IntNumTheoDom<> IP;
IntNumTheoDom<>::Element a,pr;
if (argc > 1) a = IntNumTheoDom<>::Element(argv[1]); else std::cin >> a;
-
+
Timer tim; tim.clear(); tim.start();
IP.prim_elem(pr, a);
tim.stop();
diff --git a/examples/Integer/primitiveroot.C b/examples/Integer/primitiveroot.C
index 49a6e29..75fddf4 100644
--- a/examples/Integer/primitiveroot.C
+++ b/examples/Integer/primitiveroot.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/primitiveroot.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/primitiveroot.C
+ * @brief NO DOC
+ */
#include <iostream>
#define GIVARO_LENSTRA
#include <givaro/givintnumtheo.h>
@@ -8,6 +20,10 @@
#define TIMING 1
#endif
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
IntNumTheoDom<> IP;
@@ -16,15 +32,15 @@ int main(int argc, char** argv)
#endif
IntNumTheoDom<>::Element a,pr;
if (argc > 1) a = IntNumTheoDom<>::Element(argv[1]); else std::cin >> a;
-
+
unsigned long runs;
- Timer tim; tim.clear();
+ Timer tim; tim.clear();
if (IP.isprime(a)) {
Integer phin; IP.sub(phin,a,IP.one);
std::vector<Integer> Lf;
IP.write(std::cout << "Totient : ", Lf,phin) << std::endl;
tim.start();
- for(unsigned long i = 0; i < TIMING; ++i)
+ for(unsigned long i = 0; i < TIMING; ++i)
IP.prim_root_of_prime(pr, a);
tim.stop();
IP.write( std::cout << "Deterministic : ", pr ) << std::endl;
diff --git a/examples/Integer/probable_primroot.C b/examples/Integer/probable_primroot.C
index 3074433..e59c128 100644
--- a/examples/Integer/probable_primroot.C
+++ b/examples/Integer/probable_primroot.C
@@ -1,9 +1,25 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Integer/probable_primroot.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/probable_primroot.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <givaro/givintnumtheo.h>
#include <givaro/givtimer.h>
#include <math.h>
-// Polynomial-time generation of primitive roots
+using namespace Givaro;
+
+
+
+// Polynomial-time generation of primitive roots
// L is number of loops of Pollard partial factorization of n-1
// 10,000,000 gives at least 1-2^{-40} probability of success
// [Dubrois & Dumas, Industrial-strength primitive roots]
@@ -21,25 +37,25 @@ int main(int argc, char** argv)
if (argc > 1) a = IntNumTheoDom<>::Element(argv[1]); else std::cin >> a;
bool comp ; if ( (comp=(! IP.isprime(a))) ) std::cerr << a << " is not prime, primitive root will have no sense and may loop forever ..." << std::endl;
double epsilon = argc > 2 ? atof(argv[2]) : 0.0000001;
-
- Timer tim; tim.clear();
+
+ Timer tim; tim.clear();
tim.start();
//======================================================================
// Default is partial factorization up to factors of at least 12 digits.
- // with probability of error much less than 2^{-40}
+ // with probability of error much less than 2^{-40}
// IP.probable_prim_root(pr, error, a );
//======================================================================
- // Choosing L to be O(log^2(p))
+ // Choosing L to be O(log^2(p))
// gives the best probability with O(log^4(p)) complexity
// Probability of error is approximately O(1/log^4(p))
// IP.probable_prim_root(pr, error, a, (unsigned long)power(logtwo(a),2));
//======================================================================
- // Choosing L to be O( \sqrt(epsilon) )
+ // Choosing L to be O( \sqrt(epsilon) )
// gives probability of error at most epsilon
- // Newton-Raphson iteration is used for
+ // Newton-Raphson iteration is used for
// 1-epsilon = (1+2/(p-1))*(1-1/B)^(ln( (p-1)/2 )/ln(B))
// So that no factor less than B can be avoided
// With Pollard's rho factorization, L is chosen to be sqrt(B)
@@ -47,15 +63,15 @@ int main(int argc, char** argv)
#define GIVARO_POLLARD
IP.probable_prim_root(pr, error, a, epsilon );
tim.stop();
-
+
if (comp) std::cerr << IP.gcd(g,a,pr) << " is a factor of " << a << std::endl;
IntegerDom().write( std::cout << "Prim root : ", pr );
if (error > 0) {
std::cout << ", correct with probability at least : 1-" << error << std::endl;
std::cerr << tim << std::endl;
-
+
std::cerr << "Now checking primitivity, this may take some time (complete factorization of n-1) ...";
-
+
#define GIVARO_LENSTRA
Timer verif; verif.clear(); verif.start();
@@ -73,7 +89,7 @@ int main(int argc, char** argv)
std::cout << ", deterministically correct" << std::endl;
std::cerr << tim << std::endl;
}
-
+
return 0;
}
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 83f183f..aea0800 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1 +1,16 @@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+# all all-local: $(none)
+
SUBDIRS=Rational Integer FiniteField Polynomial
+
+.PHONY:$(SUBDIRS)
+
+examples: $(SUBDIRS)
+
+$(SUBDIRS):
+ make -C $@
diff --git a/examples/Makefile.in b/examples/Makefile.in
index afae089..47ac49d 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -13,6 +14,14 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+# all all-local: $(none)
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -36,12 +45,21 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -65,26 +83,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -94,40 +113,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -167,6 +196,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = Rational Integer FiniteField Polynomial
@@ -177,14 +207,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps examples/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu examples/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps examples/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -216,7 +246,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -241,7 +271,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -284,7 +314,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -425,6 +455,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -433,18 +465,28 @@ install-data-am:
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am:
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -482,6 +524,13 @@ uninstall-am:
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
+
+.PHONY:$(SUBDIRS)
+
+examples: $(SUBDIRS)
+
+$(SUBDIRS):
+ make -C $@
# 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/examples/Polynomial/Makefile.am b/examples/Polynomial/Makefile.am
old mode 100644
new mode 100755
index bd0c5cc..fbc5bc0
--- a/examples/Polynomial/Makefile.am
+++ b/examples/Polynomial/Makefile.am
@@ -1,5 +1,10 @@
-check: $(EXTRA_PROGRAMS)
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
+AM_CPPFLAGS=-I$(top_srcdir)
#OPTFLAGS = -O7 -funroll-all-loops -felide-constructors -fstrict-aliasing
#OPTFLAGS+= -frerun-loop-opt -fexpensive-optimizations
@@ -18,21 +23,28 @@ INCLUDES=-I$(top_srcdir)
#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/library/tools
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS += $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/rational -I$(top_srcdir)/src/library/tools
-LDADD = -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+LDADD = -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS=-static
-EXTRA_PROGRAMS=isirred isprimitive pol_arith pol_eval pol_factor interpolate
+EXTRA_PROGRAMS=isirred isprimitive trunc_arith pol_arith pol_eval pol_factor interpolate PolynomialCRT highorder
-interpolate_SOURCES = interpolate.C
-isirred_SOURCES = isirred.C
-isprimitive_SOURCES = isprimitive.C
-pol_arith_SOURCES = pol_arith.C
-pol_eval_SOURCES = pol_eval.C
-pol_factor_SOURCES = pol_factor.C
+CLEANFILES=$(EXTRA_PROGRAMS)
+
+interpolate_SOURCES = interpolate.C
+isirred_SOURCES = isirred.C
+isprimitive_SOURCES = isprimitive.C
+pol_arith_SOURCES = pol_arith.C
+trunc_arith_SOURCES = trunc_arith.C
+pol_eval_SOURCES = pol_eval.C
+pol_factor_SOURCES = pol_factor.C
+PolynomialCRT_SOURCES = PolynomialCRT.C
+highorder_SOURCES = highorder.C
# for compilation of new examples
GIVARO_BIN=@bindir@
-%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+%:%.C
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
diff --git a/examples/Polynomial/Makefile.in b/examples/Polynomial/Makefile.in
index 70a3f02..88cf0bc 100644
--- a/examples/Polynomial/Makefile.in
+++ b/examples/Polynomial/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -32,23 +33,39 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
EXTRA_PROGRAMS = isirred$(EXEEXT) isprimitive$(EXEEXT) \
- pol_arith$(EXEEXT) pol_eval$(EXEEXT) pol_factor$(EXEEXT) \
- interpolate$(EXEEXT)
+ trunc_arith$(EXEEXT) pol_arith$(EXEEXT) pol_eval$(EXEEXT) \
+ pol_factor$(EXEEXT) interpolate$(EXEEXT) \
+ PolynomialCRT$(EXEEXT) highorder$(EXEEXT)
subdir = examples/Polynomial
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+am_PolynomialCRT_OBJECTS = PolynomialCRT.$(OBJEXT)
+PolynomialCRT_OBJECTS = $(am_PolynomialCRT_OBJECTS)
+PolynomialCRT_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+PolynomialCRT_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_highorder_OBJECTS = highorder.$(OBJEXT)
+highorder_OBJECTS = $(am_highorder_OBJECTS)
+highorder_LDADD = $(LDADD)
+highorder_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_interpolate_OBJECTS = interpolate.$(OBJEXT)
interpolate_OBJECTS = $(am_interpolate_OBJECTS)
interpolate_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
interpolate_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_isirred_OBJECTS = isirred.$(OBJEXT)
isirred_OBJECTS = $(am_isirred_OBJECTS)
@@ -70,9 +87,13 @@ am_pol_factor_OBJECTS = pol_factor.$(OBJEXT)
pol_factor_OBJECTS = $(am_pol_factor_OBJECTS)
pol_factor_LDADD = $(LDADD)
pol_factor_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_trunc_arith_OBJECTS = trunc_arith.$(OBJEXT)
+trunc_arith_OBJECTS = $(am_trunc_arith_OBJECTS)
+trunc_arith_LDADD = $(LDADD)
+trunc_arith_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -82,12 +103,16 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(interpolate_SOURCES) $(isirred_SOURCES) \
+SOURCES = $(PolynomialCRT_SOURCES) $(highorder_SOURCES) \
+ $(interpolate_SOURCES) $(isirred_SOURCES) \
$(isprimitive_SOURCES) $(pol_arith_SOURCES) \
- $(pol_eval_SOURCES) $(pol_factor_SOURCES)
-DIST_SOURCES = $(interpolate_SOURCES) $(isirred_SOURCES) \
+ $(pol_eval_SOURCES) $(pol_factor_SOURCES) \
+ $(trunc_arith_SOURCES)
+DIST_SOURCES = $(PolynomialCRT_SOURCES) $(highorder_SOURCES) \
+ $(interpolate_SOURCES) $(isirred_SOURCES) \
$(isprimitive_SOURCES) $(pol_arith_SOURCES) \
- $(pol_eval_SOURCES) $(pol_factor_SOURCES)
+ $(pol_eval_SOURCES) $(pol_factor_SOURCES) \
+ $(trunc_arith_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -99,26 +124,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -128,40 +154,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -201,9 +237,18 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) $(OPTFLAGS) $(GMP_CFLAGS) \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/library/poly1 \
+ -I$(top_srcdir)/src/kernel/zpz \
+ -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/kernel/rational \
+ -I$(top_srcdir)/src/library/tools
#OPTFLAGS = -O7 -funroll-all-loops -felide-constructors -fstrict-aliasing
#OPTFLAGS+= -frerun-loop-opt -fexpensive-optimizations
@@ -220,14 +265,19 @@ INCLUDES = -I$(top_srcdir)
#OPTFLAGS+= -parallel -par_report1
# icc for itanium2
#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/library/tools
-LDADD = -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+LDADD = -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS = -static
+CLEANFILES = $(EXTRA_PROGRAMS)
interpolate_SOURCES = interpolate.C
isirred_SOURCES = isirred.C
isprimitive_SOURCES = isprimitive.C
pol_arith_SOURCES = pol_arith.C
+trunc_arith_SOURCES = trunc_arith.C
pol_eval_SOURCES = pol_eval.C
pol_factor_SOURCES = pol_factor.C
+PolynomialCRT_SOURCES = PolynomialCRT.C
+highorder_SOURCES = highorder.C
# for compilation of new examples
GIVARO_BIN = @bindir@
@@ -239,14 +289,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Polynomial/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps examples/Polynomial/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu examples/Polynomial/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps examples/Polynomial/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -264,6 +314,12 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+PolynomialCRT$(EXEEXT): $(PolynomialCRT_OBJECTS) $(PolynomialCRT_DEPENDENCIES)
+ @rm -f PolynomialCRT$(EXEEXT)
+ $(CXXLINK) $(PolynomialCRT_OBJECTS) $(PolynomialCRT_LDADD) $(LIBS)
+highorder$(EXEEXT): $(highorder_OBJECTS) $(highorder_DEPENDENCIES)
+ @rm -f highorder$(EXEEXT)
+ $(CXXLINK) $(highorder_OBJECTS) $(highorder_LDADD) $(LIBS)
interpolate$(EXEEXT): $(interpolate_OBJECTS) $(interpolate_DEPENDENCIES)
@rm -f interpolate$(EXEEXT)
$(CXXLINK) $(interpolate_OBJECTS) $(interpolate_LDADD) $(LIBS)
@@ -282,6 +338,9 @@ pol_eval$(EXEEXT): $(pol_eval_OBJECTS) $(pol_eval_DEPENDENCIES)
pol_factor$(EXEEXT): $(pol_factor_OBJECTS) $(pol_factor_DEPENDENCIES)
@rm -f pol_factor$(EXEEXT)
$(CXXLINK) $(pol_factor_OBJECTS) $(pol_factor_LDADD) $(LIBS)
+trunc_arith$(EXEEXT): $(trunc_arith_OBJECTS) $(trunc_arith_DEPENDENCIES)
+ @rm -f trunc_arith$(EXEEXT)
+ $(CXXLINK) $(trunc_arith_OBJECTS) $(trunc_arith_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -289,33 +348,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/interpolate.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isirred.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isprimitive.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pol_arith.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pol_eval.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pol_factor.Po at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -328,7 +368,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -417,6 +457,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -429,7 +470,6 @@ clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -440,6 +480,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -448,22 +490,31 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -497,9 +548,15 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
-check: $(EXTRA_PROGRAMS)
-%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
+%:%.C
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
# 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/examples/Polynomial/PolynomialCRT.C b/examples/Polynomial/PolynomialCRT.C
new file mode 100644
index 0000000..27f4794
--- /dev/null
+++ b/examples/Polynomial/PolynomialCRT.C
@@ -0,0 +1,235 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/PolynomialCRT.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/PolynomialCRT.C
+ * @brief NO DOC
+ */
+
+#include <iostream>
+#include <algorithm>
+#include <givaro/givtimer.h>
+#include <givaro/givpoly1crt.h>
+#include <givaro/givintprime.h>
+#include <givaro/givmontg32.h>
+#include <givaro/givextension.h>
+#include <givaro/givzpz.h>
+#include <givaro/givgfq.h>
+#include <givaro/givcra.h> // Chinese Remainder of two elements
+#include <givaro/givrns.h> // Chinese Remainder of an array of elements
+#include <givaro/givrandom.h>
+
+#include <givaro/givrational.h>
+
+
+using namespace Givaro;
+
+
+typedef GFqDom<long> Field1;
+typedef ZpzDom<Std16> Field2;
+typedef ZpzDom<Log16> Field3;
+typedef ZpzDom<Std32> Field4;
+typedef ZpzDom<Std64> Field5;
+typedef ZpzDom<Unsigned32> Field6;
+typedef Montgomery<Std32> Field7;
+typedef RationalDom Field8;
+typedef ZpzDom<Integer> Field9;
+
+
+typedef Extension<> Field10;
+
+template <typename Field>
+bool tmain(int argc, char ** argv, GivRandom& generator) {
+ bool pass = true;
+ typedef Poly1CRT< Field > CRTSystem;
+ typedef typename CRTSystem::Element Poly;
+ typedef typename CRTSystem::Type_t Scal;
+ typedef typename CRTSystem::array_E VPoly;
+ typedef typename CRTSystem::array_T VScal;
+
+ IntPrimeDom ID;
+ Integer a( generator() >>(argc>2?atoi(argv[2]):17) );
+ Field F(ID.nextprimein( a ));
+
+ VScal Primes( argc>1 ? atoi(argv[1]):15);
+ VScal Moduli( Primes.size() );
+
+ typename VScal::iterator i = Primes.begin();
+ typename VScal::iterator e = Moduli.begin();
+ for(; i != Primes.end(); ++i, ++e) {
+ do {
+ F.init(*i, generator());
+ } while ( (std::find(Primes.begin(), i, *i) != i) || (F.isZero(*i))) ;
+
+ F.init(*e, generator());
+ }
+// for(typename VScal::const_iterator it=Primes.begin(); it!=Primes.end();++it)
+// F.write(std::cout, *it) << std::endl;
+// for(typename VScal::const_iterator it=Moduli.begin(); it!=Moduli.end();++it)
+// F.write(std::cout, *it) << std::endl;
+
+
+ CRTSystem CRT( F, Primes, "X" );
+ Poly res;
+
+ Timer tim; tim.clear(); tim.start();
+ CRT.RnsToRing( res, Moduli );
+ tim.stop();
+ F.write( std::cerr << tim << " using ") << std::endl;
+
+ if (Primes.size() < 14) {
+ i = Primes.begin();
+ e = Moduli.begin();
+ for( ; i != Primes.end(); ++i, ++e)
+ if (F.characteristic()>0)
+ F.write(CRT.getpolydom().write(F.write(std::cout << "subs(X=", *i) << ",", res) << ") mod " << F.characteristic() << " = ", *e) << ';' << std::endl;
+ else
+ F.write(CRT.getpolydom().write(F.write(std::cout << "subs(X=", *i) << ",", res) << ") = ", *e) << ';' << std::endl;
+ }
+
+
+ VScal Verifs( Primes.size() );
+ CRT.RingToRns( Verifs, res );
+ typename VScal::const_iterator v = Verifs.begin();
+ e = Moduli.begin();
+ for( ; e != Moduli.end(); ++e, ++v)
+ if (! F.areEqual(*e, *v) ) {
+ F.write(std::cerr << "incoherency within ") << std::endl;
+ F.write(std::cerr << "e: ", *e ) << std::endl;
+ F.write(std::cerr << "v: ", *v ) << std::endl;
+ pass = false;
+ break;
+ }
+
+ CRT.getpolydom().random(generator, res, Degree(Primes.size()-1));
+ CRT.RingToRns( Verifs, res );
+ Poly nres;
+
+ tim.clear(); tim.start();
+ CRT.RnsToRing( nres, Verifs );
+ tim.stop();
+ if (! CRT.getpolydom().areEqual(res,nres) ) {
+ CRT.getpolydom().write(std::cerr << "incoherency within ") << std::endl;
+ CRT.getpolydom().write(std::cerr << "r: ", res ) << std::endl;
+ CRT.getpolydom().write(std::cerr << "n: ", nres ) << std::endl;
+ pass = false;
+ }
+ F.write( std::cerr << tim << " using ") << std::endl;
+
+
+ return pass;
+}
+template <typename Field>
+bool tmainext(int argc, char ** argv, GivRandom& generator) {
+ bool pass = true;
+ typedef Poly1CRT< Field > CRTSystem;
+ typedef typename CRTSystem::Element Poly;
+ typedef typename CRTSystem::Type_t Scal;
+ typedef typename CRTSystem::array_E VPoly;
+ typedef typename CRTSystem::array_T VScal;
+
+ IntPrimeDom ID;
+ Integer a( generator() >>(argc>2?atoi(argv[2]):17) );
+ Field F(ID.nextprimein( a ),2);
+
+ VScal Primes( argc>1 ? atoi(argv[1]):15);
+ VScal Moduli( Primes.size() );
+
+ typename VScal::iterator i = Primes.begin();
+ typename VScal::iterator e = Moduli.begin();
+ for(; i != Primes.end(); ++i, ++e) {
+ F.init(*i); F.init(*e);
+ do {
+ F.random(generator,*i);
+ } while ( (std::find(Primes.begin(), i, *i) != i) || (F.isZero(*i))) ;
+
+ F.random(generator,*e);
+ }
+for(typename VScal::const_iterator it=Primes.begin(); it!=Primes.end();++it)
+F.write(std::cout, *it) << std::endl;
+for(typename VScal::const_iterator it=Moduli.begin(); it!=Moduli.end();++it)
+F.write(std::cout, *it) << std::endl;
+
+
+ CRTSystem CRT( F, Primes, "X" );
+ Poly res;
+
+ Timer tim; tim.clear(); tim.start();
+ CRT.RnsToRing( res, Moduli );
+ tim.stop();
+ F.write( std::cerr << tim << " using ") << std::endl;
+
+ if (Primes.size() < 14) {
+ i = Primes.begin();
+ e = Moduli.begin();
+ for( ; i != Primes.end(); ++i, ++e)
+ if (F.characteristic()>0)
+ F.write(CRT.getpolydom().write(F.write(std::cout << "subs(X=", *i) << ",", res) << ") mod " << F.characteristic() << " = ", *e) << ';' << std::endl;
+ else
+ F.write(CRT.getpolydom().write(F.write(std::cout << "subs(X=", *i) << ",", res) << ") = ", *e) << ';' << std::endl;
+ }
+
+
+ VScal Verifs( Primes.size() );
+ CRT.RingToRns( Verifs, res );
+ typename VScal::const_iterator v = Verifs.begin();
+ e = Moduli.begin();
+ for( ; e != Moduli.end(); ++e, ++v)
+ if (! F.areEqual(*e, *v) ) {
+ F.write(std::cerr << "incoherency within ") << std::endl;
+ F.write(std::cerr << "e: ", *e ) << std::endl;
+ F.write(std::cerr << "v: ", *v ) << std::endl;
+ pass = false;
+ break;
+ }
+
+ CRT.getpolydom().random(generator, res, Degree(Primes.size()-1));
+ CRT.RingToRns( Verifs, res );
+ Poly nres;
+
+ tim.clear(); tim.start();
+ CRT.RnsToRing( nres, Verifs );
+ tim.stop();
+ if (! CRT.getpolydom().areEqual(res,nres) ) {
+ CRT.getpolydom().write(std::cerr << "incoherency within ") << std::endl;
+ CRT.getpolydom().write(std::cerr << "r: ", res ) << std::endl;
+ CRT.getpolydom().write(std::cerr << "n: ", nres ) << std::endl;
+ pass = false;
+ }
+ F.write( std::cerr << tim << " using ") << std::endl;
+
+
+ return pass;
+}
+
+
+
+int main(int argc, char ** argv) {
+ // argv[1] : number of primes
+ // argv[2] : 2^{32-j} is size of primes
+ // argv[3] : seed for generator
+
+ GivRandom seedor( argc>3 ? atoi(argv[3]): BaseTimer::seed() );
+ unsigned long seed = seedor.seed();
+ std::cerr << "seed: " << seed << std::endl;
+
+ Integer::seeding(seed);
+
+ return
+ tmain<Field1>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field2>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field3>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field4>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field5>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field6>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field7>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field8>(argc, argv, *( new GivRandom(seed)))
+ && tmain<Field9>(argc, argv, *( new GivRandom(seed)))
+ && tmainext<Field10>(argc, argv, *( new GivRandom(seed)))
+ ;
+
+}
diff --git a/examples/Polynomial/highorder.C b/examples/Polynomial/highorder.C
new file mode 100644
index 0000000..7de7372
--- /dev/null
+++ b/examples/Polynomial/highorder.C
@@ -0,0 +1,258 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/highorder.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/highorder.C
+ * @brief NO DOC
+ */
+
+#include <iostream>
+#define GIVARO_DEBUG 1
+#include <givaro/givrandom.h>
+#include <givaro/givtimer.h>
+#include <givaro/givgfq.h>
+#include <givaro/givpoly1.h>
+#include <givaro/givtruncdomain.h>
+#include <givaro/givhighorder.h>
+
+using namespace Givaro;
+
+
+
+
+typedef GFqDom<int> Field;
+typedef Poly1Dom< Field, Dense> Polys;
+typedef HighOrder< Field > HighOrders;
+
+
+long long TFDcount = 0;
+long long FiDcount = 0;
+Timer Ttaylor, Thighorder, Tfiduccia;
+
+
+
+bool TestFracDevel(const HighOrders& HO101, const Polys::Element P, const Polys::Element oQ, Degree a, Degree b) {
+ bool success = false, successF=false;
+
+ try {
+
+
+ ++TFDcount;
+// std::cerr << "------------------------------------------------------------" << TFDcount <<std::endl;
+
+ HighOrders::Truncated TQ;
+ Degree dp; HO101.getpoldom().degree(dp, P);
+ HO101.gettruncdom().assign(TQ, oQ,0,dp-1);
+ Polys::Element Q;
+ HO101.gettruncdom().convert(Q, TQ);
+//HO101.write(std::cout << "Q:=", TQ) << ';' << std::endl;
+
+ HighOrders::Element Fra;
+ Fra._num = Q;
+ Fra._den = P;
+
+ Polys::Element TTy;
+ Timer tt; tt.clear(); tt.start();
+ HO101.taylor(TTy, Fra, b);
+ tt.stop();
+ Ttaylor+=tt;
+
+ HighOrders::Truncated TTy17;
+ HO101.gettruncdom().assign(TTy17, TTy, a, b);
+
+//HO101.write(std::cout << "TTy17:=", TTy17) << ';' << std::endl;
+
+
+ HighOrders::Truncated TTy17b;
+
+ tt.clear(); tt.start();
+ HO101.FracDevel(TTy17b, Fra, a, b);
+ tt.stop();
+ Thighorder+=tt;
+
+
+//HO101.write(std::cout << "TTy17b:=", TTy17b) << ';' << std::endl;
+
+ success = HO101.gettruncdom().areEqual(TTy17,TTy17b);
+
+ if (! success) {
+ std::cerr << "---------- BEG ERROR ----------" <<std::endl;
+ HO101.getpoldom().write(std::cerr << "Q:=", Q) << ';' << std::endl;
+ HO101.getpoldom().write(std::cerr << "P:=", P) << ';' << std::endl;
+ HO101.getpoldom().write(std::cerr << "TTy:=", TTy) << ';' << std::endl;
+
+// Fra._num = HO101.getpoldom().one;
+// Polys::Element Tay;
+// HO101.taylor(Tay, Fra, b);
+// HO101.getpoldom().write(std::cerr << "Tay:=", Tay) << ';' << std::endl;
+
+
+ HO101.write(std::cerr << "TTy17:=", TTy17) << ';' << std::endl;
+ HO101.write(std::cerr << "TTy17b:=", TTy17b) << ';' << std::endl;
+ std::cerr << "---------- END ERROR ----------" <<std::endl;
+ }
+
+
+ HighOrders::Truncated TTy17c; HO101.gettruncdom().init(TTy17c);
+ HighOrders::Truncated TTy17d; HO101.gettruncdom().init(TTy17d);
+
+ tt.clear(); tt.start();
+// HO101.Fiduccia(TTy17c, Fra, b);
+// for(Degree d=a; d<b; ++d) {
+// HO101.Fiduccia(TTy17d, Fra, d);
+// HO101.gettruncdom().addin(TTy17c, TTy17d);
+// }
+ HO101.Fiduccia(TTy17c, Fra, a, b);
+ tt.stop();
+ Tfiduccia+=tt;
+
+
+//HO101.write(std::cout << "TTy17b:=", TTy17b) << ';' << std::endl;
+
+ successF = HO101.gettruncdom().areEqual(TTy17,TTy17c);
+
+ if (! successF) {
+ std::cerr << "---------- BEG ERROR ----------" <<std::endl;
+ HO101.getpoldom().write(std::cerr << "Q:=", Q) << ';' << std::endl;
+ HO101.getpoldom().write(std::cerr << "P:=", P) << ';' << std::endl;
+ HO101.getpoldom().write(std::cerr << "TTy:=", TTy) << ';' << std::endl;
+
+// Fra._num = HO101.getpoldom().one;
+// Polys::Element Tay;
+// HO101.taylor(Tay, Fra, b);
+// HO101.getpoldom().write(std::cerr << "Tay:=", Tay) << ';' << std::endl;
+
+
+ HO101.write(std::cerr << "TTy17:=", TTy17) << ';' << std::endl;
+ HO101.write(std::cerr << "TTy17c:=", TTy17c) << ';' << std::endl;
+ std::cerr << "---------- END ERROR ----------" <<std::endl;
+ } else {
+ ++FiDcount;
+ }
+
+
+} catch (GivError e) {
+ std::cerr << e << std::endl;
+}
+
+ return success && successF;
+}
+
+
+
+
+
+
+int main(int argc, char ** argv) {
+
+
+ long numb = (argc>1?atoi(argv[1]):200);
+ std::cerr << "numb: " << numb << std::endl;
+ long tttn = (argc>2?atoi(argv[2]):100);
+ std::cerr << "tttn: " << tttn << std::endl;
+ long seed = (argc>3?atoi(argv[3]):BaseTimer::seed());
+ std::cerr << "seed: " << seed << std::endl;
+
+ Field Z101( 101, 1 ); // integers modulo 101
+
+ // Polynomials over Z101, with X as indeterminate
+ Polys DP101( Z101, Indeter("X") );
+ Polys::Element P, Q, R, monomial;
+
+ GivRandom generator(seed);
+ long deg1 = generator() % 6;
+ long deg2 = generator() % 6;
+ long deg3 = generator() % 155;
+ // long v1 = generator() % 195;
+ // long v2 = v1 + (generator() % 5);
+ DP101.random(generator, P, Degree(deg1) );
+ DP101.random(generator, Q, Degree(deg2) );
+ DP101.random(generator, R, Degree(deg3) );
+ Degree dP; DP101.degree(dP,P);
+ Degree dQ; DP101.degree(dQ,Q);
+ Degree dR; DP101.degree(dR,R);
+
+ DP101.write(std::cout << "P:=", P) << ';' << std::endl;
+
+ HighOrders HO101( Z101, Indeter("X") );
+
+ HighOrders::Element F;
+ F._num = DP101.one;
+ F._den = P;
+
+ Polys::Element Tay;
+
+ HO101.taylor(Tay, F, 128);
+ DP101.write(std::cout << "Tay:=", Tay) << ';' << std::endl;
+
+
+ Polys::Element S; Degree dS;
+
+ size_t e = 0 ; // initialisé à quoi ? dans GammaId, k0 est const...
+
+ HighOrders::Truncated G0;
+ HO101.GammaId(G0, S, dS, e, P, dP);
+ std::cout << "e:=" << e << ';' << std::endl;
+ HO101.write(std::cout << "G0:=", G0) << ';' << std::endl;
+ DP101.write(std::cout << "S:=", S) << ';' << std::endl;
+
+ std::vector<HighOrders::Truncated> Gam, T;
+ std::vector<Degree> D;
+
+ Polys::Element nTay; Degree dT;
+
+ HO101.highorder(Gam, T, D, nTay, dT, Degree(970), Degree(1000), P, dP);
+ HO101.write(std::cout << "Gam:=", Gam.back()) << ';' << std::endl;
+
+ HighOrders::Truncated TP; HO101.gettruncdom().assign(TP, P);
+
+ HighOrders::Truncated I;
+ HO101.Inverse(I, 113, 127, TP, dP, nTay, dT, Gam, T, D);
+
+ HO101.write(std::cout << "I]_155^175:=", I) << ';' << std::endl;
+
+ Ttaylor.clear();
+ Thighorder.clear();
+
+ bool success=true;
+
+ success &= TestFracDevel(HO101, P, Q, tttn-(17*tttn)/100,tttn);
+ success &= TestFracDevel(HO101, P, Q, tttn-(27*tttn)/100,tttn);
+ success &= TestFracDevel(HO101, P, Q, tttn-(87*tttn)/100,tttn);
+ success &= TestFracDevel(HO101, P, Q, 0,tttn);
+ success &= TestFracDevel(HO101, P, Q, 1,tttn);
+ success &= TestFracDevel(HO101, P, Q, 2,tttn);
+ success &= TestFracDevel(HO101, P, Q, tttn,tttn);
+ success &= TestFracDevel(HO101, P, Q, tttn-1,tttn);
+ success &= TestFracDevel(HO101, P, Q, tttn-2,tttn);
+
+
+ for(long i=0; i<numb; ++i) {
+ long Deg1 = generator() % ((66*tttn)/100);
+ long Deg2 = generator() % ((65*tttn)/100);
+ long v1 = generator() % ((19195*tttn)/100);
+ long v2 = v1 + (generator() % ((45*tttn)/100));
+ DP101.random(generator, P, Degree(Deg1) );
+ DP101.random(generator, Q, Degree(Deg2) );
+ success &= TestFracDevel(HO101, P, Q, v1, v2);
+ }
+
+ std::cerr << "Taylor: " << Ttaylor << std::endl;
+ std::cerr << "HighOrder: " << Thighorder << std::endl;
+ std::cerr << "Fiduccia: " << Tfiduccia << std::endl;
+
+
+
+ if (! success) {
+ std::cerr << "Error: " << seed << std::endl;
+ } else {
+ std::cerr << "Success:" << TFDcount << std::endl;
+ }
+ std::cerr << "Success F:" << FiDcount << std::endl;
+
+ return 0;
+}
diff --git a/examples/Polynomial/interpolate.C b/examples/Polynomial/interpolate.C
index da08a37..0928e91 100644
--- a/examples/Polynomial/interpolate.C
+++ b/examples/Polynomial/interpolate.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/interpolate.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/interpolate.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <fstream>
#include <stdlib.h>
@@ -8,18 +20,22 @@
using namespace std;
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
ZpzDom<Std32>::Residu_t MOD;
- if (argc > 2)
+ if (argc > 2)
MOD = atoi(argv[2]);
else
std::cin >> MOD;
ZpzDom<Std32> F(MOD);
-
+
Interpolation< ZpzDom<Std32> > FD(F,Indeter("X"));
Interpolation< ZpzDom<Std32> >::Element nouv, prec;
int EarlyTerm = 0, Bound = 5;
diff --git a/examples/Polynomial/isirred.C b/examples/Polynomial/isirred.C
index 5fc4db7..6443454 100644
--- a/examples/Polynomial/isirred.C
+++ b/examples/Polynomial/isirred.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/isirred.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/isirred.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <stdlib.h>
#include <givaro/givgfq.h>
@@ -6,11 +18,15 @@
using namespace std;
+using namespace Givaro;
+
+
+
int main(int argc, char** argv)
{
GFqDom<long>::Residu_t MOD;
- if (argc > 1)
+ if (argc > 1)
MOD = atoi(argv[1]);
else
std::cin >> MOD;
@@ -18,7 +34,7 @@ int main(int argc, char** argv)
if (argc > 2) expo = atoi(argv[2]);
GFqDom<long> F(MOD, expo);
-
+
Poly1FactorDom<GFqDom<long>, Dense> FD(F,Indeter("X"));
Poly1FactorDom<GFqDom<long>, Dense>::Element P;
FD.read( cin, P );
@@ -34,41 +50,32 @@ int main(int argc, char** argv)
return 0;
}
+#if 0
+
+bool f;
+
+Poly1FactorDom<GFqDom<long>, Dense>::element W,D;
+FD.gcd(W,FD.diff(D,P),P);
+Degree d, dP;
+if (FD.degree(d,W) > 0) return 0;
+// Distinct degree free ?
+Poly1FactorDom<GFqDom<long>, Dense>::element Unit, G1;
+FD.init(Unit, Degree(1), F.one);
+W.copy(Unit);
+FD.degree(dP,P); Degree dPo = (dP/2);
+
+f = 1;
+
+for(Degree dp = 1; dp <= dPo; ++dp) {
+ FD.write(cout << "W: ", W) << endl ;
+ FD.powmod(W, D.copy(W), MOD, P);
+ FD.write(cout << "W^q: " , W) << endl ;
+ FD.gcd (G1, FD.sub(D,W,Unit), P) ;
+ FD.write(cout << "D: " , D) << endl ;
+ FD.write(cout << "G1: " , G1) << endl ;
+ if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
+}
-
-
-
-
-
-
-
-
-
-
-// bool f;
-
-// Poly1FactorDom<GFqDom<long>, Dense>::element W,D;
-// FD.gcd(W,FD.diff(D,P),P);
-// Degree d, dP;
-// if (FD.degree(d,W) > 0) return 0;
-// // Distinct degree free ?
-// Poly1FactorDom<GFqDom<long>, Dense>::element Unit, G1;
-// FD.init(Unit, Degree(1), F.one);
-// W.copy(Unit);
-// FD.degree(dP,P); Degree dPo = (dP/2);
-
-// f = 1;
-
-// for(Degree dp = 1; dp <= dPo; ++dp) {
-// FD.write(cout << "W: ", W) << endl ;
-// FD.powmod(W, D.copy(W), MOD, P);
-// FD.write(cout << "W^q: " , W) << endl ;
-// FD.gcd (G1, FD.sub(D,W,Unit), P) ;
-// FD.write(cout << "D: " , D) << endl ;
-// FD.write(cout << "G1: " , G1) << endl ;
-// if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
-// }
-
-
+#endif
diff --git a/examples/Polynomial/isprimitive.C b/examples/Polynomial/isprimitive.C
index 5f22e05..be2fcb6 100644
--- a/examples/Polynomial/isprimitive.C
+++ b/examples/Polynomial/isprimitive.C
@@ -1,16 +1,30 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/isprimitive.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/isprimitive.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <stdlib.h>
#include <givaro/givgfq.h>
#include <givaro/givpoly1factor.h>
#include <givaro/givtimer.h>
-using namespace std;
+// using namespace std;
+
+using namespace Givaro;
int main(int argc, char** argv)
{
GFqDom<long>::Residu_t MOD;
- if (argc > 1)
+ if (argc > 1)
MOD = atoi(argv[1]);
else
std::cin >> MOD;
@@ -18,17 +32,17 @@ int main(int argc, char** argv)
if (argc > 2) expo = atoi(argv[2]);
GFqDom<long> F(MOD, expo);
-
+
Poly1FactorDom<GFqDom<long>, Dense> FD(F,Indeter("X"));
Poly1FactorDom<GFqDom<long>, Dense>::Element P, IXE;
FD.init(IXE,Degree(1),F.one);
- FD.read( cin, P );
+ FD.read( std::cin, P );
Timer tim; tim.clear(); tim.start();
bool f = FD.is_prim_root(IXE, P );
tim.stop();
- F.write( FD.write( cout, P ) << " is " << (f?"":"not ") << "primitive in " ) << endl;
+ F.write( FD.write( std::cout, P ) << " is " << (f?"":"not ") << "primitive in " ) << std::endl;
// std::cout << f << std::endl;
std::cerr << tim << std::endl;
@@ -38,39 +52,31 @@ int main(int argc, char** argv)
+#if 0
+bool f;
+Poly1FactorDom<GFqDom<long>, Dense>::element W,D;
+FD.gcd(W,FD.diff(D,P),P);
+Degree d, dP;
+if (FD.degree(d,W) > 0) return 0;
+// Distinct degree free ?
+Poly1FactorDom<GFqDom<long>, Dense>::element Unit, G1;
+FD.init(Unit, Degree(1), F.one);
+W.copy(Unit);
+FD.degree(dP,P); Degree dPo = (dP/2);
+f = 1;
+for(Degree dp = 1; dp <= dPo; ++dp) {
+ FD.write(cout << "W: ", W) << endl ;
+ FD.powmod(W, D.copy(W), MOD, P);
+ FD.write(cout << "W^q: " , W) << endl ;
+ FD.gcd (G1, FD.sub(D,W,Unit), P) ;
+ FD.write(cout << "D: " , D) << endl ;
+ FD.write(cout << "G1: " , G1) << endl ;
+ if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
+}
-
-
-
-
-
-// bool f;
-
-// Poly1FactorDom<GFqDom<long>, Dense>::element W,D;
-// FD.gcd(W,FD.diff(D,P),P);
-// Degree d, dP;
-// if (FD.degree(d,W) > 0) return 0;
-// // Distinct degree free ?
-// Poly1FactorDom<GFqDom<long>, Dense>::element Unit, G1;
-// FD.init(Unit, Degree(1), F.one);
-// W.copy(Unit);
-// FD.degree(dP,P); Degree dPo = (dP/2);
-
-// f = 1;
-
-// for(Degree dp = 1; dp <= dPo; ++dp) {
-// FD.write(cout << "W: ", W) << endl ;
-// FD.powmod(W, D.copy(W), MOD, P);
-// FD.write(cout << "W^q: " , W) << endl ;
-// FD.gcd (G1, FD.sub(D,W,Unit), P) ;
-// FD.write(cout << "D: " , D) << endl ;
-// FD.write(cout << "G1: " , G1) << endl ;
-// if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
-// }
-
-
+#endif
diff --git a/examples/Polynomial/pol_arith.C b/examples/Polynomial/pol_arith.C
index 2a03680..515d946 100644
--- a/examples/Polynomial/pol_arith.C
+++ b/examples/Polynomial/pol_arith.C
@@ -1,7 +1,22 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/pol_arith.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/pol_arith.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <givaro/givgfq.h>
#include <givaro/givpoly1.h>
+using namespace Givaro;
+
+
int main(int argc, char ** argv) {
{
@@ -26,7 +41,7 @@ int main(int argc, char ** argv) {
// DP13.read( std::cin, P); // would read P as a succession of integers :
// deg leadcoeff (lead-1)coeff ... unitcoeff
- DP13.init( Q, Degree(0), 6UL );
+ DP13.init( Q, Degree(0), 6UL );
DP13.write( std::cout << "Q: " , Q )<< std::endl;
DP13.init( monomial, Degree(4), 3UL);
DP13.write( std::cout << "m: " , monomial )<< std::endl;
@@ -46,10 +61,10 @@ int main(int argc, char ** argv) {
DP13.write( DP13.write(
std::cout << "(" , P ) << ") * (", Q) << ")";
-
+
DP13.write(std::cout << " = " , R) << std::endl;
- DP13.gcd ( R, P, Q); //
+ DP13.gcd ( R, P, Q); //
DP13.write( DP13.write( DP13.write(
std::cout << "gcd(", P ) << ",", Q) << ") = ", R) << std::endl;
@@ -57,10 +72,10 @@ int main(int argc, char ** argv) {
DP13.lcm ( R, P, Q); //
DP13.write( DP13.write( DP13.write(
std::cout << "lcm(", P ) << ",", Q) << ") = ", R) << std::endl;
- DP13.lcm ( R, Q, P); //
+ DP13.lcm ( R, Q, P); //
DP13.write( DP13.write( DP13.write(
std::cout << "lcm(", Q ) << ",", P) << ") = ", R) << std::endl;
- }
+ }
return 0;
}
diff --git a/examples/Polynomial/pol_eval.C b/examples/Polynomial/pol_eval.C
index 13d2f90..d5efe7c 100644
--- a/examples/Polynomial/pol_eval.C
+++ b/examples/Polynomial/pol_eval.C
@@ -1,16 +1,31 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/pol_eval.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/pol_eval.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <stdlib.h>
#include <givaro/givgfq.h>
#include <givaro/givpoly1factor.h>
#include <givaro/givtimer.h>
+using namespace Givaro;
+
+
using namespace std;
int main(int argc, char** argv)
{
GFqDom<long>::Residu_t MOD;
- if (argc > 1)
+ if (argc > 1)
MOD = atoi(argv[1]);
else
std::cin >> MOD;
@@ -18,7 +33,7 @@ int main(int argc, char** argv)
if (argc > 2) expo = atoi(argv[2]);
GFqDom<long> F(MOD, expo);
-
+
Poly1FactorDom<GFqDom<long>, Dense> FD(F,Indeter("X"));
Poly1FactorDom<GFqDom<long>, Dense>::Element P;
FD.read( cin, P );
@@ -38,6 +53,7 @@ int main(int argc, char** argv)
+#if 0
@@ -45,31 +61,30 @@ int main(int argc, char** argv)
+ bool f;
-// bool f;
-
-// Poly1FactorDom<GFqDom<long>, Dense>::Element W,D;
-// FD.gcd(W,FD.diff(D,P),P);
-// Degree d, dP;
-// if (FD.degree(d,W) > 0) return 0;
-// // Distinct degree free ?
-// Poly1FactorDom<GFqDom<long>, Dense>::Element Unit, G1;
-// FD.init(Unit, Degree(1), F.one);
-// W.copy(Unit);
-// FD.degree(dP,P); Degree dPo = (dP/2);
-
-// f = 1;
+ Poly1FactorDom<GFqDom<long>, Dense>::Element W,D;
+ FD.gcd(W,FD.diff(D,P),P);
+ Degree d, dP;
+ if (FD.degree(d,W) > 0) return 0;
+ // Distinct degree free ?
+ Poly1FactorDom<GFqDom<long>, Dense>::Element Unit, G1;
+ FD.init(Unit, Degree(1), F.one);
+ W.copy(Unit);
+ FD.degree(dP,P); Degree dPo = (dP/2);
-// for(Degree dp = 1; dp <= dPo; ++dp) {
-// FD.write(cout << "W: ", W) << endl ;
-// FD.powmod(W, D.copy(W), MOD, P);
-// FD.write(cout << "W^q: " , W) << endl ;
-// FD.gcd (G1, FD.sub(D,W,Unit), P) ;
-// FD.write(cout << "D: " , D) << endl ;
-// FD.write(cout << "G1: " , G1) << endl ;
-// if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
-// }
+ f = 1;
+ for(Degree dp = 1; dp <= dPo; ++dp) {
+ FD.write(cout << "W: ", W) << endl ;
+ FD.powmod(W, D.copy(W), MOD, P);
+ FD.write(cout << "W^q: " , W) << endl ;
+ FD.gcd (G1, FD.sub(D,W,Unit), P) ;
+ FD.write(cout << "D: " , D) << endl ;
+ FD.write(cout << "G1: " , G1) << endl ;
+ if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
+ }
+#endif
diff --git a/examples/Polynomial/pol_factor.C b/examples/Polynomial/pol_factor.C
index 135a2f3..49ddc35 100644
--- a/examples/Polynomial/pol_factor.C
+++ b/examples/Polynomial/pol_factor.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+/*! @file examples/Polynomial/pol_factor.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/pol_factor.C
+ * @brief NO DOC
+ */
+
#include <iostream>
#include <stdlib.h>
#include <givaro/givgfq.h>
@@ -6,11 +18,14 @@
using namespace std;
+using namespace Givaro;
+
+
int main(int argc, char** argv)
{
GFqDom<long>::Residu_t MOD;
- if (argc > 1)
+ if (argc > 1)
MOD = atoi(argv[1]);
else
std::cin >> MOD;
@@ -18,14 +33,14 @@ int main(int argc, char** argv)
if (argc > 2) expo = atoi(argv[2]);
GFqDom<long> F(MOD, expo);
-
+
Poly1FactorDom<GFqDom<long>, Dense> FD(F,Indeter("X"));
typedef Poly1FactorDom<GFqDom<long>, Dense>::Element Polys ;
Polys P;
FD.read( cin, P );
std::vector<Polys> Lf;
std::vector<unsigned long> Le;
-
+
Timer tim; tim.clear(); tim.start();
FD.CZfactor(Lf, Le, P);
tim.stop();
@@ -45,6 +60,7 @@ int main(int argc, char** argv)
+#if 0
@@ -52,31 +68,30 @@ int main(int argc, char** argv)
+ bool f;
-// bool f;
-
-// Poly1FactorDom<GFqDom<long>, Dense>::Element W,D;
-// FD.gcd(W,FD.diff(D,P),P);
-// Degree d, dP;
-// if (FD.degree(d,W) > 0) return 0;
-// // Distinct degree free ?
-// Poly1FactorDom<GFqDom<long>, Dense>::Element Unit, G1;
-// FD.init(Unit, Degree(1), F.one);
-// W.copy(Unit);
-// FD.degree(dP,P); Degree dPo = (dP/2);
-
-// f = 1;
+ Poly1FactorDom<GFqDom<long>, Dense>::Element W,D;
+ FD.gcd(W,FD.diff(D,P),P);
+ Degree d, dP;
+ if (FD.degree(d,W) > 0) return 0;
+ // Distinct degree free ?
+ Poly1FactorDom<GFqDom<long>, Dense>::Element Unit, G1;
+ FD.init(Unit, Degree(1), F.one);
+ W.copy(Unit);
+ FD.degree(dP,P); Degree dPo = (dP/2);
-// for(Degree dp = 1; dp <= dPo; ++dp) {
-// FD.write(cout << "W: ", W) << endl ;
-// FD.powmod(W, D.copy(W), MOD, P);
-// FD.write(cout << "W^q: " , W) << endl ;
-// FD.gcd (G1, FD.sub(D,W,Unit), P) ;
-// FD.write(cout << "D: " , D) << endl ;
-// FD.write(cout << "G1: " , G1) << endl ;
-// if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
-// }
+ f = 1;
+ for(Degree dp = 1; dp <= dPo; ++dp) {
+ FD.write(cout << "W: ", W) << endl ;
+ FD.powmod(W, D.copy(W), MOD, P);
+ FD.write(cout << "W^q: " , W) << endl ;
+ FD.gcd (G1, FD.sub(D,W,Unit), P) ;
+ FD.write(cout << "D: " , D) << endl ;
+ FD.write(cout << "G1: " , G1) << endl ;
+ if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
+ }
+#endif
diff --git a/examples/Polynomial/trunc_arith.C b/examples/Polynomial/trunc_arith.C
new file mode 100644
index 0000000..9d38d49
--- /dev/null
+++ b/examples/Polynomial/trunc_arith.C
@@ -0,0 +1,338 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Polynomial/trunc_arith.C
+ * @ingroup examples
+ * @ingroup polynomials
+ * @example examples/Polynomial/trunc_arith.C
+ * @brief NO DOC
+ */
+#include <iostream>
+#include <givaro/givrandom.h>
+#include <givaro/givtimer.h>
+#include <givaro/givgfq.h>
+#include <givaro/givpoly1.h>
+#include <givaro/givtruncdomain.h>
+
+using namespace Givaro;
+
+
+
+long long TTcount = 0;
+
+bool TestAdd(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V;
+ DP.add ( R, P, Q, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.add (T, P, Q);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ if( DP.areNEqual( V, R) ) {
+ std::cerr << "ERROR ADD:" << TTcount << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestSub(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V;
+ DP.sub ( R, P, Q, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.sub (T, P, Q);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ if( DP.areNEqual( V, R) ) {
+ std::cerr << "ERROR SUB:" << TTcount << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestMul(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V;
+ DP.mul ( R, P, Q, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.mul (T, P, Q);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ if( DP.areNEqual( V, R) ) {
+ std::cerr << "ERROR MUL:" << TTcount << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestAxpy(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, const TruncDom< GFqDom<int> >::Element& G, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V;
+ DP.axpy ( R, P, Q, G, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.axpy (T, P, Q, G);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ if( DP.areNEqual( V, R) ) {
+ std::cerr << "ERROR Axpy:" << std::endl;
+ DP.write(std::cout << " P: " , P) << std::endl;
+ DP.write(std::cout << " Q: " , Q) << std::endl;
+ DP.write(std::cout << " G: " , G) << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree dG; DP.degree(dG,G);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ Degree vG; DP.val(vG,G);
+ std::cerr << "vP: " << vP << ", dP: " << dP << ", vQ: " << vQ << ", dQ: " << dQ << ", vG: " << vG << ", dG: " << dG << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestAxmy(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, const TruncDom< GFqDom<int> >::Element& G, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V;
+ DP.axmy ( R, P, Q, G, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.axmy (T, P, Q, G);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ if( DP.areNEqual( V, R) ) {
+ std::cerr << "ERROR Axmy:" << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestMaxpy(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, const TruncDom< GFqDom<int> >::Element& G, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V;
+ DP.maxpy ( R, P, Q, G, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.maxpy (T, P, Q, G);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ if( DP.areNEqual( V, R) ) {
+ std::cerr << "ERROR Maxpy:" << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+
+int main(int argc, char ** argv) {
+
+ {
+ long seed = (argc>1?atoi(argv[1]):BaseTimer::seed());
+ std::cerr << "seed: " << seed << std::endl;
+
+ GFqDom<int> Z101( 101, 1 ); // integers modulo 101
+
+ // Polynomials over Z101, with X as indeterminate
+ TruncDom< GFqDom<int> > DP101( Z101, Indeter("X") );
+ TruncDom< GFqDom<int> >::Element P, Q, R, monomial;
+ GFqDom<int>::Element tmp;
+
+ DP101.assign( P, Z101.init(tmp,5) ); // P is degree 0 polynomial : 5 modulo 101
+ DP101.write( std::cout << "P: " , P )<< std::endl;
+ DP101.init( monomial, Degree(1), 33UL) ; // -33 X
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ Degree deg,val;
+ DP101.degree(deg,monomial);
+ DP101.val(val,monomial);
+ DP101.write( std::cout << "[m]_" << val << '^' << deg << ": " , monomial )<< std::endl;
+ DP101.addin( P, monomial ); // P += monomial
+ DP101.write( std::cout << "P: " , P )<< std::endl;
+ DP101.init( monomial, Degree(2), 12UL) ; // 12 X^2
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( P, monomial ); // P is now 5-33*X+12*X^2
+ DP101.write( std::cout << "P: " , P )<< std::endl;
+
+// // DP101.read( std::cin, P); // would read P as a succession of integers :
+// // deg leadcoeff (lead-1)coeff ... unitcoeff
+ Q = P;
+ DP101.write( std::cout << "P: " , P )<< std::endl;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+
+
+ DP101.init( Q, Degree(0), 6UL );
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.init( monomial, Degree(4), 3UL);
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.init( monomial, Degree(1), 75UL);
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.init( monomial, Degree(3), 45UL);
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.subin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ // Q is now 3*X^4+75*X-45*X^3+6
+
+ DP101.mulin( Q, Degree(15) ) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.mulin( monomial, Degree(32));
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.subin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+
+ DP101.divin( Q, Degree(5) ) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.divin( monomial, Degree(12));
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.subin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+
+ DP101.divin( monomial, Degree(10));
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.subin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+
+ DP101.divin( monomial, Degree(10));
+ DP101.write( std::cout << "m: " , monomial )<< std::endl;
+ DP101.addin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.subin( Q, monomial) ;
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+ DP101.setval(Q);
+ DP101.write( std::cout << "Q: " , Q )<< std::endl;
+
+ DP101.mulin( P, Degree(15) ) ;
+
+ DP101.mul ( R, P, Q); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "(" , P ) << ") * (", Q) << ")";
+ DP101.write(std::cout << " = " , R) << std::endl;
+
+ DP101.mul ( R, P, Q, Degree(28), Degree(30)); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "[(" , P ) << ") * (", Q) << ")]_28^30";
+ DP101.write(std::cout << " = " , R) << std::endl;
+ DP101.mul ( R, P, Q, Degree(0), Degree(30)); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "[(" , P ) << ") * (", Q) << ")]_0^30";
+ DP101.write(std::cout << " = " , R) << std::endl;
+ DP101.mul ( R, P, Q, Degree(28), Degree(100)); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "[(" , P ) << ") * (", Q) << ")]_28^100";
+ DP101.write(std::cout << " = " , R) << std::endl;
+ DP101.mul ( R, P, Q, Degree(4), Degree(10)); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "[(" , P ) << ") * (", Q) << ")]_4^10";
+ DP101.write(std::cout << " = " , R) << std::endl;
+ DP101.mul ( R, P, Q, Degree(75), Degree(100)); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "[(" , P ) << ") * (", Q) << ")]_75^100";
+ DP101.write(std::cout << " = " , R) << std::endl;
+ DP101.setval(R);
+ DP101.write( std::cout << "R: " , R )<< std::endl;
+
+ DP101.mulin( Q, Degree(3) ) ;
+
+ DP101.add ( R, P, Q); // R = P*Q;
+ DP101.write( DP101.write(
+ std::cout << "(" , P ) << ") + (", Q) << ")";
+ DP101.write(std::cout << " = " , R) << std::endl;
+
+/*
+ DP101.gcd ( R, P, Q); //
+
+ DP101.write( DP101.write( DP101.write(
+ std::cout << "gcd(", P ) << ",", Q) << ") = ", R) << std::endl;
+
+ DP101.lcm ( R, P, Q); //
+ DP101.write( DP101.write( DP101.write(
+ std::cout << "lcm(", P ) << ",", Q) << ") = ", R) << std::endl;
+ DP101.lcm ( R, Q, P); //
+ DP101.write( DP101.write( DP101.write(
+ std::cout << "lcm(", Q ) << ",", P) << ") = ", R) << std::endl;
+
+*/
+ }
+ return 0;
+}
diff --git a/examples/Rational/Makefile.am b/examples/Rational/Makefile.am
old mode 100644
new mode 100755
index 4a4495e..545aec3
--- a/examples/Rational/Makefile.am
+++ b/examples/Rational/Makefile.am
@@ -1,5 +1,10 @@
-check: $(EXTRA_PROGRAMS)
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
+AM_CPPFLAGS=-I$(top_srcdir)
#OPTFLAGS = -O7 -funroll-all-loops -felide-constructors -fstrict-aliasing
#OPTFLAGS+= -frerun-loop-opt -fexpensive-optimizations
@@ -18,20 +23,21 @@ INCLUDES=-I$(top_srcdir)
#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS)
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS += $(OPTFLAGS) $(GMP_CFLAGS)
AM_CPPFLAGS += -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/rational -I$(top_srcdir)/src/library/tools -I$(top_srcdir)/src/library/poly1
-LDADD = -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+LDADD = -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS=-static
EXTRA_PROGRAMS=iratrecon polydouble
+CLEANFILES=$(EXTRA_PROGRAMS)
-iratrecon_SOURCES = iratrecon.C
-
+iratrecon_SOURCES = iratrecon.C
polydouble_SOURCES = polydouble.C
# for compilation of new examples
GIVARO_BIN=@bindir@
%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
-
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
diff --git a/examples/Rational/Makefile.in b/examples/Rational/Makefile.in
index 58e95c1..d424496 100644
--- a/examples/Rational/Makefile.in
+++ b/examples/Rational/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -37,7 +38,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -53,8 +61,8 @@ polydouble_OBJECTS = $(am_polydouble_OBJECTS)
polydouble_LDADD = $(LDADD)
polydouble_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -77,26 +85,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -106,40 +115,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -179,9 +198,18 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) $(OPTFLAGS) $(GMP_CFLAGS) \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/kernel/zpz \
+ -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/kernel/rational \
+ -I$(top_srcdir)/src/library/tools \
+ -I$(top_srcdir)/src/library/poly1
#OPTFLAGS = -O7 -funroll-all-loops -felide-constructors -fstrict-aliasing
#OPTFLAGS+= -frerun-loop-opt -fexpensive-optimizations
@@ -198,17 +226,11 @@ INCLUDES = -I$(top_srcdir)
#OPTFLAGS+= -parallel -par_report1
# icc for itanium2
#OPTFLAGS+= -tpp2 -mcpu=itanium2
-AM_CPPFLAGS = $(OPTFLAGS) $(GMP_CFLAGS) \
- -I$(top_srcdir)/src/kernel/system \
- -I$(top_srcdir)/src/kernel/memory \
- -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
- -I$(top_srcdir)/src/kernel/zpz \
- -I$(top_srcdir)/src/kernel/bstruct \
- -I$(top_srcdir)/src/kernel/rational \
- -I$(top_srcdir)/src/library/tools \
- -I$(top_srcdir)/src/library/poly1
-LDADD = -L${libdir} -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
-iratrecon_SOURCES = iratrecon.C
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+LDADD = -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS = -static
+CLEANFILES = $(EXTRA_PROGRAMS)
+iratrecon_SOURCES = iratrecon.C
polydouble_SOURCES = polydouble.C
# for compilation of new examples
@@ -221,14 +243,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Rational/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps examples/Rational/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu examples/Rational/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps examples/Rational/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -259,29 +281,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/iratrecon.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polydouble.Po at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -294,7 +301,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -383,6 +390,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -395,7 +403,6 @@ clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -406,6 +413,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -414,22 +423,31 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -463,9 +481,15 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
-check: $(EXTRA_PROGRAMS)
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+all: $(EXTRA_PROGRAMS)
%:%.C
- $(CXX) $(OPTFLAGS) ${INCLUDES} $(AM_CPPFLAGS) $*.C -o $* $(shell $(GIVARO_BIN)/givaro-config --cflags ) $(LDADD) $(shell $(GIVARO_BIN)/givaro-config --libs)
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
# 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/examples/Rational/iratrecon.C b/examples/Rational/iratrecon.C
index 35c88c5..b252fde 100644
--- a/examples/Rational/iratrecon.C
+++ b/examples/Rational/iratrecon.C
@@ -1,29 +1,41 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Rational/iratrecon.C
+ * @ingroup examples
+ * @ingroup rationals
+ * @example examples/Rational/iratrecon.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <stdlib.h>
#include <givaro/givrational.h>
#include <givaro/givtimer.h>
#include <givaro/givinit.h> // Givaro initialization
-
+using namespace Givaro;
int main(int argc, char** argv)
{
Integer f,m,k;
if (argc > 1) f = Integer(argv[1]); else std::cin >> f;
if (argc > 2) m = Integer(argv[2]); else std::cin >> m;
-
+
RationalDom RD;
- Rational rec;
-
+ Rational rec;
+
Timer tim; tim.clear(); tim.start();
- if (argc > 3)
+ if (argc > 3)
RD.ratrecon(rec,f,m, Integer(argv[3]) );
- else
+ else
RD.ratrecon(rec,f,m);
tim.stop();
std::cout << rec.nume() << "/" << rec.deno() << " = " << f << " mod " << m << std::endl;
std::cerr << tim << std::endl;
-
+
return 0;
}
diff --git a/examples/Rational/polydouble.C b/examples/Rational/polydouble.C
index 41f2c6a..71bf3d3 100644
--- a/examples/Rational/polydouble.C
+++ b/examples/Rational/polydouble.C
@@ -1,3 +1,15 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file examples/Rational/polydouble.C
+ * @ingroup examples
+ * @ingroup rationals
+ * @example examples/Rational/polydouble.C
+ * @brief NO DOC
+ */
#include <iostream>
#include <stdlib.h>
#include <givaro/givpoly1.h>
@@ -5,9 +17,11 @@
#include <givaro/givtimer.h>
#include <givaro/givinit.h> // Givaro initialization
+using namespace Givaro;
+
typedef Poly1Dom< RationalDom, Dense>::Element RatPoly;
typedef std::vector<double> DoublePoly;
-
+
std::ostream& operator<< (std::ostream& o, const RatPoly& v) {
o << "Poly (s [v_1, .., v_s]) : ";
o << v.size() << " [";
@@ -15,7 +29,7 @@ std::ostream& operator<< (std::ostream& o, const RatPoly& v) {
o << ' ' << v[i];
}
return o << ']';
-}
+}
std::ostream& operator<< (std::ostream& o, const DoublePoly& v) {
o << '[';
@@ -23,67 +37,67 @@ std::ostream& operator<< (std::ostream& o, const DoublePoly& v) {
o << ' ' << v[i];
}
return o << ']';
-}
+}
int main(int argc, char** argv)
{
- srand48(BaseTimer::seed() );
-
+ srandom((unsigned int)BaseTimer::seed() );
+
Integer f,m,k;
RationalDom Q;
Poly1Dom< RationalDom, Dense> PolQ(Q);
-
+
DoublePoly D;
RatPoly R;
-
+
size_t n = (argc>1?atoi(argv[1]):10);
-
- for(size_t i=0;i<n;++i)
- D.push_back( drand48() );
-
-
+
+ for(size_t i=0;i<n;++i)
+ D.push_back( (double(random()) / RAND_MAX) );
+
+
R.resize( D.size() );
-
+
RatPoly::iterator it=R.begin();
DoublePoly::const_iterator dit = D.begin();
- for( ; dit != D.end(); ++dit, ++it)
+ for( ; dit != D.end(); ++dit, ++it)
*it =*dit;
-
+
std::cout << "Double Poly : " << D << std::endl;
std::cout << "REDUCED Rational " << R << std::endl;
std::cout << "Approximations : ";
-
+
RatPoly::const_iterator cit=R.begin();
dit = D.begin();
- for( ; dit != D.end(); ++dit, ++cit)
+ for( ; dit != D.end(); ++dit, ++cit)
std::cout << std::endl << *cit << " is " << ((double)*cit) << " by " << ( (double)*cit -*dit ) << ' ';
std::cout << std::endl;
-
-
+
+
Rational::SetNoReduce();
it=R.begin();
dit = D.begin();
- for( ; dit != D.end(); ++dit, ++it)
+ for( ; dit != D.end(); ++dit, ++it)
*it =*dit;
std::cout << "Double Poly : " << D << std::endl;
std::cout << "Unreduced Rational " << R << std::endl;
std::cout << "Approximations : ";
-
+
cit=R.begin();
dit = D.begin();
- for( ; dit != D.end(); ++dit, ++cit)
+ for( ; dit != D.end(); ++dit, ++cit)
std::cout << std::endl << *cit << " is " << ((double)*cit) << " by " << ( (double)*cit -*dit ) << ' ';
std::cout << std::endl;
-
-
-
+
+
+
return 0;
}
diff --git a/givaro-config.h b/givaro-config.h
index d4a68b1..e5c7d56 100644
--- a/givaro-config.h
+++ b/givaro-config.h
@@ -3,7 +3,10 @@
/* givaro-config.h. Generated automatically at end of configure. */
/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.in by autoheader. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+/* #undef __GIVARO_AC_APPLE_UNIVERSAL_BUILD */
/* Define if GMP has no <gmpxx.h> */
/* #undef __GIVARO_GMP_NO_CXX */
@@ -19,6 +22,21 @@
#define __GIVARO_HAVE_DLFCN_H 1
#endif
+/* Define to 1 if you have the <float.h> header file. */
+#ifndef __GIVARO_HAVE_FLOAT_H
+#define __GIVARO_HAVE_FLOAT_H 1
+#endif
+
+/* Define to 1 if you have the `floor' function. */
+#ifndef __GIVARO_HAVE_FLOOR
+#define __GIVARO_HAVE_FLOOR 1
+#endif
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#ifndef __GIVARO_HAVE_GETTIMEOFDAY
+#define __GIVARO_HAVE_GETTIMEOFDAY 1
+#endif
+
/* Define if GMP is installed */
#ifndef __GIVARO_HAVE_GMP
#define __GIVARO_HAVE_GMP 1
@@ -29,16 +47,47 @@
#define __GIVARO_HAVE_INTTYPES_H 1
#endif
+/* Define to 1 if you have the <limits.h> header file. */
+#ifndef __GIVARO_HAVE_LIMITS_H
+#define __GIVARO_HAVE_LIMITS_H 1
+#endif
+
/* Define that architecture uses little endian storage */
#ifndef __GIVARO_HAVE_LITTLE_ENDIAN
#define __GIVARO_HAVE_LITTLE_ENDIAN 1
#endif
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#ifndef __GIVARO_HAVE_MALLOC
+#define __GIVARO_HAVE_MALLOC 1
+#endif
+
/* Define to 1 if you have the <memory.h> header file. */
#ifndef __GIVARO_HAVE_MEMORY_H
#define __GIVARO_HAVE_MEMORY_H 1
#endif
+/* Define to 1 if you have the `pow' function. */
+#ifndef __GIVARO_HAVE_POW
+#define __GIVARO_HAVE_POW 1
+#endif
+
+/* Define to 1 if you have the `sqrt' function. */
+#ifndef __GIVARO_HAVE_SQRT
+#define __GIVARO_HAVE_SQRT 1
+#endif
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#ifndef __GIVARO_HAVE_STDBOOL_H
+#define __GIVARO_HAVE_STDBOOL_H 1
+#endif
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#ifndef __GIVARO_HAVE_STDDEF_H
+#define __GIVARO_HAVE_STDDEF_H 1
+#endif
+
/* Define to 1 if you have the <stdint.h> header file. */
#ifndef __GIVARO_HAVE_STDINT_H
#define __GIVARO_HAVE_STDINT_H 1
@@ -64,6 +113,11 @@
#define __GIVARO_HAVE_SYS_STAT_H 1
#endif
+/* Define to 1 if you have the <sys/time.h> header file. */
+#ifndef __GIVARO_HAVE_SYS_TIME_H
+#define __GIVARO_HAVE_SYS_TIME_H 1
+#endif
+
/* Define to 1 if you have the <sys/types.h> header file. */
#ifndef __GIVARO_HAVE_SYS_TYPES_H
#define __GIVARO_HAVE_SYS_TYPES_H 1
@@ -74,6 +128,9 @@
#define __GIVARO_HAVE_UNISTD_H 1
#endif
+/* Define to 1 if the system has the type `_Bool'. */
+/* #undef __GIVARO_HAVE__BOOL */
+
/* Canonical 16-bit data type */
#ifndef __GIVARO_INT16
#define __GIVARO_INT16 short
@@ -86,7 +143,7 @@
/* Canonical 64-bit data type */
#ifndef __GIVARO_INT64
-#define __GIVARO_INT64 long long
+#define __GIVARO_INT64 long
#endif
/* Canonical 8-bit data type */
@@ -94,6 +151,12 @@
#define __GIVARO_INT8 char
#endif
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#ifndef __GIVARO_LT_OBJDIR
+#define __GIVARO_LT_OBJDIR ".libs/"
+#endif
+
/* Name of package */
#ifndef __GIVARO_PACKAGE
#define __GIVARO_PACKAGE "givaro"
@@ -101,27 +164,32 @@
/* Define to the address where bug reports for this package should be sent. */
#ifndef __GIVARO_PACKAGE_BUGREPORT
-#define __GIVARO_PACKAGE_BUGREPORT ""
+#define __GIVARO_PACKAGE_BUGREPORT "Jean-Guillaume.Dumas at imag.fr"
#endif
/* Define to the full name of this package. */
#ifndef __GIVARO_PACKAGE_NAME
-#define __GIVARO_PACKAGE_NAME ""
+#define __GIVARO_PACKAGE_NAME "Givaro"
#endif
/* Define to the full name and version of this package. */
#ifndef __GIVARO_PACKAGE_STRING
-#define __GIVARO_PACKAGE_STRING ""
+#define __GIVARO_PACKAGE_STRING "Givaro 3.4.2"
#endif
/* Define to the one symbol short name of this package. */
#ifndef __GIVARO_PACKAGE_TARNAME
-#define __GIVARO_PACKAGE_TARNAME ""
+#define __GIVARO_PACKAGE_TARNAME "givaro"
+#endif
+
+/* Define to the home page for this package. */
+#ifndef __GIVARO_PACKAGE_URL
+#define __GIVARO_PACKAGE_URL "http://ljk.imag.fr/CASYS/LOGICIELS/givaro"
#endif
/* Define to the version of this package. */
#ifndef __GIVARO_PACKAGE_VERSION
-#define __GIVARO_PACKAGE_VERSION ""
+#define __GIVARO_PACKAGE_VERSION "3.4.2"
#endif
/* The size of `char', as computed by sizeof. */
@@ -136,7 +204,7 @@
/* The size of `long', as computed by sizeof. */
#ifndef __GIVARO_SIZEOF_LONG
-#define __GIVARO_SIZEOF_LONG 4
+#define __GIVARO_SIZEOF_LONG 8
#endif
/* The size of `long long', as computed by sizeof. */
@@ -159,10 +227,39 @@
#define __GIVARO_STDC_HEADERS 1
#endif
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#ifndef __GIVARO_TIME_WITH_SYS_TIME
+#define __GIVARO_TIME_WITH_SYS_TIME 1
+#endif
+
/* Version number of package */
#ifndef __GIVARO_VERSION
-#define __GIVARO_VERSION "3.2.13"
+#define __GIVARO_VERSION "3.4.2"
+#endif
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef ___givaro_const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef ___givaro_inline */
+#endif
+
+/* Define to rpl_malloc if the replacement function should be used. */
+/* #undef ___givaro_malloc */
/* once: _GIVARO_CONFIG_H */
#endif
diff --git a/givaro-config.in b/givaro-config.in
index 5f0d159..b6fd444 100644
--- a/givaro-config.in
+++ b/givaro-config.in
@@ -1,4 +1,10 @@
#! /bin/sh
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
prefix=@prefix@
exec_prefix=@exec_prefix@
@@ -59,7 +65,7 @@ while test $# -gt 0; do
;;
--libs)
- echo -L${libdir} -lgivaro @GMP_LIBS@
+ echo -L${libdir} ${libdir}/libgivaro.so -lgivaro @GMP_LIBS@
;;
*)
diff --git a/givaro-makefile.in b/givaro-makefile.in
index 2d3eb7e..1421617 100644
--- a/givaro-makefile.in
+++ b/givaro-makefile.in
@@ -1,4 +1,10 @@
#! /bin/sh
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
prefix=@prefix@
exec_prefix=@exec_prefix@
diff --git a/givaro.doxy b/givaro.doxy
new file mode 100644
index 0000000..22cb1ef
--- /dev/null
+++ b/givaro.doxy
@@ -0,0 +1,14 @@
+// Copyright(c)'2010 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @defgroup givaro Givaro
+ *
+ * \brief Givaro library starts here.
+ *
+ */
+
+
+// vim:syntax=doxygen
diff --git a/install-sh b/install-sh
deleted file mode 100755
index 4d4a951..0000000
--- a/install-sh
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2005-05-14.22
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. 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}"
-
-chmodcmd="$chmodprog 0755"
-chowncmd=
-chgrpcmd=
-stripcmd=
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=
-dst=
-dir_arg=
-dstarg=
-no_target_directory=
-
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
-"
-
-while test -n "$1"; do
- case $1 in
- -c) shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t) dstarg=$2
- shift
- shift
- continue;;
-
- -T) no_target_directory=true
- shift
- continue;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- *) # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- test -n "$dir_arg$dstarg" && break
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
- break;;
- esac
-done
-
-if test -z "$1"; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call `install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-for src
-do
- # Protect names starting with `-'.
- case $src in
- -*) src=./$src ;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- src=
-
- if test -d "$dst"; then
- mkdircmd=:
- chmodcmd=
- else
- mkdircmd=$mkdirprog
- fi
- else
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dstarg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
-
- dst=$dstarg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst ;;
- esac
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
- exit 1
- fi
- dst=$dst/`basename "$src"`
- fi
- fi
-
- # This sed command emulates the dirname command.
- dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
-
- # Make sure that the destination directory exists.
-
- # Skip lots of stat calls in the usual case.
- if test ! -d "$dstdir"; then
- defaultIFS='
- '
- IFS="${IFS-$defaultIFS}"
-
- oIFS=$IFS
- # Some sh's can't handle IFS=/ for some reason.
- IFS='%'
- set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
- shift
- IFS=$oIFS
-
- pathcomp=
-
- while test $# -ne 0 ; do
- pathcomp=$pathcomp$1
- shift
- if test ! -d "$pathcomp"; then
- $mkdirprog "$pathcomp"
- # mkdir can fail with a `File exist' error in case several
- # install-sh are creating the directory concurrently. This
- # is OK.
- test -d "$pathcomp" || exit
- fi
- pathcomp=$pathcomp/
- done
- fi
-
- if test -n "$dir_arg"; then
- $doit $mkdircmd "$dst" \
- && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
- else
- dstfile=`basename "$dst"`
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
- trap '(exit $?); exit' 1 2 13 15
-
- # Copy the file name to the temp name.
- $doit $cpprog "$src" "$dsttmp" &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dstdir/$dstfile"; then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
- || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
- || {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
- }
- }
- fi || { (exit 1); exit 1; }
-done
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
- (exit 0); 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/ltmain.sh b/ltmain.sh
deleted file mode 100644
index 0bf3848..0000000
--- a/ltmain.sh
+++ /dev/null
@@ -1,6964 +0,0 @@
-# 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 <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 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-4"
-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 <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# 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
- SP2NL='tr \040 \012'
- NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- SP2NL='tr \100 \n'
- NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-lt_env=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- lt_env=\"$lt_var=\$$lt_var \$lt_env\"
- $lt_var=C
- export $lt_var
- fi"
-done
-
-if test -n "$lt_env"; then
- lt_env="env $lt_env"
-fi
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- $echo "$modename: not configured to build any kind of library" 1>&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 <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $exit_status
- fi
- fi
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- $run $rm "$lobj" "$output_obj"
-
- $show "$command"
- if $run eval $lt_env "$command"; then :
- else
- test -n "$output_obj" && $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $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 <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- else
- # No PIC object so indicate it doesn't exist in the libtool
- # object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
- $show "$command"
- if $run eval $lt_env "$command"; then :
- else
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $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 <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
- else
- # 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 <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
- fi
-
- $run $mv "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- # libtool link mode
- link | relink)
- modename="$modename: link"
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args="$nonopt"
- base_compile="$nonopt $@"
- compile_command="$nonopt"
- finalize_command="$nonopt"
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- notinst_path= # paths that contain not-installed libtool libraries
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
- single_module="${wl}-single_module"
-
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&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 <<EOF
- int main() { return 0; }
-EOF
- $rm conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $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 I believe you do not have"
- $echo "*** because a test_compile did reveal that the linker did not use it for"
- $echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- $rm conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $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 a test_compile did reveal that the linker did not use this one"
- $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
- $echo "*** library that it depends on before this library will be fully"
- $echo "*** functional. Installing it before continuing would be even better."
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method
- file_magic_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 "$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
- # 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 >/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 <<EOF
-
-/* $cwrappersource - temporary wrapper executable 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 executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "/bin/sh $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
-*/
-EOF
- cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#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 <<EOF
- newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
- cat >> $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<argc+1; i++)
- {
- DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- ;
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",(char const **)newargz);
-EOF
- ;;
- *)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",newargz);
-EOF
- ;;
- esac
-
- cat >> $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 <bug-libtool at gnu.org>."
- 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/macros/Makefile.am b/macros/Makefile.am
old mode 100755
new mode 100644
index 1f5a12f..caebd4c
--- a/macros/Makefile.am
+++ b/macros/Makefile.am
@@ -1,5 +1,12 @@
-EXTRA_DIST=\
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+EXTRA_DIST= \
aclocal-include.m4 \
gmp-check.m4 \
- config-header.m4
-
+ config-header.m4 \
+ givaro-doc.m4
+
diff --git a/macros/Makefile.in b/macros/Makefile.in
index a81912b..3cfe409 100644
--- a/macros/Makefile.in
+++ b/macros/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -13,6 +14,12 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -36,12 +43,21 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -53,26 +69,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -82,40 +99,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -155,12 +182,14 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
aclocal-include.m4 \
gmp-check.m4 \
- config-header.m4
+ config-header.m4 \
+ givaro-doc.m4
all: all-am
@@ -169,14 +198,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu macros/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps macros/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu macros/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps macros/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -275,6 +304,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -283,18 +314,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
diff --git a/macros/aclocal-include.m4 b/macros/aclocal-include.m4
old mode 100755
new mode 100644
index abf6533..90e401f
--- a/macros/aclocal-include.m4
+++ b/macros/aclocal-include.m4
@@ -1,4 +1,9 @@
# aclocal-include.m4
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
#
# This macro adds the name macrodir to the set of directories
# that `aclocal' searches for macros.
@@ -14,3 +19,4 @@ AC_DEFUN([AM_ACLOCAL_INCLUDE],
for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
])
+
diff --git a/macros/config-header.m4 b/macros/config-header.m4
index 7e27e84..ec1fddf 100644
--- a/macros/config-header.m4
+++ b/macros/config-header.m4
@@ -1,4 +1,8 @@
-
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
AC_DEFUN([AX_PREFIX_CONFIG_H],[AC_REQUIRE([AC_CONFIG_HEADER])
AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
@@ -69,7 +73,6 @@ else
rm -f "$_OUT"
mv $tmp/pconfig.h "$_OUT"
fi
- cp _script _configs.sed
else
AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
fi
diff --git a/macros/debug.m4 b/macros/debug.m4
new file mode 100644
index 0000000..2141058
--- /dev/null
+++ b/macros/debug.m4
@@ -0,0 +1,91 @@
+# Copyright(c)'2011 by The Givaro group
+# Written by BB <bboyer at imag.fr>
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+dnl enable basic debug mode.
+AC_DEFUN([AC_DEBUG],
+[AC_MSG_CHECKING([whether to enable debugging options in the library])
+ AC_ARG_ENABLE(debug,
+[AC_HELP_STRING([--enable-debug], [enable debugging options in library])],
+ USE_DEBUG=$enableval,
+ USE_DEBUG=no)
+ AC_MSG_RESULT([$USE_DEBUG])
+ AM_CONDITIONAL(DEBUG, [test $USE_DEBUG = yes])
+ DBG=$USE_DEBUG
+ AC_SUBST(DBG)dnl
+]
+)
+
+dnl enable as much debug flag options as possible
+dnl AC_DEFUN([AC_FULL_DEBUG],
+dnl [AC_MSG_CHECKING([whether to enable full debugging mode in the library])
+ dnl AC_ARG_ENABLE(full-debug,
+dnl [ --enable-full-debug enable full debugging options in library],
+ dnl USE_FULL_DEBUG=$enableval,
+ dnl USE_FULL_DEBUG=no)
+ dnl AC_MSG_RESULT([$USE_FULL_DEBUG])
+ dnl AM_CONDITIONAL(FULL_DEBUG, [test $USE_FULL_DEBUG = yes])
+ dnl FULLDBG=$USE_FULL_DEBUG
+ dnl AC_SUBST(FULLDBG)dnl
+dnl ]
+dnl )
+
+
+dnl Enable warnings from compiler.
+AC_DEFUN([AC_WARNINGS],
+[AC_MSG_CHECKING([whether to enable warnings when compiling the library])
+ AC_ARG_ENABLE(warnings,
+[AC_HELP_STRING([--enable-warnings],[enable warings when compiling the library])],
+ USE_WARNINGS=$enableval,
+ USE_WARNINGS=no)
+ AC_MSG_RESULT([$USE_WARNINGS])
+ AM_CONDITIONAL(WARNINGS, [test $USE_WARNINGS = yes])
+ WARN=$USE_WARNINGS
+ AC_SUBST(WARN)dnl
+]
+)
+
+AC_DEFUN([AC_COMPILER_NAME],
+[
+AC_MSG_CHECKING(for family name of compiler)
+AC_TRY_RUN(dnl ICC ?
+[ #ifdef __INTEL_COMPILER
+ int main() { return 0 ; }
+ #else
+ pas intel
+ #endif],dnl
+[dnl
+ AC_MSG_RESULT(icc)
+ CCNAM=icc
+ AC_SUBST(CCNAM)
+],dnl GCC ?
+[dnl
+ AC_TRY_RUN(dnl GCC ?
+[#ifdef __GNUC__
+ int main() { return 0 ; }
+ #else
+ pas gcc non plus.
+ #endif],[
+ AC_MSG_RESULT(gcc)
+ CCNAM=gcc
+ AC_SUBST(CCNAM)
+ ],[
+ AC_MSG_RESULT(unknown)
+ CCNAM=unknown
+ AC_SUBST(CCNAM)
+ ],[
+ AC_MSG_RESULT(unknown)
+ CCNAM=unknown
+ AC_SUBST(CCNAM)
+ ])
+],dnl GCC !
+[
+ AC_MSG_RESULT(unknown)
+ CCNAM=unknown
+ AC_SUBST(CCNAM)
+])
+])
+
diff --git a/macros/givaro-doc.m4 b/macros/givaro-doc.m4
new file mode 100644
index 0000000..512f725
--- /dev/null
+++ b/macros/givaro-doc.m4
@@ -0,0 +1,49 @@
+
+AC_DEFUN([GIV_DOC],
+[
+
+AC_MSG_CHECKING(whether to build documentation)
+
+
+AC_ARG_WITH(docdir,
+[AC_HELP_STRING([--with-docdir=<path>], [Where the Givaro documentation should be installed])],
+ [
+ GIVARO_DOC_PATH="$withval"
+ ],
+ [
+ eval GIVARO_DOC_PATH="${prefix}/docs"
+ ])
+
+AC_SUBST(GIVARO_DOC_PATH)
+
+AC_ARG_WITH(doxygen,
+[AC_HELP_STRING([--with-doxygen=<path>], [Give the path to Doxygen. Note: --enable-doc needed])],
+ [
+ DOXYGEN_PATH="$PATH $withval"
+ ],
+ [
+ DOXYGEN_PATH="$PATH"
+ ])
+
+AC_ARG_ENABLE(docs,[AC_HELP_STRING([--enable-doc], [Enable building documentation])],
+[
+AC_MSG_RESULT(yes)
+AC_MSG_CHECKING(whether doxygen works)
+export PATH=$DOXYGEN_PATH
+(doxygen --version) < /dev/null > /dev/null 2>&1 || {
+ AC_MSG_RESULT(no)
+ echo
+ echo "You must have doxygen installed to create documentation for"
+ echo "Givaro. This error only happens if you use --enable-doc."
+ echo "Download the appropriate package for your distribution, or get"
+ echo "the source tarball from http://www.stack.nl/~dimitri/doxygen/"
+ exit -1
+}
+AC_MSG_RESULT(yes)
+AM_CONDITIONAL(GIVARO_BUILD_DOC, true)
+],
+[
+AC_MSG_RESULT(no)
+AM_CONDITIONAL(GIVARO_BUILD_DOC, false)
+])
+])
diff --git a/macros/gmp-check.m4 b/macros/gmp-check.m4
index 25323f0..55ad0fd 100644
--- a/macros/gmp-check.m4
+++ b/macros/gmp-check.m4
@@ -1,4 +1,10 @@
# Check for GMP
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+#
# Modified by Pascal Giorgi, 2003-12-03
dnl LB_CHECK_GMP ([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
@@ -9,13 +15,13 @@ AC_DEFUN([LB_CHECK_GMP],
[
AC_ARG_WITH(gmp,
- [ --with-gmp= <path>|yes|no
- Use GMP library.
+ [AC_HELP_STRING([--with-gmp=<path>|yes|no],[
+ Use GMP library.
If argument is no, you do not have the library installed on your machine.
If argument is yes or <empty> that means the library is reachable with the standard
search path "/usr" or "/usr/local" (set as default).
- Otherwise you give the <path> to the directory which contain the library.
- ],
+ Otherwise you give the <path> to the directory which contain the library.
+ ])],
[if test "$withval" = yes ; then
GMP_HOME_PATH="/usr"
elif test "$withval" != no ; then
@@ -30,21 +36,26 @@ BACKUP_CXXFLAGS=${CXXFLAGS}
BACKUP_LIBS=${LIBS}
-for GMP_HOME in ${GMP_HOME_PATH}
- do
+for GMP_HOME in ${GMP_HOME_PATH}
+ do
if test "x$GMP_HOME" != "x/usr" -a "x$GMP_HOME" != "x/usr/local"; then
if test -r "$GMP_HOME/include/gmp.h" ; then
GMP_CFLAGS="-I${GMP_HOME}/include"
GMP_LIBS="-L${GMP_HOME}/lib -lgmp"
else
+ if test -r "$GMP_HOME/gmp.h" ; then
+ GMP_CFLAGS="-I${GMP_HOME}"
+ GMP_LIBS="-L${GMP_HOME} -lgmp"
+ else
echo "($GMP_HOME) seems an invalid GMP prefix"
echo "Searching GMP in PATH"
GMP_CFLAGS=
GMP_LIBS="-lgmp"
+ fi
fi
else
GMP_CFLAGS=
- GMP_LIBS="-lgmp"
+ GMP_LIBS="-lgmp"
fi
AC_MSG_CHECKING(for GMP >= $min_gmp_version)
CXXFLAGS="${CXXFLAGS} ${GMP_CFLAGS}"
@@ -86,7 +97,7 @@ for GMP_HOME in ${GMP_HOME_PATH}
],[
dnl This should never happen
AC_MSG_RESULT(no)
- ])
+ ])
],[
AC_MSG_RESULT(no)
AC_DEFINE(GMP_VERSION_3,1,[Define if GMP is version 3.xxx])
@@ -97,7 +108,7 @@ for GMP_HOME in ${GMP_HOME_PATH}
AC_MSG_RESULT(no)
])
ifelse([$2], , :, [$2])
- ],[
+ ],[
AC_MSG_RESULT(problem)
echo "Sorry, your GMP version is too old. Disabling."
unset GMP_CFLAGS
@@ -110,14 +121,14 @@ for GMP_HOME in ${GMP_HOME_PATH}
echo "whether your GMP version is new enough. I am assuming it is."
AC_SUBST(GMP_CFLAGS)
AC_SUBST(GMP_LIBS)
- AC_DEFINE(HAVE_GMP,1,[Define if GMP is installed])
+ AC_DEFINE(HAVE_GMP,1,[Define if GMP is installed])
ifelse([$2], , :, [$2])
])
break
],[
AC_MSG_RESULT(not found)
unset GMP_CFLAGS
- unset GMP_LIBS
+ unset GMP_LIBS
ifelse([$3], , :, [$3])
])
done
diff --git a/macros/libtool.m4 b/macros/libtool.m4
new file mode 100644
index 0000000..8ff3c76
--- /dev/null
+++ b/macros/libtool.m4
@@ -0,0 +1,7851 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) 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"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ 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<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ 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
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ 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 | kopensolaris*-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
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ 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
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t at _DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/macros/ltoptions.m4 b/macros/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/macros/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/macros/ltsugar.m4 b/macros/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/macros/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/macros/ltversion.m4 b/macros/ltversion.m4
new file mode 100644
index 0000000..9c7b5d4
--- /dev/null
+++ b/macros/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3293 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4'
+macro_revision='1.3293'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/macros/lt~obsolete.m4 b/macros/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/macros/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/src/Makefile.am b/src/Makefile.am
index 8580571..8da9237 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,14 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-SUBDIRS=kernel library
+AM_CPPFLAGS=-I$(top_srcdir)
+
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+
+SUBDIRS=kernel library
lib_LTLIBRARIES= libgivaro.la
@@ -10,4 +18,4 @@ libgivaro_la_LIBADD= \
kernel/gmp++/libgmppp.la kernel/bstruct/libgivbstruct.la kernel/integer/libgivinteger.la kernel/memory/libgivmemory.la kernel/rational/libgivrational.la kernel/system/libgivsystem.la kernel/zpz/libgivzpz.la library/tools/libgivtools.la library/poly1/libgivpoly1.la
# soname of libgivaro
-libgivaro_la_LDFLAGS = -version-info 0:2:0
+libgivaro_la_LDFLAGS = -version-info 2:2:2
diff --git a/src/Makefile.in b/src/Makefile.in
index 074ceb0..3120c0a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -37,7 +44,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -64,8 +78,8 @@ libgivaro_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(libgivaro_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -98,26 +112,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -127,40 +142,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -200,10 +225,12 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-SUBDIRS = kernel library
+AM_CPPFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+SUBDIRS = kernel library
lib_LTLIBRARIES = libgivaro.la
libgivaro_la_SOURCES = dummy.C
libgivaro_la_LIBADD = \
@@ -211,7 +238,7 @@ libgivaro_la_LIBADD = \
# soname of libgivaro
-libgivaro_la_LDFLAGS = -version-info 0:2:0
+libgivaro_la_LDFLAGS = -version-info 2:2:2
all: all-recursive
.SUFFIXES:
@@ -220,14 +247,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -281,28 +308,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dummy.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -317,7 +330,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -342,7 +355,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -385,7 +398,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -521,7 +534,6 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -532,6 +544,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -540,22 +554,31 @@ install-data-am:
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am: install-libLTLIBRARIES
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/dummy.C b/src/dummy.C
index 7131ff6..d2c6db7 100644
--- a/src/dummy.C
+++ b/src/dummy.C
@@ -1,3 +1,8 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
#include "givaro-config.h"
diff --git a/src/kernel/Makefile.am b/src/kernel/Makefile.am
index aade02e..06493ee 100644
--- a/src/kernel/Makefile.am
+++ b/src/kernel/Makefile.am
@@ -1,4 +1,12 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+AM_CPPFLAGS=-I$(top_srcdir)
+
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
SUBDIRS=system memory gmp++ integer bstruct rational zpz
diff --git a/src/kernel/Makefile.in b/src/kernel/Makefile.in
index 0987362..a4f72dc 100644
--- a/src/kernel/Makefile.in
+++ b/src/kernel/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -13,6 +14,12 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -36,12 +43,21 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -65,26 +81,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -94,40 +111,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -167,9 +194,11 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
SUBDIRS = system memory gmp++ integer bstruct rational zpz
all: all-recursive
@@ -178,14 +207,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -217,7 +246,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -242,7 +271,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -285,7 +314,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -426,6 +455,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -434,18 +465,28 @@ install-data-am:
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am:
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
diff --git a/src/kernel/bstruct/Makefile.am b/src/kernel/bstruct/Makefile.am
index 1cc924a..2661686 100644
--- a/src/kernel/bstruct/Makefile.am
+++ b/src/kernel/bstruct/Makefile.am
@@ -1,22 +1,29 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
- givarray0.h \
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+
+pkginclude_HEADERS= \
+ givarray0.h \
givarrayallocator.h \
givarrayfixed.h \
- givbits.h \
- givelem.h \
+ givbits.h \
+ givelem.h \
givhashtable.h \
- givlist0.h \
- givstack.h \
+ givlist0.h \
+ givstack.h \
givarray0.inl \
- givbits.inl \
+ givbits.inl \
givhashtable.inl \
givlist0.inl \
- givstack.inl
+ givstack.inl
noinst_LTLIBRARIES=libgivbstruct.la
-libgivbstruct_la_SOURCES=givbits.C
\ No newline at end of file
+libgivbstruct_la_SOURCES=givbits.C
diff --git a/src/kernel/bstruct/Makefile.in b/src/kernel/bstruct/Makefile.in
index 8bb86cc..16a2678 100644
--- a/src/kernel/bstruct/Makefile.in
+++ b/src/kernel/bstruct/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -50,8 +64,8 @@ libgivbstruct_la_LIBADD =
am_libgivbstruct_la_OBJECTS = givbits.lo
libgivbstruct_la_OBJECTS = $(am_libgivbstruct_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -83,26 +97,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -112,40 +127,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -185,24 +210,26 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
- givarray0.h \
+ givarray0.h \
givarrayallocator.h \
givarrayfixed.h \
- givbits.h \
- givelem.h \
+ givbits.h \
+ givelem.h \
givhashtable.h \
- givlist0.h \
- givstack.h \
+ givlist0.h \
+ givstack.h \
givarray0.inl \
- givbits.inl \
+ givbits.inl \
givhashtable.inl \
givlist0.inl \
- givstack.inl
+ givstack.inl
noinst_LTLIBRARIES = libgivbstruct.la
libgivbstruct_la_SOURCES = givbits.C
@@ -214,14 +241,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/bstruct/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/bstruct/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/bstruct/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/bstruct/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -257,28 +284,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givbits.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -308,7 +321,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -413,7 +426,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -424,6 +436,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -432,22 +446,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/kernel/bstruct/givarray0.h b/src/kernel/bstruct/givarray0.h
index e4091f2..096414e 100644
--- a/src/kernel/bstruct/givarray0.h
+++ b/src/kernel/bstruct/givarray0.h
@@ -1,104 +1,127 @@
-#ifndef _GIV_ARRAY0_H_
-#define _GIV_ARRAY0_H_
-// ==========================================================================
+// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givarray0.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givarray0.h,v 1.3 2005/06/14 14:53:14 pernet Exp $
-// ==========================================================================
+// $Id: givarray0.h,v 1.7 2011-02-02 16:23:55 bboyer Exp $
+// ==========================================================================
// Description:
// Array of type T with reference mecanism.
+#ifndef __GIVARO_array0_H
+#define __GIVARO_array0_H
#include <stddef.h> // size_t
#include "givaro/givaromm.h"
#include "givaro/givperf.h"
#include "givaro/giverror.h"
+namespace Givaro {
+
GIVARO_PERF_DEFCLASS(Array0,T)
template <class T>
class Array0 GIVARO_PERF_INEHERIT(Array0,T) {
- //-- Recopy cstor : private: don't use it
- Array0 (const Array0<T>& p);
- void build( size_t s, const T& t) ;
+ void build( size_t s, const T& t) ;
public :
- typedef int Indice_t;
- typedef T Type_t;
- typedef Array0<T> Self_t;
- typedef Type_t *Iterator_t;
- typedef const Type_t *constIterator_t;
+ typedef int Indice_t;
+ typedef T Type_t;
+ typedef Array0<T> Self_t;
+ typedef Type_t *Iterator_t;
+ typedef const Type_t *constIterator_t;
+
+ // STL compliance
+ typedef Type_t value_type;
+ typedef Type_t *iterator;
+ typedef const Type_t *const_iterator;
+
+
+ //-- Default cstor : ctsor of s size array
+ Array0 (size_t s = 0);
+ Array0 (size_t s, const T& t);
- // STL compliance
- typedef Type_t value_type;
- typedef Type_t *iterator;
- typedef const Type_t *const_iterator;
+ //-- Recopy cstor : logical copy
+ Array0 (const Self_t& p, givNoCopy);
+ //-- Recopy cstor : physical copy
+ Array0 (const Self_t& p, givWithCopy);
+ //-- Destructor
+ ~Array0 ();
- //-- Default cstor : ctsor of s size array
- Array0 (size_t s = 0);
- Array0 (size_t s, const T& t);
+ //-- Destroy of the array
+ void destroy ();
- //-- Recopy cstor : logical copy
- Array0 (const Self_t& p, givNoCopy);
- //-- Recopy cstor : physical copy
- Array0 (const Self_t& p, givWithCopy);
+ //-- Allocation of an array of s Elements: if refcount>1
+ // then it is always a creation of new array
+ void allocate (size_t s);
- //-- Destructor
- ~Array0 ();
+ //-- Reallocation of an array of s Elements: if refcount>1
+ // then it is always a creation of new array + recopy
+ void reallocate (size_t s);
+ void resize (size_t s) { this->reallocate(s); }
+ void reserve (size_t s) { this->reallocate(s); this->reallocate(0); }
- //-- Destroy of the array
- void destroy ();
+ //-- Physical copy operator: reallocate dest of the same size
+ // as src (if necessary) and apply GivaroCopyItem<Array<T>,T> on each Element.
+ // This class can be specialized. Return dest (i.e, *this).
+ Self_t& copy(const Self_t& src);
- //-- Allocation of an array of s Elements: if refcount>1
- // then it is always a creation of new array
- void allocate (size_t s);
+ //-- Logical recopy operator: make an alias to src. Return dest.
+ Self_t& logcopy(const Self_t& src);
- //-- Reallocation of an array of s Elements: if refcount>1
- // then it is always a creation of new array + recopy
- void reallocate (size_t s);
+ //-- assignement operator is physical copy
+ Self_t& operator= (const Self_t& p);
- //-- Physical copy operator: reallocate dest of the same size
- // as src (if necessary) and apply GivaroCopyItem<Array<T>,T> on each Element.
- // This class can be specialized. Return dest (i.e, *this).
- Self_t& copy(const Self_t& src);
+ //-- Return the occuped size of the array
+ size_t size() const { return _size; }
- //-- Logical recopy operator: make an alias to src. Return dest.
- Self_t& logcopy(const Self_t& src);
+ //-- Return the physical size of the array (capacity)
+ size_t phsize() const;
- //-- Return the occuped size of the array
- size_t size() const { return _size; }
+ //-- Return the base ptr to the array
+ Type_t* baseptr();
+ const Type_t* baseptr() const;
- //-- Return the physical size of the array (capacity)
- size_t phsize() const;
+ //-- Access to the ith Element:
+ const T& operator[] (Indice_t i) const; // { return _d[i]; }
+ T& operator[] (Indice_t i); // { return _d[i]; } ;
+ const T& front () const; // { return _d[0]; }
+ T& front (); // { return _d[0]; } ;
+ const T& back () const; // *(--end())
+ T& back (); // *(--end())
- //-- Return the base ptr to the array
- Type_t* baseptr();
- Type_t* const baseptr() const;
+ //-- add one element at the end
+ void push_back( const T& a );
- //-- Access to the ith Element:
- const T& operator[] (Indice_t i) const; // { return _d[i]; }
- T& operator[] (Indice_t i); // { return _d[i]; } ;
- void write(Indice_t i, const Type_t& val);
- void read (Indice_t i, Type_t& val) const;
+ void write(Indice_t i, const Type_t& val);
+ void read (Indice_t i, Type_t& val) const;
- Iterator_t begin();
- Iterator_t end();
- constIterator_t begin() const;
- constIterator_t end() const;
+ Iterator_t begin();
+ Iterator_t end();
+ constIterator_t begin() const;
+ constIterator_t end() const;
+
+ int getCounter() const
+ {
+ return *_cnt ;
+ }
protected : //--------------------- protected Internal representation
- int* _cnt; // reference counter on _d
- size_t _size; // actual size of the array. If ==0 then _psz=_d=_cnt=0
- size_t _psz; // physical size of the array
- T* _d; // ptr to the memory
-private:
- //-- assignement operator cannot be herited.
- Self_t& operator= (const Self_t& p);
+ int* _cnt; // reference counter on _d
+ size_t _size; // actual size of the array. If ==0 then _psz=_d=_cnt=0
+ size_t _psz; // physical size of the array
+ T* _d; // ptr to the memory
};
+} // namespace Givaro
+
#include "givaro/givarray0.inl"
-#endif
+#endif // __GIVARO_array0_H
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/bstruct/givarray0.inl b/src/kernel/bstruct/givarray0.inl
index 819e407..c865dc1 100644
--- a/src/kernel/bstruct/givarray0.inl
+++ b/src/kernel/bstruct/givarray0.inl
@@ -1,233 +1,293 @@
// ========================================================================== //
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givarray0.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givarray0.inl,v 1.3 2005/06/14 14:53:14 pernet Exp $
+// $Id: givarray0.inl,v 1.7 2011-02-02 16:23:55 bboyer Exp $
// ======================================================================= //
// Description:
// implementation of operators of Array0<T>
+#ifndef __GIVARO__array0_INL
+#define __GIVARO__array0_INL
- // -- Default cstor : ctsor of s size array
-template<class T>
-inline void Array0<T>::build( size_t s, const T& t) {
- GIVARO_ASSERT( s>=0, "[Array<T>::cstor(size_t)] must takes a >=0 parameter");
- _psz = _size = s;
- if (s !=0) {
- _d = GivaroMM<T>::allocate(s);
- GivaroMM<T>::initialize(_d, s, t);
- _cnt = GivaroMM<int>::allocate(1);
- *_cnt = 1;
- } else { _d =0; _cnt =0; }
-}
-
-template<class T>
-inline Array0<T>::Array0 ( size_t s ) {
- build(s, T());
-}
-
-template<class T>
-inline Array0<T>::Array0 ( size_t s, const T& t) {
- build(s, t);
-}
-
-
- //-- Recopy cstor : logical copy
-template<class T>
-inline Array0<T>::Array0 (const Array0<T>& p, givNoCopy)
-{
- _psz = p._psz; _size = p._size;
- if (_size !=0)
- { // -- increment ref. counting
- _d = p._d;
- _cnt = p._cnt; (*_cnt) ++;
- }
- else { _d = 0; _cnt = 0; }
-}
-
-
- //-- Recopy cstor : physical copy
-template<class T>
-inline Array0<T>::Array0 (const Array0<T>& p, givWithCopy)
-{
- _psz = _size = p._size;
- if (_size !=0) {
- _d = GivaroMM<T>::allocate(_size);
- _cnt = GivaroMM<int>::allocate(1);
- *_cnt = 1;
- for (size_t i=0; i<_size; i++)
- GivaroMM<T>::initone(&_d[i], p._d[i]);
- } else { _d =0; _cnt =0; }
-}
-
- // -- Destroy of the array
-template<class T>
-inline void Array0<T>::destroy( )
-{
- if (_psz !=0) {
- if (--(*_cnt) ==0)
- {
- GivaroMM<T>::destroy(_d, _psz);
- GivaroMM<T>::desallocate(_d);
- GivaroMM<int>::desallocate(_cnt);
- }
- }
- _size = _psz = 0; _cnt = 0; _d = 0;
-}
-
- // -- Allocation of an array of s Elements
-template<class T>
-inline void Array0<T>::allocate( size_t s )
-{
- GIVARO_ASSERT( s>=0, "[Array<T>::allocate]: must takes a >=0 parameter");
- if (_cnt !=0) {
- if (((*_cnt) ==1) && (_psz >= s)) { _size = s; return; }
- this->destroy();
- }
- if (s >0) {
- _d = GivaroMM<T>::allocate(s);
- GivaroMM<T>::initialize(_d, s);
- _cnt = GivaroMM<int>::allocate(1);
- *_cnt = 1;
- }
- else _cnt =0;
- _psz = _size = s;
-}
-
- // Reallocation of an array of s Elements
- // and recopy the min(_size,s) first Elements
-template<class T>
-inline void Array0<T>::reallocate( size_t s )
-{
- GIVARO_ASSERT( s>=0, "[Array<T>::reallocate]: must takes a >=0 parameter");
- if (_cnt !=0) {
- if (*_cnt ==1) {
- if (_psz >=s) { _size = s; return; }
- }
- else (*_cnt) --;
- }
- if (s >0) {
- T* tmp = GivaroMM<T>::allocate(s);
- GivaroMM<T>::initialize(tmp+_size, s-_size);
- if (_cnt !=0) {
- for (size_t i=0; i<_size; i++)
- GivaroMM<T>::initone(&(tmp[i]), _d[i]);
- this->destroy();
- }
- _cnt = GivaroMM<int>::allocate(1);
- *_cnt = 1;
- _d = tmp;
- } else _cnt =0;
- _psz = _size = s;
-}
-
-
- // Logical destructor: identical to free
-template<class T>
-inline Array0<T>::~Array0 ()
-{
- this->destroy();
-}
-
-
-// Physical copy : recopy and assignement on each Element
-template <class T>
-inline Array0<T>& Array0<T>::copy (const Array0<T>& src)
-{
- if (src._d == _d) return *this;
- reallocate(src._size); // - try...
- // -- here we have a large enough array with refcount==1
- const T* baseP = src._d;
- T* baseThis = _d;
- for (size_t i=0; i<_size; i++)
- baseThis[i] = baseP[i];
- return *this;
-}
-
-// Physical copy : recopy and assignement on each Element
-template <class T>
-inline Array0<T>& Array0<T>::logcopy (const Array0<T>& src)
-{
- destroy();
- _psz = src._psz; _size = src._size;
- if (_psz !=0)
- {
- _d = src._d;
- _cnt = src._cnt; (*_cnt) ++;
- }
- else { _d = 0; _cnt = 0; }
- return *this;
-}
-
-template<class T>
-Array0<T>& Array0<T>::operator= (const Array0<T>& p)
-{
- //throw GivError("[Array0<T>::operator=] cannot be used" " File:" ##__FILE__ ", line:" ##__LINE__ );
- throw GivError("[Array0<T>::operator=] cannot be used");
- return *this;
-}
-
-template<class T>
-inline size_t Array0<T>::phsize() const { return _psz; }
-
-template<class T>
-inline T* Array0<T>::baseptr() { return _d; }
-
-template<class T>
-inline T* const Array0<T>::baseptr() const { return _d; }
-
-
- // This foloowing functions directly access to protected
-template <class T>
-inline const T& Array0<T>::operator[] (Indice_t i) const
-{
- GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
- GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::[]]: index out of bounds.");
- return _d[i];
-}
-
-// Access operator : Write access
-template <class T>
-inline T& Array0<T>::operator[] (Indice_t i)
-{
- GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
- GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>]: index out of bounds.");
- return _d[i];
-}
-template <class T>
-inline void Array0<T>::write( Indice_t i, const T& val)
-{
- GIVARO_ASSERT(_size >0, "[Array<T>::write]: try to access to an Element of null size Array0.");
- GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::write]: index out of bounds.");
- _d[i] = val;
-}
-
-template <class T>
-inline void Array0<T>::read ( Indice_t i, T& val ) const
-{
- GIVARO_ASSERT(_size >0, "[Array<T>::read]: try to access to an Element of null size Array0");
- GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::read]: index out of bounds.");
- val = _d[i];
-}
-
-template <class T>
-inline typename Array0<T>::Iterator_t
- Array0<T>::begin()
-{ return _d; }
-
-template <class T>
-inline typename Array0<T>::Iterator_t
- Array0<T>::end()
-{ return _d + _size; }
-
-template <class T>
-inline typename Array0<T>::constIterator_t
- Array0<T>::begin() const
-{ return _d; }
-
-template <class T>
-inline typename Array0<T>::constIterator_t
- Array0<T>::end() const
-{ return _d + _size; }
+namespace Givaro {
+ // -- Default cstor : ctsor of s size array
+ template<class T>
+ inline void Array0<T>::build( size_t s, const T& t) {
+ // JGD 24.02.2011 : size_t is unsigned
+ // GIVARO_ASSERT( s>=0, "[Array<T>::cstor(size_t)] must takes a >=0 parameter");
+ _psz = _size = s;
+ if (s !=0) {
+ _d = GivaroMM<T>::allocate(s);
+ GivaroMM<T>::initialize(_d, s, t);
+ _cnt = GivaroMM<int>::allocate(1);
+ *_cnt = 1;
+ } else { _d =0; _cnt =0; }
+ }
+
+ template<class T>
+ inline Array0<T>::Array0 ( size_t s ) {
+ build(s, T());
+ }
+
+ template<class T>
+ inline Array0<T>::Array0 ( size_t s, const T& t) {
+ build(s, t);
+ }
+
+
+ //-- Recopy cstor : logical copy
+ template<class T>
+ inline Array0<T>::Array0 (const Array0<T>& p, givNoCopy)
+ {
+ _psz = p._psz; _size = p._size;
+ if (_size !=0)
+ { // -- increment ref. counting
+ _d = p._d;
+ _cnt = p._cnt; (*_cnt) ++;
+ }
+ else { _d = 0; _cnt = 0; }
+ }
+
+
+ //-- Recopy cstor : physical copy
+ template<class T>
+ inline Array0<T>::Array0 (const Array0<T>& p, givWithCopy)
+ {
+ _psz = _size = p._size;
+ if (_size !=0) {
+ _d = GivaroMM<T>::allocate(_size);
+ _cnt = GivaroMM<int>::allocate(1);
+ *_cnt = 1;
+ for (size_t i=0; i<_size; i++)
+ GivaroMM<T>::initone(&_d[i], p._d[i]);
+ } else { _d =0; _cnt =0; }
+ }
+
+ // -- Destroy of the array
+ template<class T>
+ inline void Array0<T>::destroy( )
+ {
+ if (_psz !=0) {
+ if (--(*_cnt) ==0)
+ {
+ GivaroMM<T>::destroy(_d, _psz);
+ GivaroMM<T>::desallocate(_d);
+ GivaroMM<int>::desallocate(_cnt);
+ }
+ }
+ _size = _psz = 0; _cnt = 0; _d = 0;
+ }
+
+ // -- Allocation of an array of s Elements
+ template<class T>
+ inline void Array0<T>::allocate( size_t s )
+ {
+ // JGD 24.02.2011 : size_t is unsigned
+ // GIVARO_ASSERT( s>=0, "[Array<T>::allocate]: must takes a >=0 parameter");
+ if (_cnt !=0) {
+ if (((*_cnt) ==1) && (_psz >= s)) { _size = s; return; }
+ this->destroy();
+ }
+ if (s >0) {
+ _d = GivaroMM<T>::allocate(s);
+ GivaroMM<T>::initialize(_d, s);
+ _cnt = GivaroMM<int>::allocate(1);
+ *_cnt = 1;
+ }
+ else _cnt =0;
+ _psz = _size = s;
+ }
+
+ // Reallocation of an array of s Elements
+ // and recopy the min(_size,s) first Elements
+ template<class T>
+ inline void Array0<T>::reallocate( size_t s )
+ {
+ // JGD 24.02.2011 : size_t is unsigned
+ // GIVARO_ASSERT( s>=0, "[Array<T>::reallocate]: must takes a >=0 parameter");
+ if (_cnt !=0) {
+ if (*_cnt ==1) {
+ if (_psz >=s) { _size = s; return; }
+ }
+ else (*_cnt) --;
+ }
+ if (s >0) {
+ T* tmp = GivaroMM<T>::allocate(s);
+ GivaroMM<T>::initialize(tmp+_size, s-_size);
+ if (_cnt !=0) {
+ for (size_t i=0; i<_size; i++)
+ GivaroMM<T>::initone(&(tmp[i]), _d[i]);
+ this->destroy();
+ }
+ _cnt = GivaroMM<int>::allocate(1);
+ *_cnt = 1;
+ _d = tmp;
+ } else _cnt =0;
+ _psz = _size = s;
+ }
+
+ template<class T>
+ inline void Array0<T>::push_back( const T& a )
+ {
+ this->reallocate(_size+1);
+ this->back() = a;
+ }
+
+ // Logical destructor: identical to free
+ template<class T>
+ inline Array0<T>::~Array0 ()
+ {
+ this->destroy();
+ }
+
+
+ // Physical copy : recopy and assignement on each Element
+ template <class T>
+ inline Array0<T>& Array0<T>::copy (const Array0<T>& src)
+ {
+ if (src._d == _d) return *this;
+ reallocate(src._size); // - try...
+ // -- here we have a large enough array with refcount==1
+ const T* baseP = src._d;
+ T* baseThis = _d;
+ for (size_t i=0; i<_size; i++)
+ baseThis[i] = baseP[i];
+ return *this;
+ }
+
+ // Logical copy
+ template <class T>
+ inline Array0<T>& Array0<T>::logcopy (const Array0<T>& src)
+ {
+ destroy();
+ _psz = src._psz; _size = src._size;
+ if (_psz !=0)
+ {
+ _d = src._d;
+ _cnt = src._cnt; (*_cnt) ++;
+ }
+ else { _d = 0; _cnt = 0; }
+ return *this;
+ }
+
+
+ // Physical copy
+ template<class T>
+ Array0<T>& Array0<T>::operator= (const Array0<T>& p)
+ {
+ //throw GivError("[Array0<T>::operator=] cannot be used" " File:" ##__FILE__ ", line:" ##__LINE__ );
+ // throw GivError("[Array0<T>::operator=] cannot be used");
+ return this->copy(p);
+ }
+
+ template<class T>
+ inline size_t Array0<T>::phsize() const { return _psz; }
+
+ template<class T>
+ inline T* Array0<T>::baseptr() { return _d; }
+
+ template<class T>
+ inline const T* Array0<T>::baseptr() const { return _d; }
+
+
+ // This following functions directly access to protected
+ template <class T>
+ inline const T& Array0<T>::front () const
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
+ return _d[0];
+ }
+
+ // Access operator : Write access
+ template <class T>
+ inline T& Array0<T>::front ()
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
+ return _d[0];
+ }
+
+
+ // This following functions directly access to protected
+ template <class T>
+ inline const T& Array0<T>::back () const
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
+ return _d[_size-1];
+ }
+
+ // Access operator : Write access
+ template <class T>
+ inline T& Array0<T>::back ()
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
+ return _d[_size-1];
+ }
+
+
+
+ template <class T>
+ inline const T& Array0<T>::operator[] (Indice_t i) const
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
+ GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::[]]: index out of bounds.");
+ return _d[i];
+ }
+
+ // Access operator : Write access
+ template <class T>
+ inline T& Array0<T>::operator[] (Indice_t i)
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
+ GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>]: index out of bounds.");
+ return _d[i];
+ }
+
+
+ template <class T>
+ inline void Array0<T>::write( Indice_t i, const T& val)
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::write]: try to access to an Element of null size Array0.");
+ GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::write]: index out of bounds.");
+ _d[i] = val;
+ }
+
+ template <class T>
+ inline void Array0<T>::read ( Indice_t i, T& val ) const
+ {
+ GIVARO_ASSERT(_size >0, "[Array<T>::read]: try to access to an Element of null size Array0");
+ GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::read]: index out of bounds.");
+ val = _d[i];
+ }
+
+ template <class T>
+ inline typename Array0<T>::Iterator_t
+ Array0<T>::begin()
+ { return _d; }
+
+ template <class T>
+ inline typename Array0<T>::Iterator_t
+ Array0<T>::end()
+ { return _d + _size; }
+
+ template <class T>
+ inline typename Array0<T>::constIterator_t
+ Array0<T>::begin() const
+ { return _d; }
+
+ template <class T>
+ inline typename Array0<T>::constIterator_t
+ Array0<T>::end() const
+ { return _d + _size; }
+
+} // namespace Givaro
+
+#endif // __GIVARO__array0_INL
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/bstruct/givarrayallocator.h b/src/kernel/bstruct/givarrayallocator.h
index 3b2a562..6d46ac8 100644
--- a/src/kernel/bstruct/givarrayallocator.h
+++ b/src/kernel/bstruct/givarrayallocator.h
@@ -1,19 +1,26 @@
-#ifndef _ARRAY_ALLOCATOR_H_
-#define _ARRAY_ALLOCATOR_H_
-// ==========================================================================
+// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givarrayallocator.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givarrayallocator.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
-// ==========================================================================
-// Description:
+// $Id: givarrayallocator.h,v 1.3 2011-02-02 16:23:55 bboyer Exp $
+// ==========================================================================
+#ifndef __GIVARO_array_allocator_H
+#define __GIVARO_array_allocator_H
+namespace Givaro {
-// -- ArrayAllocator: class for allocation of arrays. Should have
-// - allocate(size_n)
-// - reallocate(size_n)
-// - destroy
+
+/*! @brief ArrayAllocator: class for allocation of arrays.
+ * Should have
+ * - allocate(size_n)
+ * - reallocate(size_n)
+ * - destroy
+ * .
+ */
template<class T, class Tag>
class ArrayAllocatort { };
@@ -23,4 +30,7 @@ class Array0Tag {};
template<class T, Array0Tag>
class ArrayAllocatort : public Array0<T> {};
-#endif
+} // namespace Givaro
+
+
+#endif // __GIVARO_array_allocator_H
diff --git a/src/kernel/bstruct/givarrayfixed.h b/src/kernel/bstruct/givarrayfixed.h
index d01b690..ef4180b 100644
--- a/src/kernel/bstruct/givarrayfixed.h
+++ b/src/kernel/bstruct/givarrayfixed.h
@@ -1,20 +1,26 @@
-#ifndef _GIV_ARRAY_FIXED_H_
-#define _GIV_ARRAY_FIXED_H_
-// ==========================================================================
+// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givarrayfixed.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givarrayfixed.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
-// ==========================================================================
+// $Id: givarrayfixed.h,v 1.5 2011-02-02 16:23:55 bboyer Exp $
+// ==========================================================================
// Description:
// ArrayFixed of type T with fixed dimension
+#ifndef __GIVARO_array_fixed_H
+#define __GIVARO_array_fixed_H
#include <stddef.h> // size_t
#include "givaro/givaromm.h"
#include "givaro/giverror.h"
#include "givaro/givperf.h"
+namespace Givaro {
+
+
template <class T, size_t SIZE>
class ArrayFixed GIVARO_PERF_INEHERIT(ArrayFixed,T) {
T _data[SIZE]; // _data
@@ -25,7 +31,7 @@ public :
typedef Type_t *Iterator_t;
typedef const Type_t *constIterator_t;
- //-- Default cstor:
+ //-- Default cstor:
ArrayFixed () {};
//-- Recopy cstor : implicit
@@ -43,19 +49,19 @@ public :
//-- Return the physical size of the array (capacity)
size_t phsize() const { return SIZE; }
- //-- Return the base ptr to the array
+ //-- Return the base ptr to the array
Type_t* baseptr() { return _data; }
Type_t* const baseptr() const { return _data; }
//-- Access to the ith Element:
- const T& operator[] (Indice_t i) const {
+ const T& operator[] (Indice_t i) const {
GIVARO_ASSERT((i >=0)&&(i<SIZE), "[Array<T>::[]]: index out of bounds.");
- return _data[i];
+ return _data[i];
}
- T& operator[] (Indice_t i) {
+ T& operator[] (Indice_t i) {
GIVARO_ASSERT((i >=0)&&(i<SIZE), "[Array<T>::[]]: index out of bounds.");
- return _data[i];
+ return _data[i];
}
// -- Iterator
@@ -72,7 +78,7 @@ public :
protected : //--------------------- protected Internal representation
private:
- //-- assignement operator cannot be herited.
+ //-- assignement operator cannot be herited.
Self_t& operator= (const Self_t& p) {};
};
@@ -83,16 +89,16 @@ struct __giv_map_less_ith;
template<class T, class UNARYOP>
struct __giv_map_less_ith<T, UNARYOP, 0> {
- inline void operator()( register T* data, UNARYOP& opcode )
+ inline void operator()( T* data, UNARYOP& opcode )
{ opcode(data[0]); }
};
template<class T, class UNARYOP, size_t ith>
struct __giv_map_less_ith<T, UNARYOP, ith> {
- inline void operator()( register T* data, UNARYOP& opcode )
- {
- opcode(data[ith]);
- __giv_map_less_ith<T,UNARYOP,ith-1>()(data, opcode);
+ inline void operator()( T* data, UNARYOP& opcode )
+ {
+ opcode(data[ith]);
+ __giv_map_less_ith<T,UNARYOP,ith-1>()(data, opcode);
}
};
@@ -101,15 +107,15 @@ struct __giv_map_less_ith_const;
template<class T, class UNARYOP>
struct __giv_map_less_ith_const<T,UNARYOP,0> {
- inline operator()( register const T* data, UNARYOP& opcode )
+ inline operator()( const T* data, UNARYOP& opcode )
{ opcode(data[0]); }
};
template<class T, class UNARYOP, size_t ith>
struct __giv_map_less_ith_const<T,UNARYOP,ith> {
- inline void operator() ( register const T* data, UNARYOP& opcode )
- { opcode(data[ith]);
- __giv_map_less_ith<T,UNARYOP,ith-1>(data, opcode);
+ inline void operator() ( const T* data, UNARYOP& opcode )
+ { opcode(data[ith]);
+ __giv_map_less_ith<T,UNARYOP,ith-1>(data, opcode);
}
};
@@ -124,6 +130,7 @@ template<class UNARYOP>
void ArrayFixed<T,SIZE>::map( UNARYOP& opcode ) const
{ __giv_map_less_ith_const<T,UNARYOP,SIZE>()(_data, opcode); }
+} // namespace Givaro
-#endif
+#endif // __GIVARO_array_fixed_H
diff --git a/src/kernel/bstruct/givbits.C b/src/kernel/bstruct/givbits.C
index bb9776c..c740930 100644
--- a/src/kernel/bstruct/givbits.C
+++ b/src/kernel/bstruct/givbits.C
@@ -1,11 +1,14 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givbits.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givbits.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givbits.C,v 1.2 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
-// Description:
+// Description:
// - field of n bits, for any n.
// The bits field is and array of long: a_(k-1),...,a_0.
// each entry has sizeof(long) bits. Give an number i, to i-th
@@ -19,7 +22,7 @@
#define GIV_SIZE_LONG 32
#if (GIV_SIZE_LONG == 32)
-# define SIZE_IN_BYTE 4 // size of the base
+# define SIZE_IN_BYTE 4 // size of the base
# define SIZE_IN_BIT 32 // size of the base
# define QUO(x) ( (x >>5) ) // quotient by 32
# define REM(x) ( (x & 0x1f) ) // remainder by 32
@@ -32,127 +35,139 @@
# define MAX_WORD(x) (QUO(x) + (0!=REM(x) ? 1 : 0))
#endif
+namespace Givaro {
+
// -- Table of 2^i = Table2pow[i], for i =0..sizeof(base)
static Bits::base* Table2pow;
-Bits::Bits ()
- : rep(0)
+Bits::Bits () :
+ rep(0)
{ }
-Bits::Bits (const size_t n)
+Bits::Bits (const size_t n)
{
- int len = MAX_WORD(n) ;
- rep.allocate( len );
+ size_t len = MAX_WORD(n) ;
+ rep.allocate( len );
}
-Bits::Bits( const Bits& B )
- : rep(B.rep, givWithCopy())
+Bits::Bits( const Bits& B ) :
+ rep(B.rep, givWithCopy())
{}
-Bits::Bits( const Bits::Rep& B )
- : rep(B, givWithCopy())
+Bits::Bits( const Bits::Rep& B ) :
+ rep(B, givWithCopy())
{}
-Bits::~Bits()
+Bits::~Bits()
{ rep.destroy(); }
- // And
-const Bits Bits::operator& (const Bits& A) const
+ // And
+const Bits Bits::operator& (const Bits& A) const
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in 'and'");
- int len = rep.size();
+ size_t len = rep.size();
Rep res( len );
- for (int i=0; i<len; i++) res[i] = rep[i] & A.rep[i];
+ for (int i=0; i< int(len); ++i)
+ res[i] = rep[i] & A.rep[i];
return Bits(res);
}
-Bits& Bits::andin( const Bits& A, const Bits B)
+Bits& Bits::andin( const Bits& A, const Bits B)
{
GIVARO_ASSERT( B.rep.size() == A.rep.size(), "[Bits]: invalide size in andin");
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in andin");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] = A.rep[i] & B.rep[i];
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] = A.rep[i] & B.rep[i];
return *this;
}
Bits& Bits::operator&= (const Bits& A)
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in &=");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] &= A.rep[i];
+ size_t len = rep.size();
+ for (int i=0; i< int(len); ++i)
+ rep[i] &= A.rep[i];
return *this;
}
- // Or
-const Bits Bits::operator| (const Bits& A) const
+ // Or
+const Bits Bits::operator| (const Bits& A) const
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in or");
- int len = rep.size();
+ size_t len = rep.size();
Rep res( len );
- for (int i=0; i<len; i++) res[i] = rep[i] | A.rep[i];
+ for (int i=0; i<int(len); ++i)
+ res[i] = rep[i] | A.rep[i];
return Bits(res);
}
-Bits& Bits::orin( const Bits& A, const Bits B)
+Bits& Bits::orin( const Bits& A, const Bits B)
{
GIVARO_ASSERT( B.rep.size() == A.rep.size(), "[Bits]: invalide size in orin");
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in orin");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] = A.rep[i] | B.rep[i];
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] = A.rep[i] | B.rep[i];
return *this;
}
-Bits& Bits::operator|=( const Bits& A )
+Bits& Bits::operator|=( const Bits& A )
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in |=");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] |= A.rep[i];
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] |= A.rep[i];
return *this;
}
- // XOr
-const Bits Bits::operator^ (const Bits& A) const
+ // XOr
+const Bits Bits::operator^ (const Bits& A) const
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in xor");
- int len = rep.size();
+ size_t len = rep.size();
Rep res( len );
- for (int i=0; i<len; i++) res[i] = rep[i] ^ A.rep[i];
+ for (int i=0; i<int(len); ++i)
+ res[i] = rep[i] ^ A.rep[i];
return Bits(res);
}
-Bits& Bits::xorin( const Bits& A, const Bits B)
+Bits& Bits::xorin( const Bits& A, const Bits B)
{
GIVARO_ASSERT( B.rep.size() == A.rep.size(), "[Bits]: invalide size in xorin");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] = A.rep[i] ^ B.rep[i];
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] = A.rep[i] ^ B.rep[i];
return *this;
}
-Bits& Bits::operator^=( const Bits& A )
+Bits& Bits::operator^=( const Bits& A )
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in ^=");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] ^= A.rep[i];
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] ^= A.rep[i];
return *this;
}
// Not
-const Bits Bits::operator~() const
+const Bits Bits::operator~() const
{
- int len = rep.size();
+ size_t len = rep.size();
Rep res( len );
- for (int i=0; i<len; i++) {
+ for (int i=0; i<int(len); ++i) {
res[i] = ~rep[i];
}
return res;
}
-Bits& Bits::notin( const Bits& A )
+Bits& Bits::notin( const Bits& A )
{
GIVARO_ASSERT( rep.size() == A.rep.size(), "[Bits]: invalide size in notin");
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] = ~(A.rep[i]);
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] = ~(A.rep[i]);
return *this;
}
@@ -160,8 +175,8 @@ Bits& Bits::notin( const Bits& A )
long Bits::numone() const
{
size_t l = rep.size();
- long num = 0;
- for (size_t i=0; i<l; i++)
+ long num = 0;
+ for (int i=0; i<int(l); ++i)
{
int quo = QUO(i);
int rem = REM(i);
@@ -170,18 +185,19 @@ long Bits::numone() const
return num;
}
- // -- Returns the index of non zero bits
+ // -- Returns the index of non zero bits
void Bits::indexofone( Array0<base>& index) const
{
size_t l = rep.size();
index.allocate( numone() );
long num =0;
- for (size_t i=0; i<l; i++)
+ for (int i=0; i<int(l); ++i)
{
int quo = QUO(i);
int rem = REM(i);
- if (((rep[quo] & Table2pow[rem]) >> rem) !=0) index[num++] = i;
- }
+ if (((rep[quo] & Table2pow[rem]) >> rem) !=0)
+ index[int(num++)] = i;
+ }
}
@@ -193,52 +209,63 @@ size_t Bits::length() const
// return the i-th bit of *this
-int Bits::operator[] (const int i) const
+int Bits::operator[] (const int i) const
{
GIVARO_ASSERT( i>=0, "invalide index in Bits::operator[]");
- GIVARO_ASSERT( i<length()*SIZE_IN_BIT, "invalide index in Bits::operator[]");
+ GIVARO_ASSERT( i<(int)length()*SIZE_IN_BIT, "invalide index in Bits::operator[]");
int quo = QUO(i);
int rem = REM(i);
- return (rep[quo] & Table2pow[rem]) >> rem;
+ return int((rep[quo] & Table2pow[rem]) >> rem);
}
-int Bits::get (const int i) const
+int Bits::operator[] (const size_t i) const
+{
+ // GIVARO_ASSERT( i>=0, "invalide index in Bits::operator[]");
+ GIVARO_ASSERT( i<length()*SIZE_IN_BIT, "invalide index in Bits::operator[]");
+ int quo = QUO(int(i));
+ int rem = REM(int(i));
+ return (int) ((rep[quo] & Table2pow[rem]) >> rem);
+}
+
+
+int Bits::get (const int i) const
{
GIVARO_ASSERT( i>=0, "invalide index in Bits::get");
- GIVARO_ASSERT( i<length()*SIZE_IN_BIT, "invalide index in Bits::get");
+ GIVARO_ASSERT( i<(int)length()*SIZE_IN_BIT, "invalide index in Bits::get");
int quo = QUO(i);
int rem = REM(i);
- return (rep[quo] & Table2pow[rem]) >> rem;
+ return int((rep[quo] & Table2pow[rem]) >> rem);
}
- // Set all bits
-void Bits::set()
+ // Set all bits
+void Bits::set()
{
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] = ~0L;
+ int len = (int) rep.size();
+ for (int i=0; i< len; ++i) rep[i] = ~0L;
}
// Set the i-th bit of *this
-void Bits::set(const int i)
+void Bits::set(const int i)
{
GIVARO_ASSERT( i>=0, "invalide index in Bits::set");
- GIVARO_ASSERT( i<length()*SIZE_IN_BIT, "invalide index in Bits::set");
+ GIVARO_ASSERT( i<(int)length()*SIZE_IN_BIT, "invalide index in Bits::set");
int quo = QUO(i);
int rem = REM(i);
rep[quo] |= Table2pow[rem];
}
-void Bits::clear()
+void Bits::clear()
{
- int len = rep.size();
- for (int i=0; i<len; i++) rep[i] = 0;
+ size_t len = rep.size();
+ for (int i=0; i<int(len); ++i)
+ rep[i] = 0;
}
// Clear the i-th bit of *this
-void Bits::clear(const int i)
+void Bits::clear(const int i)
{
GIVARO_ASSERT( i>=0, "invalide index in Bits::clear");
- GIVARO_ASSERT( i<length()*SIZE_IN_BIT, "invalide index in Bits::clear");
+ GIVARO_ASSERT( i<(int)length()*SIZE_IN_BIT, "invalide index in Bits::clear");
int quo = QUO(i);
int rem = REM(i);
rep[quo] ^= !(Table2pow[rem]); // is the true not ?
@@ -247,9 +274,9 @@ void Bits::clear(const int i)
std::ostream& Bits::print( std::ostream& o ) const
{
//- o << "";
- int len = rep.size();
- for (int i= len-1; i>=0; i--)
- {
+ size_t len = rep.size();
+ for (int i= int(len-1); i>=0; i--)
+ {
for (int j=SIZE_IN_BIT-1; j>=0; j--)
if ((rep[i] & Table2pow[j]) !=0) o << '1';
else o << '0';
@@ -264,12 +291,14 @@ void Bits::Init(int*, char***)
Table2pow = new Bits::base[SIZE_IN_BIT];
int i;
Table2pow[0] = 1;
- for (i=1; i<SIZE_IN_BIT; i++) {
+ for (i=1; i<SIZE_IN_BIT; ++i) {
Table2pow[i] = Table2pow[i-1] << 1;
- }
+ }
}
void Bits::End()
{
}
GivModule Bits::Module (Bits::Init, Bits::End, GivModule::DfltPriority, "[Bits]");
+
+} // namespace Givaro
diff --git a/src/kernel/bstruct/givbits.h b/src/kernel/bstruct/givbits.h
index dc5e29a..40d834c 100644
--- a/src/kernel/bstruct/givbits.h
+++ b/src/kernel/bstruct/givbits.h
@@ -1,22 +1,27 @@
-#ifndef _BITS_H_
-#define _BITS_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givbits.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givbits.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givbits.h,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
-// Description:
+// Description:
// - field of n bits, for any n
+#ifndef __GIVARO_bits_H
+#define __GIVARO_bits_H
#include <iostream>
#include "givaro/givaromm.h"
#include "givaro/givarray0.h"
+namespace Givaro {
+
class Bits {
public:
- typedef unsigned long base ;
+ typedef size_t base ;
Bits () ;
Bits (const size_t n) ; // -- n is the number of bits reclaimed
@@ -25,19 +30,19 @@ public:
// -- All binary operand must have same type:
// <op>in are for inplace operator (this receives the result)
-
+
const Bits operator&( const Bits& A ) const ;
Bits& andin( const Bits& A, const Bits B) ;
Bits& operator&= (const Bits& A) ;
//inline const Bits operator& (const Bits& A) const { return operator&(A) ; }
- // -- Or
+ // -- Or
const Bits operator|( const Bits& A ) const ;
Bits& orin( const Bits& A, const Bits B) ;
Bits& operator|=( const Bits& A ) ;
//inline const Bits operator| (const Bits& A) const { return operator|(A) ; }
- // -- Or
+ // -- Or
const Bits operator^( const Bits& A ) const ;
Bits& xorin( const Bits& A, const Bits B) ;
Bits& operator^=( const Bits& A ) ;
@@ -58,12 +63,12 @@ public:
// -- Returns the number of non zero bits :
long numone() const ;
- // -- Returns the index of non zero bits
+ // -- Returns the index of non zero bits
void indexofone( Array0<Bits::base>& ) const ;
// -- Returns the length (in bit) of this :
size_t length() const ;
-
+
// -- set to 0 all bits:
void clear() ;
// -- set to 0 the i-th bit
@@ -75,6 +80,7 @@ public:
// -- returns the i-th bit
int get(const int i) const ;
int operator[] (const int i) const ;
+ int operator[] (const size_t i) const ;
// -- IO/methods
std::ostream& print( std::ostream& o ) const ;
@@ -87,10 +93,12 @@ protected:
private:
static GivModule Module;
friend class GivModule;
- static void Init(int*, char***);
+ static void Init(int*, char***);
static void End();
} ;
+} // namespace Givaro
+
#include "givaro/givbits.inl"
-#endif
+#endif // __GIVARO_bits_H
diff --git a/src/kernel/bstruct/givbits.inl b/src/kernel/bstruct/givbits.inl
index 78dfac5..fa652b1 100644
--- a/src/kernel/bstruct/givbits.inl
+++ b/src/kernel/bstruct/givbits.inl
@@ -1,17 +1,23 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givbits.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givbits.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givbits.inl,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_bits_INL
+#define __GIVARO_bits_INL
+namespace Givaro {
// -- Copy operators
inline
Bits& Bits::copy( const Bits& src )
{ rep.copy( src.rep ); return *this; }
-inline
+inline
Bits& Bits::logcopy( const Bits& src )
{ rep.copy( src.rep ); return *this; }
@@ -20,4 +26,5 @@ inline Bits& Bits::operator= (const Bits& B) { return copy(B); }
//-------------------------------------------------inline << operators
inline std::ostream& operator<< (std::ostream& o, const Bits& a)
{ return a.print(o); }
-
+} // namespace Givaro
+#endif // __GIVARO_bits_INL
diff --git a/src/kernel/bstruct/givelem.h b/src/kernel/bstruct/givelem.h
index b8e8df8..75ccf8d 100644
--- a/src/kernel/bstruct/givelem.h
+++ b/src/kernel/bstruct/givelem.h
@@ -1,15 +1,21 @@
-#ifndef _GIV_ELEM_H_
-#define _GIV_ELEM_H_
// ==========================================================================
// $Source
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// $Id
// ==========================================================================
// Description:
// definition of a reference to an object.
-//
+//
+#ifndef __GIVARO_Elem_H
+#define __GIVARO_Elem_H
+
+namespace Givaro {
+
template<class T>
struct ElemRef {
@@ -47,29 +53,30 @@ ostream& operator<< (ostream& o, const Pair<T1,T2>& p )
template<class T1, class T2>
istream& operator>> (istream& fin, Pair<T1,T2>& p )
-{
+{
char ch;
// Skip the first blanks:
fin >> std::ws; fin.get(ch);
- if (ch != '(')
+ if (ch != '(')
GivError::throw_error(
GivBadFormat("operator>><Pair<T1,T2> >: syntax error no '('"));
-
+
// - read a T1 + ','
fin >> std::ws >> p._val1;
fin >> std::ws; fin.get(ch);
- if (ch != ',')
+ if (ch != ',')
GivError::throw_error(
GivBadFormat("operator>><Pair<T1,T2> >: syntax error no ','"));
// - read a T1 + ')'
fin >> p._val2;
fin >> std::ws; fin.get(ch);
- if (ch != ')')
+ if (ch != ')')
GivError::throw_error(
GivBadFormat("operator>><Pair<T1,T2> >: syntax error no ')'"));
return fin;
}
+} // namespace Givaro
-#endif
+#endif // __GIVARO_Elem_H
diff --git a/src/kernel/bstruct/givhashtable.h b/src/kernel/bstruct/givhashtable.h
index a6dca07..f7146c7 100644
--- a/src/kernel/bstruct/givhashtable.h
+++ b/src/kernel/bstruct/givhashtable.h
@@ -1,19 +1,31 @@
-#ifndef _HASHTABLE_H_
-#define _HASHTABLE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givhashtable.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givhashtable.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givhashtable.h,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
-// Description:
-// - hash table
+/*! @file bstruct/givhashtable.h
+ * @ingroup bstruct
+ * @brief hash table
+ */
-// The class Key must have :
-// - default cstor
-// - operator== : (const Key&, const Key&) -> int
-// - godel : void -> int
+#ifndef __GIVARO_hashtable_H
+#define __GIVARO_hashtable_H
+
+namespace Givaro {
+
+
+/*! @brief The class Key.
+ * must have :
+ * - default cstor
+ * - operator== : (const Key&, const Key&) -> int
+ * - godel : void -> int
+ * .
+ */
// Generic Key for class T which can be cast to and int
template<class T>
@@ -36,9 +48,9 @@ public:
HashTable ( int n = 0 ) ;
void allocate( int n ) ;
~HashTable ( ) ;
- void freeing() ;
+ void freeing() ;
- // Insert and remove functions
+ // Insert and remove functions
void insert ( const T& item, const Key& k) ;
void insertLast ( const T& item, const Key& k) ;
void insertFront( const T& item, const Key& k) ;
@@ -60,7 +72,7 @@ public: // ----- internal data structure
int num ;
struct _E {
_E( const T& item, const Key& k)
- : oneitem(item), key(k) {} ;
+ : oneitem(item), key(k) {} ;
public:
T oneitem ;
Key key ;
@@ -71,27 +83,27 @@ public: // ----- internal data structure
_E** tabE ; // End of list
-public:
+public:
// Iterator of all item of a HashTable :
class Iterator {
public:
- Iterator ( HashTable<T,Key>& r)
- : ref(r)
- {
+ Iterator ( HashTable<T,Key>& r)
+ : ref(r)
+ {
// search the first non-void pointer in ref.tabH :
for (e_curr =0; e_curr < ref.num ; e_curr++)
if ((curr =ref.tabH[e_curr]) !=0) break ;
- } ;
+ } ;
operator int() const { return !isend() ; } ;
- int isend() const
+ int isend() const
{
if (e_curr >= ref.num) return 1 ;
- if (e_curr == ref.num-1)
+ if (e_curr == ref.num-1)
if (curr ==0) return 1 ;
- return 0 ;
+ return 0 ;
}
- void next()
+ void next()
{
_E* tmp = curr->next ;
if (tmp ==0) {
@@ -102,8 +114,8 @@ public:
if (tmp !=0) break ;
}
if (i >= ref.num) { curr =0 ; e_curr = i ; }
- else { curr = tmp ; e_curr = i ; }
- }
+ else { curr = tmp ; e_curr = i ; }
+ }
else curr = tmp ;
} ;
T curr_item() { return curr->oneitem ; } ;
@@ -117,18 +129,18 @@ public:
// Iterator of all item for a same Key :
class IteratorKey {
public:
- IteratorKey ( HashTable<T,Key>& r, const Key& k )
- : ref(r), key(k)
- {
+ IteratorKey ( HashTable<T,Key>& r, const Key& k )
+ : ref(r), key(k)
+ {
e_curr = key.godel() % r.num ;
curr = ref.tabH[e_curr] ;
- } ;
+ } ;
operator int() const { return !isend() ; } ;
int isend() const { return curr == 0 ; }
- void next()
+ void next()
{
curr = curr->next ;
- while ( curr != 0 )
+ while ( curr != 0 )
{
if (curr->key == key) break ;
curr = curr->next ;
@@ -143,10 +155,12 @@ public:
_E* curr ;
} ;
-
+
} ;
+} // namespace Givaro
+
#include "givaro/givhashtable.inl"
-#endif
+#endif // __GIVARO_hashtable_H
diff --git a/src/kernel/bstruct/givhashtable.inl b/src/kernel/bstruct/givhashtable.inl
index bd4943a..f080257 100644
--- a/src/kernel/bstruct/givhashtable.inl
+++ b/src/kernel/bstruct/givhashtable.inl
@@ -1,29 +1,34 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givhashtable.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givhashtable.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givhashtable.inl,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
// Description:
// - hash table implementation
-
+#ifndef __GIVARO_hashtable_INL
+#define __GIVARO_hashtable_INL
+namespace Givaro {
// Size of the table :
template<class T, class Key>
-HashTable<T,Key>::HashTable ( int n )
+HashTable<T,Key>::HashTable ( int n )
{
allocate(n) ;
}
template<class T, class Key>
-void HashTable<T,Key>::allocate( int n )
+void HashTable<T,Key>::allocate( int n )
{
num = n ;
if (n ==0) {
tabH = tabE = 0 ;
return ;
- }
+ }
tabH = new _E*[n] ;
tabE = new _E*[n] ;
for (int i=0 ; i<num ; i++) tabH[i] = tabE[i] = 0 ;
@@ -36,13 +41,13 @@ HashTable<T,Key>::~HashTable()
}
template<class T, class Key>
-void HashTable<T,Key>::freeing()
+void HashTable<T,Key>::freeing()
{
if (tabH ==0) return ;
- for (int i=0 ; i<num ; i++)
+ for (int i=0 ; i<num ; i++)
{
_E* curr = tabH[i] ;
- while (curr !=0)
+ while (curr !=0)
{
_E* tmp = curr->next ;
delete curr ;
@@ -56,7 +61,7 @@ void HashTable<T,Key>::freeing()
}
template<class T, class Key>
-void HashTable<T,Key>::removeall ( )
+void HashTable<T,Key>::removeall ( )
{
if (tabH ==0) return ;
int i ;
@@ -93,7 +98,7 @@ void HashTable<T,Key>::insertLast( const T& item, const Key& k )
return ;
}
tabE[e]->next = cur ;
- cur->pred = tabE[e] ;
+ cur->pred = tabE[e] ;
cur->next = 0 ;
tabE[e] = cur ;
}
@@ -119,14 +124,14 @@ void HashTable<T,Key>::insertFront( const T& item, const Key& k )
// Remove entry with key k
template<class T, class Key>
-void HashTable<T,Key>::remove ( const Key& k)
+void HashTable<T,Key>::remove ( const Key& k)
{
if ((tabE ==0) || (tabH ==0)) return ;
unsigned int e = ((unsigned long)k.godel()) % ((unsigned long)num) ;
_E* cur = tabH[e] ;
while (cur !=0)
{
- if (k == cur->key)
+ if (k == cur->key)
{
if (cur->pred ==0) tabH[e] = cur->next ;
else cur->pred->next = cur->next ;
@@ -139,14 +144,14 @@ void HashTable<T,Key>::remove ( const Key& k)
}
template<class T, class Key>
-int HashTable<T,Key>::get ( T& item, const Key& k ) const
+int HashTable<T,Key>::get ( T& item, const Key& k ) const
{
if ((tabE ==0) || (tabH ==0)) return 0 ;
unsigned int e = ((unsigned long)k.godel()) % ((unsigned long)num) ;
_E* cur = tabH[e] ;
while (cur !=0)
{
- if (k == cur->key)
+ if (k == cur->key)
{
item = cur->oneitem ;
return 1 ;
@@ -159,14 +164,14 @@ int HashTable<T,Key>::get ( T& item, const Key& k ) const
template<class T, class Key>
-int HashTable<T,Key>::getrmv ( T& item, const Key& k )
+int HashTable<T,Key>::getrmv ( T& item, const Key& k )
{
if ((tabE ==0) || (tabH ==0)) return 0 ;
unsigned int e = ((unsigned long)k.godel()) % ((unsigned long)num) ;
_E* cur = tabH[e] ;
while (cur !=0)
{
- if (k == cur->key)
+ if (k == cur->key)
{
item = cur->oneitem ;
if (cur->pred ==0) tabH[e] = cur->next ;
@@ -183,7 +188,7 @@ int HashTable<T,Key>::getrmv ( T& item, const Key& k )
// Returns the number of items of the same key :
template<class T, class Key>
-int HashTable<T,Key>::num_item( const Key& k ) const
+int HashTable<T,Key>::num_item( const Key& k ) const
{
if ((tabE ==0) || (tabH ==0)) return 0 ;
int count = 0 ;
@@ -197,5 +202,6 @@ int HashTable<T,Key>::num_item( const Key& k ) const
return count ;
}
+} // namespace Givaro
-
+#endif // __GIVARO_hashtable_INL
diff --git a/src/kernel/bstruct/givlist0.h b/src/kernel/bstruct/givlist0.h
index 29dcd86..95ab727 100644
--- a/src/kernel/bstruct/givlist0.h
+++ b/src/kernel/bstruct/givlist0.h
@@ -1,19 +1,29 @@
-#ifndef _LIST0_H_
-#define _LIST0_H_
-// ==========================================================================
+// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givlist0.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givlist0.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
-// ==========================================================================
-// Description:
-// List of type T with double link and various insert/get/rmv method.
-// Used reference counting on each node of the list.
+// $Id: givlist0.h,v 1.3 2011-02-02 16:23:55 bboyer Exp $
+// ==========================================================================
+
+/*! @file bstruct/givlist0.h
+ * @ingroup bstruct
+ * @brief List of type T with double link and various insert/get/rmv method.
+ * Used reference counting on each node of the list.
+ */
+
+#ifndef __GIVARO_list0_H
+#define __GIVARO_list0_H
#include "givaro/givbasictype.h"
#include "givaro/giverror.h"
+
+namespace Givaro {
+
template <class T>
class List0 {
public :
@@ -32,13 +42,13 @@ public :
// -- Physical copy operator
List0<T>& copy(const List0<T>& p);
- // -- Logical recopy operator
+ // -- Logical recopy operator
List0<T>& logcopy(const List0<T>& p);
-
+
// -- Logical recopy
List0<T>& operator= (const List0<T>& p);
- // -- Return 1 if the list is empty or 0
+ // -- Return 1 if the list is empty or 0
int is_empty() const;
// -- Return the occuped size of the list
@@ -65,8 +75,8 @@ public:
GivaroMM<T>::desallocate(item,1);
GivaroMM<int>::desallocate(cnt,1);
}
- node* next;
- node* prev;
+ node* next;
+ node* prev;
T* item;
int* cnt; // reference counter on item
};
@@ -93,6 +103,8 @@ protected : // --------------------- Public Internal representation
node* _queue; // queue of the list
};
+} // namespace Givaro
+
#include "givaro/givlist0.inl"
-#endif
+#endif // __GIVARO_list0_H
diff --git a/src/kernel/bstruct/givlist0.inl b/src/kernel/bstruct/givlist0.inl
index dc38b0a..6af3542 100644
--- a/src/kernel/bstruct/givlist0.inl
+++ b/src/kernel/bstruct/givlist0.inl
@@ -1,25 +1,33 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givlist0.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givlist0.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givlist0.inl,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
// inline implementation of the List0 methods
+#ifndef __GIVARO_list0_INL
+#define __GIVARO_list0_INL
+
+namespace Givaro {
+
template <class T>
-inline List0<T>::List0()
+inline List0<T>::List0()
: _head(0), _queue(0), _size(0)
{}
template <class T>
-inline List0<T>::List0( const List0<T>& l)
+inline List0<T>::List0( const List0<T>& l)
: _head(l._head), _queue(l._queue), _size(l._size)
{
node* curr = _head;
while (curr !=0) {
curr->cnt++ ;
- curr = curr->next ;
+ curr = curr->next ;
}
}
@@ -65,7 +73,7 @@ inline List0<T>& List0<T>::logcopy(const List0<T>& l)
node* curr = _head;
while (curr !=0) {
curr->cnt++ ;
- curr = curr->next ;
+ curr = curr->next ;
}
return *this;
}
@@ -89,9 +97,9 @@ void List0<T>::insertlast( const T& val)
curr->cnt = GivaroMM<int>::allocate(1); *(curr->cnt) = 1 ;
curr->item = GivaroMM<T>::allocate(1);
GivaroMM<T>::initone(curr->item, val);
- curr->prev = _queue ;
+ curr->prev = _queue ;
curr->next = 0;
- if (_queue !=0) _queue->next = curr ;
+ if (_queue !=0) _queue->next = curr ;
_queue = curr ;
if (_head ==0) _head = curr ;
_size++ ;
@@ -106,7 +114,7 @@ void List0<T>::insertfirst( const T& val)
GivaroMM<T>::initone(curr->item, val);
curr->prev = 0;
curr->next = _head;
- if (_head !=0) _head->prev = curr ;
+ if (_head !=0) _head->prev = curr ;
_head = curr ;
if (_queue ==0) _queue = curr ;
_size++ ;
@@ -129,7 +137,7 @@ int List0<T>::getfirst(T& val) const
}
template<class T>
-int List0<T>::getrmvlast(T& val)
+int List0<T>::getrmvlast(T& val)
{
if (_queue ==0) return 0;
node* curr = _queue;
@@ -146,7 +154,7 @@ int List0<T>::getrmvlast(T& val)
}
template<class T>
-int List0<T>::getrmvfirst(T& val)
+int List0<T>::getrmvfirst(T& val)
{
if (_head ==0) return 0;
node* curr = _head;
@@ -162,3 +170,6 @@ int List0<T>::getrmvfirst(T& val)
return 1;
}
+} // namespace Givaro
+
+#endif // __GIVARO_list0_INL
diff --git a/src/kernel/bstruct/givstack.h b/src/kernel/bstruct/givstack.h
index f4b0117..a8a8e1c 100644
--- a/src/kernel/bstruct/givstack.h
+++ b/src/kernel/bstruct/givstack.h
@@ -1,26 +1,31 @@
-#ifndef _STACK_H_
-#define _STACK_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givstack.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givstack.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givstack.h,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_stack_H
+#define __GIVARO_stack_H
+
+namespace Givaro {
template <class THING>
class Stack {
public :
inline Stack() ;
inline ~Stack() ;
-
+
inline void push(const THING&) ;
inline void pop() ;
inline int isEmpty() const { return (ThePointer == NULL) ; }
inline THING top() const ;
-
-private :
+
+private :
struct inner_stack
{
THING thething ;
@@ -28,8 +33,10 @@ struct inner_stack
} *ThePointer ;
} ;
+} // Givaro
+
#include "givaro/givstack.inl"
-#endif
+#endif // __GIVARO_stack_H
+
-
diff --git a/src/kernel/bstruct/givstack.inl b/src/kernel/bstruct/givstack.inl
index 535d6ca..defc8a6 100644
--- a/src/kernel/bstruct/givstack.inl
+++ b/src/kernel/bstruct/givstack.inl
@@ -1,11 +1,19 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givstack.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givstack.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givstack.inl,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_stack_INL
+#define __GIVARO_stack_INL
+
+namespace Givaro {
+
template <class THING>
Stack<THING>::~Stack()
{ }
@@ -29,7 +37,7 @@ void Stack<THING>::push(const THING& T)
template <class THING>
void Stack<THING>::pop()
{
- if (ThePointer == NULL)
+ if (ThePointer == NULL)
{
cerr << "*** Error: Empty Stack" << endl ;
}
@@ -41,8 +49,12 @@ void Stack<THING>::pop()
}
template <class THING>
-THING Stack<THING>::top() const
+THING Stack<THING>::top() const
{
return ThePointer->thething ;
}
+} // namespace Givaro
+
+
+#endif // __GIVARO_stack_INL
diff --git a/src/kernel/gmp++/Makefile.am b/src/kernel/gmp++/Makefile.am
index 054be50..bba4209 100644
--- a/src/kernel/gmp++/Makefile.am
+++ b/src/kernel/gmp++/Makefile.am
@@ -1,21 +1,28 @@
-INCLUDES=-I$(top_srcdir) ${GMP_VERSION}
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+AM_CPPFLAGS=-I$(top_srcdir) ${GMP_VERSION}
pkgincludesubdir=$(includedir)/gmp++
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/system
+AM_CXXFLAGS=@DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/system
pkgincludesub_HEADERS=\
- gmp++.h \
- gmp++_int.h \
- gmp++_int.inl \
- gmp++.C \
+ gmp++.h \
+ gmp++_int.h \
+ gmp++_int.inl \
+ gmp++.C \
gmp++_int.C
#lib_LTLIBRARIES=libgmpxx.la
noinst_LTLIBRARIES=libgmppp.la
#libgmpxx_la_SOURCES=
-libgmppp_la_SOURCES=\
+libgmppp_la_SOURCES= \
gmp++_int_div.C \
gmp++_int_mod.C \
gmp++_int_sub.C \
@@ -27,3 +34,5 @@ libgmppp_la_SOURCES=\
gmp++_int_cstor.C \
gmp++_int_misc.C \
gmp++_int_pow.C
+
+#EXTRA_DIST= gmp++.doxy
diff --git a/src/kernel/gmp++/Makefile.in b/src/kernel/gmp++/Makefile.in
index 0309078..ef969e3 100644
--- a/src/kernel/gmp++/Makefile.in
+++ b/src/kernel/gmp++/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkgincludesub_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -53,8 +67,8 @@ am_libgmppp_la_OBJECTS = gmp++_int_div.lo gmp++_int_mod.lo \
gmp++_int_cstor.lo gmp++_int_misc.lo gmp++_int_pow.lo
libgmppp_la_OBJECTS = $(am_libgmppp_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -86,26 +100,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -115,40 +130,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -188,16 +213,19 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir) ${GMP_VERSION}
+AM_CPPFLAGS = -I$(top_srcdir) ${GMP_VERSION} \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/system
pkgincludesubdir = $(includedir)/gmp++
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/system
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkgincludesub_HEADERS = \
- gmp++.h \
- gmp++_int.h \
- gmp++_int.inl \
- gmp++.C \
+ gmp++.h \
+ gmp++_int.h \
+ gmp++_int.inl \
+ gmp++.C \
gmp++_int.C
@@ -226,14 +254,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/gmp++/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/gmp++/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/gmp++/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/gmp++/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -269,38 +297,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_add.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_compare.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_cstor.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_div.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_gcd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_io.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_misc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_mod.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_mul.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_pow.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmp++_int_sub.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -330,7 +334,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -435,7 +439,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -446,6 +449,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -454,22 +459,31 @@ install-data-am: install-pkgincludesubHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -504,6 +518,8 @@ uninstall-am: uninstall-pkgincludesubHEADERS
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-pkgincludesubHEADERS
+
+#EXTRA_DIST= gmp++.doxy
# 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/kernel/gmp++/gmp++.C b/src/kernel/gmp++/gmp++.C
index d7777a6..d73cfbc 100644
--- a/src/kernel/gmp++/gmp++.C
+++ b/src/kernel/gmp++/gmp++.C
@@ -1,3 +1,9 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
#ifndef __GMPplusplus_C__
#define __GMPplusplus_C__
diff --git a/src/kernel/gmp++/gmp++.h b/src/kernel/gmp++/gmp++.h
index 20b8f23..c4f41f6 100644
--- a/src/kernel/gmp++/gmp++.h
+++ b/src/kernel/gmp++/gmp++.h
@@ -1,18 +1,24 @@
-#ifndef _GMPplusplus_H_
-#define _GMPplusplus_H_
// ========================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro version of gmp++.h
-// Time-stamp: <08 Mar 07 14:07:31 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <20 Oct 10 18:46:59 Jean-Guillaume.Dumas at imag.fr>
// ========================================================================
+#ifndef __GIVARO_GMPplusplus_H
+#define __GIVARO_GMPplusplus_H
#include <string.h>
#include <limits.h>
#include <climits> // required by gcc 4.3
#include <givaro-config.h>
#ifndef __GIVARO__DONOTUSE_longlong__
-#ifndef __DONOTUSE_Givaro_SIXTYFOUR__
#define __USE_64_bits__
#endif
+#ifndef __DONOTUSE_Givaro_SIXTYFOUR__
+#define __USE_64_bits__
#endif
#if !defined(GMP_VERSION_3) && !defined(GMP_NO_CXX) && !defined(__GIVARO_GMP_VERSION_3) && !defined(__GIVARO_GMP_NO_CXX)
@@ -24,13 +30,18 @@
extern "C" {
#endif
-#include "gmp.h"
+#include <gmp.h>
#ifdef __GIVARO_GMP_VERSION_3
}
#endif
+#ifdef NDEBUG
+#ifdef DEBUG
+#error "NDEBUG and DEBUG both defined"
+#endif
+#endif
#include <gmp++/gmp++_int.h>
-#endif
+#endif // __GIVARO_GMPplusplus_H
diff --git a/src/kernel/gmp++/gmp++_int.C b/src/kernel/gmp++/gmp++_int.C
index 98ea4b0..3d3daba 100644
--- a/src/kernel/gmp++/gmp++_int.C
+++ b/src/kernel/gmp++/gmp++_int.C
@@ -1,3 +1,8 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
#ifndef __GMPplusplus_INTEGER_C__
#define __GMPplusplus_INTEGER_C__
diff --git a/src/kernel/gmp++/gmp++_int.h b/src/kernel/gmp++/gmp++_int.h
index d9d0a55..d3d409c 100644
--- a/src/kernel/gmp++/gmp++_int.h
+++ b/src/kernel/gmp++/gmp++_int.h
@@ -1,15 +1,25 @@
-#ifndef _GMPplusplus_INTEGER_H_
-#define _GMPplusplus_INTEGER_H_
// ========================================================================
-// Copyright(c)'2001-2007 by LinBox Team
-// see the copyright file.
+// Copyright(c)'1994-2010 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier, JG. Dumas
-// Time-stamp: <11 Jan 07 14:52:53 Jean-Guillaume.Dumas at imag.fr>
+// Modified by: B. Boyer
+// Time-stamp: <22 Oct 10 15:35:39 Jean-Guillaume.Dumas at imag.fr>
// ========================================================================
-// Description:
+// Description:
// Integer class definition based on Gmp (>V2.0 or 1.3.2)
+#ifndef __GIVARO_GMPplusplus_integer_H
+#define __GIVARO_GMPplusplus_integer_H
+
+
+
+/*! @file kernel/gmp++/gmp++_int.h
+ * @ingroup integers
+ * Core gmp++_int.h.
+ */
-// Core gmp++_int.h
#include <vector>
#include <list>
#include <string>
@@ -23,382 +33,776 @@
# define __USE_GMPPLUSPLUS_SIXTYFOUR__
#endif
-
-//------------------------------------------------------ Friend Integer
-class Integer;
-
-int compare(const Integer& a, const Integer& b);
-int absCompare(const Integer& a, const Integer& b);
-Integer& inv (Integer& u, const Integer& a, const Integer& b);
-Integer gcd (const Integer& a, const Integer& b);
-Integer gcd (const Integer& a, const Integer& b, Integer& u, Integer& v);
-Integer& gcd (Integer& g, const Integer& a, const Integer& b);
-Integer& gcd (Integer& g, const Integer& a, const Integer& b, Integer& u, Integer& v);
-Integer pp( const Integer& P, const Integer& Q );
-Integer& lcm (Integer& g, const Integer& a, const Integer& b);
-Integer lcm (const Integer& a, const Integer& b);
-Integer& pow(Integer& Res, const Integer& n, const long l);
-Integer& pow(Integer& Res, const unsigned long n, const unsigned long l);
-Integer& pow(Integer& Res, const Integer& n, const unsigned long l);
-Integer& pow(Integer& Res, const Integer& n, const int l) ;
-Integer& pow(Integer& Res, const Integer& n, const unsigned int l) ;
-Integer pow(const Integer& n, const long l);
-Integer pow(const Integer& n, const unsigned long l);
-Integer pow(const Integer& n, const int l) ;
-Integer pow(const Integer& n, const unsigned int l);
-Integer& powmod(Integer& Res, const Integer& n, const unsigned long e, const Integer& m);
-Integer& powmod(Integer& Res, const Integer& n, const long e, const Integer& m);
-Integer& powmod(Integer& Res, const Integer& n, const unsigned int e, const Integer& m) ;
-Integer& powmod(Integer& Res, const Integer& n, const int e, const Integer& m) ;
-Integer& powmod(Integer& Res, const Integer& n, const Integer& e, const Integer& m);
-Integer powmod(const Integer& n, const unsigned long e, const Integer& m);
-Integer powmod(const Integer& n, const long e, const Integer& m);
-Integer powmod(const Integer& n, const unsigned int e, const Integer& m) ;
-Integer powmod(const Integer& n, const int e, const Integer& m) ;
-Integer powmod(const Integer& n, const Integer& e, const Integer& m);
-Integer fact ( unsigned long l);
-Integer sqrt(const Integer& p);
-Integer sqrtrem(const Integer& p, Integer& rem);
-Integer& sqrt(Integer& r, const Integer& p);
-Integer& sqrtrem(Integer& r, const Integer& p, Integer& rem);
-bool root(Integer& q, const Integer&, unsigned int n);
-long logp(const Integer& a, const Integer& p) ;
-double logtwo(const Integer& a) ;
-void swap(Integer& , Integer&);
-int sign (const Integer& a);
-int isZero (const Integer& a);
-int isOne (const Integer& a);
-int isperfectpower (const Integer& );
-Integer abs(const Integer& n);
-Integer& prevprime(Integer&, const Integer& p);
-Integer& nextprime(Integer&, const Integer& p);
-int probab_prime(const Integer& p);
-int probab_prime(const Integer& p, int r);
-int jacobi(const Integer& u, const Integer& v) ;
-int legendre(const Integer& u, const Integer& v) ;
-unsigned long length (const Integer& a);
-std::istream& operator >> (std::istream &i, Integer& n);
-std::ostream& operator << (std::ostream &o, const Integer& n);
-std::ostream& absOutput (std::ostream &o, const Integer& n);
-void importWords(Integer&, size_t, int, int, int, size_t, const void*);
-
-
-//------------------------------------------------------ Class Integer
-class Integer {
-
-public:
- typedef std::vector<mp_limb_t> vect_t;
- Integer( const std::vector<mp_limb_t>& vect_t );
- //--------------------------------------cstors & dstors
- Integer(int n = 0);
- Integer(long n);
- Integer(unsigned char n);
- Integer(unsigned int n);
- Integer(unsigned long n);
+namespace Givaro {
+
+ //------------------------------------------------------ Friend Integer
+ // forward declaration.
+ class Integer;
+
+ int compare(const Integer& a, const Integer& b);
+ int absCompare(const Integer& a, const Integer& b);
+ Integer& inv (Integer& u, const Integer& a, const Integer& b);
+ Integer& invin (Integer& u, const Integer& b);
+ Integer gcd (const Integer& a, const Integer& b);
+ Integer gcd (const Integer& a, const Integer& b, Integer& u, Integer& v);
+ Integer& gcd (Integer& g, const Integer& a, const Integer& b);
+ Integer& gcd (Integer& g, const Integer& a, const Integer& b, Integer& u, Integer& v);
+ Integer pp( const Integer& P, const Integer& Q );
+ Integer& lcm (Integer& g, const Integer& a, const Integer& b);
+ Integer lcm (const Integer& a, const Integer& b);
+ Integer& pow(Integer& Res, const Integer& n, const long l);
+ Integer& pow(Integer& Res, const unsigned long n, const unsigned long l);
+ Integer& pow(Integer& Res, const Integer& n, const unsigned long l);
+ Integer& pow(Integer& Res, const Integer& n, const int l) ;
+ Integer& pow(Integer& Res, const Integer& n, const unsigned int l) ;
+ Integer pow(const Integer& n, const long l);
+ Integer pow(const Integer& n, const unsigned long l);
+ Integer pow(const Integer& n, const int l) ;
+ Integer pow(const Integer& n, const unsigned int l);
+ Integer& powmod(Integer& Res, const Integer& n, const unsigned long e, const Integer& m);
+ Integer& powmod(Integer& Res, const Integer& n, const long e, const Integer& m);
+ Integer& powmod(Integer& Res, const Integer& n, const unsigned int e, const Integer& m) ;
+ Integer& powmod(Integer& Res, const Integer& n, const int e, const Integer& m) ;
+ Integer& powmod(Integer& Res, const Integer& n, const Integer& e, const Integer& m);
+ Integer powmod(const Integer& n, const unsigned long e, const Integer& m);
+ Integer powmod(const Integer& n, const long e, const Integer& m);
+ Integer powmod(const Integer& n, const unsigned int e, const Integer& m) ;
+ Integer powmod(const Integer& n, const int e, const Integer& m) ;
+ Integer powmod(const Integer& n, const Integer& e, const Integer& m);
+ Integer fact ( unsigned long l);
+ Integer sqrt(const Integer& p);
+ Integer sqrtrem(const Integer& p, Integer& rem);
+ Integer& sqrt(Integer& r, const Integer& p);
+ Integer& sqrtrem(Integer& r, const Integer& p, Integer& rem);
+ bool root(Integer& q, const Integer&, unsigned int n);
+ long logp(const Integer& a, const Integer& p) ;
+ double logtwo(const Integer& a) ;
+ double naturallog(const Integer& a) ;
+ void swap(Integer& , Integer&);
+ int sign (const Integer& a);
+ int isZero (const Integer& a);
+ int isOne (const Integer& a);
+ int isperfectpower (const Integer& );
+ Integer abs(const Integer& n);
+ Integer& prevprime(Integer&, const Integer& p);
+ Integer& nextprime(Integer&, const Integer& p);
+ int probab_prime(const Integer& p);
+ int probab_prime(const Integer& p, int r);
+ int jacobi(const Integer& u, const Integer& v) ;
+ int legendre(const Integer& u, const Integer& v) ;
+ unsigned long length (const Integer& a);
+ std::istream& operator >> (std::istream &i, Integer& n);
+ std::ostream& operator << (std::ostream &o, const Integer& n);
+ std::ostream& absOutput (std::ostream &o, const Integer& n);
+ void importWords(Integer&, size_t, int, int, int, size_t, const void*);
+
+
+ //------------------------------------------------------ Class Integer
+ /*! @ingroup integers
+ * This is the Integer class.
+ * An Integer is represented as a GMP integer.
+ * This class provides arithmetic on Integers.
+ */
+ class Integer
+ {
+
+ public:
+ //! vector of limbs (ie a gmp number).
+ typedef std::vector<mp_limb_t> vect_t;
+ //--------------------------------------cstors & dstors
+ /*! @name Constructor/Destructors
+ */
+ //@{
+ Integer( const std::vector<mp_limb_t>& vect_t );
+ Integer(int n = 0);
+ Integer(long n);
+ Integer(unsigned char n);
+ Integer(unsigned int n);
+ Integer(unsigned long n);
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
- Integer(long long n);
- Integer(unsigned long long n);
+ Integer(long long n);
+ Integer(unsigned long long n);
#endif
- Integer(double d);
- Integer(const char *s);
- Integer(const Integer& n);
- ~Integer();
-
- //------------------------------------- predefined null and one
- static const Integer zero;
- static const Integer one;
-
- // -- Assignment and copy operators
- Integer& operator = (const Integer& n);
- Integer& logcpy(const Integer& n);
- Integer& copy(const Integer& n);
-
- //------------------Equalities and inequalities between integers and longs
- int operator != (const int l) const;
- int operator != (const long l) const;
- int operator != (const unsigned long l) const;
-
- friend int compare(const Integer& a, const Integer& b);
- friend int absCompare(const Integer& a, const Integer& b);
-
- int operator > (const int l) const;
- int operator > (const long l) const;
- int operator > (const unsigned long l) const;
- int operator < (const int l) const;
- int operator < (const long l) const;
- int operator < (const unsigned long l) const;
-
- //------------------ Bit logic
- Integer operator^ (const Integer&); // XOR
- Integer operator| (const Integer&); // OR
- Integer operator& (const Integer&); // AND
- Integer operator ~ () const; // 1 complement
- Integer& operator^= (const Integer&); // XOR
- Integer& operator|= (const Integer&); // OR
- Integer& operator&= (const Integer&); // AND
- Integer operator<< (int l) const; // lshift
- Integer operator>> (int l) const; // rshift
- Integer operator<< (long l) const; // lshift
- Integer operator>> (long l) const; // rshift
- Integer operator<< (unsigned int l) const; // lshift
- Integer operator>> (unsigned int l) const; // rshift
- Integer operator<< (unsigned long l) const; // lshift
- Integer operator>> (unsigned long l) const; // rshift
- Integer& operator<<= (int l) ; // lshift
- Integer& operator>>= (int l) ; // rshift
- Integer& operator<<= (long l) ; // lshift
- Integer& operator>>= (long l) ; // rshift
- Integer& operator<<= (unsigned int l) ; // lshift
- Integer& operator>>= (unsigned int l) ; // rshift
- Integer& operator<<= (unsigned long l) ; // lshift
- Integer& operator>>= (unsigned long l) ; // rshift
-
- //----------------Elementary arithmetic between Integers & longs
- Integer operator + (const Integer& n) const;
- Integer operator + (const unsigned long l) const;
- Integer operator + (const long l) const;
- Integer& operator += (const Integer& n);
- Integer& operator += (const unsigned long l);
- Integer& operator += (const long l);
- template<class XXX> Integer& operator +=(const XXX& x) { return this->operator += ( (Integer)x ); }
-
- Integer operator - (const Integer& n) const;
- Integer operator - (const unsigned long l) const;
- Integer operator - (const long l) const;
- Integer& operator -= (const Integer& n);
- Integer& operator -= (const unsigned long l);
- Integer& operator -= (const long l);
- template<class XXX> Integer& operator -=(const XXX& x) { return this->operator -= ( (Integer)x ); }
- Integer operator -() const;
-
- Integer operator * (const Integer& n) const;
- Integer operator * (const unsigned long l) const;
- Integer operator * (const long l) const;
- Integer& operator *= (const Integer& n);
- Integer& operator *= (const unsigned long l);
- Integer& operator *= (const long l);
- template<class XXX> Integer& operator *=(const XXX& x) { return this->operator *= ( (Integer)x ); }
-
- // -- Euclidian division of a/b: returns q or r such that
- // - a=b*q + r, with |r| < |b|, a*r >=0
- Integer operator / (const Integer& n) const;
- Integer operator / (const unsigned long l) const;
- Integer operator / (const long l) const;
- Integer& operator /= (const Integer& n);
- Integer& operator /= (const unsigned long l);
- Integer& operator /= (const long l);
- template<class XXX> Integer& operator /=(const XXX& x) { return this->operator /= ( (Integer)x ); }
-
- Integer operator % (const Integer& n) const;
- unsigned long operator % (const unsigned long l) const;
- long operator % (const long l) const;
- unsigned short operator % (const unsigned short l) const { return (unsigned short) ( this->operator % ( (unsigned long)l ) ); }
- template<class XXX> XXX operator %(const XXX& x) const { return (XXX)this->operator % ( Integer(x) ); }
- Integer& operator %= (const Integer& n);
- Integer& operator %= (const unsigned long l);
- Integer& operator %= (const long l);
+ Integer(double d);
+ Integer(const char *s);
+ Integer(const Integer& n);
+ ~Integer();
+ //@}
+
+ //------------------------------------- predefined null and one
+ //! zero
+ static const Integer zero;
+ //! one
+ static const Integer one;
+
+ // -- Assignment and copy operators
+ /*! @name Assignment and copy operators
+ */
+ //@{
+ Integer& operator = (const Integer& n);
+ Integer& logcpy(const Integer& n);
+ Integer& copy(const Integer& n);
+ //@}
+
+ //------------------Equalities and inequalities between integers and longs
+ /*! @name (in)equality
+ */
+ //@{
+ int operator != (const int l) const;
+ int operator != (const long l) const;
+ int operator != (const unsigned long l) const;
+
+ friend int compare(const Integer& a, const Integer& b);
+ friend int absCompare(const Integer& a, const Integer& b);
+
+ int operator > (const int l) const;
+ int operator > (const long l) const;
+ int operator > (const unsigned long l) const;
+ int operator < (const int l) const;
+ int operator < (const long l) const;
+ int operator < (const unsigned long l) const;
+ //@}
+
+ //------------------ Bit logic
+ /*!@name Bit logic
+ */
+ //@{
+ Integer operator^ (const Integer&) const; // XOR
+ Integer operator| (const Integer&) const; // OR
+ Integer operator& (const Integer&) const; // AND
+ unsigned long operator^ (const unsigned long& a) const;
+ unsigned long operator| (const unsigned long& a) const;
+ unsigned long operator& (const unsigned long& a) const;
+ Integer operator ~ () const; // 1 complement
+ Integer& operator^= (const Integer&); // XOR
+ Integer& operator|= (const Integer&); // OR
+ Integer& operator&= (const Integer&); // AND
+ Integer operator<< (int l) const; // lshift
+ Integer operator>> (int l) const; // rshift
+ Integer operator<< (long l) const; // lshift
+ Integer operator>> (long l) const; // rshift
+ Integer operator<< (unsigned int l) const; // lshift
+ Integer operator>> (unsigned int l) const; // rshift
+ Integer operator<< (unsigned long l) const; // lshift
+ Integer operator>> (unsigned long l) const; // rshift
+ Integer& operator<<= (int l) ; // lshift
+ Integer& operator>>= (int l) ; // rshift
+ Integer& operator<<= (long l) ; // lshift
+ Integer& operator>>= (long l) ; // rshift
+ Integer& operator<<= (unsigned int l) ; // lshift
+ Integer& operator>>= (unsigned int l) ; // rshift
+ Integer& operator<<= (unsigned long l) ; // lshift
+ Integer& operator>>= (unsigned long l) ; // rshift
+ //@}
+
+ // - Methods
+ /*! @name Addition, substraction, multiplication
+ */
+ //@{
+ /*! Addition (inplace)
+ * <code>res+=n</code>.
+ * @param res as in the formula
+ * @param n as in the formula
+ */
+ static Integer& addin (Integer& res, const Integer& n);
+ static Integer& addin (Integer& res, const long n);
+ static Integer& addin (Integer& res, const unsigned long n);
+ /*! Addition
+ * <code>res=n1+n2</code>.
+ * @param res as in the formula
+ * @param n1 as in the formula
+ * @param n2 as in the formula
+ */
+ static Integer& add (Integer& res, const Integer& n1, const Integer& n2);
+ static Integer& add (Integer& res, const Integer& n1, const long n2);
+ static Integer& add (Integer& res, const Integer& n1, const unsigned long n2);
+
+ /*! Substraction (inplace)
+ * <code>res-=n</code>.
+ * @param res as in the formula
+ * @param n as in the formula
+ */
+ static Integer& subin (Integer& res, const Integer& n);
+ static Integer& subin (Integer& res, const long n);
+ static Integer& subin (Integer& res, const unsigned long n);
+ /*! Substraction
+ * <code>res=n1-n2</code>.
+ * @param res as in the formula
+ * @param n1 as in the formula
+ * @param n2 as in the formula
+ */
+ static Integer& sub (Integer& res, const Integer& n1, const Integer& n2);
+ static Integer& sub (Integer& res, const Integer& n1, const long n2);
+ static Integer& sub (Integer& res, const Integer& n1, const unsigned long n2);
+ /*! Negation (inplace)
+ * <code>res=-res</code>.
+ * @param res as in the formula
+ */
+ static Integer& negin (Integer& res);
+ /*! Negation
+ * <code>res=-n</code>.
+ * @param n as in the formula
+ * @param res as in the formula
+ */
+ static Integer& neg (Integer& res, const Integer& n);
+
+ /*! Multiplication (inplace)
+ * <code>res*=n</code>.
+ * @param res as in the formula
+ * @param n as in the formula
+ */
+ static Integer& mulin (Integer& res, const Integer& n);
+ static Integer& mulin (Integer& res, const long n);
+ static Integer& mulin (Integer& res, const unsigned long n);
+ /*! Multiplication
+ * <code>res=n1*n2</code>.
+ * @param res as in the formula
+ * @param n1 as in the formula
+ * @param n2 as in the formula
+ */
+ static Integer& mul (Integer& res, const Integer& n1, const Integer& n2);
+ static Integer& mul (Integer& res, const Integer& n1, const long n2);
+ static Integer& mul (Integer& res, const Integer& n1, const unsigned long n2);
+
+ //----------------Elementary arithmetic between Integers & longs
+ /*! operator \c +.
+ * @return <code> (*this)+n</code>
+ * @param n as in the formula.
+ */
+ Integer operator + (const Integer& n) const;
+ Integer operator + (const unsigned long n) const;
+ Integer operator + (const long n) const;
+ /*! operator \c += .
+ * @param n as in the formula.
+ * @return <code> (*this) += n</code>.
+ */
+ Integer& operator += (const Integer& n);
+ Integer& operator += (const unsigned long n);
+ Integer& operator += (const long n);
+ template<class XXX>
+ Integer& operator +=(const XXX& n) { return this->operator += ( (Integer)n ); }
+
+ /*! operator \c -.
+ * @return <code> (*this)-n</code>
+ * @param n as in the formula.
+ */
+ Integer operator - (const Integer& n) const;
+ Integer operator - (const unsigned long n) const;
+ Integer operator - (const long n) const;
+ /*! operator \c -= .
+ * @param n as in the formula.
+ * @return <code> (*this) -= n</code>.
+ */
+ Integer& operator -= (const Integer& n);
+ Integer& operator -= (const unsigned long n);
+ Integer& operator -= (const long n);
+ template<class XXX>
+ Integer& operator -=(const XXX& n) { return this->operator -= ( (Integer)n ); }
+
+ /*! Opposite.
+ * \return <code>-(*this)</code>.
+ */
+ Integer operator -() const;
+
+ /*! operator \c *.
+ * @return <code> (*this)*n</code>
+ * @param n as in the formula.
+ */
+ Integer operator * (const Integer& n) const;
+ Integer operator * (const unsigned long n) const;
+ Integer operator * (const long n) const;
+ /*! operator \c *= .
+ * @param n as in the formula.
+ * @return <code> (*this) *= n</code>.
+ */
+ Integer& operator *= (const Integer& n);
+ Integer& operator *= (const unsigned long n);
+ Integer& operator *= (const long n);
+ template<class XXX>
+ Integer& operator *=(const XXX& n) { return this->operator *= ( (Integer)n ); }
+ //@}
+
+ /*! @name fused add-multiply
+ * @brief
+ * Groups a multiplication adn an addition/division is a single function.
+ * This is usually faster than doing the two operations separately.
+ */
+ //@{
+ /*! axpy
+ * <code>res = ax+y</code>.
+ * @param res Integers as in the forumla
+ * @param a Integers as in the forumla
+ * @param x Integers as in the forumla
+ * @param y Integers as in the forumla
+ */
+ static Integer& axpy (Integer& res,
+ const Integer& a, const Integer& x, const Integer& y );
+ static Integer& axpy (Integer& res,
+ const Integer& a, const unsigned long x, const Integer& y );
+
+ /*! axpyin (inplace)
+ * <code>res += ax</code>.
+ * @param res Integers as in the formula.
+ * @param a Integers as in the formula.
+ * @param x Integers as in the formula.
+ */
+ static Integer& axpyin (Integer& res,
+ const Integer& a, const Integer& x);
+ static Integer& axpyin (Integer& res,
+ const Integer& a, const unsigned long x);
+
+ /*! maxpy
+ * <code>res = y - ax</code>.
+ * @param res Integers as in the formula.
+ * @param a Integers as in the formula.
+ * @param x Integers as in the formula.
+ * @param y Integers as in the formula.
+ */
+ static Integer& maxpy (Integer& res,
+ const Integer& a, const Integer& x, const Integer& y );
+ static Integer& maxpy (Integer& res,
+ const Integer& a, const unsigned long x, const Integer& y );
+
+ /*! maxpyin
+ * <code>res -= ax</code>.
+ * @param res Integers as in the formula.
+ * @param a Integers as in the formula.
+ * @param x Integers as in the formula.
+ * @param y Integers as in the formula.
+ */
+ static Integer& maxpyin (Integer& res,
+ const Integer& a, const Integer& x );
+ static Integer& maxpyin (Integer& res,
+ const Integer& a, const unsigned long x );
+
+
+ /*! axmy
+ * <code>res = ax - y</code>.
+ * @param res Integers as in the formula.
+ * @param a Integers as in the formula.
+ * @param x Integers as in the formula.
+ * @param y Integers as in the formula.
+ */
+ static Integer& axmy (Integer& res,
+ const Integer& a, const Integer& x, const Integer& y );
+ static Integer& axmy (Integer& res,
+ const Integer& a, const unsigned long x, const Integer & y );
+
+
+ /*! axmyin (in place)
+ * <code>res = ax - res</code>.
+ * @param res Integers as in the formula.
+ * @param a Integers as in the formula.
+ * @param x Integers as in the formula.
+ */
+ static Integer& axmyin (Integer& res,
+ const Integer& a, const Integer& x);
+ static Integer& axmyin (Integer& res,
+ const Integer& a, const unsigned long x);
+ //@}
+
+ /*! @name Division/euclidean division/modulo
+ * @brief
+ * The convention for rounding are the following :
+ * - <code>q = a/b</code>, or equivalent operations with the name \c
+ * div or \c divin, return \c q rounded towards \c 0, in the same
+ * manner as C's '/' (truncated division).
+ * - <code>r = a % b</code> behaves like C %. The modulo function %
+ * rounds towards 0 and the sign of the dividend is preserved. This
+ * is : \f[ a= b q + r, \text{with } \vert r\vert < \vert b\vert
+ * \text{ and } a r \geq 0 \f]
+ * - <code>r = a mod b</code> or similar functions have the same
+ * behaviour as GMP \c mpz_mod, that is the remainder is always
+ * positive (>=0). This is the division algorithm convention that
+ * is used (see \c divmod). In a formula : \f[ a= b q + r,
+ * \text{with } 0 \leq r < \vert b\vert \f]
+ *
+ * @warning if <code>q=a/b</code> and <code>r= a % b</code> then <code>
+ * a = b q + r </code> is always true (with in addition <code>0 <= |r|
+ * < |b|</code>). This is also true for <code>divmod(q,a,b,r)</code>
+ * (and <code>0<=r<|b|</code>). However, one should not mix the two
+ * conventions and expect equalities <small>(except if a>=0)</small>.
+ */
+ //@{
+ /*! Division \c q/=d.
+ * @param q quotient
+ * @param d divisor.
+ * @return \c q
+ */
+ static Integer& divin (Integer& q, const Integer& d);
+ static Integer& divin (Integer& q, const long d);
+ static Integer& divin (Integer& q, const unsigned long d);
+ /*! Division \c q=n/d.
+ * @param q quotient
+ * @param n dividand.
+ * @param d divisor
+ * @return \c q
+ */
+ static Integer& div (Integer& q, const Integer& n, const Integer& d);
+ static Integer& div (Integer& q, const Integer& n, const long d);
+ static Integer& div (Integer& q, const Integer& n, const int d);
+ static Integer& div (Integer& q, const Integer& n, const unsigned long d);
+ /*! Division when \c d divides \c n.
+ * @param q exact quotient
+ * @param n dividend
+ * @param d divisor
+ * @warning if quotient is not exact, the result is not predictable.
+ */
+ static Integer& divexact (Integer& q, const Integer& n, const Integer& d);
+ /*! Division when \c d divides \c n.
+ * @param n dividend
+ * @param d divisor
+ * @return exact quotient \c n/d
+ * @warning if quotient is not exact, the result is not predictable.
+ */
+ static Integer divexact (const Integer& n, const Integer& d);
+
+ /*! Division operator.
+ * @param d divisor
+ */
+ Integer operator / (const Integer& d) const;
+ Integer operator / (const unsigned long d) const;
+ Integer operator / (const long d) const;
+ /*! Division operator (inplace).
+ * @param d divisor
+ */
+ Integer& operator /= (const Integer& d);
+ Integer& operator /= (const unsigned long d);
+ Integer& operator /= (const long d);
+ template<class XXX>
+ Integer& operator /=(const XXX& d) { return this->operator /= ( (Integer)d ); }
+
+ /*! Function \c mod (inplace).
+ * \f$ r \gets r \mod n\f$
+ * @param r remainder
+ * @param n modulus
+ */
+ static Integer& modin (Integer& r, const Integer& n);
+ static Integer& modin (Integer& r, const long n);
+ static Integer& modin (Integer& r, const unsigned long n);
+ /*! Function \c mod.
+ * \f$ r \gets n \mod d\f$
+ * @param r remainder
+ * @param n integer
+ * @param d modulus
+ */
+ static Integer& mod (Integer& r, const Integer& n, const Integer& d);
+ static Integer& mod (Integer& r, const Integer& n, const long d);
+ static Integer& mod (Integer& r, const Integer& n, const unsigned long d);
+
+ /*! Euclidean division.
+ * <code> n = d q + r </code>.
+ * @param q as in the formula
+ * @param r as in the formula
+ * @param n as in the formula
+ * @param d as in the formula
+ * @return the quotient \c q
+ */
+ static Integer& divmod (Integer& q, Integer& r, const Integer& n, const Integer& d);
+ static Integer& divmod (Integer& q, long& r, const Integer& n, const long d);
+ static Integer& divmod (Integer& q, unsigned long& r, const Integer& n, const unsigned long d);
+
+ /*! Modulo operator.
+ * @param n modulus
+ * @return remainder <code> (*this) mod n</code>
+ */
+ Integer operator % (const Integer& n) const;
+ long operator % (const unsigned long n) const;
+ long operator % (const long n) const;
+ double operator % (const double n) const;
+ short operator % (const unsigned short n) const { return (short) ( this->operator % ( (unsigned long)n ) ); }
+ template<class XXX>
+ XXX operator %(const XXX& n) const { return (XXX)this->operator % ( Integer(n) ); }
+
+ /*! Modulo operator (inplace).
+ * @param n modulus
+ * @return remainder <code> (*this) <- (*this) mod n</code>
+ */
+ Integer& operator %= (const Integer& n);
+ Integer& operator %= (const unsigned long n);
+ Integer& operator %= (const long n);
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
- Integer& operator %= (const long long l) { return *this %= (Integer)l; }
- Integer& operator %= (const unsigned long long l) { return *this %= (Integer)l; }
- long long operator % (const long long l) const;
- unsigned long long operator % (const unsigned long long l) const;
+ Integer& operator %= (const long long n) { return *this %= (Integer)n; }
+ Integer& operator %= (const unsigned long long n) { return *this %= (Integer)n; }
+ long long operator % (const long long n) const;
+ unsigned long long operator % (const unsigned long long n) const;
#endif
- template<class XXX> Integer& operator %=(const XXX& x) { return this->operator %= ( (Integer)x ); }
-
- // - Methods
-static Integer& addin (Integer& res, const Integer& n);
-static Integer& addin (Integer& res, const long n);
-static Integer& addin (Integer& res, const unsigned long n);
-static Integer& add (Integer& res, const Integer& n1, const Integer& n2);
-static Integer& add (Integer& res, const Integer& n1, const long n2);
-static Integer& add (Integer& res, const Integer& n1, const unsigned long n2);
-
-static Integer& subin (Integer& res, const Integer& n);
-static Integer& subin (Integer& res, const long n);
-static Integer& subin (Integer& res, const unsigned long n);
-static Integer& sub (Integer& res, const Integer& n1, const Integer& n2);
-static Integer& sub (Integer& res, const Integer& n1, const long n2);
-static Integer& sub (Integer& res, const Integer& n1, const unsigned long n2);
-static Integer& negin (Integer& res);
-static Integer& neg (Integer& res, const Integer& n);
-
-static Integer& mulin (Integer& res, const Integer& n);
-static Integer& mulin (Integer& res, const long n);
-static Integer& mulin (Integer& res, const unsigned long n);
-static Integer& mul (Integer& res, const Integer& n1, const Integer& n2);
-static Integer& mul (Integer& res, const Integer& n1, const long n2);
-static Integer& mul (Integer& res, const Integer& n1, const unsigned long n2);
-static Integer& axpy (Integer& res, const Integer& a, const Integer& x, const Integer& y );
-static Integer& axpyin (Integer& res, const Integer& a, const Integer& x);
-static Integer& amxy (Integer& res, const Integer& a, const Integer& x, const Integer& y );
-static Integer& axmy (Integer& res, const Integer& a, const Integer& x, const Integer& y );
-static Integer& axmyin (Integer& res, const Integer& a, const Integer& x);
-
-static Integer& divin (Integer& q, const Integer& n);
-static Integer& divin (Integer& q, const long n);
-static Integer& divin (Integer& q, const unsigned long n);
-static Integer& div (Integer& q, const Integer& n1, const Integer& n2);
-static Integer& div (Integer& q, const Integer& n1, const long n2);
-static Integer& div (Integer& q, const Integer& n1, const unsigned long n2);
-static Integer& divexact (Integer& q, const Integer& n1, const Integer& n2);
-static Integer divexact (const Integer& n1, const Integer& n2);
-
-static Integer& modin (Integer& r, const Integer& n);
-static Integer& modin (Integer& r, const long n);
-static Integer& modin (Integer& r, const unsigned long n);
-static Integer& mod (Integer& r, const Integer& n1, const Integer& n2);
-static Integer& mod (Integer& r, const Integer& n1, const long n2);
-static Integer& mod (Integer& r, const Integer& n1, const unsigned long n2);
-
- // -- return q, the quotient
-static Integer& divmod (Integer& q, Integer& r, const Integer& n1, const Integer& n2);
-static Integer& divmod (Integer& q, long& r, const Integer& n1, const long n2);
-static Integer& divmod (Integer& q, unsigned long& r, const Integer& n1, const unsigned long n2);
-
-
- //------------------------------------- Arithmetic functions
- friend Integer& inv (Integer& u, const Integer& a, const Integer& b);
- friend Integer gcd (const Integer& a, const Integer& b);
- friend Integer gcd (const Integer& a, const Integer& b,
- Integer& u, Integer& v);
- friend Integer& gcd (Integer& g, const Integer& a, const Integer& b);
- friend Integer& gcd (Integer& g, const Integer& a, const Integer& b,
- Integer& u, Integer& v);
-
- friend Integer pp( const Integer& P, const Integer& Q );
-
- friend Integer& lcm (Integer& g, const Integer& a, const Integer& b);
- friend Integer lcm (const Integer& a, const Integer& b);
-
- // - return n^l
- friend Integer& pow(Integer& Res, const Integer& n, const long l);
- friend Integer& pow(Integer& Res, const unsigned long n, const unsigned long l);
- friend Integer& pow(Integer& Res, const Integer& n, const unsigned long l);
- friend Integer& pow(Integer& Res, const Integer& n, const int l) { return pow(Res, n, (long)l ); }
- friend Integer& pow(Integer& Res, const Integer& n, const unsigned int l) { return pow(Res, n, (unsigned long)l ); }
- friend Integer pow(const Integer& n, const long l);
- friend Integer pow(const Integer& n, const unsigned long l);
- friend Integer pow(const Integer& n, const int l) { return pow(n, (long)l ); }
- friend Integer pow(const Integer& n, const unsigned int l) { return pow(n, (unsigned long)l ); }
-
- // - return n^e % m
- friend Integer& powmod(Integer& Res, const Integer& n, const unsigned long e, const Integer& m);
- friend Integer& powmod(Integer& Res, const Integer& n, const long e, const Integer& m);
- friend Integer& powmod(Integer& Res, const Integer& n, const unsigned int e, const Integer& m) { return powmod(Res, n, (unsigned long)e, m); }
- friend Integer& powmod(Integer& Res, const Integer& n, const int e, const Integer& m) { return powmod(Res, n, (long)e, m); }
- friend Integer& powmod(Integer& Res, const Integer& n, const Integer& e, const Integer& m);
- friend Integer powmod(const Integer& n, const unsigned long e, const Integer& m);
- friend Integer powmod(const Integer& n, const long e, const Integer& m);
- friend Integer powmod(const Integer& n, const unsigned int e, const Integer& m) { return powmod(n, (unsigned long)e, m); }
- friend Integer powmod(const Integer& n, const int e, const Integer& m) { return powmod(n, (long)e, m); }
- friend Integer powmod(const Integer& n, const Integer& e, const Integer& m);
-
- friend Integer fact ( unsigned long l);
-
- friend Integer sqrt(const Integer& p);
- friend Integer sqrtrem(const Integer& p, Integer& rem);
- friend Integer& sqrt(Integer& r, const Integer& p);
- friend Integer& sqrtrem(Integer& r, const Integer& p, Integer& rem);
-
-
- friend bool root(Integer& q, const Integer&, unsigned int n);
- friend long logp(const Integer& a, const Integer& p) ;
- friend double logtwo(const Integer& a) ;
-
- //-----------------------------------------Miscellaneous
- friend void swap(Integer& , Integer&);
-
- friend inline int sign (const Integer& a);
- friend inline int isZero (const Integer& a);
- friend inline int isOne (const Integer& a);
- friend int isperfectpower (const Integer& );
-
- friend Integer abs(const Integer& n);
-
- friend Integer& prevprime(Integer&, const Integer& p);
- friend Integer& nextprime(Integer&, const Integer& p);
- friend int probab_prime(const Integer& p);
- friend int probab_prime(const Integer& p, int r);
- friend int jacobi(const Integer& u, const Integer& v) ;
- friend int legendre(const Integer& u, const Integer& v) ;
-
- Integer& operator++() { return *this+=1UL; } // prefix
- Integer& operator--() { return *this-=1UL; } // prefix
-
- // - return the size in byte
- friend inline unsigned long length (const Integer& a);
- // - return the size in word.
- size_t size() const;
- // - return the size in base B (always exact if B is a power of two)
- size_t size_in_base(int B) const;
- // - return the size in bit.
- size_t bitsize() const;
- // - return the i-th word of the integer. Word 0 is lowest word.
- unsigned long operator[](size_t i) const;
-
- // -- Convert an Integer to a basic C++ type
- // -- Cast operators
- operator short() const { return (int) *this; }
- operator unsigned short() const { return (unsigned int) *this; }
- operator unsigned char() const { return (unsigned int) *this; }
- operator unsigned int() const ;
- operator int() const ;
- operator signed char() const { return (int) *this; }
- operator unsigned long() const ;
- operator long() const ;
+ template<class XXX>
+ Integer& operator %=(const XXX& n) { return this->operator %= ( (Integer)n ); }
+ //@}
+
+
+ //------------------------------------- Arithmetic functions
+ /*! @name Arithmetic functions */
+ //@{
+ friend Integer gcd (const Integer& a, const Integer& b);
+ friend Integer gcd (const Integer& a, const Integer& b,
+ Integer& u, Integer& v);
+ friend Integer& gcd (Integer& g, const Integer& a, const Integer& b);
+ friend Integer& gcd (Integer& g, const Integer& a, const Integer& b,
+ Integer& u, Integer& v);
+ // modular inverses
+ friend Integer& inv (Integer& u, const Integer& a, const Integer& b);
+ friend Integer& invin (Integer& u, const Integer& b);
+
+ friend Integer pp( const Integer& P, const Integer& Q );
+
+ friend Integer& lcm (Integer& g, const Integer& a, const Integer& b);
+ friend Integer lcm (const Integer& a, const Integer& b);
+
+ // - return n^l
+ friend Integer& pow(Integer& Res, const Integer& n, const long l);
+ friend Integer& pow(Integer& Res, const unsigned long n, const unsigned long l);
+ friend Integer& pow(Integer& Res, const Integer& n, const unsigned long l);
+ friend Integer& pow(Integer& Res, const Integer& n, const int l) { return pow(Res, n, (long)l ); }
+ friend Integer& pow(Integer& Res, const Integer& n, const unsigned int l) { return pow(Res, n, (unsigned long)l ); }
+ friend Integer pow(const Integer& n, const long l);
+ friend Integer pow(const Integer& n, const unsigned long l);
+ friend Integer pow(const Integer& n, const int l) { return pow(n, (long)l ); }
+ friend Integer pow(const Integer& n, const unsigned int l) { return pow(n, (unsigned long)l ); }
+
+ // - return n^e % m
+ friend Integer& powmod(Integer& Res, const Integer& n, const unsigned long e, const Integer& m);
+ friend Integer& powmod(Integer& Res, const Integer& n, const long e, const Integer& m);
+ friend Integer& powmod(Integer& Res, const Integer& n, const unsigned int e, const Integer& m) { return powmod(Res, n, (unsigned long)e, m); }
+ friend Integer& powmod(Integer& Res, const Integer& n, const int e, const Integer& m) { return powmod(Res, n, (long)e, m); }
+ friend Integer& powmod(Integer& Res, const Integer& n, const Integer& e, const Integer& m);
+ friend Integer powmod(const Integer& n, const unsigned long e, const Integer& m);
+ friend Integer powmod(const Integer& n, const long e, const Integer& m);
+ friend Integer powmod(const Integer& n, const unsigned int e, const Integer& m) { return powmod(n, (unsigned long)e, m); }
+ friend Integer powmod(const Integer& n, const int e, const Integer& m) { return powmod(n, (long)e, m); }
+ friend Integer powmod(const Integer& n, const Integer& e, const Integer& m);
+
+ friend Integer fact ( unsigned long l);
+
+ friend Integer sqrt(const Integer& p);
+ friend Integer sqrtrem(const Integer& p, Integer& rem);
+ friend Integer& sqrt(Integer& r, const Integer& p);
+ friend Integer& sqrtrem(Integer& r, const Integer& p, Integer& rem);
+
+
+ friend bool root(Integer& q, const Integer&, unsigned int n);
+ friend long logp(const Integer& a, const Integer& p) ;
+ friend double logtwo(const Integer& a) ;
+ friend double naturallog(const Integer& a) ;
+ //@}
+
+ //-----------------------------------------Miscellaneous
+ /*! @name Miscellaneous.
+ */
+ //@{
+ friend void swap(Integer& , Integer&);
+
+ friend inline int sign (const Integer& a);
+ friend inline int isZero (const Integer& a);
+ friend inline int isOne (const Integer& a);
+ friend int isperfectpower (const Integer& );
+
+ friend Integer abs(const Integer& n);
+
+ friend Integer& prevprime(Integer&, const Integer& p);
+ friend Integer& nextprime(Integer&, const Integer& p);
+ friend int probab_prime(const Integer& p);
+ friend int probab_prime(const Integer& p, int r);
+ friend int jacobi(const Integer& u, const Integer& v) ;
+ friend int legendre(const Integer& u, const Integer& v) ;
+
+ Integer& operator++() { return *this+=1UL; } // prefix
+ Integer operator++(int)
+ { // postfix
+ Integer tmp = *this ;
+ ++*this;
+ return tmp;
+ }
+ Integer& operator--() { return *this-=1UL; } // prefix
+ Integer operator--(int)
+ {// postfix
+ Integer tmp = *this ;
+ --*this;
+ return tmp;
+ }
+
+ // - return the size in byte
+ friend inline unsigned long length (const Integer& a);
+ // - return the size in word.
+ size_t size() const;
+ // - return the size in base B (always exact if B is a power of two)
+ size_t size_in_base(int B) const;
+ // - return the size in bit.
+ size_t bitsize() const;
+ // - return the i-th word of the integer. Word 0 is lowest word.
+ unsigned long operator[](size_t i) const;
+
+ // -- Convert an Integer to a basic C++ type
+ // -- Cast operators
+ operator bool() const { return *this!=0UL; }
+ operator short() const { return (short)(int) *this; }
+ operator unsigned short() const { return (unsigned short) (unsigned int) *this; }
+ operator unsigned char() const { return (unsigned char) (unsigned int) *this; }
+ operator unsigned int() const ;
+ operator int() const ;
+ operator signed char() const { return (signed char) (int) *this; }
+ operator unsigned long() const ;
+ operator long() const ;
#ifndef __GIVARO__DONOTUSE_longlong__
- operator unsigned long long() const ;
- operator long long() const ;
+ operator unsigned long long() const ;
+ operator long long() const ;
#endif
- operator std::string() const ;
- operator float() const ;
- operator double() const ;
- operator vect_t() const ;
-
- //--------------------Random Iterators
- // -- return a random number with sz machine word.
- // -- To be improved.
+ operator std::string() const ;
+ operator float() const ;
+ operator double() const ;
+ operator vect_t() const ;
+ //@}
+
+ //--------------------Random Iterators
+ /*! @name Random numbers functions
+ */
+ //@{
+ static void seeding(unsigned long int s);
+ static void seeding(Integer s);
+ static void seeding();
+
#ifdef __GMP_PLUSPLUS__
- static void seeding(unsigned long int s=0);
- static gmp_randclass& randstate(unsigned long int s=0);
+ static gmp_randclass& randstate();
+#else
+ static __gmp_randstate_struct intializerandstate();
+ static __gmp_randstate_struct* randstate();
#endif
- static Integer random(int sz=1 );
- static Integer nonzerorandom(int sz=1 );
- static Integer& random(Integer& r, const Integer& size );
- static Integer& nonzerorandom(Integer& r, const Integer& size );
- static Integer& random(Integer& r, long size =1 );
- static Integer& nonzerorandom(Integer& r, long size =1 );
- //----------------------------------------------I/O
-
- friend std::istream& operator >> (std::istream &i, Integer& n);
- friend std::ostream& operator << (std::ostream &o, const Integer& n);
- friend std::ostream& absOutput (std::ostream &o, const Integer& n);
-
- friend void importWords(Integer&, size_t, int, int, int, size_t, const void*);
-
- std::ostream& print( std::ostream& o ) const;
-
- int sign() const {return priv_sign(); } // but figure out the friend sign()
-
- mpz_ptr get_mpz() {return (mpz_ptr)&gmp_rep;}
-
-protected:
-
- typedef MP_INT Rep;
-
- Rep gmp_rep;
-
- int priv_sign() const;
- //mpz_ptr get_mpz() {return (mpz_ptr)&gmp_rep;}
- const Rep* get_rep() const { return &gmp_rep; }
-
- // -- Creates a new Integer from a size sz and a array of unsigned long d
- Integer(unsigned long* d, long size);
-
-}; //----------------------------------------------- End of Class Integer
-
-
+ static bool RandBool() ;
+ /* random <= */
+ template<bool U>
+ static Integer& random_lessthan (Integer& r, const Integer & m);
+ static Integer& random_lessthan (Integer& r, const Integer & m)
+ {return random_lessthan<true>(r,m);}
+ template<bool U>
+ static Integer& random_lessthan_2exp (Integer& r, const unsigned long & m);
+ static Integer& random_lessthan_2exp (Integer& r, const unsigned long & m)
+ { return random_lessthan_2exp<true>(r,m);}
+ template<bool U>
+ static Integer random_lessthan_2exp (const unsigned long & m);
+ static Integer random_lessthan_2exp (const unsigned long & m)
+ { return random_lessthan_2exp<true>(m);}
+ template<bool U>
+ static Integer& random_lessthan (Integer& r, const unsigned long & m) ;
+ static Integer& random_lessthan (Integer& r, const unsigned long & m)
+ { return random_lessthan<true>(r,m);}
+ template<bool U,class T>
+ static Integer random_lessthan (const T & m);
+ template<class T>
+ static Integer random_lessthan (const T & m)
+ { return random_lessthan<true>(m);}
+
+
+ /* random = */
+ template<bool U>
+ static Integer& random_exact (Integer& r, const Integer & s) ;
+ static Integer& random_exact (Integer& r, const Integer & s)
+ { return random_exact<true>(r,s); }
+ template<bool U>
+ static Integer& random_exact_2exp (Integer& r, const unsigned long int & m) ;
+ static Integer& random_exact_2exp (Integer& r, const unsigned long int & m)
+ {return random_exact_2exp<true>(r,m);}
+ template<bool U>
+ static Integer& random_exact (Integer& r, const unsigned long int & m) ;
+ static Integer& random_exact (Integer& r, const unsigned long int & m)
+ {return random_exact<true>(r,m);}
+ template<bool U,class T>
+ static Integer& random_exact (Integer& r, const T & m)
+ { return random_exact<U>(r,static_cast<unsigned long int>(m)); }
+ template<class T>
+ static Integer& random_exact (Integer& r, const T & m)
+ { return random_exact(r,static_cast<unsigned long int>(m)); }
+ template<bool U,class T>
+ static Integer random_exact (const T & s) ;
+ template<class T>
+ static Integer random_exact (const T & s)
+ { return random_exact<true>(s) ; }
+
+ /* random <.< */
+ static Integer& random_between (Integer& r, const Integer& m, const Integer&M) ;
+ static Integer random_between (const Integer& m, const Integer &M) ;
+ static Integer& random_between_2exp (Integer& r, const unsigned long int& m, const unsigned long int &M) ;
+ static Integer& random_between (Integer& r, const unsigned long int& m, const unsigned long int &M) ;
+ static Integer random_between_2exp (const unsigned long int & m, const unsigned long int &M) ;
+ static Integer random_between (const unsigned long int & m, const unsigned long int &M) ;
+
+ template<class R>
+ static Integer random_between (const R & m, const R & M)
+ { return random_between(static_cast<unsigned long int>(m), static_cast<unsigned long int>(M)); }
+
+ template<class R>
+ static Integer & random_between (Integer &r, const R & m, const R & M)
+ { return random_between(r,static_cast<unsigned long int>(m), static_cast<unsigned long int>(M)); }
+
+
+ // useful functions :
+ template<bool U,class T>
+ static Integer& random (Integer& r, const T & m) ;
+ template<class T>
+ static Integer& random (Integer& r, const T & m)
+ {return random<true>(r,m);}
+ template<bool U,class T>
+ static Integer random(const T & sz) ;
+ template<class T>
+ static Integer random(const T & sz)
+ { return random<true>(sz);}
+ template<bool U>
+ static Integer random();
+ static Integer random();
+ template<bool U,class T>
+ static Integer nonzerorandom(const T & sz) ;
+ template<bool U,class T>
+ static Integer& nonzerorandom (Integer& r, const T& size) ;
+ template<class T>
+ static Integer nonzerorandom(const T & sz)
+ { return nonzerorandom<true>(sz); }
+ template<class T>
+ static Integer& nonzerorandom (Integer& r, const T& size)
+ { return nonzerorandom<true>(r,size); }
+ static Integer nonzerorandom()
+ {
+ Integer rez = Integer::nonzerorandom(sizeof(mp_limb_t)*8) ;
+ // if (!U) if (Integer::RandBool()) negin(rez);
+ return rez;
+ }
+ //@}
+
+ //----------------------------------------------I/O
+ /*! @name I/O
+ */
+ //@{
+ friend std::istream& operator >> (std::istream &i, Integer& n);
+ friend std::ostream& operator << (std::ostream &o, const Integer& n);
+ friend std::ostream& absOutput (std::ostream &o, const Integer& n);
+
+ friend void importWords(Integer&, size_t, int, int, int, size_t, const void*);
+
+ std::ostream& print( std::ostream& o ) const;
+ //@}
+
+ int sign() const {return priv_sign(); } // but figure out the friend sign()
+
+ mpz_ptr get_mpz() {return (mpz_ptr)&gmp_rep;}
+
+ protected:
+
+ typedef __mpz_struct Rep;
+
+ Rep gmp_rep;
+
+ int priv_sign() const;
+ //mpz_ptr get_mpz() {return (mpz_ptr)&gmp_rep;}
+ const Rep* get_rep() const { return &gmp_rep; }
+
+ // -- Creates a new Integer from a size sz and a array of unsigned long d
+ Integer(unsigned long* d, long size);
+
+ }; //----------------------------------------------- End of Class Integer
+
+} // Givaro
#include "gmp++/gmp++_int.inl"
-#endif
+#endif // __GIVARO_GMPplusplus_integer_H
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/gmp++/gmp++_int.inl b/src/kernel/gmp++/gmp++_int.inl
index 6b74702..012f6ba 100644
--- a/src/kernel/gmp++/gmp++_int.inl
+++ b/src/kernel/gmp++/gmp++_int.inl
@@ -1,369 +1,884 @@
// ========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2010 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int.inl,v 1.8 2007-01-11 18:42:51 jgdumas Exp $
+// Modified by: B. Boyer
+// $Id: gmp++_int.inl,v 1.20 2011-02-02 16:23:55 bboyer Exp $
// ========================================================================
-// Description:
+// Description:
+//
+
+#ifndef __GIVARO_gmpxx_integer_INL
+#define __GIVARO_gmpxx_integer_INL
#define GMP__ABS(l) ((l) <0 ? -l : l)
-#define GMP__SGN(l) ((l) <0 ? -1 : (l >0 ? 1 : 0))
+#define GMP__SGN(l) ((l) <0 ? -1 : (l >0 ? 1 : 0))
+#include <cassert>
+#include <givaro/givtimer.h>
-//-----------------------------~Integer()
-inline Integer::~Integer() { mpz_clear((mpz_ptr)&gmp_rep) ; }
+namespace Givaro {
-//-------------------------------Integer(const Integer &n)
-inline Integer::Integer(const Integer &n) {
- mpz_init_set ( (mpz_ptr)&gmp_rep, (mpz_ptr)&(n.gmp_rep)) ;
-}
+ //-----------------------------~Integer()
+ inline Integer::~Integer() { mpz_clear((mpz_ptr)&gmp_rep) ;
+ }
-//------------------------------------------operator = (const Integer &n)
-inline Integer& Integer::logcpy(const Integer &n)
-{
- if (this == &n) return *this;
- mpz_set ( (mpz_ptr)&gmp_rep, (mpz_ptr)&(n.gmp_rep)) ;
- return *this;
-}
+ //-------------------------------Integer(const Integer &n)
+ inline Integer::Integer(const Integer &n)
+ {
+ mpz_init_set ( (mpz_ptr)&gmp_rep, (mpz_srcptr)&(n.gmp_rep)) ;
+ }
-// same as logcopy
-inline Integer& Integer::operator = (const Integer &n) { return logcpy(n) ; }
+ //------------------------------------------operator = (const Integer &n)
+ inline Integer& Integer::logcpy(const Integer &n)
+ {
+ if (this == &n) return *this;
+ mpz_set ( (mpz_ptr)&gmp_rep, (mpz_srcptr)&(n.gmp_rep)) ;
+ return *this;
+ }
-//-----------------------------Integer(int n)
-inline Integer::Integer(int n) { mpz_init_set_si((mpz_ptr)&gmp_rep, n) ; }
+ // same as logcopy
+ inline Integer& Integer::operator = (const Integer &n)
+ {
+ return logcpy(n) ;
+ }
-//-----------------------------Integer(uint n)
-inline Integer::Integer(unsigned char n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ; }
+ //-----------------------------Integer(int n)
+ inline Integer::Integer(int n) { mpz_init_set_si((mpz_ptr)&gmp_rep, n) ;
+ }
-//-----------------------------Integer(uint n)
-inline Integer::Integer(unsigned int n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ; }
+ //-----------------------------Integer(uint n)
+ inline Integer::Integer(unsigned char n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ;
+ }
-//-----------------------------Integer(long n)
-inline Integer::Integer(long n) { mpz_init_set_si((mpz_ptr)&gmp_rep, n) ; }
+ //-----------------------------Integer(uint n)
+ inline Integer::Integer(unsigned int n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ;
+ }
-//-----------------------------Integer(unsigned long n)
-inline Integer::Integer(unsigned long n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ; }
+ //-----------------------------Integer(long n)
+ inline Integer::Integer(long n) { mpz_init_set_si((mpz_ptr)&gmp_rep, n) ;
+ }
+
+ //-----------------------------Integer(unsigned long n)
+ inline Integer::Integer(unsigned long n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ;
+ }
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
#include <stdio.h>
-//-----------------------------Integer(long long n)
-// log[10](2^8) < 2.408239966
-inline Integer::Integer(long long n) {
-char * tmp = new char[long(2.408239966*sizeof(long long))+1]; sprintf(tmp,"%lld",n);
- mpz_init_set_str((mpz_ptr)&gmp_rep, tmp, 10) ;
-delete [] tmp;
-}
-
-//-----------------------------Integer(unsigned long long n)
-// log[10](2^8) < 2.408239966
-inline Integer::Integer(unsigned long long n) {
-char * tmp = new char[ long(2.408239966*sizeof(unsigned long long))+1];
-sprintf(tmp,"%llu",n);
-mpz_init_set_str((mpz_ptr)&gmp_rep, tmp, 10) ;
-delete [] tmp;
-}
+ //-----------------------------Integer(long long n)
+ // log[10](2^8) < 2.408239966
+ inline Integer::Integer(long long n)
+ {
+ char * tmp = new char[long(2.408239966*sizeof(long long))+1]; sprintf(tmp,"%lld",n);
+ mpz_init_set_str((mpz_ptr)&gmp_rep, tmp, 10) ;
+ delete [] tmp;
+ }
+
+ //-----------------------------Integer(unsigned long long n)
+ // log[10](2^8) < 2.408239966
+ inline Integer::Integer(unsigned long long n)
+ {
+ char * tmp = new char[ long(2.408239966*sizeof(unsigned long long))+1];
+ sprintf(tmp,"%llu",n);
+ mpz_init_set_str((mpz_ptr)&gmp_rep, tmp, 10) ;
+ delete [] tmp;
+ }
#endif
-//-----------------------------Integer(double)
-inline Integer::Integer(double d) { mpz_init_set_d((mpz_ptr)&gmp_rep, d) ; }
-
-
-//-----------------------------Integer(const neutral n), default n = zero
-/* Neutral is causing a problem
-inline Integer::Integer(const Neutral n) {
- if (n == Neutral::zero) mpz_init_set_ui((mpz_ptr)&gmp_rep, 0L) ;
- else mpz_init_set_ui((mpz_ptr)&gmp_rep, 1L) ;
-}
-*/
-
-//-------------------------------------------------inline comparaison operators
-inline int operator != (const Integer& a , const Integer& b)
- { return compare(a,b) != 0; }
-
-inline int operator != (int l, const Integer& n)
- { return n.operator != (l); }
-
-inline int operator != (long l, const Integer& n)
- { return n.operator != (l); }
-
-inline int operator != (unsigned long l, const Integer& n)
- { return n.operator != (l); }
-
-inline int operator == (const Integer& a, const Integer& b)
- { return compare(a,b) == 0; }
-
-inline int operator == (int l, const Integer& n)
- { return (! (n.operator != (l))); }
-
-inline int operator == (long l, const Integer& n)
- { return (! (n.operator != (l))); }
-
-inline int operator == (unsigned long l, const Integer& n)
- { return (! (n.operator != (l))); }
-
-inline int operator == (const Integer& n, unsigned long l)
- { return (! (n.operator != (l))); }
-
-inline int operator == (const Integer& n, int l)
- { return (! (n.operator != (l))); }
-
-inline int operator == (const Integer& n, long l)
- { return (! (n.operator != (l))); }
-
-inline int operator < (const Integer& a , const Integer& b)
- { return compare(a,b) < 0; }
-
-inline int operator < (const int l, const Integer& n)
- { return n > l; }
-
-inline int operator < (const long l, const Integer& n)
- { return n > l; }
-
-inline int operator < (const unsigned long l, const Integer& n)
- { return n > l; }
-
-inline int operator <= (const Integer& n, unsigned long l)
- { return (! (n > l) ); }
-
-inline int operator <= (unsigned long l, const Integer& n)
- { return (! (n < l) );}
-
-inline int operator >= (unsigned long l, const Integer& n)
- { return (! (n < l) );}
-
-inline int operator >= (const Integer& n, unsigned long l)
- { return (! (n < l) );}
-
-inline int operator > (int l, const Integer& n)
- { return n < l; }
-
-inline int operator > (long l, const Integer& n)
- { return n < l; }
-
-inline int operator > (unsigned long l, const Integer& n)
- { return n < l; }
-
-inline int operator > (const Integer& a , const Integer& b)
- { return compare(a,b) > 0; }
-
-inline int operator <= (const Integer& a, const Integer& b)
- { return compare(a,b) <= 0; }
-
-inline int operator <= (const Integer& n, int l)
- { return (! (n > l) ); }
-
-inline int operator <= (const Integer& n, long l)
- { return (! (n > l) ); }
-
-inline int operator <= (int l, const Integer& n)
- { return (! (n < l) );}
-
-inline int operator <= (long l, const Integer& n)
- { return (! (n < l) );}
-
-inline int operator >= (const Integer& a, const Integer& b)
- { return compare(a,b) >= 0; }
-
-inline int operator >= (int l, const Integer& n)
- { return (! (n > l) );}
-
-inline int operator >= (long l, const Integer& n)
- { return (! (n > l) );}
-
-inline int operator >= (const Integer& n, int l)
- { return (! (n < l) );}
-
-inline int operator >= (const Integer& n, long l)
- { return (! (n < l) );}
-
-
-//----------------------------------arithmetic inline operators
-inline Integer Integer::operator - () const
-{
-// JGD 18.06.1999
- Integer Res ;
- mpz_neg((mpz_ptr)&Res.gmp_rep, (mpz_ptr)&gmp_rep );
- return Res ;
-}
-
-// -- operator +
-inline Integer operator + (const int l, const Integer& n) { return n + (long)l; }
-inline Integer operator + (const unsigned int l, const Integer& n) { return n + (unsigned long)l; }
-inline Integer operator + (const long l, const Integer& n) { return n + l; }
-inline Integer operator + (const unsigned long l, const Integer& n) { return n + l; }
-inline Integer operator + (const Integer& n, const int l) { return n + (long)l; }
-inline Integer operator + (const Integer& n, const unsigned int l) { return n + (unsigned long)l; }
-
-inline Integer& operator += (Integer& n, const int l) { return n += (long)l; }
-inline Integer& operator += (Integer& n, const unsigned int l) { return n += (unsigned long)l; }
+ //-----------------------------Integer(double)
+ inline Integer::Integer(double d) { mpz_init_set_d((mpz_ptr)&gmp_rep, d) ;
+ }
+
+
+ //-----------------------------Integer(const neutral n), default n = zero
+ /* Neutral is causing a problem
+ inline Integer::Integer(const Neutral n)
+ {
+ if (n == Neutral::zero) mpz_init_set_ui((mpz_ptr)&gmp_rep, 0L) ;
+ else mpz_init_set_ui((mpz_ptr)&gmp_rep, 1L) ;
+ }
+ */
+
+ //-------------------------------------------------inline comparaison operators
+ inline int operator != (const Integer& a , const Integer& b)
+ {
+ return compare(a,b) != 0;
+ }
+
+ inline int operator != (int l, const Integer& n)
+ {
+ return n.operator != (l);
+ }
+
+ inline int operator != (long l, const Integer& n)
+ {
+ return n.operator != (l);
+ }
+
+ inline int operator != (unsigned long l, const Integer& n)
+ {
+ return n.operator != (l);
+ }
+
+ inline int operator == (const Integer& a, const Integer& b)
+ {
+ return compare(a,b) == 0;
+ }
+
+ inline int operator == (int l, const Integer& n)
+ {
+ return (! (n.operator != (l)));
+ }
+
+ inline int operator == (long l, const Integer& n)
+ {
+ return (! (n.operator != (l)));
+ }
+
+ inline int operator == (unsigned long l, const Integer& n)
+ {
+ return (! (n.operator != (l)));
+ }
+
+ inline int operator == (const Integer& n, unsigned long l)
+ {
+ return (! (n.operator != (l)));
+ }
+
+ inline int operator == (const Integer& n, int l)
+ {
+ return (! (n.operator != (l)));
+ }
+
+ inline int operator == (const Integer& n, long l)
+ {
+ return (! (n.operator != (l)));
+ }
+
+ inline int operator < (const Integer& a , const Integer& b)
+ {
+ return compare(a,b) < 0;
+ }
+
+ inline int operator < (const int l, const Integer& n)
+ {
+ return n > l;
+ }
+
+ inline int operator < (const long l, const Integer& n)
+ {
+ return n > l;
+ }
+
+ inline int operator < (const unsigned long l, const Integer& n)
+ {
+ return n > l;
+ }
+
+ inline int operator <= (const Integer& n, unsigned long l)
+ {
+ return (! (n > l) );
+ }
+
+ inline int operator <= (unsigned long l, const Integer& n)
+ {
+ return (! (n < l) );
+ }
+
+ inline int operator >= (unsigned long l, const Integer& n)
+ {
+ return (! (n < l) );
+ }
+
+ inline int operator >= (const Integer& n, unsigned long l)
+ {
+ return (! (n < l) );
+ }
+
+ inline int operator > (int l, const Integer& n)
+ {
+ return n < l;
+ }
+
+ inline int operator > (long l, const Integer& n)
+ {
+ return n < l;
+ }
+
+ inline int operator > (unsigned long l, const Integer& n)
+ {
+ return n < l;
+ }
+
+ inline int operator > (const Integer& a , const Integer& b)
+ {
+ return compare(a,b) > 0;
+ }
+
+ inline int operator <= (const Integer& a, const Integer& b)
+ {
+ return compare(a,b) <= 0;
+ }
+
+ inline int operator <= (const Integer& n, int l)
+ {
+ return (! (n > l) );
+ }
+
+ inline int operator <= (const Integer& n, long l)
+ {
+ return (! (n > l) );
+ }
+
+ inline int operator <= (int l, const Integer& n)
+ {
+ return (! (n < l) );
+ }
+
+ inline int operator <= (long l, const Integer& n)
+ {
+ return (! (n < l) );
+ }
+
+ inline int operator >= (const Integer& a, const Integer& b)
+ {
+ return compare(a,b) >= 0;
+ }
+
+ inline int operator >= (int l, const Integer& n)
+ {
+ return (! (n > l) );
+ }
+
+ inline int operator >= (long l, const Integer& n)
+ {
+ return (! (n > l) );
+ }
+
+ inline int operator >= (const Integer& n, int l)
+ {
+ return (! (n < l) );
+ }
+
+ inline int operator >= (const Integer& n, long l)
+ {
+ return (! (n < l) );
+ }
+
+
+ //----------------------------------arithmetic inline operators
+ inline Integer Integer::operator - () const
+ {
+ // JGD 18.06.1999
+ Integer Res ;
+ mpz_neg((mpz_ptr)&Res.gmp_rep, (mpz_srcptr)&gmp_rep );
+ return Res ;
+ }
+
+ // -- operator +
+ inline Integer operator + (const int l, const Integer& n)
+ {
+ return n + (long)l;
+ }
+ inline Integer operator + (const unsigned int l, const Integer& n)
+ {
+ return n + (unsigned long)l;
+ }
+ inline Integer operator + (const long l, const Integer& n)
+ {
+ return n + l;
+ }
+ inline Integer operator + (const unsigned long l, const Integer& n)
+ {
+ return n + l;
+ }
+ inline Integer operator + (const Integer& n, const int l)
+ {
+ return n + (long)l;
+ }
+ inline Integer operator + (const Integer& n, const unsigned int l)
+ {
+ return n + (unsigned long)l;
+ }
+
+ inline Integer& operator += (Integer& n, const int l)
+ {
+ return n += (long)l;
+ }
+ inline Integer& operator += (Integer& n, const unsigned int l)
+ {
+ return n += (unsigned long)l;
+ }
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
- inline Integer operator + (const Integer& n, const long long l) {return n + (Integer)l; }
- inline Integer operator + (const Integer& n, const unsigned long long l) {return n + (Integer)l; }
- inline Integer operator + (const long long l, const Integer& n) {return n+l;}
- inline Integer operator + (const unsigned long long l, const Integer& n) {return n+l;}
- inline Integer& operator += (Integer& n, const long long l) { return n += (Integer)l; }
- inline Integer& operator += (Integer& n, const unsigned long long l) { return n += (Integer)l; }
+ inline Integer operator + (const Integer& n, const long long l)
+ {
+ return n + (Integer)l;
+ }
+ inline Integer operator + (const Integer& n, const unsigned long long l)
+ {
+ return n + (Integer)l;
+ }
+ inline Integer operator + (const long long l, const Integer& n)
+ {
+ return n+l;
+ }
+ inline Integer operator + (const unsigned long long l, const Integer& n)
+ {
+ return n+l;
+ }
+ inline Integer& operator += (Integer& n, const long long l)
+ {
+ return n += (Integer)l;
+ }
+ inline Integer& operator += (Integer& n, const unsigned long long l)
+ {
+ return n += (Integer)l;
+ }
#endif
-// -- operator -
-inline Integer operator - (const int l, const Integer& n) { return -(n - (long)l); }
-inline Integer operator - (const unsigned int l, const Integer& n) { return -(n - (unsigned long)l); }
-inline Integer operator - (const long l, const Integer& n) { return -(n - l); }
-inline Integer operator - (const unsigned long l, const Integer& n) { return -(n - l); }
-inline Integer operator - (const Integer& n, const int l) { return n - (long)l; }
-inline Integer operator - (const Integer& n, const unsigned int l) { return n - (unsigned long)l; }
-
-inline Integer& operator -= (Integer& n, const int l) { return n -= (long)l; }
-inline Integer& operator -= (Integer& n, const unsigned int l) { return n -= (unsigned long)l; }
+ // -- operator -
+ inline Integer operator - (const int l, const Integer& n)
+ {
+ return -(n - (long)l);
+ }
+ inline Integer operator - (const unsigned int l, const Integer& n)
+ {
+ return -(n - (unsigned long)l);
+ }
+ inline Integer operator - (const long l, const Integer& n)
+ {
+ return -(n - l);
+ }
+ inline Integer operator - (const unsigned long l, const Integer& n)
+ {
+ return -(n - l);
+ }
+ inline Integer operator - (const Integer& n, const int l)
+ {
+ return n - (long)l;
+ }
+ inline Integer operator - (const Integer& n, const unsigned int l)
+ {
+ return n - (unsigned long)l;
+ }
+
+ inline Integer& operator -= (Integer& n, const int l)
+ {
+ return n -= (long)l;
+ }
+ inline Integer& operator -= (Integer& n, const unsigned int l)
+ {
+ return n -= (unsigned long)l;
+ }
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
- inline Integer operator - (const Integer& n, const long long l) {return n - (Integer)l; }
- inline Integer operator - (const Integer& n, const unsigned long long l) {return n - (Integer)l; }
- inline Integer operator - (const long long l, const Integer& n) {return n-l;}
- inline Integer operator - (const unsigned long long l, const Integer& n) {return n-l;}
- inline Integer& operator -= (Integer& n, const long long l) { return n -= (Integer)l; }
- inline Integer& operator -= (Integer& n, const unsigned long long l) { return n -= (Integer)l; }
+ inline Integer operator - (const Integer& n, const long long l)
+ {
+ return n - (Integer)l;
+ }
+ inline Integer operator - (const Integer& n, const unsigned long long l)
+ {
+ return n - (Integer)l;
+ }
+ inline Integer operator - (const long long l, const Integer& n)
+ {
+ return n-l;
+ }
+ inline Integer operator - (const unsigned long long l, const Integer& n)
+ {
+ return n-l;
+ }
+ inline Integer& operator -= (Integer& n, const long long l)
+ {
+ return n -= (Integer)l;
+ }
+ inline Integer& operator -= (Integer& n, const unsigned long long l)
+ {
+ return n -= (Integer)l;
+ }
#endif
-// -- operator *
-inline Integer operator * (const int l, const Integer& n) { return n * (long)l; }
-inline Integer operator * (const unsigned int l, const Integer& n) { return n * (unsigned long)l; }
-inline Integer operator * (const long l, const Integer& n) { return n * l; }
-inline Integer operator * (const unsigned long l, const Integer& n) { return n * l; }
-inline Integer operator * (const Integer& n, const int l) { return n * (long)l; }
-inline Integer operator * (const Integer& n, const unsigned int l) { return n * (unsigned long)l; }
-
-inline Integer& operator *= (Integer& n, const int l) { return n *= (long)l; }
-inline Integer& operator *= (Integer& n, const unsigned int l) { return n *= (unsigned long)l; }
+ // -- operator *
+ inline Integer operator * (const int l, const Integer& n)
+ {
+ return n * (long)l;
+ }
+ inline Integer operator * (const unsigned int l, const Integer& n)
+ {
+ return n * (unsigned long)l;
+ }
+ inline Integer operator * (const long l, const Integer& n)
+ {
+ return n * l;
+ }
+ inline Integer operator * (const unsigned long l, const Integer& n)
+ {
+ return n * l;
+ }
+ inline Integer operator * (const Integer& n, const int l)
+ {
+ return n * (long)l;
+ }
+ inline Integer operator * (const Integer& n, const unsigned int l)
+ {
+ return n * (unsigned long)l;
+ }
+
+ inline Integer& operator *= (Integer& n, const int l)
+ {
+ return n *= (long)l;
+ }
+ inline Integer& operator *= (Integer& n, const unsigned int l)
+ {
+ return n *= (unsigned long)l;
+ }
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
- inline Integer operator * (const Integer& n, const long long l) {return n * (Integer)l; }
- inline Integer operator * (const Integer& n, const unsigned long long l) {return n * (Integer)l; }
- inline Integer operator * (const long long l, const Integer& n) {return n*l;}
- inline Integer operator * (const unsigned long long l, const Integer& n) {return n*l;}
- inline Integer& operator *= (Integer& n, const long long l) { return n *= (Integer)l; }
- inline Integer& operator *= (Integer& n, const unsigned long long l) { return n *= (Integer)l; }
+ inline Integer operator * (const Integer& n, const long long l)
+ {
+ return n * (Integer)l;
+ }
+ inline Integer operator * (const Integer& n, const unsigned long long l)
+ {
+ return n * (Integer)l;
+ }
+ inline Integer operator * (const long long l, const Integer& n)
+ {
+ return n*l;
+ }
+ inline Integer operator * (const unsigned long long l, const Integer& n)
+ {
+ return n*l;
+ }
+ inline Integer& operator *= (Integer& n, const long long l)
+ {
+ return n *= (Integer)l;
+ }
+ inline Integer& operator *= (Integer& n, const unsigned long long l)
+ {
+ return n *= (Integer)l;
+ }
#endif
-// -- operator /
-inline Integer operator / (const int l, const Integer& n) { return Integer(l)/n; }
-inline Integer operator / (const long l, const Integer& n) { return Integer(l)/n; }
-inline Integer operator / (const Integer& n, const int l) { return n / (long)l; }
-inline Integer operator / (const Integer& n, const unsigned int l) { return n / (unsigned long)l; }
-
-inline Integer& operator /= (Integer& n, const int l) { if (l>=0) return n /= (unsigned long)l; else return n = -(n / (unsigned long)-l); }
-inline Integer& operator /= (Integer& n, const long l) { return n /= (unsigned long)l; }
-inline Integer& operator /= (Integer& n, const unsigned int l) { return n /= (unsigned long)l; }
-
-// -- operator %
-inline Integer operator % (const int l, const Integer& n) { return Integer(l) % n; }
-inline Integer operator % (const long l, const Integer& n) { return Integer(l) % n; }
-inline Integer operator % (const Integer& n, const int l) { return n % (long)l; }
-inline Integer operator % (const Integer& n, const unsigned int l) { return n % (unsigned long)l; }
-
-inline Integer& operator %= (Integer& n, const int l) { return n %= (long)l; }
-inline Integer& operator %= (Integer& n, const unsigned int l) { return n %= (unsigned long)l; }
-
-
-//----------miscellaneous inline functions
-
-inline int Integer::priv_sign() const { return mpz_sgn( (mpz_ptr)&gmp_rep ); }
-
-inline int isOne(const Integer& a) { return ! mpz_cmp_ui((mpz_ptr)&(a.gmp_rep), 1UL); }
-
-inline int isZero(const Integer& a) { return ! mpz_cmp_ui((mpz_ptr)&(a.gmp_rep), 0UL); }
-
-inline int isZero(const short int a) { return a ==0; }
-inline int isZero(const int a) { return a ==0; }
-inline int isZero(const long a) { return a ==0; }
-inline int isZero(const unsigned short int a) { return a ==0; }
-inline int isZero(const unsigned int a) { return a ==0; }
-inline int isZero(const unsigned long a) { return a ==0UL; }
+ // -- operator /
+ inline Integer operator / (const int l, const Integer& n)
+ {
+ return Integer(l)/n;
+ }
+ inline Integer operator / (const long l, const Integer& n)
+ {
+ return Integer(l)/n;
+ }
+ inline Integer operator / (const Integer& n, const int l)
+ {
+ return n / (long)l;
+ }
+ inline Integer operator / (const Integer& n, const unsigned int l)
+ {
+ return n / (unsigned long)l;
+ }
+
+ inline Integer& operator /= (Integer& n, const int l)
+ {
+ if (l>=0)
+ return n /= (unsigned long)l;
+ else
+ return n = -(n / (unsigned long)-l);
+ }
+ inline Integer& operator /= (Integer& n, const long l)
+ {
+ return n /= (unsigned long)l;
+ }
+ inline Integer& operator /= (Integer& n, const unsigned int l)
+ {
+ return n /= (unsigned long)l;
+ }
+
+ // -- operator %
+ inline Integer operator % (const int l, const Integer& n)
+ {
+ return Integer(l) % n;
+ }
+ inline Integer operator % (const long l, const Integer& n)
+ {
+ return Integer(l) % n;
+ }
+ inline Integer operator % (const Integer& n, const int l)
+ {
+ return n % (long)l;
+ }
+ inline Integer operator % (const Integer& n, const unsigned int l)
+ {
+ return n % (unsigned long)l;
+ }
+
+ inline Integer& operator %= (Integer& n, const int l)
+ {
+ return n %= (long)l;
+ }
+ inline Integer& operator %= (Integer& n, const unsigned int l)
+ {
+ return n %= (unsigned long)l;
+ }
+
+
+ //----------miscellaneous inline functions
+
+ inline int Integer::priv_sign() const
+ {
+ return mpz_sgn( (mpz_srcptr)&gmp_rep );
+ }
+
+ inline int isOne(const Integer& a)
+ {
+ return ! mpz_cmp_ui((mpz_srcptr)&(a.gmp_rep), 1UL);
+ }
+
+ inline int isZero(const Integer& a)
+ {
+ return ! mpz_cmp_ui((mpz_srcptr)&(a.gmp_rep), 0UL);
+ }
+
+ inline int isZero(const short int a)
+ {
+ return a ==0;
+ }
+ inline int isZero(const int a)
+ {
+ return a ==0;
+ }
+ inline int isZero(const long a)
+ {
+ return a ==0;
+ }
+ inline int isZero(const unsigned short int a)
+ {
+ return a ==0;
+ }
+ inline int isZero(const unsigned int a)
+ {
+ return a ==0;
+ }
+ inline int isZero(const unsigned long a)
+ {
+ return a ==0UL;
+ }
#ifdef __USE_GMPPLUSPLUS_SIXTYFOUR__
-inline int isZero(const unsigned long long a) { return a ==0ULL; }
-inline int isZero(const long long a) { return a ==0LL; }
+#if 1 /* use of C++0x long long integer constant */
+ inline int isZero(const unsigned long long a)
+ {
+ return a ==0ULL;
+ }
#endif
-
-inline int sign(const Integer& a) { return a.priv_sign(); }
-
-inline unsigned long length(const Integer& a) { return mpz_size( (mpz_ptr)&(a.gmp_rep) ) * sizeof(unsigned long); }
-
-inline Integer abs(const Integer &n) { if (sign(n) >= 0) return n; return -n; }
-
-inline size_t Integer::size() const { return mpz_size( (mpz_ptr)&gmp_rep ) ; }
-
-inline size_t Integer::size_in_base(int BASE) const { return mpz_sizeinbase ((mpz_ptr)&gmp_rep, BASE);}
-
-inline size_t Integer::bitsize() const { return mpz_sizeinbase ((mpz_ptr)&gmp_rep, 2);}
-
-inline unsigned long Integer::operator[](size_t i) const
-{ if ( mpz_size( (mpz_ptr)&gmp_rep ) > i)
- return mpz_getlimbn( (mpz_ptr)&gmp_rep, i);
- else
- return 0;
-}
-
-//-------------------------------------------------inline >> & << operators
-inline std::ostream& operator<< (std::ostream& o, const Integer& a) { return a.print(o); }
-
-//----------------------- Random integers ----------
-
-#ifdef __GMP_PLUSPLUS__
-inline gmp_randclass& Integer::randstate(long unsigned int seed) {
- static gmp_randclass randstate(GMP_RAND_ALG_DEFAULT,seed);
- return static_cast<gmp_randclass&>(randstate);
-}
-
-inline void Integer::seeding(long unsigned int s) {
- Integer::randstate().seed(s) ;
-}
+ inline int isZero(const long long a)
+ {
+ return a ==0LL;
+ }
#endif
-inline Integer& Integer::random (Integer& r, long size)
-{
+ inline int sign(const Integer& a)
+ {
+ return a.priv_sign();
+ }
+
+ inline unsigned long length(const Integer& a)
+ {
+ return mpz_size( (mpz_srcptr)&(a.gmp_rep) ) * sizeof(unsigned long);
+ }
+
+ inline Integer abs(const Integer &n) { if (sign(n) >= 0) return n; return -n;
+ }
+
+ inline size_t Integer::size() const
+ {
+ return mpz_size( (mpz_srcptr)&gmp_rep ) ;
+ }
+
+ inline size_t Integer::size_in_base(int BASE) const
+ {
+ return mpz_sizeinbase ((mpz_srcptr)&gmp_rep, BASE);
+ }
+
+ inline size_t Integer::bitsize() const
+ {
+ return mpz_sizeinbase ((mpz_srcptr)&gmp_rep, 2);
+ }
+
+ inline unsigned long Integer::operator[](size_t i) const
+ {
+ if ( mpz_size( (mpz_srcptr)&gmp_rep ) > i)
+ return mpz_getlimbn( (mpz_srcptr)&gmp_rep, i);
+ else
+ return 0;
+ }
+
+ //-------------------------------------------------inline >> & << operators
+ inline std::ostream& operator<< (std::ostream& o, const Integer& a)
+ {
+ return a.print(o);
+ }
+
+ //-----------------------------------------------------
+ //----------------------- Random integers -------------
+ //-----------------------------------------------------
+
+ /* ********************** */
+ /* seeding, initialising */
+ /* ********************** */
+ inline gmp_randclass& Integer::randstate()
+ {
+ static gmp_randclass randstate(gmp_randinit_default);
+ return static_cast<gmp_randclass&>(randstate);
+ }
+
+ inline void Integer::seeding(unsigned long s)
+ {
+ Integer::randstate().seed(s) ;
+ }
+
+ inline void Integer::seeding(Integer s)
+ {
+ Integer::randstate().seed((mpz_class) (mpz_srcptr) &(s.gmp_rep) ) ;
+ }
+
+ inline void Integer::seeding()
+ {
+ Integer::seeding( BaseTimer::seed() );
+ }
+
+
+ // BB : good seeding but not so efficient...
+ inline bool Integer::RandBool()
+ {
+ if (Integer::random(1UL)) return true;
+ else return false ;
+ }
+
+
+ /* ****************************** */
+ /* random number smaller than m */
+ /* ****************************** */
+
#ifdef __GMP_PLUSPLUS__
- mpz_set( (mpz_ptr) &(r.gmp_rep) , ((mpz_class)Integer::randstate().get_z_bits(size)).get_mpz_t() );
+ //! returns a random integer \p r in the intervall <code>[[0, m-1]]</code>
+ template<bool U>
+ inline Integer& Integer::random_lessthan (Integer& r, const Integer & m)
+ {
+ mpz_set( (mpz_ptr) &(r.gmp_rep) ,
+ ( (mpz_class)Integer::randstate().get_z_range((mpz_class) (mpz_srcptr) &(m.gmp_rep)) ).get_mpz_t() );
+ if(!U) if (Integer::RandBool()) Integer::negin(r);
+ return r;
+ }
#else
- mpz_random((mpz_ptr) &(r.gmp_rep), size);
+ //! returns a random integer \p r in the intervall <code>[[0, m-1]]</code>
+ template<bool U>
+ inline Integer& Integer::random_lessthan (Integer& r, const Integer & m)
+ {
+ mpz_urandomm((mpz_ptr) &(r.gmp_rep),Integer::randstate(),(mpz_srcptr)&(m.gmp_rep));
+ if(!U) if (Integer::RandBool()) Integer::negin(r);
+ return r;
+ }
#endif
- return r;
-}
-
-
-inline Integer Integer::random(int sz)
-{
- Integer res;
- return Integer::random(res, sz);
-}
-inline Integer Integer::nonzerorandom(int sz) {
- Integer r;
- while(isZero(Integer::random(r, sz) )) {};
- return r;
-}
+ /* ******************************** */
+ /* random number smaller than 2^m */
+ /* ******************************** */
-inline Integer& Integer::random (Integer& r, const Integer& similar)
-{
-// J.G.D. 28/04/2004 : z_range thanks to Jack Dubrois
#ifdef __GMP_PLUSPLUS__
- mpz_set( (mpz_ptr) &(r.gmp_rep) , ((mpz_class)Integer::randstate().get_z_range( (mpz_class)( (mpz_ptr) &(similar.gmp_rep) ) )).get_mpz_t() );
+ //! returns a random integer \p r of at most \p m bits
+ template<bool U>
+ inline Integer& Integer::random_lessthan_2exp (Integer& r, const unsigned long & m)
+ {
+ mpz_set( (mpz_ptr) &(r.gmp_rep) , ((mpz_class)Integer::randstate().get_z_bits(m)).get_mpz_t() );
+ if(!U) {if (Integer::RandBool()) Integer::negin(r);
+ }
+ return r;
+ }
#else
- mpz_random((mpz_ptr) &(r.gmp_rep), mpz_size( (mpz_ptr)&(similar.gmp_rep) ) );
+ //! returns a random integer \p r of at most \p m bits
+ template<bool U>
+ inline Integer& Integer::random_lessthan_2exp (Integer& r, const unsigned long & m)
+ {
+ mpz_urandomb((mpz_ptr) &(r.gmp_rep),Integer::randstate(),m) ;
+ if(!U) if (Integer::RandBool()) Integer::negin(r);
+ return r;
+ }
#endif
- return r;
-}
-inline Integer& Integer::nonzerorandom (Integer& r, const Integer& size) {
- while (isZero(Integer::random(r,size))) {};
- return r;
+ template<bool U>
+ inline Integer Integer::random_lessthan_2exp (const unsigned long & m)
+ {
+ Integer r ;
+ random_lessthan_2exp<U>(r,m);
+ return r;
+ }
+
+ /* synonyms */
+ template<bool U>
+ inline Integer& Integer::random_lessthan (Integer& r, const unsigned long & m)
+ {
+ return Integer::random_lessthan_2exp<U>(r,m);
+ }
+
+ template<bool U,class T>
+ inline Integer Integer::random_lessthan (const T & m)
+ {
+ Integer res ;
+ return random_lessthan<U>(res,m);
+ }
+
+ /* ********************************* */
+ /* random number of same size as s */
+ /* ********************************* */
+
+ //! returns a reference to a random number \p r of the size of \p s, exactly.
+ template<bool U>
+ inline Integer& Integer::random_exact (Integer& r, const Integer & s)
+ {
+ size_t t = s.bitsize() ;
+ random_exact_2exp<U>(r,t);
+ return r;
+ }
+
+
+ /* ************************* */
+ /* random number of size m */
+ /* ************************* */
+
+ //! returns a reference to a random number \p r of the size \p m bits, exactly.
+ template<bool U>
+ inline Integer& Integer::random_exact_2exp (Integer& r, const unsigned long int & m)
+ {
+ if (m) random_lessthan_2exp<true>(r,m-1);
+ mpz_setbit( (mpz_ptr) &(r.gmp_rep) , m-1);
+ if(!U) if (Integer::RandBool()) Integer::negin(r);
+ return r;
+ }
+
+ // synonym
+ template<bool U>
+ inline Integer& Integer::random_exact (Integer& r, const unsigned long int & m)
+ {
+ return Integer::random_exact_2exp<U>(r,m) ;
+ }
+
+ template<bool U,class T>
+ inline Integer Integer::random_exact (const T & s)
+ {
+ Integer res ;
+ return random_exact<U>(res,s);
+ }
+
+ /* **************************** */
+ /* random number in [[m,M-1]] */
+ /* **************************** */
+
+ inline Integer& Integer::random_between (Integer& r, const Integer& m, const Integer&M)
+ {
+ assert(M > m);
+ random_lessthan(r,Integer(M-m));
+ r += m ;
+ return (r);
+ }
+
+ inline Integer Integer::random_between (const Integer& m, const Integer &M)
+ {
+ Integer r ;
+ return random_between(r,m,M);
+ }
+
+ /* ******************************** */
+ /* random number in [[2^m,2^M-1]] */
+ /* ******************************** */
+ // todo : template<bool U, bool V>
+ inline Integer& Integer::random_between_2exp (Integer& r, const unsigned long int& m, const unsigned long int &M)
+ {
+ assert(M > m);
+ r = nonzerorandom((unsigned long int)M-m);
+ Integer r1 = random_lessthan_2exp(m);
+ r <<= m ;
+ r+= r1 ;
+ return (r);
+ }
+
+ inline Integer Integer::random_between_2exp (const unsigned long int & m, const unsigned long int &M)
+ {
+ Integer r ;
+ return random_between_2exp(r,m,M);
+ }
+
+ // synonym.
+ inline Integer Integer::random_between (const unsigned long & m, const unsigned long &M)
+ {
+ return random_between_2exp(m,M) ;
+ }
+
+
+ inline Integer& Integer::random_between (Integer& r, const unsigned long int& m, const unsigned long int &M)
+ {
+ return random_between_2exp(r,m,M);
+ }
+ /* **************/
+ /* short hand */
+ /* **************/
+
+ //! returns a random integer less than...
+ template<bool U,class T>
+ inline Integer& Integer::random (Integer& r, const T & m)
+ {
+ return Integer::random_lessthan<U>(r,m) ;
+ }
+
+ //! returns a random integer less than...
+ template<bool U,class T>
+ inline Integer Integer::random(const T & sz)
+ {
+ return Integer::random_lessthan<U,T>(sz);
+ }
+
+ inline Integer Integer::random()
+ {
+ return Integer::random(sizeof(mp_limb_t)*8) ;
+ }
+ template<bool U>
+ inline Integer Integer::random()
+ {
+ Integer rez = Integer::random(sizeof(mp_limb_t)*8) ;
+ if (!U) if (Integer::RandBool()) negin(rez);
+ return rez;
+ }
+
+ /* *******************/
+ /* Non Zero random */
+ /* *******************/
+
+ template<bool U, class T>
+ inline Integer Integer::nonzerorandom(const T & sz)
+ {
+ Integer r;
+ while(isZero(Integer::random<U,T>(r, sz) )) {} ;
+ return r;
+ }
+
+ // BB: It's also 1+random(sz-1)...
+
+ template<bool U, class T>
+ inline Integer& Integer::nonzerorandom (Integer& r, const T& size)
+ {
+ while (isZero(Integer::random<U,T>(r,size))) {} ;
+ return r;
+ }
+
}
+#endif // __GIVARO_gmp++_integer_INL
-inline Integer& Integer::nonzerorandom (Integer& r, long size)
-{ while (isZero(Integer::random(r,size))) {};
- return r;
-}
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen:foldmethod=syntax
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
diff --git a/src/kernel/gmp++/gmp++_int_add.C b/src/kernel/gmp++/gmp++_int_add.C
index 0e2e744..e7f111a 100644
--- a/src/kernel/gmp++/gmp++_int_add.C
+++ b/src/kernel/gmp++/gmp++_int_add.C
@@ -1,31 +1,35 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_add.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_add.C,v 1.3 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_add.C,v 1.5 2010-12-20 12:09:37 bboyer Exp $
// ==========================================================================
#include "gmp++/gmp++.h"
+namespace Givaro {
//-------------------------------------------------- operator +
-Integer& Integer::addin(Integer& res, const Integer& n)
+Integer& Integer::addin(Integer& res, const Integer& n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = n;
- mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep );
+ mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&res.gmp_rep, (mpz_srcptr)&n.gmp_rep );
return res;
}
-Integer& Integer::addin(Integer& res, const long n)
+Integer& Integer::addin(Integer& res, const long n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = n;
- int sgn = GMP__SGN(n);
+ int sgn = GMP__SGN(n);
if (sgn >0) mpz_add_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, n);
else mpz_sub_ui((mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, -n);
return res;
}
-Integer& Integer::addin(Integer& res, const unsigned long n)
+Integer& Integer::addin(Integer& res, const unsigned long n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = n;
@@ -37,23 +41,23 @@ Integer& Integer::add(Integer& res, const Integer& n1, const Integer& n2)
{
if (isZero(n1)) return res = n2;
if (isZero(n2)) return res = n1;
- mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, (mpz_ptr)&n2.gmp_rep);
+ mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, (mpz_srcptr)&n2.gmp_rep);
return res;
}
Integer& Integer::add(Integer& res, const Integer& n1, const long n2)
{
if (isZero(n1)) return res = n2;
if (isZero(n2)) return res = n1;
- int sgn = GMP__SGN(n2);
- if (sgn >0) mpz_add_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
- else mpz_sub_ui((mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, -n2);
+ int sgn = GMP__SGN(n2);
+ if (sgn >0) mpz_add_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
+ else mpz_sub_ui((mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, -n2);
return res;
}
Integer& Integer::add(Integer& res, const Integer& n1, const unsigned long n2)
{
if (isZero(n1)) return res = n2;
if (isZero(n2)) return res = n1;
- mpz_add_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
+ mpz_add_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
return res;
}
@@ -62,7 +66,7 @@ Integer& Integer::operator += (const Integer& n)
{
if (isZero(n)) return *this;
if (isZero(*this)) return logcpy(n);
- mpz_add( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+ mpz_add( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
return *this;
}
@@ -89,27 +93,29 @@ Integer Integer::operator + (const Integer& n) const
{
if (isZero(n)) return *this;
if (isZero(*this)) return n;
- Integer res;
- mpz_add( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+ Integer res;
+ mpz_add( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
return res;
}
-Integer Integer::operator + (const unsigned long l) const
+Integer Integer::operator + (const unsigned long l) const
{
if (l==0) return *this;
if (isZero(*this)) return Integer(l);
- Integer res;
- mpz_add_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l);
+ Integer res;
+ mpz_add_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
return res;
}
-Integer Integer::operator + (const long l) const
+Integer Integer::operator + (const long l) const
{
if (l==0) return *this;
if (isZero(*this)) return Integer(l);
- Integer res;
+ Integer res;
int sgn = GMP__SGN(l);
- if (sgn >0) mpz_add_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l);
- else mpz_sub_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, -l);
+ if (sgn >0) mpz_add_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
+ else mpz_sub_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, -l);
return res;
}
+
+}
diff --git a/src/kernel/gmp++/gmp++_int_compare.C b/src/kernel/gmp++/gmp++_int_compare.C
index 84e6113..92cb206 100644
--- a/src/kernel/gmp++/gmp++_int_compare.C
+++ b/src/kernel/gmp++/gmp++_int_compare.C
@@ -1,49 +1,55 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_compare.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_compare.C,v 1.5 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_compare.C,v 1.6 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
#include "gmp++/gmp++.h"
-// returns 1 if a > b, 0 if a == b and -1 otherwise.
-int compare(const Integer &a, const Integer& b)
+namespace Givaro {
+
+// returns 1 if a > b, 0 if a == b and -1 otherwise.
+int compare(const Integer &a, const Integer& b)
{
- return mpz_cmp ( (mpz_ptr)&a.gmp_rep, (mpz_ptr)&b.gmp_rep );
+ return mpz_cmp ( (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&b.gmp_rep );
}
-int absCompare(const Integer &a, const Integer &b)
+int absCompare(const Integer &a, const Integer &b)
{
- return mpz_cmpabs( (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep));
+ return mpz_cmpabs( (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep));
}
-int Integer::operator != (const int l) const
-{ return mpz_cmp_si ( (mpz_ptr)&gmp_rep, l ) != 0; }
+int Integer::operator != (const int l) const
+{ return mpz_cmp_si ( (mpz_srcptr)&gmp_rep, l ) != 0; }
-int Integer::operator != (const long l) const
-{ return mpz_cmp_si ( (mpz_ptr)&gmp_rep, l ) != 0; }
+int Integer::operator != (const long l) const
+{ return mpz_cmp_si ( (mpz_srcptr)&gmp_rep, l ) != 0; }
//unsigned long ops added by Dan Roche, 6-26-04
int Integer::operator != (const unsigned long l) const
-{ return mpz_cmp_ui ( (mpz_ptr)&gmp_rep, l ) != 0; }
+{ return mpz_cmp_ui ( (mpz_srcptr)&gmp_rep, l ) != 0; }
int Integer::operator > (const unsigned long l) const
-{ return mpz_cmp_ui((mpz_ptr)&gmp_rep, l) > 0; }
-
+{ return mpz_cmp_ui((mpz_srcptr)&gmp_rep, l) > 0; }
+
int Integer::operator < (const unsigned long l) const
-{ return mpz_cmp_ui((mpz_ptr)&gmp_rep, l) < 0; }
+{ return mpz_cmp_ui((mpz_srcptr)&gmp_rep, l) < 0; }
-int Integer::operator > (const int l) const
-{ return mpz_cmp_si((mpz_ptr)&gmp_rep, l) > 0; }
+int Integer::operator > (const int l) const
+{ return mpz_cmp_si((mpz_srcptr)&gmp_rep, l) > 0; }
-int Integer::operator > (const long l) const
-{ return mpz_cmp_si((mpz_ptr)&gmp_rep, l) > 0; }
+int Integer::operator > (const long l) const
+{ return mpz_cmp_si((mpz_srcptr)&gmp_rep, l) > 0; }
-int Integer::operator < (const int l) const
-{ return mpz_cmp_si((mpz_ptr)&gmp_rep, l) < 0; }
+int Integer::operator < (const int l) const
+{ return mpz_cmp_si((mpz_srcptr)&gmp_rep, l) < 0; }
-int Integer::operator < (const long l) const
-{ return mpz_cmp_si((mpz_ptr)&gmp_rep, l) < 0; }
+int Integer::operator < (const long l) const
+{ return mpz_cmp_si((mpz_srcptr)&gmp_rep, l) < 0; }
+}
diff --git a/src/kernel/gmp++/gmp++_int_cstor.C b/src/kernel/gmp++/gmp++_int_cstor.C
index b3c3b37..584a21a 100644
--- a/src/kernel/gmp++/gmp++_int_cstor.C
+++ b/src/kernel/gmp++/gmp++_int_cstor.C
@@ -1,23 +1,27 @@
-#ifndef __GMPplusplus_CSTOR_C__
-#define __GMPplusplus_CSTOR_C__
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_cstor.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_cstor.C,v 1.3 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_cstor.C,v 1.4 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
+#ifndef __GMPplusplus_CSTOR_C__
+#define __GMPplusplus_CSTOR_C__
#include <iostream>
#include "gmp++/gmp++.h"
+namespace Givaro {
//------------------------------------- predefined null and one
const Integer Integer::zero(0UL);
const Integer Integer::one(1UL);
// -- Integer(const char *s)
-Integer::Integer(const char *s)
+Integer::Integer(const char *s)
{
mpz_init_set_str((mpz_ptr)&gmp_rep, s, 10);
}
@@ -26,7 +30,7 @@ Integer::Integer(const char *s)
Integer& Integer::copy(const Integer &n)
{
if (this == &n) return *this;
- mpz_set ( (mpz_ptr)&gmp_rep, (mpz_ptr)&(n.gmp_rep)) ;
+ mpz_set ( (mpz_ptr)&gmp_rep, (mpz_srcptr)&(n.gmp_rep)) ;
return *this ;
}
@@ -34,5 +38,7 @@ void importWords(Integer& x, size_t count, int order, int size, int endian, size
mpz_import( (mpz_ptr)&(x.gmp_rep), count, order, size, endian, nails, op);
}
-#endif
+}
+
+#endif
diff --git a/src/kernel/gmp++/gmp++_int_div.C b/src/kernel/gmp++/gmp++_int_div.C
index 2c18848..37a33fa 100644
--- a/src/kernel/gmp++/gmp++_int_div.C
+++ b/src/kernel/gmp++/gmp++_int_div.C
@@ -1,197 +1,272 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_div.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_div.C,v 1.5 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_div.C,v 1.9 2011-01-06 18:02:37 bboyer Exp $
// ==========================================================================
#include "gmp++/gmp++.h"
+namespace Givaro {
//-------------------------------------------------- operator /
-Integer& Integer::divin(Integer& res, const Integer& n)
+Integer& Integer::divin(Integer& res, const Integer& n)
{
-// if (isZero(n)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(res)) return res;
- mpz_tdiv_q( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep );
- return res;
+ // if (isZero(n)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(res)) return res;
+ mpz_tdiv_q( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n.gmp_rep );
+ return res;
}
-Integer& Integer::divin(Integer& res, const long n)
+
+Integer& Integer::divin(Integer& res, const long n)
{
-// if (n ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(res)) return res;
- int sgn = GMP__SGN(n);
- mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, GMP__ABS(n));
- if (sgn <0) return res = -res;
- return res;
+ // if (n ==0) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(res)) return res;
+ int sgn = GMP__SGN(n);
+ mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, GMP__ABS(n));
+ if (sgn <0) return res = -res;
+ // if (n<0)
+ // mpz_fdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&res.gmp_rep, n);
+ // else
+ // mpz_cdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&res.gmp_rep, n);
+
+
+ return res;
}
-Integer& Integer::divin(Integer& res, const unsigned long n)
+
+Integer& Integer::divin(Integer& res, const unsigned long n)
{
-// if (n ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(res)) return res;
- mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&res.gmp_rep, n);
- return res;
+ // if (n ==0) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(res)) return res;
+ mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&res.gmp_rep, n);
+ return res;
}
Integer& Integer::div(Integer& res, const Integer& n1, const Integer& n2)
{
- if (isZero(n1)) return res = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- mpz_tdiv_q( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, (mpz_ptr)&n2.gmp_rep);
- return res;
+ if (isZero(n1)) return res = Integer::zero;
+ // if (isZero(n2)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ mpz_tdiv_q( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, (mpz_srcptr)&n2.gmp_rep);
+ return res;
}
+
Integer& Integer::div(Integer& res, const Integer& n1, const long n2)
{
- if (isZero(n1)) return res = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- int sgn = GMP__SGN(n2);
- mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, GMP__ABS(n2));
- if (sgn <0) return res = -res;
- return res;
+ if (isZero(n1)) return res = Integer::zero;
+ // if (isZero(n2)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ int sgn = GMP__SGN(n2);
+ mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, GMP__ABS(n2));
+ if (sgn <0) return res = -res;
+
+ // if (n2>0)
+ // mpz_fdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&n1.gmp_rep, n2);
+ // else
+ // mpz_cdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&n1.gmp_rep, n2);
+
+
+ return res;
+}
+
+
+Integer& Integer::div(Integer& res, const Integer& n1, const int n2) {
+ return div(res,n1,long(n2));
}
+
Integer& Integer::div(Integer& res, const Integer& n1, const unsigned long n2)
{
- if (isZero(n1)) return res = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
- return res;
+ if (isZero(n1)) return res = Integer::zero;
+ // if (isZero(n2)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ mpz_tdiv_q_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
+ return res;
}
Integer& Integer::divexact (Integer& q, const Integer& n1, const Integer& n2)
{
- if (isZero(n1)) return q = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- mpz_divexact( (mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(n1.gmp_rep), (mpz_ptr)&(n2.gmp_rep)) ;
- return q;
+ if (isZero(n1)) return q = Integer::zero;
+ // if (isZero(n2)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ mpz_divexact( (mpz_ptr)&(q.gmp_rep),
+ (mpz_srcptr)&(n1.gmp_rep), (mpz_srcptr)&(n2.gmp_rep)) ;
+ return q;
}
Integer Integer::divexact (const Integer& n1, const Integer& n2)
{
- if (isZero(n1)) return Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- Integer q;
- mpz_divexact( (mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(n1.gmp_rep), (mpz_ptr)&(n2.gmp_rep)) ;
- return q;
+ if (isZero(n1)) return Integer::zero;
+ // if (isZero(n2)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ Integer q;
+ mpz_divexact( (mpz_ptr)&(q.gmp_rep),
+ (mpz_srcptr)&(n1.gmp_rep), (mpz_srcptr)&(n2.gmp_rep)) ;
+ return q;
}
Integer& Integer::operator /= (const Integer& n)
{
-// if (isZero(n)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return *this;
- mpz_tdiv_q( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
- return *this;
+ // if (isZero(n)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(*this)) return *this;
+ mpz_tdiv_q( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
+ return *this;
}
Integer& Integer::operator /= (const unsigned long l)
{
-// if (l ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return *this;
- mpz_tdiv_q_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
- return *this;
+ // if (l ==0) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(*this)) return *this;
+ mpz_tdiv_q_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
+ return *this;
}
Integer& Integer::operator /= (const long l)
{
-// if (l ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return *this;
- int sgn = GMP__SGN(l);
- mpz_tdiv_q_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
- if (sgn <0) mpz_neg( (mpz_ptr)&gmp_rep, (mpz_ptr)&(gmp_rep));
- return *this;
+ // if (l ==0) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(*this)) return *this;
+ int sgn = GMP__SGN(l);
+ mpz_tdiv_q_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
+ if (sgn <0) mpz_neg( (mpz_ptr)&gmp_rep, (mpz_ptr)&(gmp_rep));
+ return *this;
}
Integer Integer::operator / (const Integer& n) const
{
-// if (isZero(n)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return Integer::zero;
- Integer res;
- mpz_tdiv_q( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
- return res;
+ // if (isZero(n)) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(*this)) return Integer::zero;
+ Integer res;
+ mpz_tdiv_q( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
+
+ // if (n>0)
+ // mpz_fdiv_q( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+ // else
+ // mpz_cdiv_q( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+
+ return res;
}
-Integer Integer::operator / (const unsigned long l) const
+Integer Integer::operator / (const unsigned long l) const
{
-// if (l ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return Integer::zero;
- Integer res;
- mpz_tdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l);
- return res;
+ // if (l ==0) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(*this)) return Integer::zero;
+ Integer res;
+ mpz_tdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
+
+ return res;
}
-Integer Integer::operator / (const long l) const
+Integer Integer::operator / (const long l) const
{
-// if (l ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return Integer::zero;
- Integer res;
- int sgn = GMP__SGN(l);
- mpz_tdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
- if (sgn <0) return negin(res);
- return res;
+ // if (l ==0) {
+ // GivMathDivZero("[Integer::/]: division by zero");
+ // }
+ if (isZero(*this)) return Integer::zero;
+ Integer res;
+ int sgn = GMP__SGN(l);
+ mpz_tdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, GMP__ABS(l));
+ if (sgn <0) return negin(res);
+ // if (l>0)
+ // mpz_fdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l) ;
+ // else
+ // mpz_fdiv_q_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, -l ) ;
+
+
+ return res;
}
// -- Euclidian division
Integer& Integer::divmod(Integer& q, Integer& r, const Integer &a, const Integer &b)
{
-// if (isZero(b)) {
-// GivMathDivZero("[Integer::divide]: division by zero");
-// }
+ // if (isZero(b)) {
+ // GivMathDivZero("[Integer::divide]: division by zero");
+ // }
+
+ mpz_tdiv_qr( (mpz_ptr)&(q.gmp_rep), (mpz_ptr)&(r.gmp_rep),
+ (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep));
+ // if (a>0)
+ // mpz_fdiv_qr_ui( (mpz_ptr)&(q.gmp_rep),r
+ // (mpz_ptr)&(a.gmp_rep), b);
+ // else
+ // mpz_cdiv_qr_ui( (mpz_ptr)&(q.gmp_rep),r
+ // (mpz_ptr)&(a.gmp_rep), b);
- mpz_tdiv_qr( (mpz_ptr)&(q.gmp_rep), (mpz_ptr)&(r.gmp_rep),
- (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep));
- return q;
+ if (a<0 && r) {
+ subin(q,(long)1) ;
+ r = b - r;
+ }
+
+
+ return q;
}
Integer& Integer::divmod(Integer& q, long& r, const Integer& a, const long b)
{
-// if (isZero(b)) {
-// GivMathDivZero("[Integer::divide]: division by zero");
-// }
- int sgn = GMP__SGN(b);
- r = mpz_tdiv_q_ui( (mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(a.gmp_rep), GMP__ABS(b));
- if (sgn <0) return negin(q);
- return q;
+ // if (isZero(b)) {
+ // GivMathDivZero("[Integer::divide]: division by zero");
+ // }
+ // int sgn = GMP__SGN(b);
+ r = mpz_tdiv_q_ui( (mpz_ptr)&(q.gmp_rep),
+ (mpz_srcptr)&(a.gmp_rep), GMP__ABS(b));
+ // if (sgn <0) return negin(q);
+ // if (a>0)
+ // mpz_fdiv_qr_ui( (mpz_ptr)&(q.gmp_rep),r
+ // (mpz_ptr)&(a.gmp_rep), b);
+ // else
+ // mpz_cdiv_qr_ui( (mpz_ptr)&(q.gmp_rep),r
+ // (mpz_ptr)&(a.gmp_rep), b);
+ if (a<0 && r) {
+ subin(q,(long)1) ;
+ r = b - r ;
+ }
+
+
+
+ return q;
}
Integer& Integer::divmod(Integer& q, unsigned long& r, const Integer& a, const unsigned long b)
{
-// if (isZero(b)) {
-// GivMathDivZero("[Integer::divide]: division by zero");
-// }
- r = mpz_tdiv_q_ui( (mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(a.gmp_rep), b);
- return q;
+ // if (isZero(b)) {
+ // GivMathDivZero("[Integer::divide]: division by zero");
+ // }
+ r = mpz_tdiv_q_ui( (mpz_ptr)&(q.gmp_rep),
+ (mpz_srcptr)&(a.gmp_rep), b);
+
+ if (a<0 && r) {
+ subin(q,(long)1) ;
+ r = b - r;
+ }
+
+ return q;
+}
+
}
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/gmp++/gmp++_int_gcd.C b/src/kernel/gmp++/gmp++_int_gcd.C
index b647111..f0ccae6 100644
--- a/src/kernel/gmp++/gmp++_int_gcd.C
+++ b/src/kernel/gmp++/gmp++_int_gcd.C
@@ -1,26 +1,30 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_gcd.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_gcd.C,v 1.2 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_gcd.C,v 1.4 2011-01-18 17:49:06 jgdumas Exp $
// ==========================================================================
-// Description:
+// Description:
//
#include "gmp++/gmp++.h"
+namespace Givaro {
// ==========================================================================
// Computes and returns the lcm of the two integers a and b.
Integer lcm(const Integer& a, const Integer& b) {
Integer Res(Integer::one);
- mpz_lcm( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_lcm( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
if (Res.priv_sign() <0) return -Res;
else return Res ;
}
Integer& lcm(Integer& g, const Integer& a, const Integer& b) {
- mpz_lcm( (mpz_ptr)&(g.gmp_rep), (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_lcm( (mpz_ptr)&(g.gmp_rep), (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
if (g.priv_sign() <0) return Integer::negin(g);
else return g ;
}
@@ -30,19 +34,24 @@ Integer& lcm(Integer& g, const Integer& a, const Integer& b) {
// Computes and returns the gcd of the two integers a and b.
Integer gcd(const Integer& a, const Integer& b) {
Integer Res(Integer::one);
- mpz_gcd( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_gcd( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
if (Res.priv_sign() <0) return -Res;
return Res ;
}
Integer& gcd(Integer& g, const Integer& a, const Integer& b) {
- mpz_gcd( (mpz_ptr)&(g.gmp_rep), (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_gcd( (mpz_ptr)&(g.gmp_rep), (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
if (g.priv_sign() <0) return Integer::negin(g);
return g ;
}
+Integer& invin(Integer& u, const Integer& b) {
+ mpz_invert( (mpz_ptr)&(u.gmp_rep), (mpz_ptr)&(u.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
+ return u ;
+}
+
Integer& inv(Integer& u, const Integer& a, const Integer& b) {
- mpz_invert( (mpz_ptr)&(u.gmp_rep), (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_invert( (mpz_ptr)&(u.gmp_rep), (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
return u ;
}
@@ -54,8 +63,8 @@ Integer gcd (const Integer& a, const Integer& b, Integer& u, Integer& v)
{
v = 1; // v must not be 0 to be computed.
Integer Res(Integer::one);
- mpz_gcdext( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&(u.gmp_rep), (mpz_ptr)&(v.gmp_rep),
- (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_gcdext( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&(u.gmp_rep), (mpz_ptr)&(v.gmp_rep),
+ (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
if (Res.priv_sign() < 0) { Integer::negin(u); Integer::negin(v); return Integer::negin(Res);}
// { u = -u ; v = -v ; return -Res;}
return Res;
@@ -64,23 +73,24 @@ Integer gcd (const Integer& a, const Integer& b, Integer& u, Integer& v)
Integer& gcd (Integer& g, const Integer& a, const Integer& b, Integer& u, Integer& v)
{
v = 1; // v must not be 0 to be computed.
- mpz_gcdext( (mpz_ptr)&(g.gmp_rep), (mpz_ptr)&(u.gmp_rep), (mpz_ptr)&(v.gmp_rep),
- (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep) ) ;
+ mpz_gcdext( (mpz_ptr)&(g.gmp_rep), (mpz_ptr)&(u.gmp_rep), (mpz_ptr)&(v.gmp_rep),
+ (mpz_srcptr)&(a.gmp_rep), (mpz_srcptr)&(b.gmp_rep) ) ;
if (g.priv_sign() < 0) { Integer::negin(u); Integer::negin(v); return Integer::negin(g);}
return g;
}
-Integer pp( const Integer& P, const Integer& Q )
+Integer pp( const Integer& P, const Integer& Q )
{
- Integer U = P ;
- Integer V = gcd(P,Q) ;
+ Integer U = P ;
+ Integer V = gcd(P,Q) ;
// -- computes the prime part U of g relatively to U
- while ( V != Integer::one )
+ while ( V != Integer::one )
{
U = U / V ;
V = gcd( U,V) ;
- }
+ }
return U ;
}
+}
diff --git a/src/kernel/gmp++/gmp++_int_io.C b/src/kernel/gmp++/gmp++_int_io.C
index 1169bc9..81313c9 100644
--- a/src/kernel/gmp++/gmp++_int_io.C
+++ b/src/kernel/gmp++/gmp++_int_io.C
@@ -1,24 +1,30 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_io.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_io.C,v 1.6 2007-11-12 15:25:05 pernet Exp $
+// $Id: gmp++_int_io.C,v 1.7 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
-// Description:
+// Description:
#include <iostream>
#include <stdlib.h>
#include "gmp++/gmp++.h"
-// Sortie nonsignee : 321321 meme si n = -321321, par exemple
+
+namespace Givaro {
+
+// Sortie nonsignee : 321321 meme si n = -321321, par exemple
std::ostream& absOutput(std::ostream &o, const Integer&n)
{
int base = 10;
-
- unsigned long strSize = mpz_sizeinbase((mpz_ptr)&(n.gmp_rep), base) + 2;
+
+ unsigned long strSize = mpz_sizeinbase((mpz_srcptr)&(n.gmp_rep), base) + 2;
char *str = ::new char[strSize];
- mpz_get_str(str, base, (mpz_ptr)&(n.gmp_rep));
+ mpz_get_str(str, base, (mpz_srcptr)&(n.gmp_rep));
if (sign(n) < 0) {
char *str1 = &(str[1]) ;
o << str1;
@@ -26,27 +32,27 @@ std::ostream& absOutput(std::ostream &o, const Integer&n)
else o << str;
delete [] str ;
return o;
-}
+}
-// Sortie signee : +321321 ou -321321, par exemple
+// Sortie signee : +321321 ou -321321, par exemple
std::ostream& Integer::print(std::ostream &o) const
{
int base = 10;
- unsigned long strSize = mpz_sizeinbase((mpz_ptr)&(gmp_rep), base) + 2;
+ unsigned long strSize = mpz_sizeinbase((mpz_srcptr)&(gmp_rep), base) + 2;
char *str = new char[strSize];
- mpz_get_str(str, base, (mpz_ptr)&(gmp_rep));
+ mpz_get_str(str, base, (mpz_srcptr)&(gmp_rep));
// JGD 08.11.1999 : temporaire
// if (sign(*this) > 0) o << '+' ;
o << str;
delete [] str ;
return o;
-}
+}
Integer::operator std::string () const {
std::string s;
- unsigned long strSize = mpz_sizeinbase((mpz_ptr)&(gmp_rep), 10) + 2;
+ unsigned long strSize = mpz_sizeinbase((mpz_srcptr)&(gmp_rep), 10) + 2;
char *str = new char[strSize + 2];
- mpz_get_str(str, 10, (mpz_ptr)&(gmp_rep));
+ mpz_get_str(str, 10, (mpz_srcptr)&(gmp_rep));
s = std::string(str);
delete [] str ;
return s;
@@ -62,7 +68,7 @@ Integer::Integer(const std::vector<mp_limb_t>& v) {
prod = base = pow(base, (unsigned long)sizeof(mp_limb_t) );
std::vector<mp_limb_t>::const_iterator vi = v.begin();
- for(++vi;vi != v.end();++vi) {
+ for(++vi;vi != v.end();++vi) {
mpz_mul_ui( (mpz_ptr)&tmp.gmp_rep, (mpz_ptr)&prod.gmp_rep, *vi);
*this += tmp;
prod *= base;
@@ -73,10 +79,11 @@ Integer::Integer(const std::vector<mp_limb_t>& v) {
}
Integer::operator std::vector<mp_limb_t> () const {
- size_t s = mpz_size( (mpz_ptr)&(gmp_rep) );
+ size_t s = mpz_size( (mpz_srcptr)&(gmp_rep) );
std::vector<mp_limb_t> v(s);
std::vector<mp_limb_t>::iterator vi = v.begin();
- for(mp_size_t i = 0;vi != v.end();++vi, ++i) *vi = mpz_getlimbn( (mpz_ptr)& (gmp_rep) ,i);
+ for(mp_size_t i = 0;vi != v.end();++vi, ++i)
+ *vi = mpz_getlimbn( (mpz_srcptr)& (gmp_rep) ,i);
return v;
}
@@ -145,6 +152,8 @@ std::istream& operator>> (std::istream& in, Integer& a)
a = a * base[counter-1] + l ;
}
}
- if (sign == -1) a = -a ;
+ if (sign == -1) a = -a ;
return in ;
}
+
+}
diff --git a/src/kernel/gmp++/gmp++_int_misc.C b/src/kernel/gmp++/gmp++_int_misc.C
index 2394d2f..12729d1 100644
--- a/src/kernel/gmp++/gmp++_int_misc.C
+++ b/src/kernel/gmp++/gmp++_int_misc.C
@@ -1,18 +1,22 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_misc.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_misc.C,v 1.11 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_misc.C,v 1.16 2010-12-16 16:54:38 jgdumas Exp $
// ==========================================================================
-// Description:
+// Description:
#include <iostream>
#include <math.h>
#include "gmp++/gmp++.h"
+namespace Givaro {
//-------------------------------------------fact (unsigned long l)
-Integer fact ( unsigned long l)
+Integer fact ( unsigned long l)
{
Integer Res ;
mpz_fac_ui( (mpz_ptr)&(Res.gmp_rep), l ) ;
@@ -23,14 +27,14 @@ Integer fact ( unsigned long l)
Integer& sqrt(Integer& q, const Integer &a)
{
mpz_sqrt( (mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(a.gmp_rep)) ;
+ (mpz_srcptr)&(a.gmp_rep)) ;
return q;
}
Integer& sqrtrem(Integer& q, const Integer &a, Integer& r)
{
mpz_sqrtrem( (mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(r.gmp_rep), (mpz_ptr)&(a.gmp_rep)) ;
+ (mpz_ptr)&(r.gmp_rep), (mpz_srcptr)&(a.gmp_rep)) ;
return q;
}
@@ -49,7 +53,7 @@ Integer sqrtrem(const Integer &a, Integer& r)
bool root(Integer& q, const Integer &a, unsigned int n)
{
return (bool)mpz_root ((mpz_ptr)&(q.gmp_rep),
- (mpz_ptr)&(a.gmp_rep),
+ (mpz_srcptr)&(a.gmp_rep),
n);
}
@@ -57,7 +61,15 @@ void swap(Integer& a, Integer& b) {
return mpz_swap( (mpz_ptr)&(a.gmp_rep), (mpz_ptr)&(b.gmp_rep));
}
-
+
+// Natural logarithm of a
+// log(2) being close to 0.69314718055994531
+double naturallog(const Integer& a) {
+ signed long int exp;
+ double d = mpz_get_d_2exp( &exp, (mpz_srcptr)&(a.gmp_rep) );
+ return (double)exp*0.69314718055994531+log(d);
+}
+
// base p logarithm of a
@@ -84,8 +96,8 @@ long logp(const Integer& a, const Integer& p) {
// 1/log(2) being close to 1.44269504088896341
double logtwo(const Integer& a) {
signed long int exp;
- double d = mpz_get_d_2exp( &exp, (mpz_ptr)&(a.gmp_rep) );
- return (double)exp+log(d)*1.44269504088896341;
+ double d = mpz_get_d_2exp( &exp, (mpz_srcptr)&(a.gmp_rep) );
+ return (double)exp+log(d)*1.44269504088896341;
}
//------------------------------------------GMP isprime
@@ -95,57 +107,57 @@ double logtwo(const Integer& a) {
Integer& nextprime(Integer& r, const Integer &p)
{
- mpz_nextprime ((mpz_ptr)&(r.gmp_rep), (mpz_ptr)&(p.gmp_rep)) ;
+ mpz_nextprime ((mpz_ptr)&(r.gmp_rep), (mpz_srcptr)&(p.gmp_rep)) ;
return r;
}
// Copied and adapted from mpz/nextprime.c
Integer& prevprime(Integer& r, const Integer &p)
{
- mpz_sub_ui ( (mpz_ptr)&(r.gmp_rep), (mpz_ptr)&(p.gmp_rep), 1L );
- while( !mpz_probab_prime_p ( (mpz_ptr)&(p.gmp_rep), 5 ) )
- mpz_sub_ui ( (mpz_ptr)&(r.gmp_rep), (mpz_ptr)&(p.gmp_rep), 1L );
+ mpz_sub_ui ( (mpz_ptr)&(r.gmp_rep), (mpz_srcptr)&(p.gmp_rep), 1L );
+ while( !mpz_probab_prime_p ( (mpz_srcptr)&(p.gmp_rep), 5 ) )
+ mpz_sub_ui ( (mpz_ptr)&(r.gmp_rep), (mpz_srcptr)&(p.gmp_rep), 1L );
return r;
}
int probab_prime(const Integer &p)
{
- return mpz_probab_prime_p ((mpz_ptr)&(p.gmp_rep),1) ;
+ return mpz_probab_prime_p ((mpz_srcptr)&(p.gmp_rep),1) ;
}
int probab_prime(const Integer &p, int r)
{
- return mpz_probab_prime_p ((mpz_ptr)&(p.gmp_rep),r) ;
+ return mpz_probab_prime_p ((mpz_srcptr)&(p.gmp_rep),r) ;
}
// ==========================================================================
-// Computes and returns the Jacobi and Legendre symbols (u/v) of the integers u and v.
+// Computes and returns the Jacobi and Legendre symbols (u/v) of the integers u and v.
// The algorithm used is Gmp's.
int jacobi(const Integer& u, const Integer& v)
{
- return mpz_jacobi ((mpz_ptr)&(u.gmp_rep),(mpz_ptr)&(v.gmp_rep)) ;
+ return mpz_jacobi ((mpz_srcptr)&(u.gmp_rep),(mpz_srcptr)&(v.gmp_rep)) ;
}
int legendre(const Integer& u, const Integer& v)
{
- return mpz_legendre ((mpz_ptr)&(u.gmp_rep),(mpz_ptr)&(v.gmp_rep)) ;
+ return mpz_legendre ((mpz_srcptr)&(u.gmp_rep),(mpz_srcptr)&(v.gmp_rep)) ;
}
//--------------------------------------------Integer::operator << // shift left
-Integer Integer::operator << (int l) const
+Integer Integer::operator << (int l) const
{ return this->operator<<( (unsigned long)l ); }
-Integer Integer::operator << (unsigned int l) const
+Integer Integer::operator << (unsigned int l) const
{ return this->operator<<( (unsigned long)l ); }
-Integer Integer::operator << (long l) const
+Integer Integer::operator << (long l) const
{ return this->operator<<( (unsigned long)l ); }
-Integer Integer::operator << (unsigned long l) const
-{
+Integer Integer::operator << (unsigned long l) const
+{
Integer tmp;
mpz_mul_2exp((mpz_ptr)&(tmp.gmp_rep), (mpz_srcptr)&(gmp_rep), l );
- return tmp;
+ return tmp;
}
@@ -160,57 +172,66 @@ Integer Integer::operator >> (unsigned int l) const
{ return this->operator>>( (unsigned long)l ); }
Integer Integer::operator >> (unsigned long l) const
-{
+{
Integer tmp;
mpz_tdiv_q_2exp( (mpz_ptr)&(tmp.gmp_rep), (mpz_srcptr)&(gmp_rep), l );
- return tmp;
+ return tmp;
}
//--------------------------------------------Integer::operator <<= // shift left
-Integer& Integer::operator <<= (int l)
+Integer& Integer::operator <<= (int l)
{ return this->operator<<= ( (unsigned long)l ); }
-Integer& Integer::operator <<= (unsigned int l)
+Integer& Integer::operator <<= (unsigned int l)
{ return this->operator<<= ( (unsigned long)l ); }
-Integer& Integer::operator <<= (long l)
+Integer& Integer::operator <<= (long l)
{ return this->operator<<= ( (unsigned long)l ); }
Integer& Integer::operator <<= (unsigned long l)
-{
+{
mpz_mul_2exp((mpz_ptr)&(gmp_rep), (mpz_srcptr)&(gmp_rep), l );
- return *this;
+ return *this;
}
//--------------------------------------------Integer::operator >>= // shift right
Integer& Integer::operator >>= (int l)
{ return this->operator>>= ( (unsigned long)l ); }
-Integer& Integer::operator >>= (long l)
+Integer& Integer::operator >>= (long l)
{ return this->operator>>= ( (unsigned long)l ); }
-Integer& Integer::operator >>= (unsigned int l)
+Integer& Integer::operator >>= (unsigned int l)
{ return this->operator>>= ( (unsigned long)l ); }
-Integer& Integer::operator >>= (unsigned long l)
-{
+Integer& Integer::operator >>= (unsigned long l)
+{
mpz_tdiv_q_2exp( (mpz_ptr)&(gmp_rep), (mpz_srcptr)&(gmp_rep), l );
- return *this;
+ return *this;
}
//------------------------------------------- Bit logic
- Integer Integer::operator^ (const Integer& a) { // XOR
+ Integer Integer::operator^ (const Integer& a) const { // XOR
Integer res(*this);
return res ^= a;
}
- Integer Integer::operator| (const Integer& a) { // OR
+ Integer Integer::operator| (const Integer& a) const { // OR
Integer res(*this);
return res |= a;
}
- Integer Integer::operator& (const Integer& a) { // AND
+ Integer Integer::operator& (const Integer& a) const { // AND
Integer res(*this);
return res &= a;
}
+ unsigned long Integer::operator^ (const unsigned long& a) const { // XOR
+ return mpz_get_ui((mpz_srcptr)&(gmp_rep)) ^ a;
+ }
+ unsigned long Integer::operator| (const unsigned long& a) const { // OR
+ return mpz_get_ui((mpz_srcptr)&(gmp_rep)) | a;
+ }
+ unsigned long Integer::operator& (const unsigned long& a) const { // AND
+ return mpz_get_ui((mpz_srcptr)&(gmp_rep)) & a;
+ }
Integer Integer::operator~ () const { // 1 complement
Integer res;
- mpz_com( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&(gmp_rep));
+ mpz_com( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&(gmp_rep));
return res;
}
Integer& Integer::operator^= (const Integer& a) { // XOR
@@ -230,10 +251,10 @@ Integer& Integer::operator >>= (unsigned long l)
//------------------------------------------- convert method
//------------------------------------------- casting method
Integer::operator int() const {
- return mpz_get_si ( (mpz_srcptr)&gmp_rep);
+ return int (mpz_get_si ( (mpz_srcptr)&gmp_rep));
}
Integer::operator unsigned int() const {
- return mpz_get_ui ( (mpz_srcptr)&gmp_rep);
+ return (unsigned int) mpz_get_ui ( (mpz_srcptr)&gmp_rep);
}
Integer::operator long() const {
return mpz_get_si ( (mpz_srcptr)&gmp_rep);
@@ -250,14 +271,14 @@ Integer::operator unsigned long long() const {
unsigned long high = (unsigned long)(rem);
unsigned long long tmp = high;
// tmp <<= CHAR_BIT*sizeof(unsigned long int) ;
- cbtuli >>= 1;
+ cbtuli = short (cbtuli >> 1);
tmp <<= cbtuli ;
tmp <<= cbtuli ;
return tmp += low;
}
Integer::operator long long() const {
- unsigned long long tmp = (unsigned long long)(*this);
+ unsigned long long tmp = (unsigned long long)(*this);
return (long long)tmp;
}
#endif
@@ -268,4 +289,4 @@ Integer::operator double() const {
Integer::operator float() const {
return (float)mpz_get_d ( (mpz_srcptr)&gmp_rep);
}
-
+}
diff --git a/src/kernel/gmp++/gmp++_int_mod.C b/src/kernel/gmp++/gmp++_int_mod.C
index 989ba0f..9a425f8 100644
--- a/src/kernel/gmp++/gmp++_int_mod.C
+++ b/src/kernel/gmp++/gmp++_int_mod.C
@@ -1,187 +1,223 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_mod.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2010 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_mod.C,v 1.6 2007-01-24 15:40:38 jgdumas Exp $
+// Modified: JG. Dumas, BB.
+// $Id: gmp++_int_mod.C,v 1.17 2010-12-22 13:47:45 jgdumas Exp $
// ==========================================================================
#include "gmp++/gmp++.h"
+#ifndef GIVABS
+#define GIVABS(a) ((a)>0?(a):-(a))
+#endif
-//-------------------------------------------------- operator /
-Integer& Integer::modin(Integer& res, const Integer& n)
-{
-// if (isZero(n)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(res)) return res;
- mpz_tdiv_r( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep );
- return res;
-}
-Integer& Integer::modin(Integer& res, const long n)
-{
-// if (n ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(res)) return res;
- int sgn = GMP__SGN(n);
- mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, GMP__ABS(n));
- if (sgn <0) return res = -res;
- return res;
-}
-Integer& Integer::modin(Integer& res, const unsigned long n)
-{
-// if (n ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(res)) return res;
- mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&res.gmp_rep, n);
- return res;
-}
-
-Integer& Integer::mod(Integer& res, const Integer& n1, const Integer& n2)
-{
- if (isZero(n1)) return res = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- mpz_tdiv_r( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, (mpz_ptr)&n2.gmp_rep);
- return res;
-}
-Integer& Integer::mod(Integer& res, const Integer& n1, const long n2)
-{
- if (isZero(n1)) return res = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- int sgn = GMP__SGN(n2);
- mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, GMP__ABS(n2));
- if (sgn <0) return res = - res;
- return res;
-}
-Integer& Integer::mod(Integer& res, const Integer& n1, const unsigned long n2)
-{
- if (isZero(n1)) return res = Integer::zero;
-// if (isZero(n2)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
- return res;
-}
+namespace Givaro {
+ //-------------------------------------------------- operator /
+ Integer& Integer::modin(Integer& res, const Integer& n)
+ {
+ if (isZero(res)) return res;
+ // mpz_tdiv_r( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep );
+ mpz_mod( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n.gmp_rep );
+ return res;
+ }
+ Integer& Integer::modin(Integer& res, const unsigned long n)
+ {
+ if (isZero(res)) return res;
+ // mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&res.gmp_rep, n);
+ mpz_mod_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&res.gmp_rep, n);
+ return res;
+ }
+ Integer& Integer::modin(Integer& res, const long n)
+ {
+ if (isZero(res)) return res;
+ // int sgn = GMP__SGN(n);
+ // mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, GMP__ABS(n));
+ // if (sgn <0) return res = -res;
+
+ if (n>0)
+ mpz_mod_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&res.gmp_rep, n);
+ else
+ mpz_mod_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&res.gmp_rep, -n);
+
+
+ return res;
+ }
+
+ Integer& Integer::mod(Integer& res, const Integer& n1, const Integer& n2)
+ {
+ if (isZero(n1)) return res = Integer::zero;
+ // mpz_tdiv_r( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, (mpz_ptr)&n2.gmp_rep);
+ mpz_mod( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, (mpz_srcptr)&n2.gmp_rep);
+ assert(!(res<0) && (res<GMP__ABS(n2)));
+ return res;
+ }
+ Integer& Integer::mod(Integer& res, const Integer& n1, const long n2)
+ {
+ if (isZero(n1)) return res = Integer::zero;
+ // int sgn = GMP__SGN(n2);
+ // mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, GMP__ABS(n2));
+ // if (sgn <0) return res = - res;
+
+ if (n2>0)
+ mpz_mod_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&n1.gmp_rep, n2);
+ else
+ mpz_mod_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&n1.gmp_rep, -n2);
+
+ assert(!(res<0) && (res<GMP__ABS(n2)));
+ return res;
+ }
+ Integer& Integer::mod(Integer& res, const Integer& n1, const unsigned long n2)
+ {
+ if (isZero(n1)) return res = Integer::zero;
+ // mpz_tdiv_r_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
+ mpz_mod_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
+ assert(!(res<0) && (res<n2));
+ return res;
+ }
+
+
+ Integer& Integer::operator %= (const Integer& n)
+ {
+ if (isZero(*this)) return *this;
+ mpz_tdiv_r( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
+ // mpz_mod( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+ return *this;
+ }
+
+ Integer& Integer::operator %= (const unsigned long l)
+ {
+ if (isZero(*this)) return *this;
+#ifdef DEBUG
+ int sgn_this = (*this>0)?1:-1;
+#endif
+ mpz_tdiv_r_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
-Integer& Integer::operator %= (const Integer& n)
-{
-// if (isZero(n)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return *this;
- Integer res;
- mpz_tdiv_r( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
- mpz_set( (mpz_ptr)&gmp_rep , (mpz_ptr)&(res.gmp_rep) );
- return *this;
-}
+#ifdef DEBUG
+ assert((*this<GIVABS(l)) && (*this> -GIVABS(l)) && (sgn_this*(*this).priv_sign()>=0)) ;
+#endif
-Integer& Integer::operator %= (const unsigned long l)
-{
-// if (l ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return *this;
- mpz_tdiv_r_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
- return *this;
-}
+ return *this;
+ }
-Integer& Integer::operator %= (const long l)
-{
-// if (l ==0) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return *this;
- int sgn = GMP__SGN(l);
- mpz_tdiv_r_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
-// if (sgn <0) (res.gmp_rep).size = -(res.gmp_rep).size;
-// gmp_rep = (res.gmp_rep);
- if (sgn <0) mpz_neg( (mpz_ptr)&gmp_rep, (mpz_ptr)&(gmp_rep) );
- return *this;
-}
+ Integer& Integer::operator %= (const long l)
+ {
+ if (isZero(*this)) return *this;
+#ifdef DEBUG
+ int sgn_this = (*this>0)?1:-1;
+#endif
+ int sgn = GMP__SGN(l);
+ mpz_tdiv_r_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
+ if (sgn <0) mpz_neg( (mpz_ptr)&gmp_rep, (mpz_ptr)&(gmp_rep) );
+#ifdef DEBUG
+ assert((*this<GIVABS(l)) && (*this> -GIVABS(l)) && (sgn_this*(*this).priv_sign()>=0)) ;
+#endif
+ return *this;
+ }
+
+ Integer Integer::operator % (const Integer& n) const
+ {
+ if (isZero(*this)) return Integer::zero;
+ Integer res;
+ mpz_tdiv_r( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
+
+ // std::cout << res << ',' << n << ',' << *this << std::endl;
+ assert((res<GIVABS(n)) && (res> -GIVABS(n)) && (res.priv_sign()*(*this).priv_sign()>=0)) ;
+ return res;
+ }
+
+ long Integer::operator % (const unsigned long l) const
+ {
+#if 0
+ if (isZero(*this)) return 0UL;
+ if (this->priv_sign()>0)
+ return mpz_tdiv_ui( (mpz_ptr)&gmp_rep, l);
+ else {
+ Integer Neg;
+ mpz_neg( (mpz_ptr)&(Neg.gmp_rep), (mpz_ptr)&gmp_rep );
+ unsigned long res = mpz_tdiv_ui( (mpz_ptr)&(Neg.gmp_rep), l);
+ if (res > 0UL) return (l-res);
+ else return 0UL;
+ }
+#endif
-Integer Integer::operator % (const Integer& n) const
-{
-// if (isZero(n)) {
-// GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (isZero(*this)) return Integer::zero;
- Integer res;
- mpz_tdiv_r( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
- return res;
-}
+ if (isZero(*this)) return 0UL;
+ bool isneg = (*this)<0 ;
+ //CONDITION: mpz_tdiv_ui does NOT consider the sign of gmp_rep
+ unsigned long res = mpz_tdiv_ui( (mpz_srcptr)&gmp_rep, l);
+#ifdef DEBUG
+ Integer toto = res;
+ if (isneg) toto = -(long)res ;
-// long Integer::operator % (const unsigned long l) const
-// {
-// // if (l ==0) {
-// // GivMathDivZero("[Integer::/]: division by zero");
-// // }
-// if (isZero(*this)) return 0L;
-// Integer Res(Integer::one);
-// mpz_tdiv_r_ui( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&gmp_rep, l);
-// // return Integer((res.gmp_rep));
-// return long( Res );
-// }
-unsigned long Integer::operator % (const unsigned long l) const {
- if (isZero(*this)) return 0L;
- if (this->priv_sign()>0)
- return mpz_tdiv_ui( (mpz_ptr)&gmp_rep, l);
- else {
- Integer Neg;
- mpz_neg( (mpz_ptr)&(Neg.gmp_rep), (mpz_ptr)&gmp_rep );
- unsigned long res = mpz_tdiv_ui( (mpz_ptr)&(Neg.gmp_rep), l);
- if (res > 0UL) return (l-res);
- else return 0UL;
- }
-}
+ // std::cout << toto << ',' << l << ',' << ',' << *this << std::endl;
+ assert((toto<l) && (-toto<l) && (toto.priv_sign()*(*this).priv_sign()>=0)) ;
+#endif
+ if (!res) return res ;
+ if (isneg) return (-(long)res) ;
-long Integer::operator % (const long l) const
-{
-// // if (l ==0) {
-// // GivMathDivZero("[Integer::/]: division by zero");
-// }
- if (l>0)
- return static_cast<long>(this->operator%( static_cast<const unsigned long>(l) ) );
- else {
- long res = static_cast<long>(this->operator%( static_cast<const unsigned long>( -l ) ) );
- return -res;
- }
-}
-//long Integer::operator % (const long l) const
-//{
-// int sgn = GMP__SGN(l);
-// long res = mpz_tdiv_ui((mpz_ptr)&gmp_rep, GMP__ABS(l));
-// if (sgn <0) return -res;
-// else return res;
-//}
+ return res ;
+ }
-//Added by Dan Roche, 6-28-04
+ long Integer::operator % (const long l) const
+ {
+#if 0
+ if (l ==0) {
+ GivMathDivZero("[Integer::/]: division by zero");
+ }
+#endif
+ long res ;
+ if (l>0) {
+ res = static_cast<long>(this->operator%( static_cast<unsigned long>(l) ) );
+ }
+ else {
+ res = static_cast<long>(this->operator%( static_cast<unsigned long>( -l ) ) );
+ }
+
+ // std::cout << res << ',' << l << ',' << *this << std::endl;
+ assert((res<GIVABS(l)) && (res> -GIVABS(l)) && (((res>0)?1:((res==0)?0:-1))*(*this).priv_sign()>=0)) ;
+ return res;
+ }
+
+ double Integer::operator % (const double l) const
+ {
+ double res ;
+ if (l>0)
+ res = static_cast<double>(this->operator%( static_cast<unsigned long>(l) ) );
+ else{
+ res = static_cast<double>(this->operator%( static_cast<unsigned long>(-l) ) );
+ }
+ assert((res<GIVABS(l)) && (res> -GIVABS(l)) && (((res>0)?1:((res==0)?0:-1))*(*this).priv_sign()>=0)) ;
+ return res;
+ }
+
+ //Added by Dan Roche, 6-28-04
#ifdef __USE_64_bits__
-unsigned long long Integer::operator % (const unsigned long long l) const
-{
- if (isZero(*this)) return 0LL;
- Integer Res(Integer::one);
- Integer Divisor(l);
- mpz_tdiv_r( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&(Divisor.gmp_rep) );
- return (unsigned long long)( Res );
-}
+ unsigned long long Integer::operator % (const unsigned long long l) const
+ {
+ if (isZero(*this)) return 0LL;
+ Integer Res(Integer::one);
+ Integer Divisor(l);
+ mpz_tdiv_r( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_ptr)&(Divisor.gmp_rep) );
+ return (unsigned long long)( Res );
+ }
+
+ long long Integer::operator % (const long long l) const
+ {
+ if (isZero(*this)) return 0LL;
+ Integer Res(Integer::one);
+ Integer Divisor(l);
+ mpz_tdiv_r( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_ptr)&(Divisor.gmp_rep) );
+ return (long long)( Res );
+ }
+#endif //__USE_64_bits__
-long long Integer::operator % (const long long l) const
-{
- if (isZero(*this)) return 0LL;
- Integer Res(Integer::one);
- Integer Divisor(l);
- mpz_tdiv_r( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&(Divisor.gmp_rep) );
- return (long long)( Res );
}
-
-#endif
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen:foldmethod=syntax
diff --git a/src/kernel/gmp++/gmp++_int_mul.C b/src/kernel/gmp++/gmp++_int_mul.C
index 1d2972e..fdcc18c 100644
--- a/src/kernel/gmp++/gmp++_int_mul.C
+++ b/src/kernel/gmp++/gmp++_int_mul.C
@@ -1,34 +1,39 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_mul.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_mul.C,v 1.5 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_mul.C,v 1.11 2011-01-20 08:19:15 jgdumas Exp $
// ==========================================================================
#include "gmp++/gmp++.h"
+namespace Givaro {
//-------------------------------------------------- operator *
-Integer& Integer::mulin(Integer& res, const Integer& n)
+Integer& Integer::mulin(Integer& res, const Integer& n)
{
if (isZero(n)) return res = Integer::zero;
if (isZero(res)) return res;
- mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep );
+ mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n.gmp_rep );
return res;
}
-Integer& Integer::mulin(Integer& res, const long n)
+Integer& Integer::mulin(Integer& res, const long n)
{
if (isZero(n)) return res = Integer::zero;
if (isZero(res)) return res;
-// int sgn = GMP__SGN(n);
- int sgn = GMP__SGN(n);
- mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, GMP__ABS(n));
+// int sgn = GMP__SGN(n);
+ // int sgn = GMP__SGN(n);
+ // mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, GMP__ABS(n));
// if (sgn <0) res.gmp_rep.size = -res.gmp_rep.size;
- if (sgn <0) return res = -res;
+ // if (sgn <0) return res = -res;
+ mpz_mul_si( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, n);
return res;
}
-Integer& Integer::mulin(Integer& res, const unsigned long n)
+Integer& Integer::mulin(Integer& res, const unsigned long n)
{
if (isZero(n)) return res = Integer::zero;
if (isZero(res)) return res;
@@ -40,24 +45,25 @@ Integer& Integer::mul(Integer& res, const Integer& n1, const Integer& n2)
{
if (isZero(n1)) return res = Integer::zero;
if (isZero(n2)) return res = Integer::zero;
- mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, (mpz_ptr)&n2.gmp_rep);
+ mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, (mpz_srcptr)&n2.gmp_rep);
return res;
}
Integer& Integer::mul(Integer& res, const Integer& n1, const long n2)
{
if (isZero(n1)) return res = Integer::zero;
if (isZero(n2)) return res = Integer::zero;
- int sgn = GMP__SGN(n2);
- mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, GMP__ABS(n2));
-// if (sgn <0) res.gmp_rep.size = -res.gmp_rep.size;
- if (sgn <0) return res = -res;
+ // int sgn = GMP__SGN(n2);
+ // mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, GMP__ABS(n2));
+ // if (sgn <0) res.gmp_rep.size = -res.gmp_rep.size;
+ // if (sgn <0) return res = -res;
+ mpz_mul_si( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
return res;
}
Integer& Integer::mul(Integer& res, const Integer& n1, const unsigned long n2)
{
if (isZero(n1)) return res = Integer::zero;
if (isZero(n2)) return res = Integer::zero;
- mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
+ mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
return res;
}
@@ -65,47 +71,96 @@ Integer& Integer::axpy(Integer& res, const Integer& a, const Integer& x, const I
{
if (&res == &b) return Integer::axpyin(res,a,x);
if (isZero(a) || isZero(x)) return res = b;
- mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&x.gmp_rep);
- mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&b.gmp_rep);
+ mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&x.gmp_rep);
+ mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&b.gmp_rep);
+ return res;
+}
+
+Integer& Integer::axpy(Integer& res, const Integer& a, const long unsigned x, const Integer& b)
+{
+ if (&res == &b) return Integer::axpyin(res,a,x);
+ if (isZero(a) || isZero(x)) return res = b;
+ mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, x);
+ mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&b.gmp_rep);
return res;
}
+
Integer& Integer::axpyin(Integer& res, const Integer& a, const Integer& x)
{
if (isZero(a) || isZero(x)) return res;
-// Rep gmp_res; mpz_init((mpz_ptr)&gmp_res);
-// mpz_mul( (mpz_ptr)&gmp_res, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&x.gmp_rep);
-// mpz_add( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&gmp_res);
-// mpz_clear((mpz_ptr)&gmp_res);
- mpz_addmul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&x.gmp_rep);
+ mpz_addmul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&x.gmp_rep);
return res;
}
-Integer& Integer::amxy(Integer& res, const Integer& a, const Integer& x, const Integer& b)
+Integer& Integer::axpyin(Integer& res, const Integer& a, const long unsigned x)
{
- if (isZero(b) || isZero(x)) return res=a;
- mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&b.gmp_rep, (mpz_ptr)&x.gmp_rep);
- mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&res.gmp_rep);
+ if (isZero(a) || isZero(x)) return res;
+ mpz_addmul_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, x);
return res;
}
+Integer& Integer::maxpy(Integer& res, const Integer& a, const Integer& x, const Integer& b)
+{
+ if (isZero(a) || isZero(x)) return res=b;
+ if (&res == &b) return Integer::maxpyin(res,a,x);
+ mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&x.gmp_rep);
+ mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&b.gmp_rep, (mpz_ptr)&res.gmp_rep);
+ return res;
+}
+Integer& Integer::maxpy(Integer& res, const Integer& a, const long unsigned x, const Integer& b)
+{
+ if (isZero(a) || isZero(x)) return res=b;
+ if (&res == &b) return Integer::maxpyin(res,a,x);
+ mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, x);
+ mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&b.gmp_rep, (mpz_ptr)&res.gmp_rep);
+ return res;
+}
+
Integer& Integer::axmy(Integer& res, const Integer& a, const Integer& x, const Integer& b)
{
if (&res == &b) return Integer::axmyin(res,a,x);
if (isZero(a) || isZero(x)) return Integer::neg(res,b);
- mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&x.gmp_rep);
- mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&b.gmp_rep);
+ mpz_mul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&x.gmp_rep);
+ mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&b.gmp_rep);
+ return res;
+}
+
+Integer& Integer::axmy(Integer& res, const Integer& a, const long unsigned x, const Integer& b)
+{
+ if (&res == &b) return Integer::axmyin(res,a,x);
+ if (isZero(a) || isZero(x)) return Integer::neg(res,b);
+ mpz_mul_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, x);
+ mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&b.gmp_rep);
return res;
}
+
Integer& Integer::axmyin(Integer& res, const Integer& a, const Integer& x)
{
+ Integer::maxpyin(res,a,x);
+ Integer::negin(res);
+ return res ;
+}
+
+Integer& Integer::axmyin(Integer& res, const Integer& a, const unsigned long x)
+{
+ Integer::maxpyin(res,a,x);
+ Integer::negin(res);
+ return res ;
+}
+
+Integer& Integer::maxpyin(Integer& res, const Integer& a, const Integer& x)
+{
+ if (isZero(a) || isZero(x)) return res;
+ mpz_submul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&x.gmp_rep);
+ return res;
+}
+
+Integer& Integer::maxpyin(Integer& res, const Integer& a, const unsigned long x)
+{
if (isZero(a) || isZero(x)) return res;
-// Rep gmp_res; mpz_init((mpz_ptr)&gmp_res);
-// mpz_mul( (mpz_ptr)&gmp_res, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&x.gmp_rep);
-// mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&gmp_res);
-// mpz_clear((mpz_ptr)&gmp_res);
- mpz_submul( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&a.gmp_rep, (mpz_ptr)&x.gmp_rep);
+ mpz_submul_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, x);
return res;
}
@@ -113,9 +168,9 @@ Integer& Integer::operator *= (const Integer& n)
{
if (isZero(n)) return *this = Integer::zero;
if (isZero(*this)) return *this;
-// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
- Integer res;
- mpz_mul( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
+ Integer res;
+ mpz_mul( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
return *this = res;
}
@@ -123,7 +178,7 @@ Integer& Integer::operator *= (const unsigned long l)
{
if (l==0) return *this = Integer::zero;
if (isZero(*this)) return *this;
-// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
+// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
mpz_mul_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
return *this;
}
@@ -133,9 +188,10 @@ Integer& Integer::operator *= (const long l)
if (l==0) return *this =Integer::zero;
if (isZero(*this)) return *this;
// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
- int sgn = GMP__SGN(l);
- mpz_mul_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
- if (sgn <0) mpz_neg( (mpz_ptr)&gmp_rep, (mpz_ptr)&(gmp_rep) );
+ // int sgn = GMP__SGN(l);
+ // mpz_mul_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
+ // if (sgn <0) mpz_neg( (mpz_ptr)&gmp_rep, (mpz_ptr)&(gmp_rep) );
+ mpz_mul_si( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
return *this;
}
@@ -144,32 +200,37 @@ Integer Integer::operator * (const Integer& n) const
{
if (isZero(n)) return Integer::zero;
if (isZero(*this)) return Integer::zero;
-// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
+// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
Integer res;
- mpz_mul( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+ mpz_mul( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
return res;
}
-Integer Integer::operator * (const unsigned long l) const
+Integer Integer::operator * (const unsigned long l) const
{
if (l==0) return Integer::zero;
if (isZero(*this)) return Integer::zero;
-// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
+// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
Integer res;
- mpz_mul_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l);
+ mpz_mul_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
return res;
}
-Integer Integer::operator * (const long l) const
+Integer Integer::operator * (const long l) const
{
if (l==0) return Integer::zero;
if (isZero(*this)) return Integer::zero;
-// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
- Integer res;
- int sgn = GMP__SGN(l);
- mpz_mul_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
+// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
+ Integer res;
+ // int sgn = GMP__SGN(l);
+ // mpz_mul_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, GMP__ABS(l));
// if (sgn <0) (res.gmp_rep).size = -(res.gmp_rep).size;
// return Integer((res.gmp_rep));
- if (sgn <0) mpz_neg( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&(res.gmp_rep) );
+ // if (sgn <0) mpz_neg( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&(res.gmp_rep) );
+ mpz_mul_si( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
return res;
}
+
+}
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/gmp++/gmp++_int_pow.C b/src/kernel/gmp++/gmp++_int_pow.C
index 7eecffa..8625567 100644
--- a/src/kernel/gmp++/gmp++_int_pow.C
+++ b/src/kernel/gmp++/gmp++_int_pow.C
@@ -1,15 +1,22 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_pow.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: JG Dumas
-// $Id: gmp++_int_pow.C,v 1.2 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_pow.C,v 1.4 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
-// Description:
+// Description:
#include "gmp++/gmp++.h"
-int isperfectpower(const Integer& n) {
- return mpz_perfect_power_p((mpz_ptr)&(n.gmp_rep));
+
+namespace Givaro {
+
+int isperfectpower(const Integer& n)
+{
+ return mpz_perfect_power_p((mpz_srcptr)&(n.gmp_rep));
}
Integer& pow(Integer& Res, const unsigned long n, const unsigned long p)
@@ -19,7 +26,7 @@ Integer& pow(Integer& Res, const unsigned long n, const unsigned long p)
}
Integer& pow(Integer& Res, const Integer& n, const unsigned long p)
{
-__gmpz_pow_ui( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&n.gmp_rep, p);
+__gmpz_pow_ui( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&n.gmp_rep, p);
return Res;
}
@@ -31,16 +38,20 @@ Integer pow(const Integer& n, const unsigned long p)
return pow(Res,n,p);
}
-Integer& pow(Integer& Res, const Integer& n, const long l) {
+Integer& pow(Integer& Res, const Integer& n, const long l)
+{
+ // Beware of negative values
return pow(Res, n, (unsigned long) GMP__ABS(l) );
}
-Integer pow(const Integer& n, const long l) {
+Integer pow(const Integer& n, const long l)
+{
if (l < 0) return Integer::zero;
return pow(n, (unsigned long) GMP__ABS(l) );
}
-Integer& powmod(Integer& Res, const Integer& n, const unsigned long p, const Integer& m) {
- mpz_powm_ui( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&n.gmp_rep, p, (mpz_ptr)&m.gmp_rep);
+Integer& powmod(Integer& Res, const Integer& n, const unsigned long p, const Integer& m)
+{
+ mpz_powm_ui( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&n.gmp_rep, p, (mpz_srcptr)&m.gmp_rep);
return Res;
}
@@ -53,18 +64,22 @@ Integer powmod(const Integer& n, const unsigned long p, const Integer& m)
Integer& powmod(Integer& Res, const Integer& n, const long e, const Integer& m)
{
- return powmod (Res, n, (unsigned long)GMP__ABS(e), m);
+ if (e < 0) {
+ inv(Res, n, m);
+ return powmod(Res, Res, (unsigned long)GMP__ABS(e), m);
+ } else
+ return powmod (Res, n, (unsigned long)(e), m);
}
Integer powmod(const Integer& n, const long e, const Integer& m)
{
- if (e < 0) return Integer::zero;
- return powmod (n, (unsigned long)GMP__ABS(e), m);
+ Integer Res;
+ return powmod(Res, n, e, m);
}
Integer& powmod(Integer& Res, const Integer& n, const Integer& e, const Integer& m)
{
- mpz_powm( (mpz_ptr)&(Res.gmp_rep), (mpz_ptr)&n.gmp_rep, (mpz_ptr)&e.gmp_rep, (mpz_ptr)&m.gmp_rep);
+ mpz_powm( (mpz_ptr)&(Res.gmp_rep), (mpz_srcptr)&n.gmp_rep, (mpz_srcptr)&e.gmp_rep, (mpz_srcptr)&m.gmp_rep);
return Res;
}
Integer powmod(const Integer& n, const Integer& e, const Integer& m)
@@ -74,3 +89,5 @@ Integer powmod(const Integer& n, const Integer& e, const Integer& m)
Integer Res;
return powmod(Res, n, e, m);
}
+
+}
diff --git a/src/kernel/gmp++/gmp++_int_sub.C b/src/kernel/gmp++/gmp++_int_sub.C
index 23858da..6c67485 100644
--- a/src/kernel/gmp++/gmp++_int_sub.C
+++ b/src/kernel/gmp++/gmp++_int_sub.C
@@ -1,32 +1,36 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/gmp++/gmp++_int_sub.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: gmp++_int_sub.C,v 1.3 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: gmp++_int_sub.C,v 1.4 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
#include "gmp++/gmp++.h"
+namespace Givaro {
//-------------------------------------------------- operator -
-Integer& Integer::subin(Integer& res, const Integer& n)
+Integer& Integer::subin(Integer& res, const Integer& n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = - n;
- mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep );
+ mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n.gmp_rep );
return res;
}
-Integer& Integer::subin(Integer& res, const long n)
+Integer& Integer::subin(Integer& res, const long n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = - n;
- int sgn = GMP__SGN(n);
+ int sgn = GMP__SGN(n);
if (sgn >0) mpz_sub_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, n);
else mpz_add_ui((mpz_ptr)&res.gmp_rep, (mpz_ptr)&res.gmp_rep, -n);
return res;
}
-Integer& Integer::subin(Integer& res, const unsigned long n)
+Integer& Integer::subin(Integer& res, const unsigned long n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = - n;
@@ -38,29 +42,29 @@ Integer& Integer::sub(Integer& res, const Integer& n1, const Integer& n2)
{
if (isZero(n1)) return res = - n2;
if (isZero(n2)) return res = n1;
- mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, (mpz_ptr)&n2.gmp_rep);
+ mpz_sub( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, (mpz_srcptr)&n2.gmp_rep);
return res;
}
Integer& Integer::sub(Integer& res, const Integer& n1, const long n2)
{
if (isZero(n1)) return res = - n2;
if (isZero(n2)) return res = n1;
- int sgn = GMP__SGN(n2);
- if (sgn >0) mpz_sub_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
- else mpz_add_ui((mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, -n2);
+ int sgn = GMP__SGN(n2);
+ if (sgn >0) mpz_sub_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
+ else mpz_add_ui((mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, -n2);
return res;
}
Integer& Integer::sub(Integer& res, const Integer& n1, const unsigned long n2)
{
if (isZero(n1)) return res = - n2;
if (isZero(n2)) return res = n1;
- mpz_sub_ui( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n1.gmp_rep, n2);
+ mpz_sub_ui( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n1.gmp_rep, n2);
return res;
}
Integer& Integer::neg(Integer& res, const Integer& n)
{
- mpz_neg( (mpz_ptr)&res.gmp_rep, (mpz_ptr)&n.gmp_rep);
+ mpz_neg( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&n.gmp_rep);
return res;
}
@@ -75,8 +79,8 @@ Integer& Integer::operator -= (const Integer& n)
{
if (isZero(n)) return *this;
if (isZero(*this)) return logcpy(-n);
-// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
- mpz_sub( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
+ mpz_sub( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
return *this;
}
@@ -84,7 +88,7 @@ Integer& Integer::operator -= (const unsigned long l)
{
if (l==0) return *this;
if (isZero(*this)) return logcpy(Integer(-l));
-// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
+// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
mpz_sub_ui( (mpz_ptr)&(gmp_rep), (mpz_ptr)&gmp_rep, l);
return *this;
}
@@ -105,30 +109,32 @@ Integer Integer::operator - (const Integer& n) const
{
if (isZero(n)) return *this;
if (isZero(*this)) return -n;
-// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
- Integer res;
- mpz_sub( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, (mpz_ptr)&n.gmp_rep) ;
+// Rep (res.gmp_rep)( MAX(SZ_REP(n.gmp_rep),SZ_REP(gmp_rep)) );
+ Integer res;
+ mpz_sub( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, (mpz_srcptr)&n.gmp_rep) ;
return res;
}
-Integer Integer::operator - (const unsigned long l) const
+Integer Integer::operator - (const unsigned long l) const
{
if (l==0) return *this;
if (isZero(*this)) return Integer(-l);
-// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
- Integer res;
- mpz_sub_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l);
+// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
+ Integer res;
+ mpz_sub_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
return res;
}
-Integer Integer::operator - (const long l) const
+Integer Integer::operator - (const long l) const
{
if (l==0) return *this;
if (isZero(*this)) return Integer(-l);
-// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
- Integer res;
+// Rep (res.gmp_rep)( MAX(SZ_REP(gmp_rep),1) );
+ Integer res;
int sgn = GMP__SGN(l);
- if (sgn >0) mpz_sub_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, l);
- else mpz_add_ui( (mpz_ptr)&(res.gmp_rep), (mpz_ptr)&gmp_rep, -l);
+ if (sgn >0) mpz_sub_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, l);
+ else mpz_add_ui( (mpz_ptr)&(res.gmp_rep), (mpz_srcptr)&gmp_rep, -l);
return res;
}
+
+}
diff --git a/src/kernel/integer/Makefile.am b/src/kernel/integer/Makefile.am
index 1871ec0..ec7d946 100644
--- a/src/kernel/integer/Makefile.am
+++ b/src/kernel/integer/Makefile.am
@@ -1,22 +1,32 @@
-INCLUDES=-I$(top_srcdir) ${GMP_VERSION}
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel
+AM_CPPFLAGS=-I$(top_srcdir) ${GMP_VERSION}
-pkginclude_HEADERS=\
- givinteger.h \
- givintfactor.h \
- givintprime.h \
- givintnumtheo.h \
- givintrsa.h \
- givintrns.h \
- givinteger.inl \
- givintprime.inl \
- givintnumtheo.inl \
- givintrsa.inl \
- givintfactor.inl \
- givintrns_convert.inl \
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel
+
+pkginclude_HEADERS= \
+ givinteger.h \
+ givintfactor.h \
+ givintprime.h \
+ givintnumtheo.h \
+ givintrsa.h \
+ givintrns.h \
+ givintprime.inl \
+ givintnumtheo.inl \
+ givintrsa.inl \
+ givintfactor.inl \
+ givintsqrootmod.h \
+ givintsqrootmod.inl \
+ givintrns_convert.inl \
givintrns_cstor.inl
noinst_LTLIBRARIES=libgivinteger.la
libgivinteger_la_SOURCES=givintprime.C
+
+#EXTRA_DIST= integer.doxy
diff --git a/src/kernel/integer/Makefile.in b/src/kernel/integer/Makefile.in
index 2c04747..4a2eb1b 100644
--- a/src/kernel/integer/Makefile.in
+++ b/src/kernel/integer/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -50,8 +64,8 @@ libgivinteger_la_LIBADD =
am_libgivinteger_la_OBJECTS = givintprime.lo
libgivinteger_la_OBJECTS = $(am_libgivinteger_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -83,26 +97,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -112,40 +127,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -185,23 +210,27 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir) ${GMP_VERSION}
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel
+AM_CPPFLAGS = -I$(top_srcdir) ${GMP_VERSION} \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
- givinteger.h \
- givintfactor.h \
- givintprime.h \
- givintnumtheo.h \
- givintrsa.h \
- givintrns.h \
- givinteger.inl \
- givintprime.inl \
- givintnumtheo.inl \
- givintrsa.inl \
- givintfactor.inl \
- givintrns_convert.inl \
+ givinteger.h \
+ givintfactor.h \
+ givintprime.h \
+ givintnumtheo.h \
+ givintrsa.h \
+ givintrns.h \
+ givintprime.inl \
+ givintnumtheo.inl \
+ givintrsa.inl \
+ givintfactor.inl \
+ givintsqrootmod.h \
+ givintsqrootmod.inl \
+ givintrns_convert.inl \
givintrns_cstor.inl
noinst_LTLIBRARIES = libgivinteger.la
@@ -214,14 +243,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/integer/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/integer/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/integer/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/integer/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -257,28 +286,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givintprime.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -308,7 +323,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -413,7 +428,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -424,6 +438,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -432,22 +448,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -482,6 +507,8 @@ uninstall-am: uninstall-pkgincludeHEADERS
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
+
+#EXTRA_DIST= integer.doxy
# 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/kernel/integer/givinteger.h b/src/kernel/integer/givinteger.h
index 224fb9f..7be6d98 100644
--- a/src/kernel/integer/givinteger.h
+++ b/src/kernel/integer/givinteger.h
@@ -1,12 +1,15 @@
-#ifndef _INTEGER_H_
-#define _INTEGER_H_
// =============================================================
-// Copyright(c)'94-02 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier, J.-G. Dumas
// =============================================================
-// Description:
-// Integer Domain class definition
+// Description:
+// Integer Domain class definition
+#ifndef __GIVARO_integer_H
+#define __GIVARO_integer_H
#include "givaro/givbasictype.h"
#include "givaro/givinit.h"
#include "givaro/giverror.h"
@@ -14,143 +17,354 @@
#include "gmp++/gmp++.h"
#include <string>
+namespace Givaro {
+ //------------------------------------ Class IntegerDom
+ class IntegerDom {
+ public:
+ typedef Integer Rep;
+ typedef Rep Element;
-//------------------------------------ Class IntegerDom
-class IntegerDom : public Integer {
-public:
- typedef Integer Rep;
- typedef Rep Element;
-
-
- IntegerDom() : one(1UL), zero(0UL) {}
- IntegerDom(const IntegerDom& D) : one(1UL), zero(0UL) {}
-
- int operator==( const IntegerDom& BC) const { return 1;}
- int operator!=( const IntegerDom& BC) const { return 0;}
-
- // -- Constants:
- const Integer one;
- const Integer zero;
-
- // -- assignement
- Rep& init ( Rep& a ) const {return a;}
- Rep& init ( Rep& a, const Rep& b) const { return a = b ; }
- Rep& read( Rep& a, const long i) const { return a = Integer(i) ; }
- Rep& read( Rep& a, const unsigned long i) const { return a = Integer(i) ; }
- Rep& read( Rep& a, const int i) const { return a = Integer(i) ; }
- Rep& read( Rep& a, const unsigned int i) const { return a = Integer(i) ; }
-
- Rep& convert( Rep& a, const Rep& b) const { return a = b ; }
- Rep& assign( Rep& a, const Rep& b) const { return a = b ; }
-
- // -- access
- const Rep& access(const Rep& a) const { return a; }
-
- template<class XXX> XXX& convert(XXX& x, const Rep& a) const { return x=(XXX)a;}
-
- // -- arithmetic operators
- Rep& mul( Rep& r, const Rep& a, const Rep& b ) const { return Integer::mul(r,a,b); }
- Rep& div( Rep& r, const Rep& a, const Rep& b ) const { return Integer::div(r,a,b); }
- Rep& mod( Rep& r, const Rep& a, const Rep& b ) const { return Integer::mod(r,a,b); }
- Rep& add( Rep& r, const Rep& a, const Rep& b ) const { return Integer::add(r,a,b); }
- Rep& sub( Rep& r, const Rep& a, const Rep& b ) const { return Integer::sub(r,a,b); }
- Rep& divmod( Rep& q, Rep& r, const Rep& a, const Rep& b ) const
- { return Integer::divmod(q,r,a,b); }
- Rep& divexact( Rep& q, const Rep& a, const Rep& b ) const { return Integer::divexact(q,a,b); }
-
- Rep& mulin( Rep& r, const Rep& a) const { return r *= a; }
- Rep& divin( Rep& r, const Rep& a) const { return r /= a; }
- Rep& modin( Rep& r, const Rep& a) const { return r %= a; }
- Rep& addin( Rep& r, const Rep& a) const { return r += a; }
- Rep& subin( Rep& r, const Rep& a) const { return r -= a; }
-
- Rep& axpy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
- { return Integer::axpy(r,a,b,c); }
- Rep& amxy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
- { return Integer::amxy(r,a,b,c); }
- Rep& axmy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
- { return Integer::axmy(r,a,b,c); }
- Rep& axpyin( Rep& r, const Rep& a, const Rep& b ) const
- { return r += a * b; }
- Rep& axmyin( Rep& r, const Rep& a, const Rep& b ) const
- { return r -= a * b; }
-
- // -- unary methods
- Rep& neg( Rep& r, const Rep& a ) const { return Integer::neg(r,a); }
- Rep& negin( Rep& r ) const { return Integer::negin(r); }
-
- // -- extended gcd q = gcd(a,b) = u*a+v*b;
- Rep& gcd( Rep& g, Rep& u, Rep& v, const Rep& a, const Rep& b ) const
- { return ::gcd(g, a, b, u, v); }
- Rep& gcd( Rep& g, const Rep& a, const Rep& b ) const
- { return ::gcd(g, a, b); }
- Rep& lcm( Rep& l, const Rep& a, const Rep& b ) const
- { return ::lcm(l, a, b); }
- Rep& lcmin( Rep& l, const Rep& a) const
- { Rep tmp(l); return lcm(l, tmp, a); }
-
- // - return n^l
- Rep& pow(Rep& r, const Rep& n, const long l) const { return r = ::pow(n, l); }
- Rep& pow(Rep& r, const Rep& n, const unsigned long l) const { return r = ::pow(n, l); }
- Rep& pow(Rep& r, const Rep& n, const int l) const { return r = ::pow(n, (long)l); }
- Rep& pow(Rep& r, const Rep& n, const unsigned int l) const { return r = ::pow(n, (unsigned long)l); }
-
- // - return square root of n
- Rep& sqrt(Rep& s, const Rep& n) const { return ::sqrt(s,n); }
- Rep& sqrt(Rep& s, Rep& r, const Rep& n) const { return ::sqrtrem(s,n, r); }
- // - base p logarithm of a
- long logp(const Rep& a, const Rep& p) const { return ::logp(a,p); }
-
- // - return n^e % m
- Rep& powmod(Rep& r, const Rep& n, const long e, const Rep& m) const
- { return r = ::powmod(n, e, m);}
- Rep& powmod(Rep& r, const Rep& n, const Rep& e, const Rep& m) const
- { return r = ::powmod(n, e, m);}
-
- // - Misc
- unsigned long length (const Rep& a) const { return ::length(a); }
- int sign (const Rep& a) const { return ::sign(a); }
- bool isZero (const Rep& a) const { return ::isZero(a); }
- bool isOne (const Rep& a) const { return ::isOne(a); }
- bool areEqual (const Rep& a, const Rep& b) const { return compare(a,b) ==0;}
- bool areNEqual(const Rep& a, const Rep& b) const { return compare(a,b) !=0;}
- bool isgeq(const Rep& a, const Rep& b) const { return compare(a,b) >= 0;}
- bool isleq(const Rep& a, const Rep& b) const { return compare(a,b) <= 0;}
- bool isgeq(const long b,const Rep& a ) const { return isgeq(Rep(b),a);}
- bool isleq(const long b,const Rep& a ) const { return isleq(Rep(b),a);}
- bool isgeq(const Rep& a, const long b) const { return isgeq(a,Rep(b));}
- bool isleq(const Rep& a, const long b) const { return isleq(a,Rep(b));}
- bool isgt(const Rep& a, const Rep& b) const { return compare(a,b) > 0;}
- bool islt(const Rep& a, const Rep& b) const { return compare(a,b) < 0;}
- bool isgt(const long b,const Rep& a ) const { return isgt(Rep(b),a);}
- bool islt(const long b,const Rep& a ) const { return islt(Rep(b),a);}
- bool isgt(const Rep& a, const long b) const { return isgt(a,Rep(b));}
- bool islt(const Rep& a, const long b) const { return islt(a,Rep(b));}
+ IntegerDom() : one(1UL), zero(0UL) {}
+ IntegerDom(const IntegerDom&) : one(1UL), zero(0UL) {}
-#ifdef __GMP_PLUSPLUS__
- void seeding(unsigned long s = 0) const { Integer::seeding(s) ; }
-#endif
- template< class RandIter > Rep& random(RandIter& g, Rep& r, long s = 1) const { return Integer::random(r,s); }
- template< class RandIter > Rep& random(RandIter& g, Rep& r, const Rep& b) const { return Integer::random(r,b); }
- template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, long s = 1) const { return Integer::nonzerorandom(r,s); }
- template< class RandIter > Rep& nonzerorandom (RandIter& g,Rep& r, const Rep& b) const { return Integer::nonzerorandom(r,b); }
+ int operator==( const IntegerDom&) const
+ {
+ return 1;
+ }
+ int operator!=( const IntegerDom&) const
+ {
+ return 0;
+ }
+
+ // -- Constants:
+ const Integer one;
+ const Integer zero;
+
+ // -- assignement
+ Rep& init ( Rep& a ) const
+ {
+ return a;
+ }
+ Rep& init ( Rep& a, const Rep& b) const
+ {
+ return a = b ;
+ }
+ Rep& read( Rep& a, const long i) const
+ {
+ return a = Integer(i) ;
+ }
+ Rep& read( Rep& a, const unsigned long i) const
+ {
+ return a = Integer(i) ;
+ }
+ Rep& read( Rep& a, const int i) const
+ {
+ return a = Integer(i) ;
+ }
+ Rep& read( Rep& a, const unsigned int i) const
+ {
+ return a = Integer(i) ;
+ }
+
+ Rep& convert( Rep& a, const Rep& b) const
+ {
+ return a = b ;
+ }
+ Rep& assign( Rep& a, const Rep& b) const
+ {
+ return a = b ;
+ }
+
+ // -- access
+ const Rep& access(const Rep& a) const
+ {
+ return a;
+ }
+
+ template<class XXX> XXX& convert(XXX& x, const Rep& a) const
+ {
+ return x=(XXX)a;
+ }
+
+ // -- arithmetic operators
+ Rep& mul( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::mul(r,a,b);
+ }
+ Rep& div( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::div(r,a,b);
+ }
+ Rep& mod( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::mod(r,a,b);
+ }
+ Rep& add( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::add(r,a,b);
+ }
+ Rep& sub( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::sub(r,a,b);
+ }
+ Rep& divmod( Rep& q, Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::divmod(q,r,a,b);
+ }
+ Rep& divexact( Rep& q, const Rep& a, const Rep& b ) const
+ {
+ return Integer::divexact(q,a,b);
+ }
+
+ Rep& mulin( Rep& r, const Rep& a) const
+ {
+ return r *= a;
+ }
+ Rep& divin( Rep& r, const Rep& a) const
+ {
+ return r /= a;
+ }
+ Rep& modin( Rep& r, const Rep& a) const
+ {
+ return r %= a;
+ }
+ Rep& addin( Rep& r, const Rep& a) const
+ {
+ return r += a;
+ }
+ Rep& subin( Rep& r, const Rep& a) const
+ {
+ return r -= a;
+ }
+
+ Rep& axpy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
+ {
+ return Integer::axpy(r,a,b,c);
+ }
+ Rep& maxpy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
+ {
+ return Integer::maxpy(r,a,b,c);
+ }
+ Rep& maxpyin( Rep& r, const Rep& a, const Rep& b) const
+ {
+ return Integer::maxpyin(r,a,b);
+ }
+ Rep& axmy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
+ {
+ return Integer::axmy(r,a,b,c);
+ }
+ Rep& axpyin( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::axpyin(r,a,b);
+ }
+ Rep& axmyin( Rep& r, const Rep& a, const Rep& b ) const
+ {
+ return Integer::axmyin(r,a,b);
+ }
- // -- IO
- std::istream& read ( std::istream& i )
- { char ch;
- i >> std::ws >> ch;
-// JGD 22.03.03
-// if (ch != 'I')
-// GivError::throw_error(GivBadFormat("IntegerDom::read: bad signature domain"));
- return i;
- }
- std::ostream& write( std::ostream& o ) const { return o << 'I'; }
- std::istream& read ( std::istream& i, Rep& n) const { return i >> n; }
- std::ostream& write( std::ostream& o, const Rep& n) const { return o << n; }
-};
+ // -- unary methods
+ Rep& neg( Rep& r, const Rep& a ) const
+ {
+ return Integer::neg(r,a);
+ }
+ Rep& negin( Rep& r ) const
+ {
+ return Integer::negin(r);
+ }
+ // -- extended gcd q = gcd(a,b) = u*a+v*b;
+ Rep& gcd( Rep& g, Rep& u, Rep& v, const Rep& a, const Rep& b ) const
+ {
+ return ::Givaro::gcd(g, a, b, u, v);
+ }
+ Rep& gcd( Rep& g, const Rep& a, const Rep& b ) const
+ {
+ return ::Givaro::gcd(g, a, b);
+ }
+ Rep& lcm( Rep& l, const Rep& a, const Rep& b ) const
+ {
+ return ::Givaro::lcm(l, a, b);
+ }
+ Rep& lcmin( Rep& l, const Rep& a) const
+ { Rep tmp(l); return lcm(l, tmp, a);
+ }
+
+ Rep& inv(Rep& u, const Rep& a, const Rep& b) const
+ {
+ return ::Givaro::inv(u,a,b);
+ }
+ Rep& invin(Rep& u, const Rep& b) const
+ {
+ return ::Givaro::invin(u,b);
+ }
+
+
+ // - return n^l
+ Rep& pow(Rep& r, const Rep& n, const long l) const
+ {
+ return r = ::Givaro::pow(n, l);
+ }
+ Rep& pow(Rep& r, const Rep& n, const unsigned long l) const
+ {
+ return r = ::Givaro::pow(n, l);
+ }
+ Rep& pow(Rep& r, const Rep& n, const int l) const
+ {
+ return r = ::Givaro::pow(n, (long)l);
+ }
+ Rep& pow(Rep& r, const Rep& n, const unsigned int l) const
+ {
+ return r = ::Givaro::pow(n, (unsigned long)l);
+ }
+
+ // - return square root of n
+ Rep& sqrt(Rep& s, const Rep& n) const
+ {
+ return ::Givaro::sqrt(s,n);
+ }
+ Rep& sqrt(Rep& s, Rep& r, const Rep& n) const
+ {
+ return ::Givaro::sqrtrem(s,n, r);
+ }
+ // - base p logarithm of a
+ long logp(const Rep& a, const Rep& p) const
+ {
+ return ::Givaro::logp(a,p);
+ }
+
+ // - return n^e % m
+ Rep& powmod(Rep& r, const Rep& n, const long e, const Rep& m) const
+ {
+ return r = ::Givaro::powmod(n, e, m);
+ }
+ Rep& powmod(Rep& r, const Rep& n, const Rep& e, const Rep& m) const
+ {
+ return r = ::Givaro::powmod(n, e, m);
+ }
+
+ // - Misc
+ unsigned long length (const Rep& a) const
+ {
+ return ::Givaro::length(a);
+ }
+ int sign (const Rep& a) const
+ {
+ return ::Givaro::sign(a);
+ }
+ bool isZero (const Rep& a) const
+ {
+ return ::Givaro::isZero(a);
+ }
+ bool isOne (const Rep& a) const
+ {
+ return ::Givaro::isOne(a);
+ }
+ bool areEqual (const Rep& a, const Rep& b) const
+ {
+ return compare(a,b) ==0;
+ }
+ bool areNEqual(const Rep& a, const Rep& b) const
+ {
+ return compare(a,b) !=0;
+ }
+ bool isgeq(const Rep& a, const Rep& b) const
+ {
+ return compare(a,b) >= 0;
+ }
+ bool isleq(const Rep& a, const Rep& b) const
+ {
+ return compare(a,b) <= 0;
+ }
+ bool isgeq(const long b,const Rep& a ) const
+ {
+ return isgeq(Rep(b),a);
+ }
+ bool isleq(const long b,const Rep& a ) const
+ {
+ return isleq(Rep(b),a);
+ }
+ bool isgeq(const Rep& a, const long b) const
+ {
+ return isgeq(a,Rep(b));
+ }
+ bool isleq(const Rep& a, const long b) const
+ {
+ return isleq(a,Rep(b));
+ }
+ bool isgt(const Rep& a, const Rep& b) const
+ {
+ return compare(a,b) > 0;
+ }
+ bool islt(const Rep& a, const Rep& b) const
+ {
+ return compare(a,b) < 0;
+ }
+ bool isgt(const long b,const Rep& a ) const
+ {
+ return isgt(Rep(b),a);
+ }
+ bool islt(const long b,const Rep& a ) const
+ {
+ return islt(Rep(b),a);
+ }
+ bool isgt(const Rep& a, const long b) const
+ {
+ return isgt(a,Rep(b));
+ }
+ bool islt(const Rep& a, const long b) const
+ {
+ return islt(a,Rep(b));
+ }
+
+
+#ifdef __GMP_PLUSPLUS__
+ void seeding(unsigned long s = 0) const
+ { Integer::seeding(s) ;
+ }
+#endif
+ template< class RandIter > Rep& random(RandIter&, Rep& r, long s = 1) const
+ {
+ return Integer::random(r,s);
+ }
+ template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const
+ {
+ return Integer::random(r,b);
+ }
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s = 1) const
+ {
+ return Integer::nonzerorandom(r,s);
+ }
+ template< class RandIter > Rep& nonzerorandom (RandIter&,Rep& r, const Rep& b) const
+ {
+ return Integer::nonzerorandom(r,b);
+ }
+ // -- IO
+ std::istream& read ( std::istream& i )
+ {
+ char ch;
+ i >> std::ws >> ch;
+ // JGD 22.03.03
+ // if (ch != 'I')
+ // GivError::throw_error(GivBadFormat("IntegerDom::read: bad signature domain"));
+ return i;
+ }
+ std::ostream& write( std::ostream& o ) const
+ {
+ return o << 'I';
+ }
+ std::istream& read ( std::istream& i, Rep& n) const
+ {
+ return i >> n;
+ }
+ std::ostream& write( std::ostream& o, const Rep& n) const
+ {
+ return o << n;
+ }
+ };
-#endif //__INT_H_
+} // Givaro
+#endif //__GIVARO_integer_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givinteger.inl b/src/kernel/integer/givinteger.inl
deleted file mode 100644
index fba53e6..0000000
--- a/src/kernel/integer/givinteger.inl
+++ /dev/null
@@ -1,269 +0,0 @@
-// ==========================================================================
-// $Source: /var/lib/cvs/Givaro/src/kernel/integer/givinteger.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
-// Authors: M. Samama, T. Gautier
-// $Id: givinteger.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
-// ==========================================================================
-// Description:
-
-//-----------------------------~Integer()
-inline Integer::~Integer() { mpz_clear((mpz_ptr)&gmp_rep) ; }
-
-//-------------------------------Integer(const Integer &n)
-inline Integer::Integer(const Integer &n) {
- mpz_init_set ( (mpz_ptr)&gmp_rep, (mpz_ptr)&(n.gmp_rep)) ;
-}
-
-
-//------------------------------------------operator = (const Integer &n)
-inline Integer& Integer::logcpy(const Integer &n)
-{
- if (this == &n) return *this;
- mpz_set ( (mpz_ptr)&gmp_rep, (mpz_ptr)&(n.gmp_rep)) ;
- return *this;
-}
-
-// same as logcopy
-inline Integer& Integer::operator = (const Integer &n) { return logcpy(n) ; }
-
-//-----------------------------Integer()
-inline Integer::Integer() { mpz_init_set_ui((mpz_ptr)&gmp_rep, 0UL) ; }
-
-//-----------------------------Integer(int n)
-inline Integer::Integer(int n) { mpz_init_set_si((mpz_ptr)&gmp_rep, n) ; }
-
-//-----------------------------Integer(uint n)
-inline Integer::Integer(unsigned int n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ; }
-
-//-----------------------------Integer(long n)
-inline Integer::Integer(long n) { mpz_init_set_si((mpz_ptr)&gmp_rep, n) ; }
-
-//-----------------------------Integer(unsigned long n)
-inline Integer::Integer(unsigned long n) { mpz_init_set_ui((mpz_ptr)&gmp_rep, n) ; }
-
-//-----------------------------Integer(double)
-inline Integer::Integer(double d) { mpz_init_set_d((mpz_ptr)&gmp_rep, d) ; }
-
-
-//-----------------------------Integer(const neutral n), default n = zero
-inline Integer::Integer(const Neutral n) {
- if (n == Neutral::zero) mpz_init_set_ui((mpz_ptr)&gmp_rep, 0L) ;
- else mpz_init_set_ui((mpz_ptr)&gmp_rep, 1L) ;
-}
-
-//-------------------------------------------------inline comparaison operators
-inline int operator != (const Integer& a , const Integer& b)
- { return compare(a,b) != 0; }
-
-inline int operator != (int l, const Integer& n)
- { return n.operator != (l); }
-
-inline int operator != (long l, const Integer& n)
- { return n.operator != (l); }
-
-inline int operator == (const Integer& a, const Integer& b)
- { return compare(a,b) == 0; }
-
-inline int operator == (int l, const Integer& n)
- { return (! (n.operator != (l))); }
-
-inline int operator == (long l, const Integer& n)
- { return (! (n.operator != (l))); }
-
-inline int operator == (const Integer& n, int l)
- { return (! (n.operator != (l))); }
-
-inline int operator == (const Integer& n, long l)
- { return (! (n.operator != (l))); }
-
-inline int operator < (const Integer& a , const Integer& b)
- { return compare(a,b) < 0; }
-
-inline int operator < (const int l, const Integer& n)
- { return n > l; }
-
-inline int operator < (const long l, const Integer& n)
- { return n > l; }
-
-inline int operator > (const Integer& a , const Integer& b)
- { return compare(a,b) > 0; }
-
-inline int operator > (int l, const Integer& n)
- { return n < l; }
-
-inline int operator > (long l, const Integer& n)
- { return n < l; }
-
-inline int operator <= (const Integer& a, const Integer& b)
- { return compare(a,b) <= 0; }
-
-inline int operator <= (const Integer& n, int l)
- { return (! (n > l) ); }
-
-inline int operator <= (const Integer& n, long l)
- { return (! (n > l) ); }
-
-inline int operator <= (int l, const Integer& n)
- { return (! (n < l) );}
-
-inline int operator <= (long l, const Integer& n)
- { return (! (n < l) );}
-
-inline int operator >= (const Integer& a, const Integer& b)
- { return compare(a,b) >= 0; }
-
-inline int operator >= (int l, const Integer& n)
- { return (! (n > l) );}
-
-inline int operator >= (long l, const Integer& n)
- { return (! (n > l) );}
-
-inline int operator >= (const Integer& n, int l)
- { return (! (n < l) );}
-
-inline int operator >= (const Integer& n, long l)
- { return (! (n < l) );}
-
-
-//----------------------------------arithmetic inline operators
-inline Integer Integer::operator - () const
-{
-// JGD 18.06.1999
- Integer Res ;
- mpz_neg((mpz_ptr)&Res.gmp_rep, (mpz_ptr)&gmp_rep );
- return Res ;
-}
-
-// -- operator +
-inline Integer operator + (const int l, const Integer& n) { return n + (long)l; }
-inline Integer operator + (const unsigned int l, const Integer& n) { return n + (unsigned long)l; }
-inline Integer operator + (const long l, const Integer& n) { return n + l; }
-inline Integer operator + (const unsigned long l, const Integer& n) { return n + l; }
-inline Integer operator + (const Integer& n, const int l) { return n + (long)l; }
-inline Integer operator + (const Integer& n, const unsigned int l) { return n + (unsigned long)l; }
-
-inline Integer& operator += (Integer& n, const int l) { return n += (long)l; }
-inline Integer& operator += (Integer& n, const unsigned int l) { return n += (unsigned long)l; }
-
-// -- operator -
-inline Integer operator - (const int l, const Integer& n) { return -(n - (long)l); }
-inline Integer operator - (const unsigned int l, const Integer& n) { return -(n - (unsigned long)l); }
-inline Integer operator - (const long l, const Integer& n) { return -(n - l); }
-inline Integer operator - (const unsigned long l, const Integer& n) { return -(n - l); }
-inline Integer operator - (const Integer& n, const int l) { return n - (long)l; }
-inline Integer operator - (const Integer& n, const unsigned int l) { return n - (unsigned long)l; }
-
-inline Integer& operator -= (Integer& n, const int l) { return n -= (long)l; }
-inline Integer& operator -= (Integer& n, const unsigned int l) { return n -= (unsigned long)l; }
-
-// -- operator *
-inline Integer operator * (const int l, const Integer& n) { return n * (long)l; }
-inline Integer operator * (const unsigned int l, const Integer& n) { return n * (unsigned long)l; }
-inline Integer operator * (const long l, const Integer& n) { return n * l; }
-inline Integer operator * (const unsigned long l, const Integer& n) { return n * l; }
-inline Integer operator * (const Integer& n, const int l) { return n * (long)l; }
-inline Integer operator * (const Integer& n, const unsigned int l) { return n * (unsigned long)l; }
-
-inline Integer& operator *= (Integer& n, const int l) { return n *= (long)l; }
-inline Integer& operator *= (Integer& n, const unsigned int l) { return n *= (unsigned long)l; }
-
-// -- operator /
-inline Integer operator / (const int l, const Integer& n) { return Integer(l)/n; }
-inline Integer operator / (const long l, const Integer& n) { return Integer(l)/n; }
-inline Integer operator / (const Integer& n, const int l) { return n / (long)l; }
-inline Integer operator / (const Integer& n, const unsigned int l) { return n / (unsigned long)l; }
-
-inline Integer& operator /= (Integer& n, const int l) { if (l>=0) return n /= (unsigned long)l; else return n = -(n / (unsigned long)-l); }
-inline Integer& operator /= (Integer& n, const long l) { return n /= (unsigned long)l; }
-inline Integer& operator /= (Integer& n, const unsigned int l) { return n /= (unsigned long)l; }
-
-// -- operator %
-inline Integer operator % (const int l, const Integer& n) { return Integer(l) % n; }
-inline Integer operator % (const long l, const Integer& n) { return Integer(l) % n; }
-inline Integer operator % (const Integer& n, const int l) { return n % (long)l; }
-inline Integer operator % (const Integer& n, const unsigned int l) { return n % (unsigned long)l; }
-
-inline Integer& operator %= (Integer& n, const int l) { return n %= (long)l; }
-inline Integer& operator %= (Integer& n, const unsigned int l) { return n %= (unsigned long)l; }
-
-
-//----------miscellaneous inline functions
-
-inline int Integer::priv_sign() const { return mpz_sgn( (mpz_ptr)&gmp_rep ); }
-
-inline int isone(const Integer& a) { return ! mpz_cmp_ui((mpz_ptr)&(a.gmp_rep), 1UL); }
-
-inline int iszero(const Integer& a) { return ! mpz_cmp_ui((mpz_ptr)&(a.gmp_rep), 0UL); }
-
-inline int iszero(const short int a) { return a ==0; }
-inline int iszero(const int a) { return a ==0; }
-inline int iszero(const long a) { return a ==0; }
-inline int iszero(const unsigned short int a) { return a ==0; }
-inline int iszero(const unsigned int a) { return a ==0; }
-inline int iszero(const unsigned long a) { return a ==0; }
-
-inline int sign(const Integer& a) { return a.priv_sign(); }
-
-inline unsigned long length(const Integer& a) { return mpz_size( (mpz_ptr)&(a.gmp_rep) ) * sizeof(unsigned long); }
-
-inline Integer abs(const Integer &n) { if (sign(n) >= 0) return n; return -n; }
-
-inline size_t Integer::size() const { return mpz_size( (mpz_ptr)&gmp_rep ) ; }
-
-inline unsigned long Integer::operator[](size_t i) const
-{ if ( mpz_size( (mpz_ptr)&gmp_rep ) > i)
- return mpz_getlimbn( (mpz_ptr)&gmp_rep, i);
- else
- return 0;
-}
-
-inline Integer operator <<= (Integer& n, unsigned int l) { return n = n << l; }
-inline Integer operator <<= (Integer& n, unsigned long l) { return n = n << l; }
-inline Integer operator >>= (Integer& n, unsigned int l) { return n = n >> l; }
-inline Integer operator >>= (Integer& n, unsigned long l) { return n = n >> l; }
-
-//-------------------------------------------------inline >> & << operators
-inline ostream& operator<< (ostream& o, const Integer& a) { return a.print(o); }
-
-// =================================================================== //
-// Random generator
-// =================================================================== //
-
-template<class RandIter> inline Integer Integer::random(RandIter& g, int sz = 1)
-{
- Integer res;
- mpz_random((mpz_ptr) &(res.gmp_rep), sz);
- return res;
-}
-
-template<class RandIter> inline Integer Integer::nonzerorandom(RandIter& g, int sz) {
- Integer r;
- while(iszero(r = random(g,sz) )) {};
- return r;
-}
-
-template<class RandIter> inline Integer& Integer::random (RandIter& g, Integer& r, const Integer& similar)
-{
- mpz_random((mpz_ptr) &(r.gmp_rep), mpz_size( (mpz_ptr)&(similar.gmp_rep) ) );
- mpz_tdiv_r( (mpz_ptr)&(r.gmp_rep), (mpz_ptr)&(r.gmp_rep), (mpz_ptr)&(similar.gmp_rep) );
- return r;
-};
-
-template<class RandIter> inline Integer& Integer::nonzerorandom (RandIter& g, Integer& r, const Integer& size) {
- while (iszero(r = random(g,r,size))) {};
- return r;
-}
-
-
-template<class RandIter> inline Integer& Integer::random (RandIter& g, Integer& r, long size = 1)
-{
- mpz_random((mpz_ptr) &(r.gmp_rep), size);
- return r;
-};
-
-
-template<class RandIter> inline Integer& Integer::nonzerorandom (RandIter& g, Integer& r, long size = 1)
-{ while (iszero(r = random(g,r,size))) {};
- return r;
-}
diff --git a/src/kernel/integer/givintfactor.h b/src/kernel/integer/givintfactor.h
index bf13e0b..9c8fac8 100644
--- a/src/kernel/integer/givintfactor.h
+++ b/src/kernel/integer/givintfactor.h
@@ -1,13 +1,18 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Prime numbers
// Factor sets :
// Pollard's rho method for factorization
// Elliptic curves factorization by Lenstra
// Needs Container structures : stl ones for instance
-// Time-stamp: <29 Jun 05 14:12:09 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <29 Jun 05 14:12:09 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_FACTORISATION_H_
-#define _GIVARO_FACTORISATION_H_
+#ifndef __GIVARO_factorisation_H
+#define __GIVARO_factorisation_H
#include <iostream>
#include "givaro/givinteger.h"
@@ -20,121 +25,132 @@
#define factor_second_primes(tmp,n) (tmp = isZero(mod(tmp,n,31))?31:( isZero(mod(tmp,n,29))?29: ( isZero(mod(tmp,n,37))?37: ( isZero(mod(tmp,n,41))?41:( isZero(mod(tmp,n,43))?43: ( isZero(mod(tmp,n,71))?71:( isZero(mod(tmp,n,67))?67:( isZero(mod(tmp,n,61))?61:( isZero(mod(tmp,n,59))?59: ( isZero(mod(tmp,n,53))?53:( isZero(mod(tmp,n,47))?47: ( isZero(mod(tmp,n,97))?97: ( isZero(mod(tmp,n,89))?89:( isZero(mod(tmp,n,83))?83:( isZero(mod(tmp,n,79))?79:73)))))))))))))))
+namespace Givaro {
+
+ // =================================================================== //
+ // Set or Container of divisors, factors.
+ // =================================================================== //
+
+ template<class RandIter = GivRandom>
+ class IntFactorDom : public IntPrimeDom {
+ private:
+ // 2*3*5*7*11*13*17*19*23
+ const int PROD_first_primes;
+ // 29*31*37*41*43*47*53*59*61*67*71*73*79*83*89*97
+ const Rep PROD_second_primes;
+ protected:
+ RandIter _g;
+
+ public:
+ typedef RandIter random_generator;
+
+ IntFactorDom(RandIter g = RandIter()) :
+ IntPrimeDom(),
+ PROD_first_primes(223092870),
+ PROD_second_primes("10334565887047481278774629361"),
+ _g(g)
+ {
+ }
-// =================================================================== //
-// Set or Container of divisors, factors.
-// =================================================================== //
-
-template<class RandIter = GivRandom>
-class IntFactorDom : public IntPrimeDom {
-private:
- // 2*3*5*7*11*13*17*19*23
- const int PROD_first_primes;
- // 29*31*37*41*43*47*53*59*61*67*71*73*79*83*89*97
- const Rep PROD_second_primes;
-protected:
- RandIter _g;
-
-public:
- typedef RandIter random_generator;
-
- IntFactorDom(RandIter g = RandIter()) : IntPrimeDom(),PROD_first_primes(223092870), PROD_second_primes("10334565887047481278774629361"), _g(g) {
-#ifdef __GMP_PLUSPLUS__
- seeding( _g.seed() );
-#endif
- }
-
- // loops defaulted to 0 forces Pollard's factorization to
- // be complete
- Rep& factor(Rep& r, const Rep& n, unsigned long loops = 0) const {
- if (isOne(gcd(r,n,PROD_first_primes)))
- if (isOne(gcd(r,n,PROD_second_primes))) {
+ // loops defaulted to 0 forces Pollard's factorization to
+ // be complete
+ Rep& factor(Rep& r, const Rep& n, unsigned long loops = 0) const
+ {
+ if (isOne(gcd(r,n,PROD_first_primes)))
+ if (isOne(gcd(r,n,PROD_second_primes))) {
#ifdef GIVARO_LENSTRA
- return Lenstra((RandIter&)_g, r, n);
+ return Lenstra((const RandIter&)_g, r, n);
#else
- return Pollard((RandIter&)_g, r, n, loops);
+ return Pollard((const RandIter&)_g, r, n, loops);
#endif
- } else
- return factor_second_primes(r,n);
- else
- return factor_first_primes(r,n);
- }
-
- // Factors are checked for primality
- Rep& iffactorprime (Rep& r, const Rep& n, unsigned long loops = 0) const {
- if (factor(r, n, loops) != 1) {
- if (! isprime(r,_GIVARO_ISPRIMETESTS_) ) {
- Rep nn = r; factor(r,nn, loops);
- }
- while (! isprime(r,_GIVARO_ISPRIMETESTS_) ) {
- Rep nn = r;
- if (isOne(gcd(r,nn,PROD_first_primes))) {
- if (isOne(gcd(r,nn,PROD_second_primes))) {
- Pollard((RandIter&)_g, r, nn, loops);
- } else {
- factor_second_primes(r,nn);
- }
- } else {
- factor_first_primes(r,nn);
+ } else
+ return factor_second_primes(r,n);
+ else
+ return factor_first_primes(r,n);
+ }
+
+ // Factors are checked for primality
+ Rep& iffactorprime (Rep& r, const Rep& n, unsigned long loops = 0) const
+ {
+ if (factor(r, n, loops) != 1) {
+ if (! isprime(r,_GIVARO_ISPRIMETESTS_) ) {
+ Rep nn = r; factor(r,nn, loops);
+ }
+ while (! isprime(r,_GIVARO_ISPRIMETESTS_) ) {
+ Rep nn = r;
+ if (isOne(gcd(r,nn,PROD_first_primes))) {
+ if (isOne(gcd(r,nn,PROD_second_primes))) {
+ Pollard((const RandIter&)_g, r, nn, loops);
+ } else {
+ factor_second_primes(r,nn);
+ }
+ } else {
+ factor_first_primes(r,nn);
+ }
+ if (r == nn) {
+ Lenstra((const RandIter&)_g, r, nn) ;
+ break; // In case Lenstra fails also
+ }
+ }
+ }
+ return r;
}
- if (r == nn) {
- Lenstra((RandIter&)_g, r, nn) ;
- break; // In case Lenstra fails also
+
+ Rep& primefactor(Rep& r, const Rep& n) const {
+ while ((iffactorprime(r,n,0) == 1) && (! isprime(n, _GIVARO_ISPRIMETESTS_)) ) {}
+ return r;
}
- }
- }
- return r;
- }
-
- Rep& primefactor(Rep& r, const Rep& n) const {
- while ((iffactorprime(r,n,0) == 1) && (! isprime(n, _GIVARO_ISPRIMETESTS_)) ) {}
- return r;
- }
-
-
- /// Factors with primes
- // loops defaulted to 0 forces factorization to be complete
- // otherwise returns if factorization is complete or not
- // Factors are checked for primality
- template<class Container1, class Container2> bool set
- ( Container1& setint, Container2& setpwd, const Rep& a, unsigned long loops = 0) const ;
- ///
- template<class Container> void set( Container&, const Rep&) const ;
- ///
- template<class Container> void Erathostene(Container&, const Rep&) const ;
- ///
- template<class Container, class Cont2, class Cont3> Container& divisors(Container& L, const Cont2& Lf, const Cont3& Le) const;
- template<class Container> Container& divisors(Container&, const Rep& ) const ;
-
- /// returns a small factor
- Rep& Erathostene(Rep&, const Rep& p ) const ;
-
- // Pollard with a bound on the number of loops
- // Bound 0 is without bound
- Rep& Pollard(RandIter&, Rep&, const Rep& n, unsigned long threshold = 0) const ;
- // returns a factor by Lenstra's elliptic curves method
- Rep& Lenstra(RandIter&, Rep&, const Rep& n, const Rep& B1 = 10000000, const unsigned long curves = 30) const ;
-
- std::ostream& write(std::ostream& o, const Rep& n) const;
- template<class Array> std::ostream& write(std::ostream& o, Array&, const Rep& n) const;
-
-
-private:
-// Those are parameters for Pollard's algorithms
-// Pollard_fctin : must be somewhat a "random" function in Z/nZ
-// Pollard_cst can be a slight alternative for the Pfct x^2+1
+
+
+ /// Factors with primes
+ // loops defaulted to 0 forces factorization to be complete
+ // otherwise returns if factorization is complete or not
+ // Factors are checked for primality
+ template<class Container1, class Container2> bool set
+ ( Container1& setint, Container2& setpwd, const Rep& a, unsigned long loops = 0) const ;
+ ///
+ template<class Container> void set( Container&, const Rep&) const ;
+ ///
+ template<class Container> void Erathostene(Container&, const Rep&) const ;
+ ///
+ template<class Container, class Cont2, class Cont3> Container& divisors(Container& L, const Cont2& Lf, const Cont3& Le) const;
+ template<class Container> Container& divisors(Container&, const Rep& ) const ;
+
+ /// returns a small factor
+ Rep& Erathostene(Rep&, const Rep& p ) const ;
+
+ // Pollard with a bound on the number of loops
+ // Bound 0 is without bound
+ Rep& Pollard(const RandIter&, Rep&, const Rep& n, unsigned long threshold = 0) const ;
+ // returns a factor by Lenstra's elliptic curves method
+ Rep& Lenstra(const RandIter&, Rep&, const Rep& n, const Rep& B1 = 10000000, const unsigned long curves = 30) const ;
+
+ std::ostream& write(std::ostream& o, const Rep& n) const;
+ template<class Array> std::ostream& write(std::ostream& o, Array&, const Rep& n) const;
+
+
+ private:
+ // Those are parameters for Pollard's algorithms
+ // Pollard_fctin : must be somewhat a "random" function in Z/nZ
+ // Pollard_cst can be a slight alternative for the Pfct x^2+1
#ifndef Pollard_cst
#define Pollard_cst 1
#endif
-
- Rep& Pollard_fctin(Rep & x, const Rep& n) const {
- mulin(x,x);
- addin(x,Pollard_cst);
- return modin(x,n);
- }
-};
+ Rep& Pollard_fctin(Rep & x, const Rep& n) const
+ {
+ mulin(x,x);
+ addin(x,Pollard_cst);
+ return modin(x,n);
+ }
+
+ };
+
+} // Givaro
#include "givaro/givintfactor.inl"
-#endif
+#endif // __GIVARO_factorisation_H
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintfactor.inl b/src/kernel/integer/givintfactor.inl
index a97d441..9edbb6e 100644
--- a/src/kernel/integer/givintfactor.inl
+++ b/src/kernel/integer/givintfactor.inl
@@ -1,540 +1,559 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Prime numbers
// Factors,
// Needs list structures : stl ones for instance
-// Time-stamp: <06 Jun 06 15:03:59 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <06 Jun 06 15:03:59 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_FACTORISATION_INL_
-#define _GIVARO_FACTORISATION_INL_
+#ifndef __GIVARO_factorisation_INL
+#define __GIVARO_factorisation_INL
-#include "givinteger.h"
-#include "givintprime.h"
-#include "givintfactor.h"
+#include "givaro/givinteger.h"
+#include "givaro/givintprime.h"
+#include "givaro/givintfactor.h"
#include <iostream>
#include <vector>
-template<class RandIter>
-std::ostream& IntFactorDom<RandIter>::write(std::ostream& o, const Rep& n) const
-{
- std::vector<Rep> Lf;
- return write(o, Lf, n);
-}
-
-
-template<class RandIter>
-template<class Array>
-std::ostream& IntFactorDom<RandIter>::write(std::ostream& o, Array& Lf, const Rep& n) const
-{
-
-// // n = * Lf[i] ^ Lo[i]
-// // But Lf[i] might not be prime (cf. factor probability)
- Rep nn,g,r,u;
- nn = n;
- long c;
- bool flag = 0;
- Integer tmp;
-
- if (islt(nn,zero)) {
- nn = -n;
- o << "-";
- }
-
- if (isleq(nn,1)) { Lf.push_back(nn); return IntegerDom::write(o,nn); }
-
-
- while( isgt(nn,1) ) {
- primefactor(g,nn);
- if (flag)
- o << " * ";
- else
- flag = 1;
-
- Lf.push_back(g);
- IntegerDom::write(o,g);
- c=0;r=0;
-
- Rep::divexact(u, nn,g);
- for(;isZero(r); ++c) {
- nn.copy(u);
- Rep::divmod( u, r, nn,g );
- }
- if (c>1) o << "^" << c;
- }
- return o;
-}
+namespace Givaro {
+ template<class RandIter>
+ std::ostream& IntFactorDom<RandIter>::write(std::ostream& o, const Rep& n) const
+ {
+ std::vector<Rep> Lf;
+ return write(o, Lf, n);
+ }
-// =================================================================== //
-// Set or Container of divisors, factors.
-// =================================================================== //
-// #ifndef __ECC
-// template<class RandIter>
-// template< template<class> class Container> bool
-// IntFactorDom<RandIter>::set(Container<Rep>& Lf, Container<unsigned long>& Lo, const Rep& n, unsigned long loops) const
-// #else
-template<class RandIter>
-template<class Container1, class Container2> bool
-IntFactorDom<RandIter>::set(Container1& Lf, Container2& Lo, const Rep& n, unsigned long loops) const
-//#endif
-{
- // n = * Lf[i] ^ Lo[i]
- bool factocomplete = true;
- Rep nn,g,r,u;
- if (n<0) Rep::neg(nn,n); else nn=n;
- unsigned long c;
- while(nn > 1) {
- iffactorprime(g,nn,loops);
- if (g == 1) {
- factocomplete = false;
- g = nn;
- }
- Lf.push_back(g);
- c=0;r=zero;
- Rep::divexact(u, nn,g);
- while(r == 0) {
- // nn = nn / g;
- // r = nn % g;
- nn.copy(u);
- Rep::divmod( u, r, nn,g );
- c++;
- }
- Lo.push_back( c );
- }
- return factocomplete;
-}
-
-
-// #ifndef __ECC
-// template<class RandIter>
-// template< template<class> class Container>
-// void IntFactorDom<RandIter>::Erathostene(Container<Rep>& Lf, const Rep& p) const
-// #else
-template<class RandIter>
-template<class Container>
-void IntFactorDom<RandIter>::Erathostene(Container& Lf, const Rep& p) const
-//#endif
-{
- // Deterministic algorithm
- // Valid for p < BOUNDARY_factor
- // Lf is the Container of factors
- long n; access(n,p);
- if (! (n & 0x1)) {
- Lf.push_back(Rep(2));
- do
- n >>= 1;
- while (!(n & 0x1));
- }
- short * IP = new short[n+1];
- int i;
- for(int ii=n+1;ii--;)
- IP[ii] = 0L;
- i=3;
- int j, ii, cofact;
- Rep sq;
- while (i<=sqrt(sq,Rep(n))) {
- ii= i << 1;
- j = i+ii;
- while (j<=n) {
- IP[j] = 1L;
- j+=ii;
- }
- if ((j-ii) == n) {
- Lf.push_back(Rep(i));
- do
- n /= i;
- while (!(n%i));
- }
- j = i+1;
- while (IP[++j]) { j++;}
- i = j;
- }
- if (!(IP[n]) && (n>1)) Lf.push_back(Rep(n));
- delete [] IP;
-}
-
-
-// #ifndef __ECC
-// template<class RandIter>
-// template< template<class> class Container>
-// void IntFactorDom<RandIter>::set( Container<Rep>& Lf, const Rep& n) const
-// #else
-template<class RandIter>
-template<class Container>
-void IntFactorDom<RandIter>::set( Container& Lf, const Rep& n) const
-//#endif
-{
- // big_factor is executed until
- // a (sometimes probably) prime factor is found.
- // Lf is a Container of divisors
- // Lf is a Container of factors with probability -- TO EXPLICIT
- // something like : 1 - (big_factor to be composite)*(big_isprime)
- Rep nn,g,r,u;
- nn = n;
- while(nn > 1) {
- primefactor(g,nn);
- r=0;
- Rep::divexact(u, nn,g);
- while(r == 0) {
- nn.copy(u);
- Rep::divmod( u, r, nn,g );
- }
- // gcc 3.3.3 (Debian 20040422) : internal compiler error !!!
- Lf.push_back(g);
- //Lf.resize(Lf.size()+1);
- //Lf.back() = g;
- }
-}
-
-
-// #ifndef __ECC
-// template<class RandIter>
-// template< template<class> class Container, template<class> class Cont2> Container< typename IntFactorDom<RandIter>::Rep >& IntFactorDom<RandIter>::divisors( Container<Rep>& L, const Cont2<Rep>& Lf, const Cont2<unsigned long>& Le) const
-// {
-// typename Cont2<Rep>::const_iterator li = Lf.begin();
-// typename Cont2<unsigned long>::const_iterator lj = Le.begin();
-// Container<Rep> Res(1,Rep(1));
-// Container<Rep> Res2;
-// typename Container<Rep>::iterator lr;
-// #else
-template<class RandIter>
-template<class Container, class Cont2, class Cont3> Container& IntFactorDom<RandIter>::divisors( Container& L, const Cont2& Lf, const Cont3& Le) const
-{
- typename Cont2::const_iterator li = Lf.begin();
- typename Cont3::const_iterator lj = Le.begin();
- Container Res(1,Rep(1));
- Container Res2;
- typename Container::iterator lr;
-//#endif
- Rep Itmp;
- for(;li!=Lf.end();++li,++lj) {
- for(lr = Res.begin();lr!=Res.end();++lr) {
- Itmp = *lr;
- for(unsigned long i=*lj;i--;) {
- Itmp = Itmp * *li;
- Res2.push_back( Itmp );
+
+ template<class RandIter>
+ template<class Array>
+ std::ostream& IntFactorDom<RandIter>::write(std::ostream& o, Array& Lf, const Rep& n) const
+ {
+
+ // // n = * Lf[i] ^ Lo[i]
+ // // But Lf[i] might not be prime (cf. factor probability)
+ Rep nn,g,r,u;
+ nn = n;
+ long c;
+ bool flag = 0;
+ Integer tmp;
+
+ if (islt(nn,zero)) {
+ nn = -n;
+ o << "-";
+ }
+
+ if (isleq(nn,1)) { Lf.push_back(nn); return IntegerDom::write(o,nn); }
+
+
+ while( isgt(nn,1) ) {
+ primefactor(g,nn);
+ if (flag)
+ o << " * ";
+ else
+ flag = 1;
+
+ Lf.push_back(g);
+ IntegerDom::write(o,g);
+ c=0;r=0;
+
+ Rep::divexact(u, nn,g);
+ for(;isZero(r); ++c) {
+ nn.copy(u);
+ Rep::divmod( u, r, nn,g );
+ }
+ if (c>1) o << "^" << c;
+ }
+ return o;
+ }
+
+
+ // =================================================================== //
+ // Set or Container of divisors, factors.
+ // =================================================================== //
+ // #ifndef __ECC
+ // template<class RandIter>
+ // template< template<class> class Container> bool
+ // IntFactorDom<RandIter>::set(Container<Rep>& Lf, Container<unsigned long>& Lo, const Rep& n, unsigned long loops) const
+ // #else
+ template<class RandIter>
+ template<class Container1, class Container2> bool
+ IntFactorDom<RandIter>::set(Container1& Lf, Container2& Lo, const Rep& n, unsigned long loops) const
+ //#endif
+ {
+ // n = * Lf[i] ^ Lo[i]
+ bool factocomplete = true;
+ Rep nn,g,r,u;
+ if (n<0) Rep::neg(nn,n); else nn=n;
+ unsigned long c;
+ while(nn > 1) {
+ iffactorprime(g,nn,loops);
+ if (g == 1) {
+ factocomplete = false;
+ g = nn;
+ }
+ Lf.push_back(g);
+ c=0;r=zero;
+ Rep::divexact(u, nn,g);
+ while(r == 0) {
+ // nn = nn / g;
+ // r = nn % g;
+ nn.copy(u);
+ Rep::divmod( u, r, nn,g );
+ c++;
+ }
+ Lo.push_back( c );
}
+ return factocomplete;
}
- Res.splice(Res.end(),Res2);
- }
- return L = Res;
-}
-
-
-// #ifndef __ECC
-// template<class RandIter>
-// template< template<class> class Container> Container<typename IntFactorDom<RandIter>::Rep>& IntFactorDom<RandIter>::divisors( Container<Rep>& L, const Rep& n) const
-// {
-// Container<Rep> Lf;
-// Container<unsigned long> Le;
-// #else
+
+
+ // #ifndef __ECC
+ // template<class RandIter>
+ // template< template<class> class Container>
+ // void IntFactorDom<RandIter>::Erathostene(Container<Rep>& Lf, const Rep& p) const
+ // #else
+ template<class RandIter>
+ template<class Container>
+ void IntFactorDom<RandIter>::Erathostene(Container& Lf, const Rep& p) const
+ //#endif
+ {
+ // Deterministic algorithm
+ // Valid for p < BOUNDARY_factor
+ // Lf is the Container of factors
+ long n = (long)p;
+ if (Integer(n) != p) std::cerr << "*** Erathostene with " << p << " too large, using " << n << " instead ***" << std::endl;
+
+
+ if (! (n & 0x1)) {
+ Lf.push_back(Rep(2));
+ do
+ n >>= 1;
+ while (!(n & 0x1));
+ }
+ short * Ip = new short[n+1];
+ int i;
+ for(int ii=n+1;ii--;)
+ Ip[ii] = 0L;
+ i=3;
+ int j, ii;
+ Rep sq;
+ while (i<=sqrt(sq,Rep(n))) {
+ ii= i << 1;
+ j = i+ii;
+ while (j<=n) {
+ Ip[j] = 1L;
+ j+=ii;
+ }
+ if ((j-ii) == n) {
+ Lf.push_back(Rep(i));
+ do
+ n /= i;
+ while (!(n%i));
+ }
+ j = i+1;
+ while (Ip[++j]) { j++;}
+ i = j;
+ }
+ if (!(Ip[n]) && (n>1)) Lf.push_back(Rep(n));
+ delete [] Ip;
+ }
+
+
+ // #ifndef __ECC
+ // template<class RandIter>
+ // template< template<class> class Container>
+ // void IntFactorDom<RandIter>::set( Container<Rep>& Lf, const Rep& n) const
+ // #else
+ template<class RandIter>
+ template<class Container>
+ void IntFactorDom<RandIter>::set( Container& Lf, const Rep& n) const
+ //#endif
+ {
+ // big_factor is executed until
+ // a (sometimes probably) prime factor is found.
+ // Lf is a Container of divisors
+ // Lf is a Container of factors with probability -- TO EXPLICIT
+ // something like : 1 - (big_factor to be composite)*(big_isprime)
+ Rep nn,g,r,u;
+ nn = n;
+ while(nn > 1) {
+ primefactor(g,nn);
+ r=0;
+ Rep::divexact(u, nn,g);
+ while(r == 0) {
+ nn.copy(u);
+ Rep::divmod( u, r, nn,g );
+ }
+ // gcc 3.3.3 (Debian 20040422) : internal compiler error !!!
+ Lf.push_back(g);
+ //Lf.resize(Lf.size()+1);
+ //Lf.back() = g;
+ }
+ }
+
+
+ // #ifndef __ECC
+ // template<class RandIter>
+ // template< template<class> class Container, template<class> class Cont2> Container< typename IntFactorDom<RandIter>::Rep >& IntFactorDom<RandIter>::divisors( Container<Rep>& L, const Cont2<Rep>& Lf, const Cont2<unsigned long>& Le) const
+ // {
+ // typename Cont2<Rep>::const_iterator li = Lf.begin();
+ // typename Cont2<unsigned long>::const_iterator lj = Le.begin();
+ // Container<Rep> Res(1,Rep(1));
+ // Container<Rep> Res2;
+ // typename Container<Rep>::iterator lr;
+ // #else
+ template<class RandIter>
+ template<class Container, class Cont2, class Cont3> Container& IntFactorDom<RandIter>::divisors( Container& L, const Cont2& Lf, const Cont3& Le) const
+ {
+ typename Cont2::const_iterator li = Lf.begin();
+ typename Cont3::const_iterator lj = Le.begin();
+ Container Res(1,Rep(1));
+ Container Res2;
+ typename Container::iterator lr;
+ //#endif
+ Rep Itmp;
+ for(;li!=Lf.end();++li,++lj) {
+ for(lr = Res.begin();lr!=Res.end();++lr) {
+ Itmp = *lr;
+ for(unsigned long i=*lj;i--;) {
+ Itmp = Itmp * *li;
+ Res2.push_back( Itmp );
+ }
+ }
+ Res.splice(Res.end(),Res2);
+ }
+ return L = Res;
+ }
+
+
+ // #ifndef __ECC
+ // template<class RandIter>
+ // template< template<class> class Container> Container<typename IntFactorDom<RandIter>::Rep>& IntFactorDom<RandIter>::divisors( Container<Rep>& L, const Rep& n) const
+ // {
+ // Container<Rep> Lf;
+ // Container<unsigned long> Le;
+ // #else
#include <vector>
-template<class RandIter>
-template<class Container> Container& IntFactorDom<RandIter>::divisors( Container& L, const Rep& n) const
-{
- Container Lf;
- std::vector<unsigned long> Le;
-//#endif
- IntFactorDom<RandIter>::set(Lf,Le,n);
- return divisors(L, Lf, Le);
-}
-
-template<class RandIter>
-typename IntFactorDom<RandIter>::Rep& IntFactorDom<RandIter>::Pollard(RandIter& gen, Rep& g, const Rep& n, const unsigned long threshold) const
-{
- // average number of iterations < 13/8*sqrt( Pi*n/2)
- // Sometimes the factor isn't prime -- TO EXPLICIT
- if (islt(n,3)) return g=n;
- if ( isprime(n, _GIVARO_ISPRIMETESTS_) ) return g=n;
- g=1;
- Rep m(zero), x, y, p(one), t;
- this->random(gen, y, n);
-
- if (threshold) {
- unsigned long c = 0;
- while( this->isOne(g) && (++c < threshold)) {
- if( areEqual(p, addin(m,one)) ) {
- x=y;
- mulin(p,2);
- }
- Pollard_fctin(y,n);
- this->gcd(g,sub(t,y,x),n);
- }
- if ((g == n)&&(c<threshold)) // Failure with the initial value
- Pollard(gen, g, n, threshold-c);
- } else {
- while(this->isOne(g)) {
- if( areEqual(p, addin(m,one)) ) {
- x=y;
- mulin(p,2);
- }
- Pollard_fctin(y,n);
- this->gcd(g,sub(t,y,x),n);
- }
- if (g == n) // Failure with the initial value
- Pollard(gen, g, n, 0);
- }
- return g;
-}
+ template<class RandIter>
+ template<class Container> Container& IntFactorDom<RandIter>::divisors( Container& L, const Rep& n) const
+ {
+ Container Lf;
+ std::vector<unsigned long> Le;
+ //#endif
+ IntFactorDom<RandIter>::set(Lf,Le,n);
+ return divisors(L, Lf, Le);
+ }
+ template<class RandIter>
+ typename IntFactorDom<RandIter>::Rep& IntFactorDom<RandIter>::Pollard(const RandIter& gen, Rep& g, const Rep& n, const unsigned long threshold) const
+ {
+ // average number of iterations < 13/8*sqrt( Pi*n/2)
+ // Sometimes the factor isn't prime -- TO EXPLICIT
+ if (islt(n,3)) return g=n;
+ if ( isprime(n, _GIVARO_ISPRIMETESTS_) ) return g=n;
+ g=1;
+ Rep m(zero), x, y, p(one), t;
+ this->random(gen, y, n);
+
+ if (threshold) {
+ unsigned long c = 0;
+ while( this->isOne(g) && (++c < threshold)) {
+ if( areEqual(p, addin(m,one)) ) {
+ x=y;
+ mulin(p,2);
+ }
+ Pollard_fctin(y,n);
+ this->gcd(g,sub(t,y,x),n);
+ }
+ if ((g == n)&&(c<threshold)) // Failure with the initial value
+ Pollard(gen, g, n, threshold-c);
+ } else {
+ while(this->isOne(g)) {
+ if( areEqual(p, addin(m,one)) ) {
+ x=y;
+ mulin(p,2);
+ }
+ Pollard_fctin(y,n);
+ this->gcd(g,sub(t,y,x),n);
+ }
+ if (g == n) // Failure with the initial value
+ Pollard(gen, g, n, 0);
+ }
+ return g;
+ }
-// =================================================================== //
-// Elliptic curves routines
-// =================================================================== //
-inline void Add_Curve( const Integer& n, const Integer A, const Integer& ax, const Integer& az, Integer& cx, Integer& cz) {
- Integer t1,t2;
-// t1 = ((ax+az)*(ax+az))%n;
-// t2 = ((ax-az)*(ax-az))%n;
- t1 = ax+az;
- t1 *= t1;
- t1 %= n;
- t2 = ax-az;
- t2 *= t2;
- t2 %= n;
- cx = t1*t2;
- cx %= n;
- t1 -= t2;
- cz = A;
- cz *= t1;
- cz += t2;
- cz %= n;
-// cz = ((A*t1+t2) % n);
- cz *= t1;
- cz %= n;
-}
-
-
-inline void one_Mul_Curve( const Integer& n, const Integer A, const Integer& mm, const Integer& nn, const Integer& px, const Integer& pz, Integer& ax, Integer& az) {
- Integer bx, bz, cx, cz, tmpx, tmpz, d, e, t2;
- cx = px;
- cz = pz;
- e = mm;
- d = nn;
- d -= mm;
- if (e<d) {
- Add_Curve(n,A,px,pz,bx,bz);ax = px;az = pz;d -= e;
- } else {
- Add_Curve(n,A,px,pz,ax,az);bx = px;bz = pz;e -= d;
- }
- while (! isZero(e)) {
- if (e<d) {
- tmpx = bx; tmpz = bz;
- bz = ax;
- bz -= az;
- t2 = tmpx;
- t2 += tmpz;
- bz *= t2;
- bz %= n;
-
- t2 = ax;
- t2 += az;
- bx -= tmpz;
- t2 *= bx;
- t2 %= n;
-
- bx = bz;
- bx += t2;
- bx *= bx;
- bx %= n;
- bx *= cz;
- bx %= n;
-
- bz -= t2;
- bz *= bz;
- bz %= n;
- bz *= cx;
- bz %= n;
-
- d -= e;
- } else {
- tmpx = ax; tmpz = az;
- az = tmpx;
- az -= tmpz;
- t2 = bx;
- t2 += bz;
- az *= t2;
- az %= n;
-
- t2 = bx;
- t2 -= bz;
- ax += tmpz;
- t2 *= ax;
- t2 %= n;
-
- ax = az;
- ax += t2;
- ax *= ax;
- ax %= n;
- ax *= cz;
- ax %= n;
-
- az -= t2;
- az *= az;
- az %= n;
- az *= cx;
- az %= n;
-
- e -= d;
- }
- cx = tmpx;
- cz = tmpz;
- }
-}
-
-
-
-
-inline void one_Mul_Curve2( const Integer& n, const Integer A, const Integer& mm, const Integer& nn, const Integer& px, const Integer& pz, Integer& aax, Integer& aaz) {
- Integer ax, az, bx, bz, cx, cz, tmpx, tmpz, d, e, t1, t2,t3,t4;
- cx = px;
- cz = pz;
- e = mm;
- d = nn - mm;
- if (e<d) {
- Add_Curve(n,A,px,pz,bx,bz);ax = px;az = pz;d = d - e;
- } else {
- Add_Curve(n,A,px,pz,ax,az);bx = px;bz = pz;e = e - d;
- }
- while (! isZero(e)) {
- if (e<d) {
- tmpx = bx; tmpz = bz;
- t1 = ((ax-az)*(bx+bz))%n;
- t2 = ((ax+az)*(bx-bz))%n;
-// bx = (cz*(((t1+t2)*(t1+t2))%n))%n;
-// bz = (cx*(((t1-t2)*(t1-t2))%n))%n;
- t3 = t1+t2;
- t4 = t1-t2;
- bx = (cz*(((t3)*(t3))%n))%n;
- bz = (cx*(((t4)*(t4))%n))%n;
- d = d-e;
- } else {
- tmpx = ax; tmpz = az;
- t1 = ((ax-az)*(bx+bz))%n;
- t2 = ((ax+az)*(bx-bz))%n;
- t3 = t1+t2;
- t4 = t1-t2;
-// ax = (cz*(((t1+t2)*(t1+t2))%n))%n;
-// az = (cx*(((t1-t2)*(t1-t2))%n))%n;
- ax = (cz*(((t3)*(t3))%n))%n;
- az = (cx*(((t4)*(t4))%n))%n;
- e = e-d;
- }
- cx = tmpx;
- cz = tmpz;
- }
- aax = ax;
- aaz = az;
-}
-
-
-inline void Mul_Curve( const Integer& n, Integer& Ai, const Integer& mm, const Integer& nn, const Integer& B1, Integer& Xi, Integer& Zi) {
- Integer pow = nn, tXi, tZi;
- tXi = Xi; // Temporaries mandatory -- JGD 24.09.2004
- tZi = Zi; // Temporaries mandatory -- JGD 24.09.2004
- while (pow <= B1) {
- one_Mul_Curve(n,Ai,mm,nn,Xi,Zi,tXi,tZi);
- pow *= nn;
- Xi = tXi;
- Zi = tZi;
- }
-}
-
-// ======================================================================== //
-// Lenstra algorithm for elliptic curves
-// Returns -1 if failure to find factors
-// heuristically exp( sqrt( (2+epsilon)(ln p)(ln ln p) ) ) multiplications
-// to find a factor p of N.
-// TODO : make it generic in regards to DOMAINLIKENESS
-// ======================================================================== //
-template<class RandIter>
-typename IntFactorDom<RandIter>::Rep& IntFactorDom<RandIter>::Lenstra(RandIter& gen, Rep& g, const Rep& n, const Rep& B1, const unsigned long curves) const
-{
- if (n<3) return g=n;
- if ( isprime(n,5) ) return g=n;
- if (isZero(n % 2)) return g=2;
- if (isZero(n % 3)) return g=3;
-
- Rep * A = new Rep[curves]
- , * X = new Rep[curves]
- , * Z = new Rep[curves];
-
- Rep r,a,asq,kg,kgg;
- for (unsigned long c=0; c<curves;++c)
- Z[c] = one;
-
- Rep u,v, four, two;
- assign(two,2UL);
- this->gcd(g,u,v,two,n);
- Rep inv2 = u;
- assign(four,4UL);
- this->gcd(g,u,v,four,n);
- Rep inv4 = u, sixt;
- assign(sixt,16UL);
- this->gcd(g,u,v,sixt,n);
- Rep inv16 = u,inva;
-
-// Initialize # curves
- for (unsigned long i=0;i<curves;++i) {
- a = 0, asq = 0;
- while ((( a*(asq-1UL)*(9UL*asq-1UL) ) % n) == 0L ) {
- this->random(gen,r,n);
-// kg = r*r + 6;
- mul(kg,r,r); addin(kg,6UL);
-// kgg = this->gcd(kg,n);
- this->gcd(kgg,kg,n);
- if (this->isOne(kgg)) {
-// g = this->gcd(kg,n,u,v); if (! this->isOne(g)) { delete [] A, X, Z; return g; }
- this->gcd(g,u,v,kg,n); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
- a = (6UL*r*u)% n;
- asq = (a * a) % n ;
- } else
- return g=kgg;
- }
-// g = this->gcd(a,n,u,v); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
- this->gcd(g,u,v,a,n); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
-// A[i] = ( (8-3*a + (1-6*a*a)*u*u*u )*inv16 ) % n;
- A[i] = ( inv2 + ( (1-3*asq*asq-6*asq) %n )* (u*u*u*inv16 % n) ) % n ;
- X[i] = (3*a*inv4)%n;
- }
-
- // .5*sqrt(5)-.5, 37 digits
-// Rep s("618033988749894848204586834370");
-// Rep si("1000000000000000000000000000000");
-// Rep s("6180339887498948482045868343656381177");
-// Rep si("10000000000000000000000000000000000000");
- Rep s(618033988UL);
- Rep si(1000000000UL);
-
-// Begins search with curves on primes up to B1
- Rep prime = 2, sp, f;
- while (prime <= B1) {
-//std::cerr << "p: " << prime << std::endl;
- sp = (prime*s)/si;
- Mul_Curve(n,A[0],sp,prime,B1,X[0],Z[0]);
- f = Z[0];
- for(unsigned long i=1;i<curves;++i) {
- Mul_Curve(n,A[i],sp,prime,B1,X[i],Z[i]);
- f = (f*Z[i])%n;
- }
-// f = this->gcd(f,n);
- Rep ftm;
- this->gcd(ftm,f,n);
- f = ftm;
- if (this->isOne(f)) {
- nextprime(ftm,prime);
- prime = ftm;
-// prime = nextprime(prime);
- } else {
- delete [] A; delete [] X; delete [] Z;
- return g=f;
- }
- }
-
- std::cerr << "*** Elliptic curves with " << curves << " curves, threshold " << B1 << " failed ***" << std::endl;
- delete [] A; delete [] X; delete [] Z;
- return neg(g,one);
-}
-
-#endif
+ // =================================================================== //
+ // Elliptic curves routines
+ // =================================================================== //
+
+ inline void Add_Curve( const Integer& n, const Integer A, const Integer& ax, const Integer& az, Integer& cx, Integer& cz)
+ {
+ Integer t1,t2;
+ // t1 = ((ax+az)*(ax+az))%n;
+ // t2 = ((ax-az)*(ax-az))%n;
+ t1 = ax+az;
+ t1 *= t1;
+ t1 %= n;
+ t2 = ax-az;
+ t2 *= t2;
+ t2 %= n;
+ cx = t1*t2;
+ cx %= n;
+ t1 -= t2;
+ cz = A;
+ cz *= t1;
+ cz += t2;
+ cz %= n;
+ // cz = ((A*t1+t2) % n);
+ cz *= t1;
+ cz %= n;
+ }
+
+
+ inline void one_Mul_Curve( const Integer& n, const Integer A, const Integer& mm, const Integer& nn, const Integer& px, const Integer& pz, Integer& ax, Integer& az)
+ {
+ Integer bx, bz, cx, cz, tmpx, tmpz, d, e, t2;
+ cx = px;
+ cz = pz;
+ e = mm;
+ d = nn;
+ d -= mm;
+ if (e<d) {
+ Add_Curve(n,A,px,pz,bx,bz);ax = px;az = pz;d -= e;
+ } else {
+ Add_Curve(n,A,px,pz,ax,az);bx = px;bz = pz;e -= d;
+ }
+ while (! isZero(e)) {
+ if (e<d) {
+ tmpx = bx; tmpz = bz;
+ bz = ax;
+ bz -= az;
+ t2 = tmpx;
+ t2 += tmpz;
+ bz *= t2;
+ bz %= n;
+
+ t2 = ax;
+ t2 += az;
+ bx -= tmpz;
+ t2 *= bx;
+ t2 %= n;
+
+ bx = bz;
+ bx += t2;
+ bx *= bx;
+ bx %= n;
+ bx *= cz;
+ bx %= n;
+
+ bz -= t2;
+ bz *= bz;
+ bz %= n;
+ bz *= cx;
+ bz %= n;
+
+ d -= e;
+ } else {
+ tmpx = ax; tmpz = az;
+ az = tmpx;
+ az -= tmpz;
+ t2 = bx;
+ t2 += bz;
+ az *= t2;
+ az %= n;
+
+ t2 = bx;
+ t2 -= bz;
+ ax += tmpz;
+ t2 *= ax;
+ t2 %= n;
+
+ ax = az;
+ ax += t2;
+ ax *= ax;
+ ax %= n;
+ ax *= cz;
+ ax %= n;
+
+ az -= t2;
+ az *= az;
+ az %= n;
+ az *= cx;
+ az %= n;
+
+ e -= d;
+ }
+ cx = tmpx;
+ cz = tmpz;
+ }
+ }
+
+
+
+
+ inline void one_Mul_Curve2( const Integer& n, const Integer A, const Integer& mm, const Integer& nn, const Integer& px, const Integer& pz, Integer& aax, Integer& aaz)
+ {
+ Integer ax, az, bx, bz, cx, cz, tmpx, tmpz, d, e, t1, t2,t3,t4;
+ cx = px;
+ cz = pz;
+ e = mm;
+ d = nn - mm;
+ if (e<d) {
+ Add_Curve(n,A,px,pz,bx,bz);ax = px;az = pz;d = d - e;
+ } else {
+ Add_Curve(n,A,px,pz,ax,az);bx = px;bz = pz;e = e - d;
+ }
+ while (! isZero(e)) {
+ if (e<d) {
+ tmpx = bx; tmpz = bz;
+ t1 = ((ax-az)*(bx+bz))%n;
+ t2 = ((ax+az)*(bx-bz))%n;
+ // bx = (cz*(((t1+t2)*(t1+t2))%n))%n;
+ // bz = (cx*(((t1-t2)*(t1-t2))%n))%n;
+ t3 = t1+t2;
+ t4 = t1-t2;
+ bx = (cz*(((t3)*(t3))%n))%n;
+ bz = (cx*(((t4)*(t4))%n))%n;
+ d = d-e;
+ } else {
+ tmpx = ax; tmpz = az;
+ t1 = ((ax-az)*(bx+bz))%n;
+ t2 = ((ax+az)*(bx-bz))%n;
+ t3 = t1+t2;
+ t4 = t1-t2;
+ // ax = (cz*(((t1+t2)*(t1+t2))%n))%n;
+ // az = (cx*(((t1-t2)*(t1-t2))%n))%n;
+ ax = (cz*(((t3)*(t3))%n))%n;
+ az = (cx*(((t4)*(t4))%n))%n;
+ e = e-d;
+ }
+ cx = tmpx;
+ cz = tmpz;
+ }
+ aax = ax;
+ aaz = az;
+ }
+
+
+ inline void Mul_Curve( const Integer& n, Integer& Ai, const Integer& mm, const Integer& nn, const Integer& B1, Integer& Xi, Integer& Zi)
+ {
+ Integer pow = nn, tXi, tZi;
+ tXi = Xi; // Temporaries mandatory -- JGD 24.09.2004
+ tZi = Zi; // Temporaries mandatory -- JGD 24.09.2004
+ while (pow <= B1) {
+ one_Mul_Curve(n,Ai,mm,nn,Xi,Zi,tXi,tZi);
+ pow *= nn;
+ Xi = tXi;
+ Zi = tZi;
+ }
+ }
+
+ // ======================================================================== //
+ // Lenstra algorithm for elliptic curves
+ // Returns -1 if failure to find factors
+ // heuristically exp( sqrt( (2+epsilon)(ln p)(ln ln p) ) ) multiplications
+ // to find a factor p of N.
+ // TODO : make it generic in regards to DOMAINLIKENESS
+ // ======================================================================== //
+ template<class RandIter>
+ typename IntFactorDom<RandIter>::Rep& IntFactorDom<RandIter>::Lenstra(const RandIter& gen, Rep& g, const Rep& n, const Rep& B1, const unsigned long curves) const
+ {
+ if (n<3) return g=n;
+ if ( isprime(n,5) ) return g=n;
+ if (isZero(n % 2)) return g=2;
+ if (isZero(n % 3)) return g=3;
+
+ Rep * A = new Rep[curves]
+ , * X = new Rep[curves]
+ , * Z = new Rep[curves];
+
+ Rep r,a,asq,kg,kgg;
+ for (unsigned long c=0; c<curves;++c)
+ Z[c] = one;
+
+ Rep u,v, four, two;
+ assign(two,2UL);
+ this->gcd(g,u,v,two,n);
+ Rep inv2 = u;
+ assign(four,4UL);
+ this->gcd(g,u,v,four,n);
+ Rep inv4 = u, sixt;
+ assign(sixt,16UL);
+ this->gcd(g,u,v,sixt,n);
+ Rep inv16 = u,inva;
+
+ // Initialize # curves
+ for (unsigned long i=0;i<curves;++i) {
+ a = 0, asq = 0;
+ while ((( a*(asq-1UL)*(9UL*asq-1UL) ) % n) == 0L ) {
+ this->random(gen,r,n);
+ // kg = r*r + 6;
+ mul(kg,r,r); addin(kg,6UL);
+ // kgg = this->gcd(kg,n);
+ this->gcd(kgg,kg,n);
+ if (this->isOne(kgg)) {
+ // g = this->gcd(kg,n,u,v); if (! this->isOne(g)) { delete [] A, X, Z; return g; }
+ this->gcd(g,u,v,kg,n); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
+ a = (6UL*r*u)% n;
+ asq = (a * a) % n ;
+ } else
+ return g=kgg;
+ }
+ // g = this->gcd(a,n,u,v); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
+ this->gcd(g,u,v,a,n); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
+ // A[i] = ( (8-3*a + (1-6*a*a)*u*u*u )*inv16 ) % n;
+ A[i] = ( inv2 + ( (1-3*asq*asq-6*asq) %n )* (u*u*u*inv16 % n) ) % n ;
+ X[i] = (3*a*inv4)%n;
+ }
+
+ // .5*sqrt(5)-.5, 37 digits
+ // Rep s("618033988749894848204586834370");
+ // Rep si("1000000000000000000000000000000");
+ // Rep s("6180339887498948482045868343656381177");
+ // Rep si("10000000000000000000000000000000000000");
+ Rep s(618033988UL);
+ Rep si(1000000000UL);
+
+ // Begins search with curves on primes up to B1
+ Rep prime = 2, sp, f;
+ while (prime <= B1) {
+ //std::cerr << "p: " << prime << std::endl;
+ sp = (prime*s)/si;
+ Mul_Curve(n,A[0],sp,prime,B1,X[0],Z[0]);
+ f = Z[0];
+ for(unsigned long i=1;i<curves;++i) {
+ Mul_Curve(n,A[i],sp,prime,B1,X[i],Z[i]);
+ f = (f*Z[i])%n;
+ }
+ // f = this->gcd(f,n);
+ Rep ftm;
+ this->gcd(ftm,f,n);
+ f = ftm;
+ if (this->isOne(f)) {
+ nextprime(ftm,prime);
+ prime = ftm;
+ // prime = nextprime(prime);
+ } else {
+ delete [] A; delete [] X; delete [] Z;
+ return g=f;
+ }
+ }
+
+ std::cerr << "*** Elliptic curves with " << curves << " curves, threshold " << B1 << " failed ***" << std::endl;
+ delete [] A; delete [] X; delete [] Z;
+ return neg(g,one);
+ }
+
+} // namespace Givaro {
+
+#endif // __GIVARO_factorisation_INL
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintnumtheo.h b/src/kernel/integer/givintnumtheo.h
index f4fa804..a22ee97 100644
--- a/src/kernel/integer/givintnumtheo.h
+++ b/src/kernel/integer/givintnumtheo.h
@@ -1,12 +1,17 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Euler's phi function
// Primitive roots.
// RSA scheme.
-// Time-stamp: <30 Jun 04 10:59:26 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <30 Jun 04 10:59:26 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_NUMTHEORY_
-#define _GIVARO_NUMTHEORY_
+#ifndef __GIVARO_numtheory_H
+#define __GIVARO_numtheory_H
#include <iostream>
#include "givaro/givinteger.h"
@@ -14,12 +19,13 @@
#include "givaro/givintfactor.h"
#include "givaro/givrandom.h"
+namespace Givaro {
template<class RandIter = GivRandom>
class IntNumTheoDom : public IntFactorDom<RandIter> {
public:
typedef IntFactorDom<RandIter> Father_t;
typedef typename IntFactorDom<RandIter>::Rep Rep;
- IntNumTheoDom(RandIter g = RandIter())
+ IntNumTheoDom(RandIter g = RandIter())
: IntFactorDom<RandIter>(g) {}
// =================================================================== //
// Euler's phi function
@@ -38,14 +44,14 @@ Rep& phi(Rep& r, const Rep& n) const ;
Rep& prim_root_of_prime(Rep&, const Rep&) const ;
template<class Array> Rep& prim_root_of_prime(Rep& A, const Array& Lf, const Rep& phin, const Rep& n) const ;
-// Polynomial-time generation of primitive roots
+// Polynomial-time generation of primitive roots
// L is number of loops of Pollard partial factorization of n-1
// 10,000,000 gives at least 1-2^{-40} probability of success
// [Dubrois & Dumas, Industrial-strength primitive roots]
// Returns the probable primitive root and the probability of error.
Rep& probable_prim_root(Rep&, double&, const Rep& n, const unsigned long L = 10000000) const;
-// Here L is computed so that the error is close to epsilon
+// Here L is computed so that the error is close to epsilon
Rep& probable_prim_root(Rep&, double&, const Rep& n, const double epsilon) const;
Rep& lowest_prim_root(Rep&, const Rep&) const ;
@@ -54,15 +60,15 @@ Rep& phi(Rep& r, const Rep& n) const ;
bool isorder(const Rep&, const Rep&, const Rep&) const ;
// =================================================================== //
-// Generalization of primitive roots for any modulus
-// Primitive means maximal order
-// Primitive Element, Primitive invertible
-// Both functions coïncides except for m=8
-//
-// Lambda Function : maximal orbit size
-// lambda : Order of a primitive Element
-// lambda_inv : Order of an invertible primitive Element
-// Both functions coïncides except for m=8
+// Generalization of primitive roots for any modulus
+// Primitive means maximal order
+// Primitive Element, Primitive invertible
+// Both functions coïncides except for m=8
+//
+// Lambda Function : maximal orbit size
+// lambda : Order of a primitive Element
+// lambda_inv : Order of an invertible primitive Element
+// Both functions coïncides except for m=8
// =================================================================== //
Rep& prim_inv(Rep & , const Rep&) const ;
Rep& prim_elem(Rep & , const Rep&) const ;
@@ -85,7 +91,7 @@ short mobius(const Container<Rep, Alloc<Rep> >& lpow) const ;
short mobius(const Rep& a) const;
};
-
+} // givaro
#include "givaro/givintnumtheo.inl"
-#endif
+#endif // __GIVARO_numtheory_H
diff --git a/src/kernel/integer/givintnumtheo.inl b/src/kernel/integer/givintnumtheo.inl
index 1f22da6..c050da2 100644
--- a/src/kernel/integer/givintnumtheo.inl
+++ b/src/kernel/integer/givintnumtheo.inl
@@ -1,599 +1,636 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Euler's phi function
// Primitive roots.
// Needs list structures : stl ones for instance
-// Time-stamp: <22 Apr 08 18:21:50 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <23 Jun 09 19:26:23 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#include "givintnumtheo.h"
-#include <list>
-#include <vector>
-
-#include "givintrns.h"
-#include "givpower.h"
-
-
-// =================================================================== //
-// Euler's phi function
-// =================================================================== //
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::phi(Rep& res, const Rep& n) const {
- if (isleq(n,1)) return res=n;
- if (isleq(n,3)) return sub(res,n,this->one);
- std::list<Rep> Lf;
- Father_t::set(Lf,n);
- //return phi (res,Lf,n);
- return phi (res,Lf,n);
-}
-
-
-template<class RandIter>
-template< template<class, class> class Container, template<class> class Alloc>
- typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::phi(Rep& res, const Container<Rep, Alloc<Rep> >& Lf, const Rep& n) const {
- if (isleq(n,1)) return res=n;
- if (isleq(n,3)) return sub(res,n,this->one);
- res = n; Rep t,m;
- for(typename Container<Rep, Alloc<Rep> >::const_iterator f=Lf.begin(); f!=Lf.end(); ++f)
- mul(res, divexact(t,res,*f), sub(m, *f, this->one));
- return res;
-}
-// =================================================================== //
-// Möbius function
-// =================================================================== //
-//#ifndef __ECC
-template<class RandIter>
-template< template<class, class> class Container, template <class> class Alloc>
-//short IntNumTheoDom<RandIter>::mobius(const Container<unsigned long, Alloc<unsigned long> >& lpow) const {
-//#else
-//template<class RandIter>
-//template<template <class, class> class Container, template <class> class Alloc>
-short IntNumTheoDom<RandIter>::mobius(const Container<Rep, Alloc<Rep> >& lpow) const {
-//#endif
- if (lpow.size()) {
- short mob = 1;
- for(typename Container<Rep, Alloc<Rep> >::const_iterator i=lpow.begin();i != lpow.end(); ++i) {
- if (*i > 1) {
- return 0;
- } else
- mob = -mob;
- }
- return mob;
- } else
- return 1;
-}
-
-template<class RandIter>
-short IntNumTheoDom<RandIter>::mobius(const Rep& a) const {
- std::list< Rep> lr;
- std::list<unsigned long> lp;
- Father_t::set(lr, lp, a);
- return mobius(lp);
-}
+#ifndef __GIVARO_numtheo_INL
+#define __GIVARO_numtheo_INL
+#include "givaro/givintnumtheo.h"
+#include <list>
+#include <vector>
-// =================================================================== //
-// Primitive Root
-// =================================================================== //
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root(Rep& A, unsigned long& runs, const Rep& n) const {
- // n must be in {2,4,p^m,2p^m} where p is an odd prime
- // else infinite loop
-
- if (isleq(n,4)) return sub(A,n,this->one);
- if (isZero(mod(A,n,4))) return A=this->zero;
- Rep p,ismod2, q, no2, root;
- if (isZero(mod(ismod2,n,2))) divexact(no2,n,2); else no2=n;
- p=no2;
- int k = 1;
- while (! isprime(p) ) {
- sqrt(root, p);
- while (mul(q,root,root) == p) {
- p = root;
- sqrt(root,p);
- }
- if (! isprime(p) ) {
- q=p;
- while( p == q ) factor(p, q);
- divin(q,p);
- if (q < p) p = q;
- }
- }
- if (isZero(ismod2)) mul(q,p,2); else q=p;
- for(;q != n;++k,q*=p);
- Rep phin, tmp;
- phi(phin,p);
- std::list<Rep> Lf;
- Father_t::set(Lf,phin);
- typename std::list<Rep>::iterator f;
- for(f=Lf.begin();f!=Lf.end();++f)
- this->div(*f,phin,*f);
- int found; runs = 0;
- A=2;
- found = ++runs;
- for(f=Lf.begin();(f!=Lf.end() && found);f++)
- found = (! isOne( this->powmod(tmp,A,*f,p)) );
- if (! found) {
- A=3;
- found = ++runs;
- for(f=Lf.begin();(f!=Lf.end() && found);f++)
- found = (! isOne( this->powmod(tmp,A,*f,p)) );
- }
- if (! found) {
- A=5;
- found = ++runs;
- for(f=Lf.begin();(f!=Lf.end() && found);f++)
- found = (! isOne( this->powmod(tmp,A,*f,p)) );
- }
- if (! found) {
- A=6;
- found = ++runs;
- for(f=Lf.begin();(f!=Lf.end() && found);f++)
- found = (! isOne( this->powmod(tmp,A,*f,p)) );
- }
- while (! found) {
- do {
- this->random(this->_g, A, p);
- addin( modin(A,sub(tmp,p,7)) , 7);
- } while ( ! isOne(gcd(tmp,A,p)) );
- found = ++runs;
- for(f=Lf.begin();(f!=Lf.end() && found);f++)
- found = (! isOne( this->powmod(tmp,A,*f,p)) );
- }
- if (k == 1) {
- if (isZero(ismod2) && isZero(mod(ismod2, A, 2)))
- return A+=p;
- else
- return A;
- } else {
- if (! is_prim_root(A,no2))
- A+=p;
- if (isZero(ismod2) && isZero(mod(ismod2, A, 2)))
- return A+=no2;
- else
- return A;
- }
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root(Rep& A, const Rep& n) const { unsigned long runs; return prim_root(A, runs, n); }
-
-/*
-template<class T, template <class, class> class Container, template<class> class Alloc>
-std::ostream& operator<< (std::ostream& o, const Container<T, Alloc<T> >& C) {
- for(typename Container<T, Alloc<T> >::const_iterator refs = C.begin();
- refs != C.end() ;
- ++refs )
- o << (*refs) << " " ;
- return o << std::endl;
-}
-*/
-
-
-// =================================
-// Probable primitive roots
-//
-// Polynomial-time generation of primitive roots
-// L is number of loops of Pollard partial factorization of n-1
-// 10,000,000 gives at least 1-2^{-40} probability of success
-// [Dubrois & Dumas, Industrial-strength primitive roots]
-// Returns the probable primitive root and the probability of error.
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::probable_prim_root(Rep& primroot, double& error, const Rep& p, const unsigned long L) const {
- // std::cerr << "L: " << L << std::endl;
-
-// partial factorisation
- std::vector<Rep> Lq;
- std::vector<unsigned long> e;
- Rep Q, pmun(p); --pmun;
- primroot = 1;
-
- bool complet = Father_t::set(Lq, e, pmun, L);
-// partial factorisation done
-
-//std::cerr << "Lq: " << Lq << std::endl;
-//std::cerr << "e: " << e << std::endl;
-
-
- Rep Temp;
- Rep essai, alea;
-
-
- if (!complet) {
- Q=Lq.back();
- Lq.pop_back();
- this->div(Temp, pmun, Q);
- do {
- nonzerorandom(this->_g, alea, p);
- modin(alea, p);
- this->powmod(essai, alea, Temp, p);
-//std::cerr << alea << " should be of order " << Q << " mod " << p << std::endl;
- } while (essai == 1);
-// looking for alea, of order Q with high probability
-
- mulin(primroot, essai);
-
-// 1-(1+2/(p-1))*(1-1/L^2)^log_B(Q) < 1-(1+2^(-log_2(p)))*(1-1/L^2)^log_B(Q);
- essai = L;
- mul(Temp, essai, L);
- error = 1-1.0/(double)Temp;
- error = power(error, logp(Q,Temp) );
- error *= (1.0+1.0/((double)Q-1.0));
- error = 1-error;
- } else
- error = 0.0;
-
- typename std::vector<Rep>::const_iterator Lqi = Lq.begin();
- typename std::vector<unsigned long>::const_iterator ei = e.begin();
- for ( ; Lqi != Lq.end(); ++Lqi, ++ei) {
- this->div(Temp, pmun, *Lqi);
- do {
- nonzerorandom(this->_g, alea, p);
- modin(alea, p);
- this->powmod(essai, alea, Temp, p);
-//std::cerr << alea << " should be of order at least " << *Lqi << "^" << *ei << "==" << power(*Lqi,*ei) << " mod " << p << std::endl;
- } while( essai == 1 ) ;
-
- // looking for alea with order Lq[i]^e[i]
-
-//std::cerr << alea << " is of order at least " << (*Lqi) << "^" << (*ei) << "==" << power(*Lqi,*ei) << " mod " << p << std::endl;
-
- this->divin(Temp, power(*Lqi,*ei-1));
- mulin(primroot, this->powmod(essai, alea, Temp, p));
- }
-
- modin(primroot, p);
-
- return primroot;
-// return primroot with high probability
-}
+#include "givaro/givintrns.h"
+#include "givaro/givpower.h"
+
+namespace Givaro {
+
+ // =================================================================== //
+ // Euler's phi function
+ // =================================================================== //
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::phi(Rep& res, const Rep& n) const
+ {
+ if (isleq(n,1)) return res=n;
+ if (isleq(n,3)) return sub(res,n,this->one);
+ std::list<Rep> Lf;
+ Father_t::set(Lf,n);
+ //return phi (res,Lf,n);
+ return phi (res,Lf,n);
+ }
+
+
+ template<class RandIter>
+ template< template<class, class> class Container, template<class> class Alloc>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::phi(Rep& res, const Container<Rep, Alloc<Rep> >& Lf, const Rep& n) const
+ {
+ if (isleq(n,1)) return res=n;
+ if (isleq(n,3)) return sub(res,n,this->one);
+ res = n; Rep t,m;
+ for(typename Container<Rep, Alloc<Rep> >::const_iterator f=Lf.begin(); f!=Lf.end(); ++f)
+ mul(res, divexact(t,res,*f), sub(m, *f, this->one));
+ return res;
+ }
+
+ // =================================================================== //
+ // Möbius function
+ // =================================================================== //
+ //#ifndef __ECC
+ template<class RandIter>
+ template< template<class, class> class Container, template <class> class Alloc>
+ //short IntNumTheoDom<RandIter>::mobius(const Container<unsigned long, Alloc<unsigned long> >& lpow) const
+ //#else
+ //template<class RandIter>
+ //template<template <class, class> class Container, template <class> class Alloc>
+ short IntNumTheoDom<RandIter>::mobius(const Container<Rep, Alloc<Rep> >& lpow) const
+ {
+ //#endif
+ if (lpow.size()) {
+ short mob = 1;
+ for(typename Container<Rep, Alloc<Rep> >::const_iterator i=lpow.begin();i != lpow.end(); ++i) {
+ if (*i > 1) {
+ return 0;
+ } else
+ mob = -mob;
+ }
+ return mob;
+ } else
+ return 1;
+ }
+
+ template<class RandIter>
+ short IntNumTheoDom<RandIter>::mobius(const Rep& a) const
+ {
+ std::list< Rep> lr;
+ std::list<unsigned long> lp;
+ Father_t::set(lr, lp, a);
+ return mobius(lp);
+ }
+
+
+ // =================================================================== //
+ // Primitive Root
+ // =================================================================== //
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root(Rep& A, unsigned long& runs, const Rep& n) const
+ {
+ // n must be in {2,4,p^m,2p^m} where p is an odd prime
+ // else infinite loop
+
+ if (isleq(n,4)) return sub(A,n,this->one);
+ if (isZero(mod(A,n,4))) return A=this->zero;
+ Rep p,ismod2, q, no2, root;
+ if (isZero(mod(ismod2,n,2))) divexact(no2,n,2); else no2=n;
+ p=no2;
+ int k = 1;
+ while (! isprime(p) ) {
+ sqrt(root, p);
+ while (mul(q,root,root) == p) {
+ p = root;
+ sqrt(root,p);
+ }
+ if (! isprime(p) ) {
+ q=p;
+ while( p == q ) factor(p, q);
+ divin(q,p);
+ if (q < p) p = q;
+ }
+ }
+ if (isZero(ismod2)) mul(q,p,2); else q=p;
+ for(;q != n;++k,q*=p) ;
+ Rep phin, tmp;
+ phi(phin,p);
+ std::list<Rep> Lf;
+ Father_t::set(Lf,phin);
+ typename std::list<Rep>::iterator f;
+ for(f=Lf.begin();f!=Lf.end();++f)
+ this->div(*f,phin,*f);
+ int found; runs = 0;
+ A=2;
+ found = (int) ++runs;
+ for(f=Lf.begin();(f!=Lf.end() && found);f++)
+ found = (! isOne( this->powmod(tmp,A,*f,p)) );
+ if (! found) {
+ A=3;
+ found = (int) ++runs;
+ for(f=Lf.begin();(f!=Lf.end() && found);f++)
+ found = (! isOne( this->powmod(tmp,A,*f,p)) );
+ }
+ if (! found) {
+ A=5;
+ found = (int) ++runs;
+ for(f=Lf.begin();(f!=Lf.end() && found);f++)
+ found = (! isOne( this->powmod(tmp,A,*f,p)) );
+ }
+ if (! found) {
+ A=6;
+ found = (int) ++runs;
+ for(f=Lf.begin();(f!=Lf.end() && found);f++)
+ found = (! isOne( this->powmod(tmp,A,*f,p)) );
+ }
+ while (! found) {
+ do {
+ this->random(this->_g, A, p);
+ addin( modin(A,sub(tmp,p,7)) , 7);
+ } while ( ! isOne(gcd(tmp,A,p)) );
+ found = (int) ++runs;
+ for(f=Lf.begin();(f!=Lf.end() && found);f++)
+ found = (! isOne( this->powmod(tmp,A,*f,p)) );
+ }
+ if (k == 1) {
+ if (isZero(ismod2) && isZero(mod(ismod2, A, 2)))
+ return A+=p;
+ else
+ return A;
+ } else {
+ if (! is_prim_root(A,no2))
+ A+=p;
+ if (isZero(ismod2) && isZero(mod(ismod2, A, 2)))
+ return A+=no2;
+ else
+ return A;
+ }
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root(Rep& A, const Rep& n) const
+ { unsigned long runs; return prim_root(A, runs, n); }
+
+ /*
+ template<class T, template <class, class> class Container, template<class> class Alloc>
+ std::ostream& operator<< (std::ostream& o, const Container<T, Alloc<T> >& C) {
+ for(typename Container<T, Alloc<T> >::const_iterator refs = C.begin();
+ refs != C.end() ;
+ ++refs )
+ o << (*refs) << " " ;
+ return o << std::endl;
+ }
+ */
+
+
+ // =================================
+ // Probable primitive roots
+ //
+ // Polynomial-time generation of primitive roots
+ // L is number of loops of Pollard partial factorization of n-1
+ // 10,000,000 gives at least 1-2^{-40} probability of success
+ // [Dubrois & Dumas, Industrial-strength primitive roots]
+ // Returns the probable primitive root and the probability of error.
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::probable_prim_root(Rep& primroot, double& error, const Rep& p, const unsigned long L) const
+ {
+ // std::cerr << "L: " << L << std::endl;
+
+ // partial factorisation
+ std::vector<Rep> Lq;
+ std::vector<unsigned long> e;
+ Rep Q, pmun(p); --pmun;
+ primroot = 1;
+
+ bool complet = Father_t::set(Lq, e, pmun, L);
+ // partial factorisation done
+
+ //std::cerr << "Lq: " << Lq << std::endl;
+ //std::cerr << "e: " << e << std::endl;
+
+
+ Rep Temp;
+ Rep essai, alea;
+
+
+ if (!complet) {
+ Q=Lq.back();
+ Lq.pop_back();
+ this->div(Temp, pmun, Q);
+ do {
+ nonzerorandom(this->_g, alea, p);
+ modin(alea, p);
+ this->powmod(essai, alea, Temp, p);
+ //std::cerr << alea << " should be of order " << Q << " mod " << p << std::endl;
+ } while (essai == 1);
+ // looking for alea, of order Q with high probability
+
+ mulin(primroot, essai);
+
+ // 1-(1+2/(p-1))*(1-1/L^2)^log_B(Q) < 1-(1+2^(-log_2(p)))*(1-1/L^2)^log_B(Q);
+ essai = L;
+ mul(Temp, essai, L);
+ error = 1-1.0/(double)Temp;
+ error = power(error, logp(Q,Temp) );
+ error *= (1.0+1.0/((double)Q-1.0));
+ error = 1-error;
+ } else
+ error = 0.0;
+
+ typename std::vector<Rep>::const_iterator Lqi = Lq.begin();
+ typename std::vector<unsigned long>::const_iterator ei = e.begin();
+ for ( ; Lqi != Lq.end(); ++Lqi, ++ei) {
+ this->div(Temp, pmun, *Lqi);
+ do {
+ nonzerorandom(this->_g, alea, p);
+ modin(alea, p);
+ this->powmod(essai, alea, Temp, p);
+ //std::cerr << alea << " should be of order at least " << *Lqi << "^" << *ei << "==" << power(*Lqi,*ei) << " mod " << p << std::endl;
+ } while( essai == 1 ) ;
+
+ // looking for alea with order Lq[i]^e[i]
+
+ //std::cerr << alea << " is of order at least " << (*Lqi) << "^" << (*ei) << "==" << power(*Lqi,*ei) << " mod " << p << std::endl;
+
+ this->divin(Temp, power(*Lqi,*ei-1));
+ mulin(primroot, this->powmod(essai, alea, Temp, p));
+ }
+
+ modin(primroot, p);
+
+ return primroot;
+ // return primroot with high probability
+ }
#ifndef GIVABSDIFF
#define GIVABSDIFF(a,b) ((a)<(b)?((b)-(a)):((a)-(b)))
#endif
#include <math.h>
-// Here L is computed so that the error is close to epsilon
-// Newton-Raphson iteration is used for
-// 1-epsilon = (1+2/(p-1))*(1-1/B)^(ln( (p-1)/2 )/ln(B))
-// see [Dubrois & Dumas]
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::probable_prim_root(Rep& primroot, double& error, const Rep& p, const double epsilon) const {
- unsigned long L;
- double t1, t4, t5, t6, t7, t8, t10, t11, t17, t20, t23, t32(1.0/epsilon), B(1.0);
-
- t1 = (double)p-1.0; // p-1
- t4 = 1.0+2.0/t1; // 1+2/(p-1)
- t7 = log(t1/2.0); // log( (p-1)/2 )
- do {
- B = t32;
- t5 = 1/B; // 1/B
- t6 = 1.0-t5; // 1-1/B
- t8 = log(B); // log(B)
- t10 = t7/t8; // log_B( (p-1)/2 )
- t11 = ::pow(t6,t10); // (1-1/B)^log_B( (p-1)/2 )
- t17 = t8*t8; // log^2(B)
- t20 = log(t6); // log(1-1/B)
- t23 = B*B; // B^2
- // B-F(B)/diff(F(B),B)
- t32 = B-(t4*t11-1.0+epsilon)/t4/t11/(-t7/t17*t5*t20+t10/t23/t6);
- } while( (GIVABSDIFF(t32,B) > 0.5) && (B<1.8e+19) && ((1.0-t4*t11) > epsilon ) );
-// std::cerr << "t32: " << t32 << std::endl;
- if (B<1.8e+19)
- L = (unsigned long)::sqrt(t32);
- else
- L = 0; // TOO small a precision, turning to deterministic process
-
-
- return probable_prim_root(primroot, error, p, L);
-}
-
-
-
-// =================================
-// Specializations for prime numbers
-// =================================
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root_of_prime(Rep& A, const Rep& n) const {
-
- std::vector<Rep> Lf;
- Rep phin; sub(phin,n,this->one);
- Father_t::set(Lf,phin);
- return prim_root_of_prime(A, Lf, phin, n);
-}
-
-
-inline Integer& ppin(Integer& res, const Integer& prime) {
- IntegerDom I;
- Integer tmp;
- while( I.isZero(I.mod(tmp, res, prime)) ) {
- I.divexact(res, tmp = res, prime);
- }
- return res;
-}
-
-
-/// Add Jacobi for quadratic nonresidue
-
-template<class RandIter>
-template<class Array>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root_of_prime(Rep& A, const Array& aLf, const Rep& phin, const Rep& n) const {
-
- Rep tmp, expo, temp;
- A = this->one;
-
- Rep prime(2), Aorder=this->one;
- std::vector<Rep> Lf = aLf, newLf, oldLf;
- newLf.reserve(Lf.size());
- oldLf.reserve(Lf.size());
-
- Rep primeorder;
-
- for(bool exemp = true; exemp; nextprimein(prime) ) {
- A = prime;
- primeorder = phin;
- for(typename Array::const_iterator f = Lf.begin(); f != Lf.end(); ++f) {
- this->powmod(tmp, prime, this->div(expo, primeorder, *f), n);
- if (isOne(tmp)) {
- newLf.push_back(*f);
- while (isZero(mod(tmp,expo,*f)) && isOne( this->powmod(tmp, prime, this->div(temp, expo, *f), n) ) ) { expo = temp; }
- primeorder = expo;
-// std::cerr << "2 Order (Div): " << primeorder << std::endl;
- } else {
- oldLf.push_back(*f);
- exemp = false;
-// std::cerr << "2 Order : " << primeorder << std::endl;
- }
- }
- }
-
- Aorder = primeorder;
- Lf = newLf;
-
- // Now we have A with order > 1, we need to add other primes
-
-// std::cerr << "Prime : 2" << std::endl;
-// std::cerr << "Root : " << A << std::endl;
-// std::cerr << "Order : " << Aorder << std::endl;
-
- for ( ; islt(Aorder,phin); nextprimein(prime) ) {
- newLf.resize(0); oldLf.resize(0);
-
- for(typename Array::const_iterator f = Lf.begin(); f != Lf.end(); ++f) {
- this->powmod(tmp, prime, this->div(expo, phin, *f), n);
- if (isOne(tmp)) {
- newLf.push_back(*f);
- } else {
- oldLf.push_back(*f);
- }
- }
-
- if (oldLf.size() > 0) {
- Rep g = phin;
-
- for(typename Array::const_iterator f = oldLf.begin(); f != oldLf.end(); ++f) {
- ppin(g, *f);
- ppin(Aorder, *f);
- }
-
- this->powmod(tmp, prime, g, n);
-
- modin( mulin(A, tmp), n );
-
- mulin(Aorder, this->div(tmp, phin, g));
-
- Lf = newLf;
- }
-
-// std::cerr << "Prime : " << prime << std::endl;
-// std::cerr << "Root : " << A << std::endl;
-// std::cerr << "Order : " << Aorder << std::endl;
-
- }
-
-
- return A;
-}
-
-
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lowest_prim_root(Rep& A, const Rep& n) const {
- // n must be in {2,4,p^m,2p^m} where p is an odd prime
- // else returns zero
- if (isleq(n,4)) return sub(A,n,this->one);
- if (isZero(mod(A,n,4))) return A=this->zero;
- Rep phin, tmp;
- phi(phin,n);
- std::list<Rep> Lf;
- Father_t::set(Lf,phin);
- typename std::list<Rep>::iterator f;
- for(f=Lf.begin();f!=Lf.end();++f)
- this->div(*f,phin,*f);
- int found=0;
- for(A = 2;(isleq(A,n) && (! found));addin(A,1)) {
- if (isOne(gcd(tmp,A,n))) {
- found = 1;
- for(f=Lf.begin();(f!=Lf.end() && found);f++)
- found = (! isOne( this->powmod(tmp,A,*f,n)) );
- }
- }
- if (isleq(A,n))
- return subin(A,1);
- else
- return A=this->zero;
-}
-
-template<class RandIter>
-bool IntNumTheoDom<RandIter>::is_prim_root(const Rep& p, const Rep& n) const {
- // returns 0 if failed
- bool found=false;
- Rep phin, tmp;
- phi(phin,n);
- std::list<Rep> Lf;
- Father_t::set(Lf,phin);
- typename std::list<Rep>::iterator f=Lf.begin();
- Rep A; mod(A,p,n);
- if (isOne(gcd(tmp,A,n))) {
- found = true;
- for(;(f!=Lf.end() && found);f++) {
-// found = ( this->powmod(A,phin / (*f),n) != 1);
- found = (! isOne( this->powmod(tmp,A, this->div(tmp,phin,*f),n)) );
- }
- }
- return found;
-}
-
-template<class RandIter>
-bool IntNumTheoDom<RandIter>::isorder(const Rep& g, const Rep& p, const Rep& n) const {
- // returns 1 if p is of order g in Z/nZ
- Rep tmp;
- return (isOne( this->powmod(tmp, p, g, n) ) && areEqual( g, order(tmp,p,n) ) );
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::order(Rep& g, const Rep& p, const Rep& n) const {
- // returns 0 if failed
- Rep A; mod(A,p,n);
- if (isZero(A))
- return g = this->zero;
- if (isOne(A))
- return g = this->one;
- bool noprimroot=false;
- Rep phin,gg,tmp;
- phi(phin,n);
- std::list<Rep> Lf;
- Father_t::set(Lf,phin);
- Lf.sort();
- typename std::list<Rep>::iterator f=Lf.begin();
- if (isOne(gcd(tmp,A,n))) {
- noprimroot = false;
- for(;f!=Lf.end();++f)
- if ( (noprimroot = isOne( this->powmod(tmp,A, this->div(g,phin,*f),n)) ) )
- break;
- if (noprimroot) {
- for(;f!=Lf.end();++f)
- while (isZero(mod(tmp,g,*f)) && isOne( this->powmod(tmp,A, this->div(gg,g,*f),n) ) )
- g = gg;
- return g;
- } else
- return g=phin;
- }
- return g=this->zero;
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_inv(Rep& A, const Rep& n) const {
- if (isleq(n,4)) return sub(A,n,this->one);
- if (areEqual(n,8)) return init(A,3);
- return prim_base(A, n);
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_elem(Rep& A, const Rep& n) const {
- if (isleq(n,4)) {
- Rep tmp;
- return this->sub(A,n,this->one);
- }
-
- if (areEqual(n,8)) return init(A,2);
- return prim_base(A, n);
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_base(Rep& A, const Rep& m) const {
- // Prerequisite : m > 4, and m != 8.
- std::vector<Rep> Lp; std::vector<unsigned long> Le;
- Father_t::set(Lp, Le, m);
- unsigned long nbf = Lp.size();
- std::vector<Rep> Pe(nbf);
- std::vector<Rep> Ra(nbf);
-
- typename std::vector<Rep>::const_iterator p=Lp.begin();
- typename std::vector<unsigned long>::const_iterator e=Le.begin() ;
- typename std::vector<Rep>::iterator pe = Pe.begin();
- typename std::vector<Rep>::iterator a = Ra.begin() ;
- for( ;p!=Lp.end();++p, ++e, ++pe, ++a) {
- dom_power( *pe, *p, *e, *this);
- if (areEqual(*p,2))
- init(*a, 3);
- else
- prim_root(*a, *pe);
- }
-
- IntRNSsystem<std::vector, std::allocator > RNs( Pe );
-// IntRNSsystem<typename std::vector >, typename std::allocator > RNs( Pe );
- RNs.RnsToRing( A, Ra );
- return A;
-}
-
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_primpow(Rep & z, const Rep& p, const unsigned long e) const {
- // Prerequisite : p prime.
- if (areEqual(p, 2)) {
- if (e<=3) return init(z,e);
- return dom_power(z, p, e-2, *this);
- } else {
- Rep tmp;
- return mulin( dom_power(z, p, e-1, *this), sub(tmp, p, this->one) );
- }
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_inv_primpow(Rep & z, const Rep& p, const unsigned long e) const {
- // Prerequisite : p prime.
- if (areEqual(p, 2)) {
- if (e<=2) return init(z,e);
- if (e==3) return init(z,2);
- return dom_power(z, p, e-2, *this);
- } else {
- Rep tmp;
- return mulin( dom_power(z, p, e-1, *this), sub(tmp, p, this->one) );
- }
-}
-
-
-
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_inv(Rep & z, const Rep& m) const {
- if (areEqual(m,2)) return init(z,1);
- if (areEqual(m,3) || areEqual(m,4) || areEqual(m,8) ) return init(z,2);
- return lambda_base(z, m);
-}
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda(Rep & z, const Rep& m) const {
- if (areEqual(m,2)) return init(z,1);
- if (areEqual(m,3) || areEqual(m,4)) return init(z,2);
- if (areEqual(m,8) ) return init(z,3);
- return lambda_base(z, m);
-}
-
-
-template<class RandIter>
-typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_base(Rep & z, const Rep& m) const {
- // Prerequisite: m > 4, and m != 8.
- std::vector<Rep> Lp; std::vector<unsigned long> Le;
- Father_t::set(Lp, Le, m);
- unsigned long nbf = Lp.size();
-
- lambda_inv_primpow(z, Lp.front(), Le.front() );
-
- if (nbf == 1) return z;
-
- typename std::vector<Rep>::const_iterator p=Lp.begin();
- typename std::vector<unsigned long>::const_iterator e=Le.begin() ;
- for( ++p, ++e; p != Lp.end(); ++p, ++e) {
- Rep tmp;
- lambda_inv_primpow(tmp, *p, *e);
-// Rep g;
-// gcd(g, z, tmp);
-// mulin(z, this->divin(tmp, g));
- lcmin(z,tmp);
- }
-
- return z;
-}
+ // Here L is computed so that the error is close to epsilon
+ // Newton-Raphson iteration is used for
+ // 1-epsilon = (1+2/(p-1))*(1-1/B)^(ln( (p-1)/2 )/ln(B))
+ // see [Dubrois & Dumas]
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::probable_prim_root(Rep& primroot, double& error, const Rep& p, const double epsilon) const
+ {
+ unsigned long L;
+ double t1, t4, t5, t6, t7, t8, t10, t11, t17, t20, t23, t32(1.0/epsilon), B(1.0);
+
+ t1 = (double)p-1.0; // p-1
+ t4 = 1.0+2.0/t1; // 1+2/(p-1)
+ t7 = log(t1/2.0); // log( (p-1)/2 )
+ do {
+ B = t32;
+ t5 = 1/B; // 1/B
+ t6 = 1.0-t5; // 1-1/B
+ t8 = log(B); // log(B)
+ t10 = t7/t8; // log_B( (p-1)/2 )
+ t11 = ::pow(t6,t10); // (1-1/B)^log_B( (p-1)/2 )
+ t17 = t8*t8; // log^2(B)
+ t20 = log(t6); // log(1-1/B)
+ t23 = B*B; // B^2
+ // B-F(B)/diff(F(B),B)
+ t32 = B-(t4*t11-1.0+epsilon)/t4/t11/(-t7/t17*t5*t20+t10/t23/t6);
+ } while( (GIVABSDIFF(t32,B) > 0.5) && (B<1.8e+19) && ((1.0-t4*t11) > epsilon ) );
+ // std::cerr << "t32: " << t32 << std::endl;
+ if (B<1.8e+19)
+ L = (unsigned long)::sqrt(t32);
+ else
+ L = 0; // TOO small a precision, turning to deterministic process
+
+
+ return probable_prim_root(primroot, error, p, L);
+ }
+
+
+
+ // =================================
+ // Specializations for prime numbers
+ // =================================
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root_of_prime(Rep& A, const Rep& n) const
+ {
+
+ std::vector<Rep> Lf;
+ Rep phin; sub(phin,n,this->one);
+ Father_t::set(Lf,phin);
+ return prim_root_of_prime(A, Lf, phin, n);
+ }
+
+
+ inline Integer& ppin(Integer& res, const Integer& prime) {
+ IntegerDom I;
+ Integer tmp;
+ while( I.isZero(I.mod(tmp, res, prime)) ) {
+ I.divexact(res, tmp = res, prime);
+ }
+ return res;
+ }
+
+
+ /// Add Jacobi for quadratic nonresidue
+
+ template<class RandIter>
+ template<class Array>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_root_of_prime(Rep& A, const Array& aLf, const Rep& phin, const Rep& n) const
+ {
+
+ Rep tmp, expo, temp;
+ A = this->one;
+
+ Rep prime(2), Aorder=this->one;
+ std::vector<Rep> Lf = aLf, newLf, oldLf;
+ newLf.reserve(Lf.size());
+ oldLf.reserve(Lf.size());
+
+ Rep primeorder;
+
+ for(bool exemp = true; exemp; nextprimein(prime) ) {
+ A = prime;
+ primeorder = phin;
+ for(typename Array::const_iterator f = Lf.begin(); f != Lf.end(); ++f) {
+ this->powmod(tmp, prime, this->div(expo, primeorder, *f), n);
+ if (isOne(tmp)) {
+ newLf.push_back(*f);
+ while (isZero(mod(tmp,expo,*f)) && isOne( this->powmod(tmp, prime, this->div(temp, expo, *f), n) ) ) { expo = temp; }
+ primeorder = expo;
+ // std::cerr << "2 Order (Div): " << primeorder << std::endl;
+ } else {
+ oldLf.push_back(*f);
+ exemp = false;
+ // std::cerr << "2 Order : " << primeorder << std::endl;
+ }
+ }
+ }
+
+ Aorder = primeorder;
+ Lf = newLf;
+
+ // Now we have A with order > 1, we need to add other primes
+
+ // std::cerr << "Prime : 2" << std::endl;
+ // std::cerr << "Root : " << A << std::endl;
+ // std::cerr << "Order : " << Aorder << std::endl;
+
+ for ( ; islt(Aorder,phin); nextprimein(prime) ) {
+ newLf.resize(0); oldLf.resize(0);
+
+ for(typename Array::const_iterator f = Lf.begin(); f != Lf.end(); ++f) {
+ this->powmod(tmp, prime, this->div(expo, phin, *f), n);
+ if (isOne(tmp)) {
+ newLf.push_back(*f);
+ } else {
+ oldLf.push_back(*f);
+ }
+ }
+
+ if (oldLf.size() > 0) {
+ Rep g = phin;
+
+ for(typename Array::const_iterator f = oldLf.begin(); f != oldLf.end(); ++f) {
+ ppin(g, *f);
+ ppin(Aorder, *f);
+ }
+
+ this->powmod(tmp, prime, g, n);
+
+ modin( mulin(A, tmp), n );
+
+ mulin(Aorder, this->div(tmp, phin, g));
+
+ Lf = newLf;
+ }
+
+ // std::cerr << "Prime : " << prime << std::endl;
+ // std::cerr << "Root : " << A << std::endl;
+ // std::cerr << "Order : " << Aorder << std::endl;
+
+ }
+
+
+ return A;
+ }
+
+
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lowest_prim_root(Rep& A, const Rep& n) const
+ {
+ // n must be in {2,4,p^m,2p^m} where p is an odd prime
+ // else returns zero
+ if (isleq(n,4)) return sub(A,n,this->one);
+ if (isZero(mod(A,n,4))) return A=this->zero;
+ Rep phin, tmp;
+ phi(phin,n);
+ std::list<Rep> Lf;
+ Father_t::set(Lf,phin);
+ typename std::list<Rep>::iterator f;
+ for(f=Lf.begin();f!=Lf.end();++f)
+ this->div(*f,phin,*f);
+ int found=0;
+ for(A = 2;(isleq(A,n) && (! found));addin(A,1)) {
+ if (isOne(gcd(tmp,A,n))) {
+ found = 1;
+ for(f=Lf.begin();(f!=Lf.end() && found);f++)
+ found = (! isOne( this->powmod(tmp,A,*f,n)) );
+ }
+ }
+ if (isleq(A,n))
+ return subin(A,1);
+ else
+ return A=this->zero;
+ }
+
+ template<class RandIter>
+ bool IntNumTheoDom<RandIter>::is_prim_root(const Rep& p, const Rep& n) const
+ {
+ // returns 0 if failed
+ bool found=false;
+ Rep phin, tmp;
+ phi(phin,n);
+ std::list<Rep> Lf;
+ Father_t::set(Lf,phin);
+ typename std::list<Rep>::iterator f=Lf.begin();
+ Rep A; mod(A,p,n);
+ if (isOne(gcd(tmp,A,n))) {
+ found = true;
+ for(;(f!=Lf.end() && found);f++) {
+ // found = ( this->powmod(A,phin / (*f),n) != 1);
+ found = (! isOne( this->powmod(tmp,A, this->div(tmp,phin,*f),n)) );
+ }
+ }
+ return found;
+ }
+
+ template<class RandIter>
+ bool IntNumTheoDom<RandIter>::isorder(const Rep& g, const Rep& p, const Rep& n) const
+ {
+ // returns 1 if p is of order g in Z/nZ
+ Rep tmp;
+ return (isOne( this->powmod(tmp, p, g, n) ) && areEqual( g, order(tmp,p,n) ) );
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::order(Rep& g, const Rep& p, const Rep& n) const
+ {
+ // returns 0 if failed
+ Rep A; mod(A,p,n);
+ if (isZero(A))
+ return g = this->zero;
+ if (isOne(A))
+ return g = this->one;
+ bool noprimroot=false;
+ Rep phin,gg,tmp;
+ phi(phin,n);
+ std::list<Rep> Lf;
+ Father_t::set(Lf,phin);
+ Lf.sort();
+ typename std::list<Rep>::iterator f=Lf.begin();
+ if (isOne(gcd(tmp,A,n))) {
+ noprimroot = false;
+ for(;f!=Lf.end();++f)
+ if ( (noprimroot = isOne( this->powmod(tmp,A, this->div(g,phin,*f),n)) ) )
+ break;
+ if (noprimroot) {
+ for(;f!=Lf.end();++f)
+ while (isZero(mod(tmp,g,*f)) && isOne( this->powmod(tmp,A, this->div(gg,g,*f),n) ) )
+ g = gg;
+ return g;
+ } else
+ return g=phin;
+ }
+ return g=this->zero;
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_inv(Rep& A, const Rep& n) const
+ {
+ if (isleq(n,4)) return sub(A,n,this->one);
+ if (areEqual(n,8)) return init(A,3);
+ return prim_base(A, n);
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_elem(Rep& A, const Rep& n) const
+ {
+ if (isleq(n,4)) {
+ Rep tmp;
+ return this->sub(A,n,this->one);
+ }
+
+ if (areEqual(n,8)) return init(A,2);
+ return prim_base(A, n);
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::prim_base(Rep& A, const Rep& m) const
+ {
+ // Prerequisite : m > 4, and m != 8.
+ std::vector<Rep> Lp; std::vector<unsigned long> Le;
+ Father_t::set(Lp, Le, m);
+ unsigned long nbf = Lp.size();
+ std::vector<Rep> Pe(nbf);
+ std::vector<Rep> Ra(nbf);
+
+ typename std::vector<Rep>::const_iterator p=Lp.begin();
+ typename std::vector<unsigned long>::const_iterator e=Le.begin() ;
+ typename std::vector<Rep>::iterator pe = Pe.begin();
+ typename std::vector<Rep>::iterator a = Ra.begin() ;
+ for( ;p!=Lp.end();++p, ++e, ++pe, ++a) {
+ dom_power( *pe, *p, *e, *this);
+ if (areEqual(*p,2))
+ init(*a, 3);
+ else
+ prim_root(*a, *pe);
+ }
+
+ IntRNSsystem<std::vector, std::allocator > RNs( Pe );
+ // IntRNSsystem<typename std::vector >, typename std::allocator > RNs( Pe );
+ RNs.RnsToRing( A, Ra );
+ return A;
+ }
+
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_primpow(Rep & z, const Rep& p, const unsigned long e) const
+ {
+ // Prerequisite : p prime.
+ if (areEqual(p, 2)) {
+ if (e<=3) return init(z,e);
+ return dom_power(z, p, e-2, *this);
+ } else {
+ Rep tmp;
+ return mulin( dom_power(z, p, e-1, *this), sub(tmp, p, this->one) );
+ }
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_inv_primpow(Rep & z, const Rep& p, const unsigned long e) const
+ {
+ // Prerequisite : p prime.
+ if (areEqual(p, 2)) {
+ if (e<=2) return init(z,e);
+ if (e==3) return init(z,2);
+ return dom_power(z, p, e-2, *this);
+ } else {
+ Rep tmp;
+ return mulin( dom_power(z, p, e-1, *this), sub(tmp, p, this->one) );
+ }
+ }
+
+
+
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_inv(Rep & z, const Rep& m) const
+ {
+ if (areEqual(m,2)) return init(z,1);
+ if (areEqual(m,3) || areEqual(m,4) || areEqual(m,8) ) return init(z,2);
+ return lambda_base(z, m);
+ }
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda(Rep & z, const Rep& m) const
+ {
+ if (areEqual(m,2)) return init(z,1);
+ if (areEqual(m,3) || areEqual(m,4)) return init(z,2);
+ if (areEqual(m,8) ) return init(z,3);
+ return lambda_base(z, m);
+ }
+
+
+ template<class RandIter>
+ typename IntNumTheoDom<RandIter>::Rep& IntNumTheoDom<RandIter>::lambda_base(Rep & z, const Rep& m) const
+ {
+ // Prerequisite: m > 4, and m != 8.
+ std::vector<Rep> Lp; std::vector<unsigned long> Le;
+ Father_t::set(Lp, Le, m);
+ unsigned long nbf = Lp.size();
+
+ lambda_inv_primpow(z, Lp.front(), Le.front() );
+
+ if (nbf == 1) return z;
+
+ typename std::vector<Rep>::const_iterator p=Lp.begin();
+ typename std::vector<unsigned long>::const_iterator e=Le.begin() ;
+ for( ++p, ++e; p != Lp.end(); ++p, ++e) {
+ Rep tmp;
+ lambda_inv_primpow(tmp, *p, *e);
+ // Rep g;
+ // gcd(g, z, tmp);
+ // mulin(z, this->divin(tmp, g));
+ lcmin(z,tmp);
+ }
+
+ return z;
+ }
+
+} // namespace Givaro {
+#endif // __GIVARO_numtheo_INL
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintprime.C b/src/kernel/integer/givintprime.C
index 4bd9667..4178f25 100644
--- a/src/kernel/integer/givintprime.C
+++ b/src/kernel/integer/givintprime.C
@@ -1,10 +1,15 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Prime numbers
// Modular powering,
// Fermat numbers,
// Primality tests, Factorization one by one :
// (There are parameters to fix)
-// Time-stamp: <06 Jun 06 15:21:09 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <06 Jun 06 15:21:09 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
#include <math.h>
#include "givaro/givintprime.h"
@@ -14,6 +19,8 @@
// Fermat numbers
// =================================================================== //
+namespace Givaro {
+
FermatDom::Rep& FermatDom::fermat(Rep& f, const long n ) const
{
// fermat(n) = 2^(2^n) + 1
@@ -22,7 +29,7 @@ FermatDom::Rep& FermatDom::fermat(Rep& f, const long n ) const
pow(f,z, 1 << n);
return addin(f,one);
}
-
+
int FermatDom::pepin (const long n) const
{
// Fermat number primality test
@@ -40,7 +47,7 @@ int FermatDom::pepin (const long n) const
// =================================================================== //
-// Primality tests
+// Primality tests
// =================================================================== //
IntPrimeDom::Rep& IntPrimeDom::nextprimein(Rep& n, int r) const {
if (isleq( n,1)) return n=2;
@@ -64,13 +71,13 @@ IntPrimeDom::Rep& IntPrimeDom::nextprime(Rep& n, const Rep& p, int r) const {
add(n,p,2);
while (! isprime(n,r) )
addin(n,2);
-
+
return n;
}
IntPrimeDom::Rep& IntPrimeDom::prevprimein(Rep& n, int r) const {
if (isleq( n,2)) return n=2;
- Rep tmp;
+ Rep tmp;
mod(tmp, n, 2UL);
if (isZero(tmp) )
subin(n,1);
@@ -177,7 +184,7 @@ static const unsigned short primes[] =
#endif
-unsigned int IntPrimeDom::isprimepower (Rep& q, const Rep& u) const
+unsigned int IntPrimeDom::isprimepower (Rep& q, const Rep& u) const
{
unsigned long int prime;
unsigned long int n, n2;
@@ -185,7 +192,7 @@ unsigned int IntPrimeDom::isprimepower (Rep& q, const Rep& u) const
unsigned long int rem;
Integer t(u);
int exact;
- int usize = u.size();
+ int usize = int(u.size());
if (usize == 0)
return 1; /* consider 0 a perfect power */
@@ -203,27 +210,27 @@ unsigned int IntPrimeDom::isprimepower (Rep& q, const Rep& u) const
if (n2 >0) {
if (t == 1) {
q = 2;
- return n2;
+ return (unsigned int) (n2);
} else {
return 0;
}
}
-
-
+
+
Integer u2;
-
+
for (i = 1; primes[i] != 0; i++)
{
u2 = u;
prime = primes[i];
-
+
rem = u2 % prime;
if (rem == 0) /* divisable by this prime? */
{
Integer::divmod(q,rem,u2,prime * prime);
if (rem != 0)
return 0; /* prime divides exactly once, reject */
-
+
swap (q, u2);
for (n = 2;;++n)
{
@@ -232,35 +239,37 @@ unsigned int IntPrimeDom::isprimepower (Rep& q, const Rep& u) const
break;
swap (q, u2);
}
-
+
if ((n & 1) == 0 && usize < 0)
return 0; /* even multiplicity with negative U, reject */
-
+
if (n > 0) {
if (GIVABS(u2) == 1) {
q = Integer(prime);
- return n;
+ return (unsigned int) (n);
} else {
return 0;
}
}
}
}
-
+
/* We found no factors above; have to check all values of n. */
unsigned long int nth;
for (nth = (usize < 0 ? 3 : 2);; ++nth)
{
if (! isprime (nth))
continue;
- exact = root (q, u2, nth);
+ exact = root (q, u2, (unsigned int)nth);
if (exact) {
if (isprime(q))
- return nth;
- else
+ return (unsigned int)nth;
+ else
return 0;
}
if (GIVABS(q) < SMALLEST_OMITTED_PRIME)
return 0;
}
}
+
+} // Givaro
diff --git a/src/kernel/integer/givintprime.h b/src/kernel/integer/givintprime.h
index 3e8d3c0..501ad83 100644
--- a/src/kernel/integer/givintprime.h
+++ b/src/kernel/integer/givintprime.h
@@ -1,13 +1,18 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Prime numbers
// Modular powering,
// Fermat numbers,
// Primality tests, Factorization :
// (There are parameters to fix)
-// Time-stamp: <06 Jun 06 14:48:16 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <06 Jun 06 14:48:16 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_INTEGERS_PRIME_H_
-#define _GIVARO_INTEGERS_PRIME_H_
+#ifndef __GIVARO_integers_prime_H
+#define __GIVARO_integers_prime_H
#ifndef _GIVARO_ISPRIMETESTS_
#define _GIVARO_ISPRIMETESTS_ 5
@@ -15,95 +20,103 @@
#include "givaro/givinteger.h"
+namespace Givaro {
-// =================================================================== //
-// Fermat numbers
-// =================================================================== //
-class FermatDom : public IntegerDom {
-public:
- FermatDom() : IntegerDom() {}
- Rep& fermat (Rep&, const long) const ;
- int pepin (const long) const ;
-};
+ // =================================================================== //
+ // Fermat numbers
+ // =================================================================== //
+ class FermatDom : public IntegerDom {
+ public:
+ FermatDom() : IntegerDom() {}
+ Rep& fermat (Rep&, const long) const ;
+ int pepin (const long) const ;
+ };
-// =================================================================== //
-// Primality tests and factorization algorithms
-// =================================================================== //
+ // =================================================================== //
+ // Primality tests and factorization algorithms
+ // =================================================================== //
-// Those macros are parameters to fix
+ // Those macros are parameters to fix
-// primes known
-// first array
+ // primes known
+ // first array
#define LOGMAX 3512
#define TABMAX 32768
-// second array
+ // second array
#define LOGMAX2 3031
#define TABMAX2 65536
-// Bounds between big and small
-#define BOUNDARY_isprime TABMAX
-#define BOUNDARY_2_isprime TABMAX2
-
-// =================================================================== //
-// Primality tests
-// =================================================================== //
-class IntPrimeDom : public IntegerDom {
-public:
- IntPrimeDom() : IntegerDom() {}
-
- int isprime(const Rep& n, int r=_GIVARO_ISPRIMETESTS_) const
- {
-/*
- return probab_prime(n);
-*/
-// return ((n)<BOUNDARY_isprime ? isprime_Tabule(n) :
-// (n)<BOUNDARY_2_isprime ? isprime_Tabule2(n) :
-// probab_prime(n));
- long l;
- return (islt(n,BOUNDARY_isprime) ? isprime_Tabule(convert(l,n)):
- islt(n,BOUNDARY_2_isprime) ? isprime_Tabule2(convert(l,n)):
- local_prime(n,r));
- }
-
- // if p is a prime power, p = r^return
- // else return is 0 and r is undefined
- unsigned int isprimepower(Rep&, const Rep&) const ;
-
- template<class RandIter>
- unsigned int Miller(RandIter& g, const Rep& n=_GIVARO_ISPRIMETESTS_) const ;
-
- template<class RandIter>
- Rep& test_Lehmann(RandIter& g, Rep&, const Rep& n=_GIVARO_ISPRIMETESTS_) const ;
-
- template<class RandIter>
- int Lehmann(RandIter& g, const Rep& n=_GIVARO_ISPRIMETESTS_) const ;
-
- int isprime_Tabule(const int n) const ;
- int isprime_Tabule2(const int n) const ;
-
- Rep& nextprime(Rep&, const Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
- Rep& prevprime(Rep&, const Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
- Rep& nextprimein(Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
- Rep& prevprimein(Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
-
-
-// Using Integer
- int local_prime(const Rep& n, int r=_GIVARO_ISPRIMETESTS_) const { return probab_prime(n,r); }
-
-private:
- static int IP[LOGMAX+5]; // -- table for Tabule
- static const int * TP; // -- shifted table
- static int IP2[LOGMAX2+5]; // -- table for Tabule2
- static const int * TP2; // -- shifted table
-/*
- static int Tabule2(const Integer& p) ;
- static int Tabule(const Integer& p) ;
- static int _memTab2[LOGMAX2+5]; // -- table for Tabule2
- static const int* _Tab2; // -- shifted _memTabule2
- static int _memTab[]; // -- table for Tabule
- static const int* _Tab; // -- shifted _memTabule
-*/
-};
+ // Bounds between big and small
+#define BOUNDARY_isprime TABMAX
+#define BOUNDARY_2_isprime TABMAX2
+
+ // =================================================================== //
+ // Primality tests
+ // =================================================================== //
+ class IntPrimeDom : public IntegerDom {
+ public:
+ IntPrimeDom() : IntegerDom() {}
+
+ int isprime(const Rep& n, int r=_GIVARO_ISPRIMETESTS_) const
+ {
+ /*
+ return probab_prime(n);
+ */
+ // return ((n)<BOUNDARY_isprime ? isprime_Tabule(n) :
+ // (n)<BOUNDARY_2_isprime ? isprime_Tabule2(n) :
+ // probab_prime(n));
+ long l;
+ return int (int(islt(n,BOUNDARY_isprime) ? isprime_Tabule((int)convert(l,n)):
+ islt(n,BOUNDARY_2_isprime) ? isprime_Tabule2((int)convert(l,n)):
+ local_prime(n,r)));
+ }
+
+ // if p is a prime power, p = r^return
+ // else return is 0 and r is undefined
+ unsigned int isprimepower(Rep&, const Rep&) const ;
+
+ template<class RandIter>
+ unsigned int Miller(RandIter& g, const Rep& n=_GIVARO_ISPRIMETESTS_) const ;
+
+ template<class RandIter>
+ Rep& test_Lehmann(RandIter& g, Rep&, const Rep& n=_GIVARO_ISPRIMETESTS_) const ;
+
+ template<class RandIter>
+ int Lehmann(RandIter& g, const Rep& n=_GIVARO_ISPRIMETESTS_) const ;
+
+ int isprime_Tabule(const int n) const ;
+ int isprime_Tabule2(const int n) const ;
+
+ Rep& nextprime(Rep&, const Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
+ Rep& prevprime(Rep&, const Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
+ Rep& nextprimein(Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
+ Rep& prevprimein(Rep&, int r=_GIVARO_ISPRIMETESTS_) const ;
+
+
+ // Using Integer
+ int local_prime(const Rep& n, int r=_GIVARO_ISPRIMETESTS_) const
+ {
+ return probab_prime(n,r);
+ }
+
+ private:
+ static int IP[LOGMAX+5]; // -- table for Tabule
+ static const int * TP; // -- shifted table
+ static int IP2[LOGMAX2+5]; // -- table for Tabule2
+ static const int * TP2; // -- shifted table
+#if 0
+ static int Tabule2(const Integer& p) ;
+ static int Tabule(const Integer& p) ;
+ static int _memTab2[LOGMAX2+5]; // -- table for Tabule2
+ static const int* _Tab2; // -- shifted _memTabule2
+ static int _memTab[]; // -- table for Tabule
+ static const int* _Tab; // -- shifted _memTabule
+#endif
+ };
+} // Givaro
#include "givaro/givintprime.inl"
-#endif
+#endif // __GIVARO_integers_prime_H
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintprime.inl b/src/kernel/integer/givintprime.inl
index f1deed7..e57fd78 100644
--- a/src/kernel/integer/givintprime.inl
+++ b/src/kernel/integer/givintprime.inl
@@ -1,10 +1,15 @@
-#ifndef __GIVARO__PRIMALITY_INL
-#define __GIVARO__PRIMALITY_INL
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Prime numbers
// Primality tests
-// Time-stamp: <29 Jun 05 14:11:07 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <29 Jun 05 14:11:07 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
+#ifndef __GIVARO_primality_INL
+#define __GIVARO_primality_INL
#include <math.h>
#include "givaro/givintprime.h"
@@ -13,8 +18,11 @@
// =================================================================== //
// =================================================================== //
-// Primality tests
+// Primality tests
// =================================================================== //
+
+namespace Givaro {
+
template<class RandIter> unsigned int IntPrimeDom::Miller(RandIter& g, const Integer& n) const
{
// Monte Carlo algorithm
@@ -36,7 +44,7 @@ template<class RandIter> unsigned int IntPrimeDom::Miller(RandIter& g, const Int
return 0;
}
-
+
template<class RandIter>
IntPrimeDom::Rep& IntPrimeDom::test_Lehmann(RandIter& g, Rep& r, const Rep& n) const {
// Monte Carlo algorithm
@@ -49,7 +57,7 @@ IntPrimeDom::Rep& IntPrimeDom::test_Lehmann(RandIter& g, Rep& r, const Rep& n) c
}
template<class RandIter>
-int IntPrimeDom::Lehmann(RandIter& g, const Rep& n) const
+int IntPrimeDom::Lehmann(RandIter& g, const Rep& n) const
{
if (n < 2) return 0;
if (n <= 3) return 1;
@@ -59,4 +67,6 @@ int IntPrimeDom::Lehmann(RandIter& g, const Rep& n) const
return 1;
return 0;
}
-#endif
+
+} // Givaro
+#endif // __GIVARO_primality_INL
diff --git a/src/kernel/integer/givintrns.h b/src/kernel/integer/givintrns.h
index 364c021..8f8377d 100644
--- a/src/kernel/integer/givintrns.h
+++ b/src/kernel/integer/givintrns.h
@@ -1,22 +1,26 @@
-#ifndef _ARITHMODU_INTRNS_H
-#define _ARITHMODU_INTRNS_H
// ==========================================================================
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// Time-stamp: <08 Feb 02 16:33:39 Jean-Guillaume.Dumas at imag.fr>
// ==========================================================================
// Description:
// Modular arithmetic for GIVARO. Here is defined arithmetic functions
// on rns representation with Givaro Integers.
+#ifndef __GIVARO__arithmodu_intrns_H
+#define __GIVARO__arithmodu_intrns_H
#include "givaro/givconfig.h"
#include "givaro/givinteger.h"
- // --------------------------------------------- class RNSsystem
- // Structure which manages list of primes in order to do
+// --------------------------------------------- class RNSsystem
+// Structure which manages list of primes in order to do
-//#ifndef __ECC
+namespace Givaro {
+// #ifndef __ECC
template< template<class, class> class Container, template <class> class Alloc>
class IntRNSsystem : public IntegerDom {
public:
@@ -24,46 +28,46 @@ public:
// typedef Element Modulo;
typedef Element external;
typedef Container< Element, Alloc<Element> > array;
-
- // Default Cstor, Dstor/Cstor of recopy:
+
+ // Default Cstor, Dstor/Cstor of recopy:
// -- free memory allocated in array !
IntRNSsystem() : _primes(0), _prod(one), _ck(0) {}
- ~IntRNSsystem(){}
+ ~IntRNSsystem(){}
IntRNSsystem(const IntRNSsystem& R) : _primes(R._primes), _prod(R._prod), _ck(R._primes) {}
-
- // -- Cstor with given primes
+
+ // -- Cstor with given primes
IntRNSsystem( const array& primes );
template<class TT>
IntRNSsystem( const Container< TT, Alloc<TT> > & primes );
// -- Computation of a mixed-radix representation of the residus.
-// void RnsToMixedRadix(array& mixrad, const array& residu) const;
+// void RnsToMixedRadix(array& mixrad, const array& residu) const;
template<class TT>
- void RnsToMixedRadix(array& mixrad, const Container<TT, Alloc<TT> >& residu) const;
+ void RnsToMixedRadix(array& mixrad, const Container<TT, Alloc<TT> >& residu) ;
// -- Convert a mixed radix representation to an external
void MixedRadixToRing( external& res, const array& mixrad ) const;
// -- Convert an Ring Element to a its representation
// with the "this" rns system.
- void RingToRns( array& residu, const external& a ) const;
+ void RingToRns( array& residu, const external& a ) ;
// -- Fast conversion: requires pre-computation (first time it was called)
void fastRingToRns( array& residu, const external& a ) const;
// -- Convert a representation to an external Element
template<class TT>
- void RnsToRing( external& a, const Container<TT, Alloc<TT> >& residu ) const;
+ void RnsToRing( external& a, const Container<TT, Alloc<TT> >& residu ) ;
// -- Fast conversion: requires pre-computation (first time it was called)
void fastRnsToRing( external& a, const array& residu ) const;
// ------------- Access methods
-
+
// -- Returns the number of primes of this ctxt
- int NumOfPrimes() const { return _primes.size(); }
+ int NumOfPrimes() const { return _primes.size(); }
// -- Returns a array to the begin of the array of primes
const array& Primes() const;
@@ -87,7 +91,7 @@ protected:
array _primes; // - array of the relatively primes numbers
Element _prod; // - product of primes
- array _ck; // - reciprocals, _ck[0] = 1, same size as _primes
+ array _ck; // - reciprocals, _ck[0] = 1, same size as _primes
// -- for fast conversion
size_t _sizek;
@@ -95,6 +99,9 @@ protected:
array _qk; // - cf algo Aho, Hopcroft & Ullman
array _u; // - cf algo Aho, Hopcroft & Ullman
};
+// #endif
+
+#if 0 // defined(__ECC)
//#else
/* template<class Container> */
/* class IntRNSsystem : public IntegerDom { */
@@ -103,7 +110,7 @@ protected:
/* // typedef Element Modulo; */
/* typedef Element external; */
/* typedef Container array; */
-
+
/* // Default Cstor, Dstor/Cstor of recopy: */
/* // -- free memory allocated in array ! */
@@ -140,7 +147,7 @@ protected:
/* void fastRnsToRing( external& a, const array& residu ) const; */
/* // ------------- Access methods */
-
+
/* // -- Returns the number of primes of this ctxt */
/* int NumOfPrimes() const { return _primes.size(); } */
@@ -175,9 +182,10 @@ protected:
/* array _u; // - cf algo Aho, Hopcroft & Ullman */
/* }; */
/* #endif */
+#endif
-
+} // Givaro
#include "givaro/givintrns_cstor.inl"
#include "givaro/givintrns_convert.inl"
-#endif
+#endif // __GIVARO__arithmodu_intrns_H
diff --git a/src/kernel/integer/givintrns_convert.inl b/src/kernel/integer/givintrns_convert.inl
index 740dac7..34f101c 100644
--- a/src/kernel/integer/givintrns_convert.inl
+++ b/src/kernel/integer/givintrns_convert.inl
@@ -1,97 +1,112 @@
- // -- Computation of a mixed-radix representation of the residu.
-//#ifndef __ECC
-template<template<class, class> class Container, template <class> class Alloc>
-template<class TT>
-inline void IntRNSsystem< Container, Alloc >::RnsToMixedRadix
- (IntRNSsystem< Container, Alloc >::array& mixrad, const Container<TT, Alloc<TT> >& residu) const
-//#else
-//template<class Container> template<class ContTT>
-//inline void IntRNSsystem< Container >::RnsToMixedRadix
-// (IntRNSsystem< Container >::array& mixrad, const ContTT& residu) const
-//#endif
-{
- size_t size = _primes.size();
- if (mixrad.size() < size) mixrad.resize( size );
-
- // -- Computation of Ck
- if (_ck.size()==0) ((IntRNSsystem*)this)->ComputeCk();
-
- // -- size-1 steps
- Element tmp;
- mixrad[0] = residu[0];
- for (unsigned long i=1; i < size; i++)
- { // - computes pp_i = r_0 + r_1*p_0 + ... + r_{i-1} \prod_{j<i-2} p_j [p_i]
- // Horner scheme
- tmp = mixrad[i-1];
-// JGD 16.04.2003, Si i==1 !!!!!!!
- for (long j= i-2; j>=0; --j) {
-// std::cerr << tmp << " * " << _primes[j] << " + " << mixrad[j] << " mod " << _primes[i] << " = ";
- modin( addin( mulin(tmp, _primes[j]), mixrad[j]), _primes[i]);
-// std::cerr << tmp << ";#Horner scheme" << std::endl;
- }
- // - m_i = (r_i - pp_i)*ck_i, ck is reciprocals
-// std::cerr << "(" << residu[i] << " - " << tmp << ") * " << _ck[i] << " mod " << _primes[i] << " = ";
- mod(mixrad[i],mulin(sub(tmp, residu[i], tmp),_ck[i]) , _primes[i] );
-// std::cerr << mixrad[i] << ";#mixrad" << std::endl;
- }
-
-}
-
-
-
- // -- Convert a mixed radix representation to an Integer
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline void IntRNSsystem< Container, Alloc >::MixedRadixToRing( Element& res, const IntRNSsystem< Container, Alloc >::array& mixrad ) const
-{
- size_t size = _primes.size();
-// if (size != mixrad.size()) throw GivError("[IntRNSsystem::MixedRadixToRing]: bad size of input array");
- res = mixrad[size-1];
- for (int i=size-2; i>=0; --i) {
- addin( mulin(res, _primes[i]), mixrad[i]);
-// res *= _primes[i];
-// res += mixrad[i];
- }
-}
-
-
- // Convert an integer to a RNS representation (which is given by this)
-//#ifndef __ECC
-template<template<class,class> class Container,template<class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline void IntRNSsystem< Container, Alloc >::RingToRns( IntRNSsystem< Container, Alloc >::array& rns , const external& a) const
-{
- size_t size = _primes.size();
- if (rns.size() != size) rns.resize(size);
- // -- may be faster using the recursive
- // tree algorithm a mod p_1...p_k/2, and a mod p_k/2+1...p_k
- for (int i=0; i<size; i++)
- mod( rns[i], a, _primes[i]);
-// rns[i] = mod(a, _primes[i]);
-}
-
- // Convert to an Integer:
-//#ifndef __ECC
-template<template<class, class> class Container, template <class> class Alloc>
-template<class TT>
-inline void IntRNSsystem< Container, Alloc >::RnsToRing( external& I, const Container<TT, Alloc<TT> >& rns) const
-//#else
-//template<class Container> template<class ContTT>
-//inline void IntRNSsystem< Container >::RnsToRing( external& I, const ContTT& rns) const
-//#endif
-{
- // - Computation of a mixed radix representation of this
-
- typename IntRNSsystem< Container, Alloc >::array mixrad(_primes.size());
- RnsToMixedRadix( mixrad , rns );
-
- // - Convert mixrad to an integer
- MixedRadixToRing( I, mixrad ) ;
- return;
-}
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+#ifndef __GIVARO_intrns_convert_INL
+#define __GIVARO_intrns_convert_INL
+
+namespace Givaro {
+
+ // -- Computation of a mixed-radix representation of the residu.
+ //#ifndef __ECC
+ template<template<class, class> class Container, template <class> class Alloc>
+ template<class TT>
+ inline void IntRNSsystem< Container, Alloc >::RnsToMixedRadix
+ (IntRNSsystem< Container, Alloc >::array& mixrad, const Container<TT, Alloc<TT> >& residu)
+ //#else
+ //template<class Container> template<class ContTT>
+ //inline void IntRNSsystem< Container >::RnsToMixedRadix
+ // (IntRNSsystem< Container >::array& mixrad, const ContTT& residu) const
+ //#endif
+ {
+ size_t size = _primes.size();
+ if (mixrad.size() < size) mixrad.resize( size );
+
+ // -- Computation of Ck
+ if (_ck.size()==0) ((IntRNSsystem*)this)->ComputeCk();
+
+ // -- size-1 steps
+ Element tmp;
+ mixrad[0] = residu[0];
+ for (unsigned long i=1; i < size; i++)
+ { // - computes pp_i = r_0 + r_1*p_0 + ... + r_{i-1} \prod_{j<i-2} p_j [p_i]
+ // Horner scheme
+ tmp = mixrad[i-1];
+ // JGD 16.04.2003, Si i==1 !!!!!!!
+ for (long j= i-1; j--; ) {
+ // std::cerr << tmp << " * " << _primes[j] << " + " << mixrad[j] << " mod " << _primes[i] << " = ";
+ modin( addin( mulin(tmp, _primes[j]), mixrad[j]), _primes[i]);
+ // std::cerr << tmp << ";#Horner scheme" << std::endl;
+ }
+ // - m_i = (r_i - pp_i)*ck_i, ck is reciprocals
+ // std::cerr << "(" << residu[i] << " - " << tmp << ") * " << _ck[i] << " mod " << _primes[i] << " = ";
+ mod(mixrad[i],mulin(sub(tmp, residu[i], tmp),_ck[i]) , _primes[i] );
+ // std::cerr << mixrad[i] << ";#mixrad" << std::endl;
+ }
+
+ }
+
+
+
+ // -- Convert a mixed radix representation to an Integer
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline void IntRNSsystem< Container, Alloc >::MixedRadixToRing( Element& res, const IntRNSsystem< Container, Alloc >::array& mixrad ) const
+ {
+ size_t size = _primes.size();
+ // if (size != mixrad.size()) throw GivError("[IntRNSsystem::MixedRadixToRing]: bad size of input array");
+ res = mixrad[size-1];
+ for (size_t i=size-1; i--; ) {
+ addin( mulin(res, _primes[i]), mixrad[i]);
+ // res *= _primes[i];
+ // res += mixrad[i];
+ }
+ }
+
+
+ // Convert an integer to a RNS representation (which is given by this)
+ //#ifndef __ECC
+ template<template<class,class> class Container,template<class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline void IntRNSsystem< Container, Alloc >::RingToRns( IntRNSsystem< Container, Alloc >::array& rns , const external& a)
+ {
+ size_t size = _primes.size();
+ if (rns.size() != size) rns.resize(size);
+ // -- may be faster using the recursive
+ // tree algorithm a mod p_1...p_k/2, and a mod p_k/2+1...p_k
+ for (int i=0; i<size; i++)
+ mod( rns[i], a, _primes[i]);
+ // rns[i] = mod(a, _primes[i]);
+ }
+
+ // Convert to an Integer:
+ //#ifndef __ECC
+ template<template<class, class> class Container, template <class> class Alloc>
+ template<class TT>
+ inline void IntRNSsystem< Container, Alloc >::RnsToRing( external& I, const Container<TT, Alloc<TT> >& rns)
+ //#else
+ //template<class Container> template<class ContTT>
+ //inline void IntRNSsystem< Container >::RnsToRing( external& I, const ContTT& rns) const
+ //#endif
+ {
+ // - Computation of a mixed radix representation of this
+
+ typename IntRNSsystem< Container, Alloc >::array mixrad(_primes.size());
+ RnsToMixedRadix( mixrad , rns );
+
+ // - Convert mixrad to an integer
+ MixedRadixToRing( I, mixrad ) ;
+ return;
+ }
+
+} // namespace Givaro
+
+#endif // __GIVARO_intrns_convert_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintrns_cstor.inl b/src/kernel/integer/givintrns_cstor.inl
index 5d70d44..5c357af 100644
--- a/src/kernel/integer/givintrns_cstor.inl
+++ b/src/kernel/integer/givintrns_cstor.inl
@@ -1,135 +1,156 @@
- // -- Array of primes are given
-//#ifndef __ECC
-//template<template<class> class Container>
-//#else
-template<template <class,class> class Container, template <class> class Alloc>
-//#endif
-inline IntRNSsystem<Container, Alloc>::IntRNSsystem( const IntRNSsystem<Container, Alloc>::array& inprimes)
- : _primes(inprimes),
- _prod(one), _ck(0)
-{
- GIVARO_ASSERT( inprimes.size()>0, "[IntRNSsystem::IntRNSsystem] bad size of array");
-}
-
- // -- Array of primes are given
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-template <class TT>
-inline IntRNSsystem< Container, Alloc >::IntRNSsystem( const Container<TT, Alloc<TT> >& inprimes)
- : _prod(one), _ck(0)
-{
- GIVARO_ASSERT( inprimes.size()>0, "[IntRNSsystem::IntRNSsystem] bad size of array");
- _primes.resize(inprimes.size());
- typename Container<TT, Alloc<TT> >::const_iterator np = inprimes.begin();
- for(typename array::iterator pi = _primes.begin(); pi != _primes.end(); ++pi, ++np)
- *pi = Element( *np );
-}
-//#else
-//template<class Container> template <class ContTT>
-//inline IntRNSsystem< Container >::IntRNSsystem( const ContTT& inprimes)
-// : _prod(one), _ck(0)
-//{
-// GIVARO_ASSERT( inprimes.size()>0, "[IntRNSsystem< Container >::IntRNSsystem] bad size of array");
-// _primes.resize(inprimes.size());
-// typename ContTT::const_iterator np = inprimes.begin();
-// for(typename array::iterator pi = _primes.begin(); pi != _primes.end(); ++pi, ++np)
-// *pi = Element( *np );
-//}
-//#endif
-
- // -- Product of primes
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline void IntRNSsystem< Container, Alloc >::ComputeProd()
-{
- if (isOne(_prod))
- for (typename array::const_iterator pi = _primes.begin();pi != _primes.end(); ++pi)
- mulin(_prod, *pi);
-}
-
- // -- Computes Ck , Ck = (\prod_{i=0}^{k-1} primes[i])^(-1) % primes[k],
- // for k=1..(_sz-1)
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline void IntRNSsystem< Container, Alloc >::ComputeCk()
-{
- if (_ck.size() !=0) return; // -- already computed
-
- // - reallocation of a new array :
- size_t size = _primes.size();
- _ck.resize(size);
- _ck[0] = Element::zero; // -- undefined and never used
-
- for (size_t k=1; k < size; ++k)
- {
- Element prod = _primes[0];
- for (size_t i= 1; i < k; ++i)
- modin( mulin( prod, _primes[i]), _primes[k]);
-
- Element g,u;
- gcd(g,u, _ck[k],_primes[k],prod); // _ck[k] * prod = g mod _primes[k]
- }
-}
-
-
-//#ifndef __ECC
-template<template<class,class> class Container, template<class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline const typename IntRNSsystem< Container, Alloc >::array& IntRNSsystem< Container, Alloc >::Primes() const
-{
- return _primes;
-}
-
-
-//#ifndef __ECC
-template<template<class, class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline const typename IntRNSsystem< Container, Alloc >::Element IntRNSsystem< Container, Alloc >::ith(const size_t i) const
-{
- return _primes[i];
-}
-
-
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline const typename IntRNSsystem< Container, Alloc >::Element IntRNSsystem< Container, Alloc >::product() const
-{
- ((IntRNSsystem< Container, Alloc >*)this)->ComputeProd();
- return _prod;
-}
-
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline const typename IntRNSsystem< Container, Alloc >::array& IntRNSsystem< Container, Alloc >::Reciprocals() const
-{
- if (_ck.size() ==0) ((IntRNSsystem< Container, Alloc >*)this)->ComputeCk();
- return _ck;
-}
-
-
-//#ifndef __ECC
-template<template<class,class> class Container, template <class> class Alloc>
-//#else
-//template<class Container>
-//#endif
-inline const typename IntRNSsystem< Container, Alloc >::Element IntRNSsystem< Container, Alloc >::reciprocal(const size_t i) const
-{
- if (_ck.size() ==0) ((IntRNSsystem< Container, Alloc >*)this)->ComputeCk();
- return _ck[i];
-}
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#ifndef __GIVARO_intrns_cstor_INL
+#define __GIVARO_intrns_cstor_INL
+
+namespace Givaro {
+
+ // -- Array of primes are given
+ //#ifndef __ECC
+ //template<template<class> class Container>
+ //#else
+ template<template <class,class> class Container, template <class> class Alloc>
+ //#endif
+ inline IntRNSsystem<Container, Alloc>::IntRNSsystem( const IntRNSsystem<Container, Alloc>::array& inprimes)
+ : _primes(inprimes),
+ _prod(one), _ck(0)
+ {
+ GIVARO_ASSERT( inprimes.size()>0, "[IntRNSsystem::IntRNSsystem] bad size of array");
+ }
+
+ // -- Array of primes are given
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ template <class TT>
+ inline IntRNSsystem< Container, Alloc >::IntRNSsystem( const Container<TT, Alloc<TT> >& inprimes) :
+ _prod(one), _ck(0)
+ {
+ GIVARO_ASSERT( inprimes.size()>0, "[IntRNSsystem::IntRNSsystem] bad size of array");
+ _primes.resize(inprimes.size());
+ typename Container<TT, Alloc<TT> >::const_iterator np = inprimes.begin();
+ for(typename array::iterator pi = _primes.begin(); pi != _primes.end(); ++pi, ++np)
+ *pi = Element( *np );
+ }
+
+#if 0
+ // #else
+ template<class Container> template <class ContTT>
+ inline IntRNSsystem< Container >::IntRNSsystem( const ContTT& inprimes)
+ : _prod(one), _ck(0)
+ {
+ GIVARO_ASSERT( inprimes.size()>0, "[IntRNSsystem< Container >::IntRNSsystem] bad size of array");
+ _primes.resize(inprimes.size());
+ typename ContTT::const_iterator np = inprimes.begin();
+ for(typename array::iterator pi = _primes.begin(); pi != _primes.end(); ++pi, ++np)
+ *pi = Element( *np );
+ }
+ // #endif
+#endif
+
+ // -- Product of primes
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline void IntRNSsystem< Container, Alloc >::ComputeProd()
+ {
+ if (isOne(_prod))
+ for (typename array::const_iterator pi = _primes.begin();pi != _primes.end(); ++pi)
+ mulin(_prod, *pi);
+ }
+
+ // -- Computes Ck , Ck = (\prod_{i=0}^{k-1} primes[i])^(-1) % primes[k],
+ // for k=1..(_sz-1)
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline void IntRNSsystem< Container, Alloc >::ComputeCk()
+ {
+ if (_ck.size() !=0) return; // -- already computed
+
+ // - reallocation of a new array :
+ size_t size = _primes.size();
+ _ck.resize(size);
+ _ck[0] = Element::zero; // -- undefined and never used
+
+ for (size_t k=1; k < size; ++k)
+ {
+ Element prod = _primes[0];
+ for (size_t i= 1; i < k; ++i)
+ modin( mulin( prod, _primes[i]), _primes[k]);
+
+ Element g,u;
+ gcd(g,u, _ck[k],_primes[k],prod); // _ck[k] * prod = g mod _primes[k]
+ }
+ }
+
+
+ //#ifndef __ECC
+ template<template<class,class> class Container, template<class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline const typename IntRNSsystem< Container, Alloc >::array& IntRNSsystem< Container, Alloc >::Primes() const
+ {
+ return _primes;
+ }
+
+
+ //#ifndef __ECC
+ template<template<class, class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline const typename IntRNSsystem< Container, Alloc >::Element IntRNSsystem< Container, Alloc >::ith(const size_t i) const
+ {
+ return _primes[i];
+ }
+
+
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline const typename IntRNSsystem< Container, Alloc >::Element IntRNSsystem< Container, Alloc >::product() const
+ {
+ ((IntRNSsystem< Container, Alloc >*)this)->ComputeProd();
+ return _prod;
+ }
+
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline const typename IntRNSsystem< Container, Alloc >::array& IntRNSsystem< Container, Alloc >::Reciprocals() const
+ {
+ if (_ck.size() ==0) ((IntRNSsystem< Container, Alloc >*)this)->ComputeCk();
+ return _ck;
+ }
+
+
+ //#ifndef __ECC
+ template<template<class,class> class Container, template <class> class Alloc>
+ //#else
+ //template<class Container>
+ //#endif
+ inline const typename IntRNSsystem< Container, Alloc >::Element IntRNSsystem< Container, Alloc >::reciprocal(const size_t i) const
+ {
+ if (_ck.size() ==0) ((IntRNSsystem< Container, Alloc >*)this)->ComputeCk();
+ return _ck[i];
+ }
+
+} // namespace Givaro
+
+
+#endif // __GIVARO_intrns_cstor_INL
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintrsa.h b/src/kernel/integer/givintrsa.h
index a45cea7..1a60f54 100644
--- a/src/kernel/integer/givintrsa.h
+++ b/src/kernel/integer/givintrsa.h
@@ -1,10 +1,15 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : RSA scheme.
-// Time-stamp: <24 Mar 05 13:52:12 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <07 May 09 13:51:58 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_RSA_
-#define _GIVARO_RSA_
+#ifndef __GIVARO_rsa_H
+#define __GIVARO_rsa_H
#include <iostream>
#include "givaro/givinteger.h"
@@ -13,13 +18,15 @@
#include "givaro/givrandom.h"
- // k = 2^16 + 1, is prime
+// k = 2^16 + 1, is prime
#define SIMPLE_EXPONENT (Element( (1<<16)+1 ))
// =================================================================== //
// RSA public-key cipher codes
// =================================================================== //
+namespace Givaro {
+
template<class RandIter = GivRandom>
class IntRSADom : public IntFactorDom<RandIter> {
public:
@@ -31,8 +38,8 @@ public:
typedef typename IntFactorDom<RandIter>::random_generator random_generator;
private:
- Element _m, _k;
- Element _u;
+ Element _n, _e;
+ Element _d;
long _lm;
public:
@@ -40,32 +47,31 @@ public:
// =================================================================== //
// Constructors
// =================================================================== //
- IntRSADom(bool fi = false, RandIter g = RandIter() ) : IntFactorDom<RandIter>(g), _fast_impl(fi) { keys_gen(IntFactorDom<RandIter>::_g, 257, 255, _m, _k, _u); _lm = log(_m,1<<(8*sizeof(unsigned char))); }
- IntRSADom(const long s, bool fi = false, RandIter g = RandIter() ) : IntFactorDom<RandIter>(g), _fast_impl(fi) { keys_gen(IntFactorDom<RandIter>::_g, (s>>1)-1, (s>>1)+1, _m, _k, _u); _lm = log(_m,1<<(8*sizeof(unsigned char))); }
- IntRSADom(const long p, const long q, bool fi = false, RandIter g = RandIter() ) : IntFactorDom<RandIter>(g), _fast_impl(fi) { keys_gen(IntFactorDom<RandIter>::_g, p, q, _m, _k, _u); _lm = log(_m,1<<(8*sizeof(unsigned char))); }
- IntRSADom(const Element& m, const Element& k, const Element& u) : _m(m), _k(k), _u(u), _lm(log(m,1<<(8*sizeof(unsigned char)))), _fast_impl( k == SIMPLE_EXPONENT ) {}
- IntRSADom(const Element& m, const Element& k) : _m(m), _k(k), _u(0), _lm(log(m,1<<(8*sizeof(unsigned char)))), _fast_impl( k == SIMPLE_EXPONENT ) {}
-
+ IntRSADom(bool fi = false, RandIter g = RandIter() ) : IntFactorDom<RandIter>(g), _fast_impl(fi) { keys_gen(IntFactorDom<RandIter>::_g, 257, 255, _n, _e, _d); _lm = log(_n,1<<(8*sizeof(unsigned char))); }
+ IntRSADom(const long s, bool fi = false, RandIter g = RandIter() ) : IntFactorDom<RandIter>(g), _fast_impl(fi) { keys_gen(IntFactorDom<RandIter>::_g, (s>>1)-1, (s>>1)+1, _n, _e, _d); _lm = log(_n,1<<(8*sizeof(unsigned char))); }
+ IntRSADom(const long p, const long q, bool fi = false, RandIter g = RandIter() ) : IntFactorDom<RandIter>(g), _fast_impl(fi) { keys_gen(IntFactorDom<RandIter>::_g, p, q, _n, _e, _d); _lm = log(_n,1<<(8*sizeof(unsigned char))); }
+ IntRSADom(const Element& n, const Element& e, const Element& d) : _n(n), _e(e), _d(d), _lm(log(n,1<<(8*sizeof(unsigned char)))), _fast_impl( e == SIMPLE_EXPONENT ) {}
+ IntRSADom(const Element& n, const Element& e) : _n(n), _e(e), _d(0), _lm(log(n,1<<(8*sizeof(unsigned char)))), _fast_impl( e == SIMPLE_EXPONENT ) {}
+
// =================================================================== //
// Accesses
// =================================================================== //
- const Element& getm() const { return _m; }
- const Element& getk() const { return _k; }
- const Element& getu() const { return _u; }
+ const Element& getn() const { return _n; }
+ const Element& gete() const { return _e; }
+ const Element& getd() const { return _d; }
// =================================================================== //
// Text conversions
-// =================================================================== //
+// =================================================================== //
std::ostream& encipher(std::ostream&, std::istream&) const ;
std::ostream& decipher(std::ostream&, std::istream&) ;
-protected:
// =================================================================== //
// Keys generation
-// public keys are m and k, the secret key is u.
-// ciphering is computing : x^k mod m
-// deciphering is computing : b^u mod m
-// since for any x, x^(k.u) = x mod m
+// public keys are n and e, the secret key is d.
+// ciphering is computing : x^e mod m, in CBC mode
+// deciphering is computing : b^d mod m
+// since for any x, x^(e.d) = x mod m
// =================================================================== //
@@ -73,15 +79,16 @@ protected:
// [Strong Primes Are Easy to Find, J. Gordon, EUROCRYPT'84, LNCS 209
// =================================================================== //
Element& strong_prime(random_generator& g, long psize, Element& p) const;
-
+
// =================================================================== //
// Here m = p*q
// p and q are prime numbers of respective sizes psize, qsize
// Moreover p-1 and q-1 have one prime factor of respective size 2/3
// since k.u = 1 mod (p-1)(q-1)
// =================================================================== //
- void keys_gen(random_generator& g, long psize, long qsize, Element& m, Element& k, Element& u) const ;
-
+ void keys_gen(random_generator& g, long psize, long qsize, Element& n, Element& e, Element& d, Element& p, Element& q) const ;
+ void keys_gen(random_generator& g, long psize, long qsize, Element& n, Element& e, Element& d) const ;
+
// =================================================================== //
// log[10]
// =================================================================== //
@@ -89,23 +96,26 @@ protected:
// =================================================================== //
// Text conversions
-// =================================================================== //
+// =================================================================== //
std::ostream& ecriture_str(std::ostream&, const Element&) const ;
std::ostream& ecriture_str_last(std::ostream&, const Element&) const ;
std::ostream& ecriture_Int(std::ostream&, const Element&) const ;
-public:
// =================================================================== //
// Breaking codes : finding u knowing only m an k ...
// =================================================================== //
Element& point_break(Element& u) ;
+protected:
// Fast implementation
// Means simple enciphering key, and deciphering via chinese remaindering
// WARNING: this means less security !
bool _fast_impl;
+
};
+} // Givaro
+
#include "givaro/givintrsa.inl"
-#endif
+#endif // __GIVARO_rsa_H
diff --git a/src/kernel/integer/givintrsa.inl b/src/kernel/integer/givintrsa.inl
index c5e223b..972b378 100644
--- a/src/kernel/integer/givintrsa.inl
+++ b/src/kernel/integer/givintrsa.inl
@@ -1,281 +1,304 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : Prime numbers
// RSA public-key cipher codes
// ECB mode (UNSECURE !!!)
-// Time-stamp: <06 Jun 06 14:32:13 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <07 May 09 13:44:00 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_RSA_Public_KEY_
-#define _GIVARO_RSA_Public_KEY_
+#ifndef __GIVARO_rsa_public_key_INL
+#define __GIVARO_rsa_public_key_INL
#include <iostream>
-#include "givinteger.h"
-#include "givintrsa.h"
+#include <givaro/givinteger.h>
+#include <givaro/givrandom.h>
+#include <givaro/givintrsa.h>
+
+namespace Givaro {
+
+ // =================================================================== //
+ // log[10]
+ // =================================================================== //
+
+ template<class RandIter>
+ long IntRSADom<RandIter>::log(const Element& n, const long b = 10) const {
+ long res = 0;
+ for(Element p = n; p>=b; ++res, this->divin(p,b) ) {}
+ return res;
+ }
+
+
+ // =================================================================== //
+ // Text conversions
+ // =================================================================== //
+
+
+ template<class RandIter>
+ std::ostream& IntRSADom<RandIter>::ecriture_str(std::ostream& o, const Element& n) const {
+
+ Element p = n, a, b;
+ long i = _lm-1;
+ // First char is ignored as it is zero or this->random enabling CBC
+ a = p >> (i<<3);
+ p -= a << (i<<3);
+ for(--i; i>=0; --i) {
+ a = p >> (i<<3);
+ o << char( int(a) );
+ p -= a << (i<<3);
+ }
+ return o;
+ }
+
+ template<class RandIter>
+ std::ostream& IntRSADom<RandIter>::ecriture_str_last(std::ostream& o, const Element& n) const {
+ Element p = n, a, b;
+ long i = _lm-1, nbzeroes(0);
+ // First char is ignored as it is zero or this->random enabling CBC
+ a = p >> (i<<3);
+ p -= a << (i<<3);
+ for(--i; i>=1; --i) {
+ a = p >> (i<<3);
+ // Treatment of trailing zeroes
+ if ( char(int(a)) ) {
+ for(int j =0; j <nbzeroes; ++j)
+ o << char(0);
+ o << char( int(a) );
+ nbzeroes = 0;
+ p -= a << (i<<3);
+ } else {
+ ++nbzeroes;
+ }
+ }
+ return o << char(int(p));
+ }
+
+
+ template<class RandIter>
+ std::ostream& IntRSADom<RandIter>::ecriture_Int(std::ostream& o, const Element& p) const {
+ return o << p << std::endl;
+ }
+
+
+
+
+ // CBC mode enciphering
+ template<class RandIter>
+ std::ostream& IntRSADom<RandIter>::encipher(std::ostream& o, std::istream& in) const {
+ RandIter generator;
+ unsigned char x;
+ Element res,r;
+ o << generator.seed() << std::endl;
+ Element ancien(generator());
+ long int imax = (_lm-1)<<3;
+ do {
+ res = 0;
+ for(int i=0; i<_lm-1; ++i) {
+ x = (unsigned char) in.get();
+ if (in.eof()) {
+ // Adding zeroes at end of file
+ res <<= ( 8*(_lm-1-i) );
+ break;
+ }
+ res <<= 8;
+ res += x;
+ }
+
+ // Padding randomly to enable CBC
+ // indeed, decryption will return (res^ancien) % _n
+ while ( (res^ancien) > _n) {
+ res += ((Integer)((unsigned char)generator()) << imax);
+ }
+
+ powmod(r, res^ancien,_e,_n);
+ ecriture_Int(o, r );
+ ancien = r;
+ } while (! in.eof());
+ return o;
+ }
+
+ // CBC mode deciphering
+ template<class RandIter>
+ std::ostream& IntRSADom<RandIter>::decipher(std::ostream& o, std::istream& in) {
+ double Length = (double) _lm * 2.4082399653118495617; // _lm * 8*log[10](2)
+ char * tmp = new char[(long)Length+2];
+ Element r;
+ unsigned long seed; in >> seed;
+ GivRandom generator(seed);
+
+ if (_fast_impl) {
+ Element p, q, pr, k, phi, t, delt ;
+ pr = _e*_d;
+ --pr;
+ k = pr/_n;
+ do {
+ ++k;
+ phi = pr/ k;
+ } while (k*phi != pr);
+ t = _n-phi; ++t;
+ t >>= 1;
+ sqrt(delt, t*t-_n);
+ p = t-delt;
+ q = t+delt;
+ Element gd, a, b, c, r1, r2;
+ this->gcd(gd, a, b, q, p);
+
+ b *= p;
+ b %= _n;
+
+ Element ancien( generator() );
+
+ in >> tmp;
+ do {
+ powmod(r, Integer(tmp)%p, _d, p);
+ powmod(r2, Integer(tmp)%q, _d, q);
+ // Chinese reconstruction
+ r2 -= r;
+ r2 *= b;
+ r2 %= _n;
+ r2 += r;
+ // Must be positive
+ if (r2 > _n) r2 -= _n;
+ else if (r2 < IntFactorDom<RandIter>::zero) r2+=_n;
+ r2 ^= ancien;
+ ancien = Integer(tmp);
+ in >> tmp;
+ if (in.eof()) {
+ // Treatment of trailing zeroes
+ ecriture_str_last(o, r2);
+ break;
+ } else
+ ecriture_str(o, r2);
+ } while (! in.eof());
+ } else {
+ Element ancien( generator() );
+ in >> tmp;
+ do {
+ powmod(r, Integer(tmp),_d,_n);
+ r ^= ancien;
+ ancien = Integer(tmp);
+ in >> tmp;
+ if (in.eof()) {
+ ecriture_str_last(o, r);
+ break;
+ } else
+ ecriture_str(o, r^ancien);
+ } while (! in.eof());
+ }
+
+ return o;
+ }
+
+
+
+
+ template<class RandIter>
+ typename IntRSADom<RandIter>::Element& IntRSADom<RandIter>::strong_prime(random_generator& g, long psize, Element& p) const {
+ Element q,t,r,s;
+
+ if (psize > 9) {
+ this->random(g,t,(psize>>1)-2);
+ t += Integer(1)<<( (psize>>1)-2 );
+ this->random(g,s,(psize>>1)-2);
+ s += Integer(1)<<( (psize>>1)-2 );
+ } else {
+ this->random(g,t,3);
+ this->random(g,s,3);
+ }
+ nextprimein( t );
+ nextprimein( s );
+
+
+
+ r = t<<1;
+ ++r;
+ while( ! isprime(r,4) ) {
+ r += t<<1;
+ }
+
+
+
+
+ // q = 2(s^(r-2) mod r)s - 1
+ powmod(q, s, r-2, r);
+ q <<= 1;
+ q *= s;
+ --q;
+
+
+ // 2rs
+ r *= s;
+ r <<= 1;
+
+ p = q+r;
+ while( ! isprime(p,4) ) {
+ p += r;
+ }
+
+ return p;
+ }
+
+
+
+
+ // =================================================================== //
+ // Keys generation
+ // public keys are m and k, the secret key is u.
+ // ciphering is computing : x^k mod m
+ // deciphering is computing : b^u mod m
+ // since for any x, x^(k.u) = x mod m
+ // =================================================================== //
+ template<class RandIter>
+ void IntRSADom<RandIter>::keys_gen(random_generator& g, long psize, long qsize, Element& m, Element& k, Element& u) const {
+ Element p, q;
+ keys_gen(g,psize,qsize,m,k,u,p,q);
+ }
+
+ template<class RandIter>
+ void IntRSADom<RandIter>::keys_gen(random_generator& g, long psize, long qsize, Element& m, Element& k, Element& u, Element& p, Element& q) const {
+ Element d, l;
+
+ strong_prime(g, psize, p);
+ do strong_prime(g, qsize, q); while (q == p);
+
+
+ Element phim; mul(phim, sub(d,p,IntFactorDom<RandIter>::one), sub(l,q,IntFactorDom<RandIter>::one));
+ mul(m, p, q);
+
+ Element v, gd;
+
+ if (_fast_impl) {
+ mod(k,SIMPLE_EXPONENT, phim);
+ this->gcd(gd,u,v,k,phim);
+ } else {
+ do {
+ this->random(g,k,phim);
+ } while (this->gcd(gd,u,v,k,phim) != 1);
+ }
+ modin(u,phim);
+ if ( islt(u,IntFactorDom<RandIter>::zero) ) addin(u,phim);
+ }
-// =================================================================== //
-// log[10]
-// =================================================================== //
-
-template<class RandIter>
-long IntRSADom<RandIter>::log(const Element& n, const long b = 10) const {
- long res = 0;
- for(Element p = n; p>=b; ++res, this->divin(p,b) ) {}
- return res;
-}
-
-
-// =================================================================== //
-// Text conversions
-// =================================================================== //
+ // =================================================================== //
+ // Breaking codes
+ // =================================================================== //
+ template<class RandIter>
+ typename IntRSADom<RandIter>::Element& IntRSADom<RandIter>::point_break(Element& u) {
+ if ( isZero(_d) ) {
+ Element p,v,d, pm;
+ factor(p, _n);
+ mul(pm, sub(v,p,IntFactorDom<RandIter>::one), subin( this->div(d,_n,p), IntFactorDom<RandIter>::one ) );
+ this->gcd(d,_d,v,_e,pm);
+ if (islt(_d,IntFactorDom<RandIter>::zero)) addin(_d, pm);
+ }
+ return u = _d;
+ }
-
-template<class RandIter>
-std::ostream& IntRSADom<RandIter>::ecriture_str(std::ostream& o, const Element& n) const {
-
- Element p = n, a, b;
- long i = _lm-1;
- // First char is ignored as it is zero or this->random enabling CBC
- a = p >> (i<<3);
- p -= a << (i<<3);
- for(--i; i>=0; --i) {
- a = p >> (i<<3);
- o << char( int(a) );
- p -= a << (i<<3);
- }
- return o;
-}
-
-template<class RandIter>
-std::ostream& IntRSADom<RandIter>::ecriture_str_last(std::ostream& o, const Element& n) const {
- Element p = n, a, b;
- long i = _lm-1, nbzeroes(0);
- // First char is ignored as it is zero or this->random enabling CBC
- a = p >> (i<<3);
- p -= a << (i<<3);
- for(--i; i>=1; --i) {
- a = p >> (i<<3);
- // Treatment of trailing zeroes
- if ( char(int(a)) ) {
- for(int j =0; j <nbzeroes; ++j)
- o << char(0);
- o << char( int(a) );
- nbzeroes = 0;
- p -= a << (i<<3);
- } else {
- ++nbzeroes;
- }
- }
- return o << char(int(p));
-}
-
-
-template<class RandIter>
-std::ostream& IntRSADom<RandIter>::ecriture_Int(std::ostream& o, const Element& p) const {
- return o << p << std::endl;
-}
-
-
-
-
-// CBC mode enciphering
-template<class RandIter>
-std::ostream& IntRSADom<RandIter>::encipher(std::ostream& o, std::istream& in) const {
- srand48(1);
- unsigned char x;
- Element res,r;
- Element ancien(0);
- int imax = (_lm-1)<<3;
- do {
- res = 0;
- for(int i=0; i<_lm-1; ++i) {
- x = in.get();
- if (in.eof()) {
- // Adding zeroes at end of file
- res <<= ( 8*(_lm-1-i) );
- break;
- }
- res <<= 8;
- res += x;
- }
-
- // Padding randomly to enable CBC
- // indeed, decryption will return (res^ancien) % _m
- while ( (res^ancien) > _m) {
- res += ((Integer)((unsigned char)lrand48()) << imax);
- }
-
- powmod(r, res^ancien,_k,_m);
- ecriture_Int(o, r );
- ancien = r;
- } while (! in.eof());
- return o;
-}
-
-// CBC mode deciphering
-template<class RandIter>
-std::ostream& IntRSADom<RandIter>::decipher(std::ostream& o, std::istream& in) {
- double length = _lm * 2.4082399653118495617; // _lm * 8*log[10](2)
- char * tmp = new char[(long)length+2];
- Element r;
-
- if (_fast_impl) {
- Element p, q, pr, k, phi, t, delt ;
- pr = _k*_u;
- --pr;
- k = pr/_m;
- ++k;
- phi = pr/ k;
- t = _m-phi; ++t;
- t >>= 1;
- sqrt(delt, t*t-_m);
- p = t-delt;
- q = t+delt;
- Element gd, a, b, c, r1, r2;
- this->gcd(gd, a, b, q, p);
-
- b *= p;
- b %= _m;
-
- Element ancien(0);
-
- in >> tmp;
- do {
- powmod(r, Integer(tmp)%p, _u, p);
- powmod(r2, Integer(tmp)%q, _u, q);
- // Chinese reconstruction
- r2 -= r;
- r2 *= b;
- r2 %= _m;
- r2 += r;
- // Must be positive
- if (r2 > _m) r2 -= _m;
- else if (r2 < IntFactorDom<RandIter>::zero) r2+=_m;
- r2 ^= ancien;
- ancien = Integer(tmp);
- in >> tmp;
- if (in.eof()) {
- // Treatment of trailing zeroes
- ecriture_str_last(o, r2);
- break;
- } else
- ecriture_str(o, r2);
- } while (! in.eof());
- } else {
- Element ancien(0);
- in >> tmp;
- do {
- powmod(r, Integer(tmp),_u,_m);
- r ^= ancien;
- ancien = Integer(tmp);
- in >> tmp;
- if (in.eof()) {
- ecriture_str_last(o, r);
- break;
- } else
- ecriture_str(o, r^ancien);
- } while (! in.eof());
- }
-
- return o;
-}
-
-
-
-
-template<class RandIter>
-typename IntRSADom<RandIter>::Element& IntRSADom<RandIter>::strong_prime(random_generator& g, long psize, Element& p) const {
- Element q,t,r,s;
-
- if (psize > 9) {
- this->random(g,t,(psize>>1)-2);
- t += Integer(1)<<( (psize>>1)-2 );
- this->random(g,s,(psize>>1)-2);
- s += Integer(1)<<( (psize>>1)-2 );
- } else {
- this->random(g,t,3);
- this->random(g,s,3);
- }
- nextprimein( t );
- nextprimein( s );
-
-
-
- r = t<<1;
- ++r;
- while( ! isprime(r,4) ) {
- r += t<<1;
- }
-
-
-
-
- // q = 2(s^(r-2) mod r)s - 1
- powmod(q, s, r-2, r);
- q <<= 1;
- q *= s;
- --q;
-
-
- // 2rs
- r *= s;
- r <<= 1;
-
- p = q+r;
- while( ! isprime(p,4) ) {
- p += r;
- }
-
- return p;
-}
-
-
+} // namespace Givaro
+#endif // __GIVARO_rsa_public_key_INL
-// =================================================================== //
-// Keys generation
-// public keys are m and k, the secret key is u.
-// ciphering is computing : x^k mod m
-// deciphering is computing : b^u mod m
-// since for any x, x^(k.u) = x mod m
-// =================================================================== //
-template<class RandIter>
-void IntRSADom<RandIter>::keys_gen(random_generator& g, long psize, long qsize, Element& m, Element& k, Element& u) const {
- Element p,q, d, l;
-
- strong_prime(g, psize, p);
- do strong_prime(g, qsize, q); while (q == p);
-
-
- Element phim; mul(phim, sub(d,p,IntFactorDom<RandIter>::one), sub(l,q,IntFactorDom<RandIter>::one));
- mul(m, p, q);
-
- Element v, gd;
-
- if (_fast_impl) {
- mod(k,SIMPLE_EXPONENT, phim);
- this->gcd(gd,u,v,k,phim);
- } else {
- do {
- this->random(g,k,phim);
- } while (this->gcd(gd,u,v,k,phim) != 1);
- }
- modin(u,phim);
- if ( islt(u,IntFactorDom<RandIter>::zero) ) addin(u,phim);
-}
-
-// =================================================================== //
-// Breaking codes
-// =================================================================== //
-template<class RandIter>
-typename IntRSADom<RandIter>::Element& IntRSADom<RandIter>::point_break(Element& u) {
- if ( isZero(_u) ) {
- Element p,v,d, pm;
- factor(p, _m);
- mul(pm, sub(v,p,IntFactorDom<RandIter>::one), subin( this->div(d,_m,p), IntFactorDom<RandIter>::one ) );
- this->gcd(d,_u,v,_k,pm);
- if (islt(_u,IntFactorDom<RandIter>::zero)) addin(_u, pm);
- }
- return u = _u;
-}
-
-#endif
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/integer/givintsqrootmod.h b/src/kernel/integer/givintsqrootmod.h
new file mode 100644
index 0000000..8d7e5e5
--- /dev/null
+++ b/src/kernel/integer/givintsqrootmod.h
@@ -0,0 +1,126 @@
+// ============================================================= //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <19 Jan 11 15:53:22 Jean-Guillaume.Dumas at imag.fr>
+// Givaro : Modular square roots
+// Author : Yanis Linge
+// ============================================================= //
+
+
+#ifndef __GIVARO_sqrtmod_H
+#define __GIVARO_sqrtmod_H
+
+#include <iostream>
+#include "givaro/givinteger.h"
+#include "givaro/givintprime.h"
+#include "givaro/givintfactor.h"
+#include "givaro/givintrns.h"
+#include "givaro/givrandom.h"
+#include "givaro/givpower.h"
+#include <math.h>
+
+namespace Givaro {
+
+template < class RandIter = GivRandom >
+class IntSqrtModDom:public IntFactorDom < RandIter > {
+public:
+ typedef IntFactorDom < RandIter > Father_t;
+ typedef typename IntFactorDom < RandIter >::Rep Rep;
+
+ IntSqrtModDom (RandIter g = RandIter ()) : IntFactorDom < RandIter > (g) {}
+
+ // ======================================================== //
+ // Modular Square root functions
+ // ======================================================== //
+ Rep & sqrootmod (Rep & x, const Rep & a, const Rep & n) const {
+ std::vector < Rep > Lf;
+ std::vector < unsigned long > Le;
+ Father_t::set (Lf, Le, n);
+
+ typename std::vector < Rep >::const_iterator Lf_iter = Lf.begin ();
+ typename std::vector < unsigned long >::const_iterator Le_iter = Le.begin ();
+
+ std::vector < Rep > roots;
+ Rep tmp;
+
+ // Build prime powers
+ std::vector < Rep > Pe (Lf.size ());
+ typename std::vector < Rep >::iterator Pe_iter = Pe.begin ();
+ for (; Pe_iter != Pe.end (); ++Pe_iter, ++Lf_iter, ++Le_iter)
+ dom_power (*Pe_iter, *Lf_iter, *Le_iter, *this);
+
+ Lf_iter = Lf.begin ();
+ Le_iter = Le.begin ();
+ Pe_iter = Pe.begin ();
+
+ // roots mod powers of primes
+ for (; Lf_iter != Lf.end (); ++Lf_iter, ++Le_iter, ++Pe_iter){
+ // root mod a power of 2
+ if (*Lf_iter == 2UL){
+ roots.push_back (
+ this->sqrootmodpoweroftwo (tmp, a, *Le_iter, *Pe_iter));
+ } else {
+ roots.push_back (
+ this->sqrootmodprimepower (tmp, a, *Lf_iter, *Le_iter, *Pe_iter));
+ }
+ }
+
+ // Chinese Remaindering
+ IntRNSsystem < std::vector, std::allocator > RNs (Pe);
+
+ RNs.RnsToRing (x, roots);
+ x = (x<0?-x:x);
+ return x;
+ }
+
+ // ======================================================== //
+ // Modular Square root sub-functions
+ // ======================================================== //
+
+ // p is supposed to be prime
+ Rep & sqrootmodprime (Rep & x, const Rep & a, const Rep & p) const;
+
+ // p is supposed to be prime, modulo is taken mod p^k
+ Rep & sqrootmodprimepower (Rep & x, const Rep & a, const Rep & p, const unsigned long k, const Rep &pk) const;
+
+ // modulo is taken mod 2^k
+ Rep & sqrootmodpoweroftwo (Rep & x, const Rep & a,const unsigned long k, const Rep & pk) const;
+
+protected:
+
+ // ======================================================== //
+ // Linear update using only onemorelift
+ // ======================================================== //
+
+ // p is supposed to be prime and odd
+ Rep & sqrootlinear (Rep & x, const Rep & a,const Rep & p,const unsigned long k) const;
+
+ // result is modulo 2^{k+1}
+ Rep & sqroottwolinear(Rep & x, const Rep & a,const unsigned long k) const;
+
+ // ======================================================== //
+ // Liftings
+ // ======================================================== //
+
+ // PRECONDITION: x^2 = a [p^k]
+ // RETURNS: x s.t. x^2 = a [p^{2k}]
+ Rep & sqroothensellift (Rep & x, const Rep & a, const Rep & p, const unsigned long k, const Rep & pk) const;
+
+ // PRECONDITION: x^2 = a [p^k]
+ // RETURNS: x s.t. x^2 = a [p^{k+1}]
+ Rep & sqrootonemorelift (Rep & x, const Rep & a, const Rep & p, const unsigned long k, const Rep & pk) const;
+
+ // PRECONDITION: x^2 = a [2^k], with k>=3, a and x are odd
+ // RETURNS: x s.t. x^2 = a [2^{2k-2}]
+ Rep & sqrootmodtwolift (Rep & x, const Rep & a, const unsigned long k, const Rep & pk) const;
+
+};
+
+} // Givaro
+
+#include "givaro/givintsqrootmod.inl"
+
+#endif // __GIVARO_sqrtmod_H
diff --git a/src/kernel/integer/givintsqrootmod.inl b/src/kernel/integer/givintsqrootmod.inl
new file mode 100644
index 0000000..b585ef6
--- /dev/null
+++ b/src/kernel/integer/givintsqrootmod.inl
@@ -0,0 +1,383 @@
+// ============================================================= //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <22 Mar 11 15:05:39 Jean-Guillaume.Dumas at imag.fr>
+// Givaro : Modular square roots
+// Author : Yanis Linge
+// ============================================================= //
+
+#ifndef __GIVARO_sqrootmod_INL
+#define __GIVARO_sqrootmod_INL
+
+#include <givaro/givtimer.h>
+
+namespace Givaro {
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqrootmodprime (Rep & x,
+ const Rep & a,
+ const Rep & p) const {
+// std::cerr << "p:= " << p << ';' << std::endl;
+// std::cerr << "a:= " << a << ';' << std::endl;
+ Rep amp (a); amp %=p;
+ if (amp == 0UL || amp == 1UL) return x = amp;
+
+ if (legendre (amp, p) == -1){
+ std::cerr << amp << " is not a quadratic residue mod " << p << std::endl;
+ return x = -1;
+ }
+
+ if ((p & 3UL) == 3UL) { // If p = 3 mod 4
+ Rep ppu (p); ++ppu; ppu >>= 2UL; // ppu = (p+1)/4
+ return powmod (x, amp, ppu, p); // powmod (x,a,(p+1)/4,p);
+ }
+
+ // O. Atkin
+ if ((p & 7UL) == 5UL) { // If p = 5 mod 8
+ Rep tmp;
+ Rep puis (p); puis -= 1UL; puis >>= 2UL;// puis = (p-1)/4
+ powmod (tmp, amp, puis, p);
+
+ if (tmp == 1UL) {
+ puis = p; puis += 3UL; puis >>= 3UL;// puis = (p+3)/8
+ return powmod (x, amp, puis, p);
+ }
+ puis = p; puis -= 5UL; puis >>= 3UL; // puis = (p-5)/8
+
+ Rep a4 (amp); a4 <<= 2;
+ powmod (x, a4, puis, p);
+ x *= amp; x <<= 1; // 2a(4a)^{(p-5)/8}
+ return x %= p;
+ }
+
+ size_t l = (size_t) ceil (logtwo (p) - 1);
+
+ // S. Mueller
+ if ((p & 15UL) == 9UL) { // If p = 9 mod 16
+ Rep i (amp); i <<= 1UL;
+ Rep puis (p); puis -= 1UL; puis >>= 2UL;// puis = (p-1)/4
+ powmod (x, i, puis, p); // (2a)^{(p-1}/4} is +1 or -1
+ if (x != 1UL) x = -1L;
+
+ Rep d; while (legendre (Rep::nonzerorandom (d, l), p) == x) ;
+ puis = p; puis -= 9UL; puis >>= 4UL; // puis = (p-9)/16
+ i *= d; i *= d;
+ powmod(x, i, puis, p); // (2d^2a)^{(p-9)/16}
+ i *= x; i%=p; i *= x; i%=p; // i=2d^2x^2a ; i^2 = -1
+ --i;
+ x *= d; x%=p; x *= i; x%=p; x *= amp; // xda(i-1)
+ return x %= p; // +/- x is a root
+ }
+
+ // Tonelli and Shanks
+ // [H. Cohen, Algorithm 1.5.1, p33,
+ // A course in computational algebraic number theory]
+ Rep p1 (p); --p1;
+ Rep q (p1);
+ long e (0);
+ for( ; (q & 1UL) == 0; ++e) q >>= 1;
+
+ // now we have e and q such that : p-1=q*2^e with q odd
+ // we need a non quadratic element : g
+ Rep g; while (legendre (Rep::nonzerorandom (g, l), p) != -1) ;
+
+ Rep z;
+ powmod (z, g, q, p); // z = g^q mod p
+ //Initialize
+ Rep y (z);
+ Rep tmp (q); tmp -= 1; tmp >>= 1;
+ powmod (x, amp, tmp, p); // a^{(q-1)/2} mod p
+ Rep b (x);
+ b *= x; b *= amp; b %= p; // ax^2
+ x *= amp; x %= p; // ax
+
+ // Find exponent
+ long m(1), r(e);
+ Rep b2k, t, puis(r);
+ while (b != 1){
+ b2k = b;
+ for(m = 0; b2k != 1; ++m) {
+ b2k *= b2k; b2k %= p;
+ } // m smallest such that b^{2^m} is 1 mod p
+ if (m == r){
+ std::cerr << amp << " is not a quadratic residu mod " << p << std::endl;
+ return x = -1;
+ }
+ long lpuis = r; lpuis -= m; --lpuis;
+ puis = 1; puis <<= lpuis; // 2^{m-r-1}
+ powmod (t, y, puis, p); // t = y^{ 2^{m-r-1} } mod p
+ y = t; y *= t; y %= p; // y = t^2 mod p
+ r = m; // r = m
+ x *= t; x %= p; // x = xt mod p
+ b *= y; b %= p; // b = by mod p
+ }
+ return x;
+}
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqrootmodprimepower (Rep & x,
+ const Rep & a,
+ const Rep & p,
+ const unsigned long k,
+ const Rep & pk) const{
+
+ Rep tmpa(a); tmpa%=pk;
+ if(tmpa==0) return x=0;
+ if(tmpa==1) return x=1;
+ if (k == 1) return sqrootmodprime (x, tmpa, p);
+
+ if ((tmpa%p)==0){
+ Rep b(tmpa);
+ unsigned long t=0;
+ for( ; (b%p) == 0; ++t) b/=p; // a = b p^t and p does not divide b
+
+ if((t&1UL)==0){
+ Rep sqrtb;
+ sqrootmodprimepower(sqrtb,b,p,k,pk);
+ powmod(x,p,(t>>1),pk);
+ x*=sqrtb;
+ return x%=pk;
+ }
+ else{
+ std::cerr <<tmpa << "is not a quadratic residu mod " << pk << std::endl;
+ return x=-1;
+ }
+ }
+ //linear version
+ if (k < 3 ) return sqrootlinear (x, a, p, k);
+ else{
+ //quadratic version
+ unsigned long kdivtwo(k>>1);
+ if ((k & 1) == 1){ // kdivtwo = (k-1)/2
+ Rep sqpkdivp; pow(sqpkdivp,p,kdivtwo);
+
+ //x1^2 = a mod (p^((k-1)/2))
+ sqrootmodprimepower (x, a, p, kdivtwo, sqpkdivp);
+ if (x == -1) return x;
+
+ //x0^2 = a mod (p^(k-1))
+ sqroothensellift (x, a, p, kdivtwo, sqpkdivp);
+ if (x == -1) return x;
+
+ Rep pkdivp (pk); pkdivp /= p;
+ //x2^2 = a mod (p^k)
+ return sqrootonemorelift (x, a, p, k-1, ((pkdivp)));
+ } else { // kdivtwo = k/2
+ Rep sqpk; pow(sqpk,p,kdivtwo);
+
+ //x1^2 = a mod (p^(k/2))
+ sqrootmodprimepower(x, a, p, kdivtwo, sqpk);
+ if (x == -1) return x = -1;
+
+ //x0^2 = a mod (p^k)
+ return sqroothensellift (x, a, p, kdivtwo, sqpk);
+ }
+ }
+ return x;
+}
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqrootmodpoweroftwo (Rep & x,
+ const Rep & a,
+ const unsigned long k,
+ const Rep & pk) const {
+ Rep tmpa (a); tmpa %= pk;
+ x = 0;
+ //first cases k = 1,2,3
+ if (k == 1) return x = tmpa;
+ if (k == 2) {
+ if (tmpa == 0) return x = 0;
+ if (tmpa == 1) return x = 1;
+ else {
+ std::cerr << tmpa << "is not a quadratic residu mod " << pk << std::endl;
+ return x = -1;
+ }
+ }
+ if (k == 3) {
+ if (tmpa == 0) return x = 0;
+ if (tmpa == 1) return x = 1;
+ if (tmpa == 4) return x = 2;
+ else{
+ std::cerr << tmpa << " is not a quadratic residu mod " << pk << " (case k = 3)" << std::endl;
+ return x = -1;
+ }
+ }
+ // General case k >= 4
+ if(tmpa==0) return x=0;
+ if(tmpa==1) return x=1;
+ if ((tmpa & 1UL)==0){
+
+ Rep b(tmpa);
+ unsigned long t=0;
+ for( ; (b & 1UL) == 0; ++t) b>>=1; // a = b p^t and p does not divide b
+
+ if ((t & 1UL)==0) {
+ Rep sqrtpt(1); sqrtpt<<=(t>>1);
+ sqrootmodpoweroftwo(x,b,k,pk);
+ x <<= (t>>1); // x <-- x * 2^{t/2}
+ return x%=pk;
+ } else {
+ std::cerr << tmpa << "is not a quadratic residu mod " << pk << std::endl;
+ return x=-1;
+ }
+ }
+
+
+ //linear version
+ if (k < 29) return sqroottwolinear (x, a, k);
+ else {
+
+ Rep un (1);
+ unsigned long kdivtwoplusone(k);
+ kdivtwoplusone >>= 1; ++kdivtwoplusone;
+ // is k/2+1 if k is even, (k-1)/2+1 otherwise
+
+ Rep pkmulttwo (pk); pkmulttwo <<= 1;
+ Rep pkdivtwo (pk); pkdivtwo >>= 1;
+
+ if ((k & 1) == 0){
+ //if k is even
+ Rep sqrt_pk_mult_two (2); sqrt_pk_mult_two <<= (k>>1);
+ //x0^2=a mod (2^{k/2+1})
+ sqrootmodpoweroftwo (x, tmpa, kdivtwoplusone, (sqrt_pk_mult_two));
+ if (x == -1) return x;
+
+ //x1^2=a mod (2^k)
+ return sqrootmodtwolift (x, tmpa, kdivtwoplusone, (sqrt_pk_mult_two));
+ } else {
+ //if k is odd
+ Rep sqrt_pkdivtwo_mult_two (2); sqrt_pkdivtwo_mult_two <<= (k>>1);
+ //x0^2=a mod (2^{k/2+1})
+ sqrootmodpoweroftwo (x, tmpa,kdivtwoplusone, (sqrt_pkdivtwo_mult_two));
+ if (x == -1) return x;
+
+ //x1^2=a mod (p^{k-1})
+ sqrootmodtwolift (x, tmpa, kdivtwoplusone, (sqrt_pkdivtwo_mult_two));
+ if (x == -1) return x;
+
+ Rep u(tmpa);
+ Integer::maxpyin(u,x,x); u %= pk;
+ //if x is a square root of a mod p^k
+ if (u == 0) return x;
+
+ //if x is not square root of a mod p^k
+ //x + (p^{k-2}) is a square root of a mod p^k
+ return x += pk>>2;
+ }
+ }
+ return x;
+}
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqrootlinear (Rep & x,
+ const Rep & a,
+ const Rep & p,
+ const unsigned long k) const {
+ sqrootmodprime(x,a,p);
+ Rep pk(p);
+ for(unsigned long i=1;i<k;i++){
+ sqrootonemorelift(x,a,p,i,pk);
+ pk *= p;
+ }
+ return x;
+}
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqroottwolinear (Rep & x,
+ const Rep & a,
+ const unsigned long k) const {
+ //first cases k = 1,2,3
+ sqrootmodpoweroftwo(x, a, 3, 8);
+ if (x == -1 || k<4) return x;
+
+ Rep pk(16);
+ Rep pk2(4);
+ for(unsigned long i=4;i<=k;i++){
+ if(((x*x)%pk)!=(a%pk)){
+ x+=pk2;
+ }
+ pk2=pk;
+ pk2>>=1;
+ pk<<=1;
+ }
+ return x;
+}
+
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqroothensellift (Rep & x,
+ const Rep & a,
+ const Rep & p,
+ const unsigned long k,
+ const Rep & pk) const {
+//we have a square root of a mod p^k : x0
+//x = x0 + h*p^k mod p^{2k}
+//with h = ((((a-x0^2) mod p^{2k})/p^k)*(2x0)^{-1} mod p^k) mod p^(2k)
+//is a square root of a mod p^{2k}
+ Rep u(a);
+ Integer::maxpyin(u,x,x);
+ if(u == 0) return x;
+
+ u /= pk;
+// u %= pk;
+//u=(a-x0^2)/p^k
+
+ Rep h(x<<1);
+ this->invin (h, pk);
+ h *= u; h %= pk;
+// h = (a-x0^2)/(2*x0*p^k) modulo pk
+
+ return Integer::axpyin(x,h,pk);
+}
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqrootonemorelift (Rep & x0,
+ const Rep & a,
+ const Rep & p,
+ const unsigned long k,
+ const Rep & pk) const {
+ Rep u(a);
+ Integer::maxpyin(u,x0,x0);
+ u /= pk; u %= p;
+ if (u == 0) return x0;
+
+//u=(a-x0^2)/p^k
+
+ Rep h(x0<<1);
+ this->invin (h, p);
+ h *= u; h %= p;
+// h = (a-x0^2)/(2*x0*p^k) modulo p
+
+ return Integer::axpyin(x0,h,pk);
+}
+
+template <class RandIter> inline typename IntSqrtModDom<RandIter>::Rep &
+IntSqrtModDom<RandIter>::sqrootmodtwolift (Rep & x,
+ const Rep & a,
+ const unsigned long k,
+ const Rep & pk) const {
+//we have a square root of a mod 2^k : x0 and we have
+//x = x0 + h*2^{k-1}
+//with h = ((((a-x0^2)mod 2^{2k-2})/2^k)*x0^{-1}mod 2^{k-1}) mod 2^{k-1}
+//is a square root of a mod 2^{2k-2}
+ Rep u(a);
+ Integer::maxpyin(u,x,x);
+ u /= pk;
+
+ Rep pk1(pk); pk1 >>= 1;
+ u %= pk1;
+ if (u == 0) return x;
+
+ Rep h(x);
+ invin(h,pk1);
+ h *= u; h %= pk1;
+
+ return Integer::axpyin(x,h,pk1);
+}
+
+} // namespace Givaro
+
+#endif // __GIVARO_sqrootmod_INL
diff --git a/src/kernel/memory/Makefile.am b/src/kernel/memory/Makefile.am
index 7a99089..e8c8f9f 100644
--- a/src/kernel/memory/Makefile.am
+++ b/src/kernel/memory/Makefile.am
@@ -1,11 +1,18 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/system
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
+AM_CXXFLAGS=@DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/system
+
+pkginclude_HEADERS= \
givaromm.h \
givpointer.h \
- givref_count.h
+ givref_count.h
noinst_LTLIBRARIES=libgivmemory.la
libgivmemory_la_SOURCES=givaromm.C
diff --git a/src/kernel/memory/Makefile.in b/src/kernel/memory/Makefile.in
index 92237a9..302fe0b 100644
--- a/src/kernel/memory/Makefile.in
+++ b/src/kernel/memory/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -50,8 +64,8 @@ libgivmemory_la_LIBADD =
am_libgivmemory_la_OBJECTS = givaromm.lo
libgivmemory_la_OBJECTS = $(am_libgivmemory_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -83,26 +97,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -112,40 +127,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -185,14 +210,15 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/system
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/kernel/system
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
givaromm.h \
givpointer.h \
- givref_count.h
+ givref_count.h
noinst_LTLIBRARIES = libgivmemory.la
libgivmemory_la_SOURCES = givaromm.C
@@ -204,14 +230,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/memory/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/memory/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/memory/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/memory/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -247,28 +273,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givaromm.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -298,7 +310,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -403,7 +415,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -414,6 +425,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -422,22 +435,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/kernel/memory/givaromm.C b/src/kernel/memory/givaromm.C
index 6c2be98..a3f4c9e 100644
--- a/src/kernel/memory/givaromm.C
+++ b/src/kernel/memory/givaromm.C
@@ -1,9 +1,12 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/memory/givaromm.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: givaromm.C,v 1.3 2008-04-22 16:55:57 jgdumas Exp $
+// $Id: givaromm.C,v 1.5 2010-10-15 13:43:48 bboyer Exp $
// ==========================================================================
// Description:
@@ -14,22 +17,24 @@
#include "givaro/givaromm.h"
#include "givaro/giverror.h"
+namespace Givaro {
+
#ifdef GIVARO_MAPMEM
ofstream memlog;
#endif
- // -- Current information of the memory manager:
-GivMMInfo GivMMFreeList::info;
+// -- Current information of the memory manager:
+GivMMInfo GivMMFreeList::info;
#ifdef GIVARO_STATMEM
-size_t& GivMMFreeList::physalloc = GivMMFreeList::info.physalloc;
-size_t& GivMMFreeList::logalloc = GivMMFreeList::info.logalloc;
-long*& GivMMFreeList::tablog = GivMMFreeList::info.tablog;
+size_t& GivMMFreeList::physalloc = GivMMFreeList::info.physalloc;
+size_t& GivMMFreeList::logalloc = GivMMFreeList::info.logalloc;
+long*& GivMMFreeList::tablog = GivMMFreeList::info.tablog;
long*& GivMMFreeList::tabphy = GivMMFreeList::info.tabphy;
#endif
-
-// -- for debug #define register
+
+// -- for debug #define
// ======================================================================= //
// Short description of the Givaro memory mechanism:
@@ -39,78 +44,78 @@ long*& GivMMFreeList::tabphy = GivMMFreeList::info.tabphy;
// The allocation algorithm search in the corresponding list a free bloc,
// before call the system "malloc" routine.
// 512 different sizes of bloc are predefined.
-// The maximum bloc size is 8054880 bytes.
+// The maximum bloc size is 8054880 bytes.
// For higher bloc, the manager directly call malloc/free of the underlaying system.
const int BlocFreeList::lenTables = 512 ;
BlocFreeList* BlocFreeList::TabFree[512];
const size_t BlocFreeList::TabSize[] = { // -- array of different sizes of bloc (bytes)
-// --- 8 values per line (I hope !)
-1, 2, 3, 4, 5, 6, 7, 8,
-9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25, 26, 27, 28, 29, 30, 31, 32,
-64, 96, 128, 160, 192, 224, 256, 288,
-320, 352, 384, 416, 448, 480, 512, 544,
-576, 608, 640, 672, 704, 736, 768, 800,
-832, 864, 896, 928, 960, 992, 1024, 1056,
-1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312,
-1344, 1376, 1408, 1440, 1472, 1504, 1536, 1568,
-1600, 1632, 1664, 1696, 1728, 1760, 1792, 1824,
-1856, 1920, 1952, 1984, 2016, 2048, 2112, 2144,
-2176, 2240, 2272, 2336, 2368, 2400, 2464, 2496,
-2560, 2624, 2656, 2720, 2784, 2816, 2880, 2944,
-3008, 3072, 3104, 3168, 3232, 3296, 3360, 3456,
-3520, 3584, 3648, 3712, 3808, 3872, 3936, 4032,
-4096, 4192, 4288, 4352, 4448, 4544, 4640, 4704,
-4800, 4896, 4992, 5120, 5216, 5312, 5408, 5536,
-5632, 5760, 5856, 5984, 6112, 6208, 6336, 6464,
-6592, 6720, 6880, 7008, 7136, 7296, 7424, 7584,
-7744, 7872, 8032, 8192, 8384, 8544, 8704, 8864,
-9056, 9248, 9408, 9600, 9792, 9984, 10208, 10400,
-10624, 10816, 11040, 11264, 11488, 11712, 11936, 12192,
-12416, 12672, 12928, 13184, 13440, 13728, 13984, 14272,
-14560, 14848, 15136, 15456, 15744, 16064, 16384, 16704,
-17056, 17408, 17728, 18112, 18464, 18816, 19200, 19584,
-19968, 20384, 20800, 21184, 21632, 22048, 22496, 22944,
-23392, 23872, 24352, 24832, 25344, 25824, 26368, 26880,
-27424, 27968, 28512, 29088, 29664, 30272, 30880, 31488,
-32128, 32768, 33408, 34080, 34784, 35456, 36160, 36896,
-37632, 38400, 39168, 39936, 40736, 41536, 42368, 43232,
-44096, 44960, 45888, 46784, 47712, 48672, 49664, 50656,
-51648, 52704, 53760, 54816, 55904, 57024, 58176, 59328,
-60512, 61728, 62976, 64224, 65504, 66816, 68160, 69536,
-70912, 72320, 73760, 75264, 76768, 78304, 79840, 81440,
-83072, 84736, 86432, 88160, 89920, 91712, 93568, 95424,
-97344, 99296, 101280, 103296, 105376, 107456, 109632, 111808,
-114048, 116320, 118656, 121024, 123456, 125920, 128448, 131008,
-133632, 136288, 139008, 141792, 144640, 147520, 150464, 153472,
-156544, 159680, 162880, 166144, 169472, 172864, 176320, 179840,
-183424, 187104, 190848, 194656, 198560, 202528, 206560, 210688,
-214912, 219200, 223584, 228064, 232640, 237280, 242016, 246848,
-251808, 256832, 261984, 267200, 272544, 278016, 283552, 289248,
-295008, 300928, 306944, 313088, 319328, 325728, 332224, 338880,
-345664, 352576, 359616, 366816, 374144, 381632, 389280, 397056,
-404992, 413088, 421344, 429792, 438368, 447136, 456096, 465216,
-474528, 484000, 493696, 503552, 513632, 523904, 534368, 545056,
-555968, 567072, 578432, 589984, 601792, 613824, 626112, 638624,
-651392, 664416, 677728, 691264, 705088, 719200, 733568, 748256,
-763200, 778464, 794048, 809920, 826112, 842656, 859488, 876704,
-894240, 912096, 930336, 948960, 967936, 987296, 1007040, 1027168,
-1047712, 1068672, 1090048, 1111840, 1134080, 1156768, 1179904, 1203488,
-1227584, 1252128, 1277152, 1302720, 1328768, 1355328, 1382432, 1410080,
-1438304, 1467072, 1496416, 1526336, 1556864, 1588000, 1619744, 1652160,
-1685184, 1718880, 1753280, 1788320, 1824096, 1860576, 1897792, 1935744,
-1974464, 2013952, 2054240, 2095328, 2137216, 2179968, 2223552, 2268032,
-2313408, 2359648, 2406848, 2455008, 2504096, 2554176, 2605248, 2657376,
-2710496, 2764704, 2820000, 2876416, 2933952, 2992608, 3052480, 3113536,
-3175776, 3239296, 3304096, 3370176, 3437568, 3506336, 3576448, 3647968,
-3720928, 3795360, 3871264, 3948704, 4027680, 4108224, 4190400, 4274176,
-4359680, 4446880, 4535808, 4626528, 4719040, 4813440, 4909696, 5007904,
-5108064, 5210208, 5314400, 5420704, 5529120, 5639712, 5752480, 5867552,
-5984896, 6104576, 6226688, 6351200, 6478240, 6607808, 6739968, 6874752,
-7012256, 7152512, 7295552, 7441472, 7590272, 7742080, 7896928, 8054880
+ // --- 8 values per line (I hope !)
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ 64, 96, 128, 160, 192, 224, 256, 288,
+ 320, 352, 384, 416, 448, 480, 512, 544,
+ 576, 608, 640, 672, 704, 736, 768, 800,
+ 832, 864, 896, 928, 960, 992, 1024, 1056,
+ 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312,
+ 1344, 1376, 1408, 1440, 1472, 1504, 1536, 1568,
+ 1600, 1632, 1664, 1696, 1728, 1760, 1792, 1824,
+ 1856, 1920, 1952, 1984, 2016, 2048, 2112, 2144,
+ 2176, 2240, 2272, 2336, 2368, 2400, 2464, 2496,
+ 2560, 2624, 2656, 2720, 2784, 2816, 2880, 2944,
+ 3008, 3072, 3104, 3168, 3232, 3296, 3360, 3456,
+ 3520, 3584, 3648, 3712, 3808, 3872, 3936, 4032,
+ 4096, 4192, 4288, 4352, 4448, 4544, 4640, 4704,
+ 4800, 4896, 4992, 5120, 5216, 5312, 5408, 5536,
+ 5632, 5760, 5856, 5984, 6112, 6208, 6336, 6464,
+ 6592, 6720, 6880, 7008, 7136, 7296, 7424, 7584,
+ 7744, 7872, 8032, 8192, 8384, 8544, 8704, 8864,
+ 9056, 9248, 9408, 9600, 9792, 9984, 10208, 10400,
+ 10624, 10816, 11040, 11264, 11488, 11712, 11936, 12192,
+ 12416, 12672, 12928, 13184, 13440, 13728, 13984, 14272,
+ 14560, 14848, 15136, 15456, 15744, 16064, 16384, 16704,
+ 17056, 17408, 17728, 18112, 18464, 18816, 19200, 19584,
+ 19968, 20384, 20800, 21184, 21632, 22048, 22496, 22944,
+ 23392, 23872, 24352, 24832, 25344, 25824, 26368, 26880,
+ 27424, 27968, 28512, 29088, 29664, 30272, 30880, 31488,
+ 32128, 32768, 33408, 34080, 34784, 35456, 36160, 36896,
+ 37632, 38400, 39168, 39936, 40736, 41536, 42368, 43232,
+ 44096, 44960, 45888, 46784, 47712, 48672, 49664, 50656,
+ 51648, 52704, 53760, 54816, 55904, 57024, 58176, 59328,
+ 60512, 61728, 62976, 64224, 65504, 66816, 68160, 69536,
+ 70912, 72320, 73760, 75264, 76768, 78304, 79840, 81440,
+ 83072, 84736, 86432, 88160, 89920, 91712, 93568, 95424,
+ 97344, 99296, 101280, 103296, 105376, 107456, 109632, 111808,
+ 114048, 116320, 118656, 121024, 123456, 125920, 128448, 131008,
+ 133632, 136288, 139008, 141792, 144640, 147520, 150464, 153472,
+ 156544, 159680, 162880, 166144, 169472, 172864, 176320, 179840,
+ 183424, 187104, 190848, 194656, 198560, 202528, 206560, 210688,
+ 214912, 219200, 223584, 228064, 232640, 237280, 242016, 246848,
+ 251808, 256832, 261984, 267200, 272544, 278016, 283552, 289248,
+ 295008, 300928, 306944, 313088, 319328, 325728, 332224, 338880,
+ 345664, 352576, 359616, 366816, 374144, 381632, 389280, 397056,
+ 404992, 413088, 421344, 429792, 438368, 447136, 456096, 465216,
+ 474528, 484000, 493696, 503552, 513632, 523904, 534368, 545056,
+ 555968, 567072, 578432, 589984, 601792, 613824, 626112, 638624,
+ 651392, 664416, 677728, 691264, 705088, 719200, 733568, 748256,
+ 763200, 778464, 794048, 809920, 826112, 842656, 859488, 876704,
+ 894240, 912096, 930336, 948960, 967936, 987296, 1007040, 1027168,
+ 1047712, 1068672, 1090048, 1111840, 1134080, 1156768, 1179904, 1203488,
+ 1227584, 1252128, 1277152, 1302720, 1328768, 1355328, 1382432, 1410080,
+ 1438304, 1467072, 1496416, 1526336, 1556864, 1588000, 1619744, 1652160,
+ 1685184, 1718880, 1753280, 1788320, 1824096, 1860576, 1897792, 1935744,
+ 1974464, 2013952, 2054240, 2095328, 2137216, 2179968, 2223552, 2268032,
+ 2313408, 2359648, 2406848, 2455008, 2504096, 2554176, 2605248, 2657376,
+ 2710496, 2764704, 2820000, 2876416, 2933952, 2992608, 3052480, 3113536,
+ 3175776, 3239296, 3304096, 3370176, 3437568, 3506336, 3576448, 3647968,
+ 3720928, 3795360, 3871264, 3948704, 4027680, 4108224, 4190400, 4274176,
+ 4359680, 4446880, 4535808, 4626528, 4719040, 4813440, 4909696, 5007904,
+ 5108064, 5210208, 5314400, 5420704, 5529120, 5639712, 5752480, 5867552,
+ 5984896, 6104576, 6226688, 6351200, 6478240, 6607808, 6739968, 6874752,
+ 7012256, 7152512, 7295552, 7441472, 7590272, 7742080, 7896928, 8054880
};
@@ -118,24 +123,25 @@ const size_t BlocFreeList::TabSize[] = { // -- array of different sizes of bloc
// ======================================================================= //
// Class GivMMFreeList : allocation/destroy methods
-inline int BlocFreeList::search_binary( size_t sz )
+inline int BlocFreeList::search_binary( size_t sz )
{
- if (sz <= 32) return sz-1;
- register int max = BlocFreeList::lenTables-1; // -- last element in TabSize
- if (sz > BlocFreeList::TabSize[max])
- throw GivError("[GivaroMM]: unable to allocate this size of memory");
- register int min = 0;
- register int med;
- register unsigned int curr;
- med = 8; // may be value < TabSize[8]
- do {
- curr = BlocFreeList::TabSize[med];
- if (curr == sz) return med;
- if (curr < sz) { min = med; }
- else { max = med; }
- med = (max+min)>>1; // /2
- } while ( min != med );
- return max;
+ if (sz <= 32)
+ return int(sz-1);
+ int max = BlocFreeList::lenTables-1; // -- last element in TabSize
+ if (sz > BlocFreeList::TabSize[max])
+ throw GivError("[GivaroMM]: unable to allocate this size of memory");
+ int min = 0;
+ int med;
+ unsigned int curr;
+ med = 8; // may be value < TabSize[8]
+ do {
+ curr = (unsigned int) BlocFreeList::TabSize[med];
+ if (curr == sz) return med;
+ if (curr < sz) { min = med; }
+ else { max = med; }
+ med = (max+min)>>1; // /2
+ } while ( min != med );
+ return max;
}
@@ -143,210 +149,216 @@ inline int BlocFreeList::search_binary( size_t sz )
#define ALIGN(s) (s>>2 + 1) // may one more ?
BlocFreeList* GivMMFreeList::_allocate (const size_t s)
-{
- register int index = BlocFreeList::search_binary( s );
+{
+ int index = BlocFreeList::search_binary( s );
#ifdef GIVARO_DEBUG
- if ((index <0) || (index >= BlocFreeList::lenTables))
- throw GivError("[GivMMFreeList::_allocate]: index error, invalid bloc size.");
-#endif
- register BlocFreeList* tmp;
- if (BlocFreeList::TabFree[index] !=0) {
- tmp = BlocFreeList::TabFree[index];
- BlocFreeList::TabFree[index] = tmp->u.nextfree;
- }
- else {
- tmp = (BlocFreeList*) malloc(
- (BlocFreeList::TabSize[index]+sizeof(BlocFreeList)-sizeof(long)) );
-
-#ifdef GIVARO_STATMEM
- tabphy[index] ++; physalloc += BlocFreeList::TabSize[index];
-#endif
- }
-#ifdef GIVARO_STATMEM
- tablog[index] ++; logalloc += BlocFreeList::TabSize[index];
-#endif
- tmp->u.index = index;
+ if ((index <0) || (index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMFreeList::_allocate]: index error, invalid bloc size.");
+#endif
+ BlocFreeList* tmp;
+ if (BlocFreeList::TabFree[index] !=0) {
+ tmp = BlocFreeList::TabFree[index];
+ BlocFreeList::TabFree[index] = tmp->u.nextfree;
+ }
+ else {
+ tmp = (BlocFreeList*) malloc( (BlocFreeList::TabSize[index]+sizeof(BlocFreeList)-sizeof(long)) );
+
+#ifdef GIVARO_STATMEM
+ tabphy[index] ++; physalloc += BlocFreeList::TabSize[index];
+#endif
+ }
+#ifdef GIVARO_STATMEM
+ tablog[index] ++; logalloc += BlocFreeList::TabSize[index];
+#endif
+ tmp->u.index = index;
#ifdef GIVARO_MAPMEM
-memlog << "alloc: in:" << (void*) tmp << ", user:" << (void*)tmp->data << std::endl;
+ memlog << "alloc: in:" << (void*) tmp << ", user:" << (void*)tmp->data << std::endl;
#endif
- return tmp;
+ return tmp;
}
void* GivMMFreeList::reallocate (void* src, const size_t oldsize, const size_t newsize)
{
- if (src ==0) return _allocate(newsize) ;
- if (newsize <= oldsize) return src;
- register BlocFreeList* tmp = (BlocFreeList*)(((char*)src)-sizeof(BlocFreeList)+sizeof(long));
+ if (src ==0) return _allocate(newsize) ;
+ if (newsize <= oldsize) return src;
+ BlocFreeList* tmp = (BlocFreeList*)(((char*)src)-sizeof(BlocFreeList)+sizeof(long));
#ifdef GIVARO_DEBUG
- if ((tmp->u.index <0) || (tmp->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMFreeList::reallocate]: bad pointer 'src'");
-#endif
+ if ((tmp->u.index <0) || (tmp->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMFreeList::reallocate]: bad pointer 'src'");
+#endif
#ifdef GIVARO_MAPMEM
-memlog << "reall: in:" << (void*) tmp << ", user:" << (void*)src << std::endl;
+ memlog << "reall: in:" << (void*) tmp << ", user:" << (void*)src << std::endl;
#endif
- register int index = tmp->u.index;
- if (BlocFreeList::TabSize[index] >= newsize) return src;
- tmp = GivMMFreeList::_allocate( newsize );
- if (oldsize !=0) ::memcpy( tmp->data, src, oldsize );
- return tmp->data;
+ int index = tmp->u.index;
+ if (BlocFreeList::TabSize[index] >= newsize) return src;
+ tmp = GivMMFreeList::_allocate( newsize );
+ if (oldsize !=0) ::memcpy( tmp->data, src, oldsize );
+ return tmp->data;
}
void GivMMFreeList::memcpy( void* dest, const void* src, const size_t size )
{
- register BlocFreeList* tmp1 = (BlocFreeList*)(((char*)dest) - sizeof(BlocFreeList)+sizeof(long));
- register BlocFreeList* tmp2 = (BlocFreeList*)(((char*)src) - sizeof(BlocFreeList)+sizeof(long));
+ BlocFreeList* tmp1 = (BlocFreeList*)(((char*)dest) - sizeof(BlocFreeList)+sizeof(long));
+ BlocFreeList* tmp2 = (BlocFreeList*)(((char*)src) - sizeof(BlocFreeList)+sizeof(long));
#ifdef GIVARO_DEBUG
- if ((tmp1->u.index <0) || (tmp1->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMFreeList::memcpy]: bad pointer 'dest'");
- if ((tmp2->u.index <0) || (tmp2->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMFreeList::memcpy]: bad pointer 'src'");
-#endif
- ::memcpy ( tmp1->data, tmp2->data, size );
+ if ((tmp1->u.index <0) || (tmp1->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMFreeList::memcpy]: bad pointer 'dest'");
+ if ((tmp2->u.index <0) || (tmp2->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMFreeList::memcpy]: bad pointer 'src'");
+#endif
+ ::memcpy ( tmp1->data, tmp2->data, size );
}
-void GivMMFreeList::Destroy()
+void GivMMFreeList::Destroy()
{
- for (int i=0; i<BlocFreeList::lenTables; i++)
- {
- BlocFreeList* curr = BlocFreeList::TabFree[i];
- while (curr !=0) {
- BlocFreeList* tmp = curr->u.nextfree;
- free((char*)curr);
- curr = tmp;
- }
- }
+ for (int i=0; i<BlocFreeList::lenTables; i++)
+ {
+ BlocFreeList* curr = BlocFreeList::TabFree[i];
+ while (curr !=0) {
+ BlocFreeList* tmp = curr->u.nextfree;
+ free((char*)curr);
+ curr = tmp;
+ }
+ }
}
-void* GivMMRefCount::reallocate (void* p, const size_t oldsize, const size_t newsize )
+void* GivMMRefCount::reallocate (void* p, const size_t oldsize, const size_t newsize )
{
- if (p ==0)
- return &(GivMMFreeList::_allocate(newsize+sizeof(long))->data[1]) ;
+ if (p ==0)
+ return &(GivMMFreeList::_allocate(newsize+sizeof(long))->data[1]) ;
- register BlocFreeList* tmp = (BlocFreeList*)(((char*)p)-sizeof(BlocFreeList));
+ BlocFreeList* tmp = (BlocFreeList*)(((char*)p)-sizeof(BlocFreeList));
#ifdef GIVARO_DEBUG
- if ((tmp->u.index <0) || (tmp->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMRefCount::reallocate]: bad pointer");
-#endif
- if (tmp->data[0] ==1) { // -- one pointer on the bloc, use standard optimization
- if (newsize <= oldsize) return p;
+ if ((tmp->u.index <0) || (tmp->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMRefCount::reallocate]: bad pointer");
+#endif
+ if (tmp->data[0] ==1) { // -- one pointer on the bloc, use standard optimization
+ if (newsize <= oldsize) return p;
#ifdef GIVARO_MAPMEM
- memlog << "reall: in:" << (void*) tmp << ", user:" << (void*)p << std::endl;
+ memlog << "reall: in:" << (void*) tmp << ", user:" << (void*)p << std::endl;
#endif
- register int index = tmp->u.index;
- if (BlocFreeList::TabSize[index] >= sizeof(long)+newsize) return p;
- GivMMRefCount::desallocate(p);
- }
- else --(tmp->data[0]); // -- two pointer on the bloc:
- tmp = GivMMFreeList::_allocate( newsize+sizeof(long) );
- tmp->data[0] = 1 ;
- if (oldsize !=0) {
- if (newsize <= oldsize) ::memcpy( &(tmp->data[1]), p, newsize );
- else ::memcpy( &(tmp->data[1]), p, oldsize );
- }
- return &(tmp->data[1]);
+ int index = tmp->u.index;
+ if (BlocFreeList::TabSize[index] >= sizeof(long)+newsize) return p;
+ GivMMRefCount::desallocate(p);
+ }
+ else --(tmp->data[0]); // -- two pointer on the bloc:
+ tmp = GivMMFreeList::_allocate( newsize+sizeof(long) );
+ tmp->data[0] = 1 ;
+ if (oldsize !=0) {
+ if (newsize <= oldsize) ::memcpy( &(tmp->data[1]), p, newsize );
+ else ::memcpy( &(tmp->data[1]), p, oldsize );
+ }
+ return &(tmp->data[1]);
}
// -------- Static informations of memory allocation
GivMMInfo::GivMMInfo()
-{
- tabbloc = ::new size_t[BlocFreeList::lenTables];
- tablog = ::new long[BlocFreeList::lenTables];
- tabphy = ::new long[BlocFreeList::lenTables];
- sizetab = BlocFreeList::lenTables;
- for (int i=0; i<sizetab; i++) {
- tabbloc[i] = BlocFreeList::TabSize[i];
- tabphy[i] = 0;
- tablog[i] = 0;
- }
+{
+ tabbloc = ::new size_t[BlocFreeList::lenTables];
+ tablog = ::new long[BlocFreeList::lenTables];
+ tabphy = ::new long[BlocFreeList::lenTables];
+ sizetab = BlocFreeList::lenTables;
+ for (int i=0; i<sizetab; i++) {
+ tabbloc[i] = BlocFreeList::TabSize[i];
+ tabphy[i] = 0;
+ tablog[i] = 0;
+ }
}
GivMMInfo::~GivMMInfo()
{
- ::delete[] tabbloc;
- ::delete[] tablog;
- ::delete[] tabphy;
+ ::delete[] tabbloc;
+ ::delete[] tablog;
+ ::delete[] tabphy;
}
std::ostream& GivMMInfo::print( std::ostream& so ) const
{
- so << "--- Memory usage" << std::endl;
- so << "- physical allocated memory (in bytes):" << physalloc << std::endl;
- so << "- logical allocated memory (in bytes):" << logalloc << std::endl;
- so << "- details for each bloc size:\n";
- so.width(7); so << "index" << ": "; so.width(9); so << "bytes" << " | ";
- so.width(9); so << "#physical" << " | "; so.width(9); so << "#logical" << std::endl;
- for (long i=0; i<sizetab; i++) {
- if (tabphy[i] !=0) {
- so.width(7); so << i << ": ";
- so.width(9); so << tabbloc[i] << " | " ;
- so.width(9); so << tabphy[i] << " | ";
- so.width(9); so << tablog[i] << std::endl;
- }
- }
- return so;
+ so << "--- Memory usage" << std::endl;
+ so << "- physical allocated memory (in bytes):" << physalloc << std::endl;
+ so << "- logical allocated memory (in bytes):" << logalloc << std::endl;
+ so << "- details for each bloc size:\n";
+ so.width(7); so << "index" << ": "; so.width(9); so << "bytes" << " | ";
+ so.width(9); so << "#physical" << " | "; so.width(9); so << "#logical" << std::endl;
+ for (long i=0; i<sizetab; i++) {
+ if (tabphy[i] !=0) {
+ so.width(7); so << i << ": ";
+ so.width(9); so << tabbloc[i] << " | " ;
+ so.width(9); so << tabphy[i] << " | ";
+ so.width(9); so << tablog[i] << std::endl;
+ }
+ }
+ return so;
}
- // -- Returns some memory usage informations
+// -- Returns some memory usage informations
const GivMMInfo& GivMMFreeList::Usage()
{
- return GivMMFreeList::info;
+ return GivMMFreeList::info;
}
// ------ Initialization module:
GivModule GivMMFreeList::Module (GivMMFreeList::Init,
- GivMMFreeList::End,
- GivModule::MaxPriority,
- "Givaro Memory Manager") ;
+ GivMMFreeList::End,
+ GivModule::MaxPriority,
+ "Givaro Memory Manager") ;
-void GivMMFreeList::Init(int* argc, char***argv)
+void GivMMFreeList::Init(int* , char***)
{
#ifdef GIVARO_MAPMEM
- memlog.open("mem.log", ios::out);
+ memlog.open("mem.log", ios::out);
#endif
- for (int i=0; i<BlocFreeList::lenTables; i++)
- BlocFreeList::TabFree[i] = 0;
+ for (int i=0; i<BlocFreeList::lenTables; i++)
+ BlocFreeList::TabFree[i] = 0;
}
void GivMMFreeList::End()
{
#ifdef GIVARO_MAPMEM
- memlog.close();
+ memlog.close();
#endif
-}
+ Destroy();
-/*
-\documentstyle[12pt,a4]{article}
-\pagestyle{empty}
-\title{Mousse au chocolat}
-\date{Pour 5 personnes}
-\textwidth 12cm
-\begin{document}
-\maketitle
-\thispagestyle{empty}
-\vspace*{3cm}
-
-{\it \noindent {\large Ingr\'edients} \\
-250 g chocolat noir \\
-5 oeufs \\
-80 g beurre (ou moins)\\
-50 g sucre\\
}
-\vspace*{1.5cm}
-\noindent {\large Pr\'eparation} \\
-S\'eparer les jaunes des blancs.
-M\'elanger les jaunes avec le sucre jusqu'\`a ce que le m\'elange mousse et blanchisse. \\
-Faire fondre le chocolat doucement avec le beurre. L'incorporer au m\'elange
-jaunes/sucre. \\
-Monter les blancs en neige tr\`es ferme. Les incorporer au m\'elange jaunes/chocolat. \\
-
-\noindent Un truc : incorporer le premier tiers des blancs en remuant \'ener\-giquement pour que le m\'elange soit moins ferme, puis incorporer d\'elicatement le reste des blancs.
-
-\end{document}
-*/
+/*
+ \documentstyle[12pt,a4]{article}
+ \pagestyle{empty}
+ \title{Mousse au chocolat}
+ \date{Pour 5 personnes}
+ \textwidth 12cm
+ \begin{document}
+ \maketitle
+ \thispagestyle{empty}
+ \vspace*{3cm}
+
+ {\it \noindent {\large Ingr\'edients} \\
+ 250 g chocolat noir \\
+ 5 oeufs \\
+ 80 g beurre (ou moins)\\
+ 50 g sucre\\
+ }
+
+ \vspace*{1.5cm}
+ \noindent {\large Pr\'eparation} \\
+ S\'eparer les jaunes des blancs.
+ M\'elanger les jaunes avec le sucre jusqu'\`a ce que le m\'elange mousse et blanchisse. \\
+ Faire fondre le chocolat doucement avec le beurre. L'incorporer au m\'elange
+ jaunes/sucre. \\
+ Monter les blancs en neige tr\`es ferme. Les incorporer au m\'elange jaunes/chocolat. \\
+
+ \noindent Un truc : incorporer le premier tiers des blancs en remuant \'ener\-giquement pour que le m\'elange soit moins ferme, puis incorporer d\'elicatement le reste des blancs.
+
+ \end{document}
+ */
+
+} // namespace Givaro
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/memory/givaromm.h b/src/kernel/memory/givaromm.h
index 6e19ed0..7a64fa2 100644
--- a/src/kernel/memory/givaromm.h
+++ b/src/kernel/memory/givaromm.h
@@ -1,43 +1,46 @@
-#ifndef _GIVAROMM_H_
-#define _GIVAROMM_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/memory/givaromm.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givaromm.h,v 1.3 2008-04-22 16:15:49 pernet Exp $
+// $Id: givaromm.h,v 1.7 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// - two memory managers: the first one handle a set on free-list
// of blocs, the second one implement a reference mecanism on
// the bloc. The latter used method of the former.
+#ifndef __GIVARO_mm_H
+#define __GIVARO_mm_H
#include <cstring> // gcc 4.3
-#include <stddef.h> // size_t definition
+#include <stddef.h> // size_t definition
#include <iostream> // ostream definition
#include <new>
#include "givaro/givmodule.h"
-#include "givaro/givbasictype.h"
+#include "givaro/givbasictype.h"
#ifdef GIVARO_DEBUG
#include "givaro/giverror.h"
#endif
-
+namespace Givaro {
// ==================================================================== //
// -------- Static informations of memory allocation
class GivMMInfo {
public:
- GivMMInfo();
- ~GivMMInfo();
- size_t physalloc; // size in bytes of physical allocated bloc
- size_t logalloc; // size in bytes of "logical" allocated bloc
- long sizetab; // length of next arrays
- size_t* tabbloc; // size of all the blocs
- long* tablog; // number of each logical allocated bloc
- long* tabphy; // number of each physical allocated bloc
- std::ostream& print( std::ostream& so ) const;
+ GivMMInfo();
+ ~GivMMInfo();
+ size_t physalloc; // size in bytes of physical allocated bloc
+ size_t logalloc; // size in bytes of "logical" allocated bloc
+ long sizetab; // length of next arrays
+ size_t* tabbloc; // size of all the blocs
+ long* tablog; // number of each logical allocated bloc
+ long* tabphy; // number of each physical allocated bloc
+ std::ostream& print( std::ostream& so ) const;
};
inline std::ostream& operator<<( std::ostream& o, const GivMMInfo& T)
@@ -47,21 +50,21 @@ inline std::ostream& operator<<( std::ostream& o, const GivMMInfo& T)
// -- Data structure of a bloc.
// Each bloc in TabFree[id] has a data field of size TabSize[id]
class BlocFreeList {
- union header {
- int index ; // - index in free list
- BlocFreeList* nextfree; // - pointer to the next free bloc (of the same size)
- } u;
- long data[1]; // - alignement on long, may be no enough one some processor ?
-
- // -- Array of list of free bloc
-static BlocFreeList* TabFree[];
-static const size_t TabSize[] ;
-static const int lenTables;
-static int search_binary( size_t sz ) ;
-
-friend class GivMMInfo;
-friend class GivMMFreeList;
-friend class GivMMRefCount;
+ union header {
+ int index ; // - index in free list
+ BlocFreeList* nextfree; // - pointer to the next free bloc (of the same size)
+ } u;
+ long data[1]; // - alignement on long, may be no enough one some processor ?
+
+ // -- Array of list of free bloc
+ static BlocFreeList* TabFree[];
+ static const size_t TabSize[] ;
+ static const int lenTables;
+ static int search_binary( size_t sz ) ;
+
+ friend class GivMMInfo;
+ friend class GivMMFreeList;
+ friend class GivMMRefCount;
};
@@ -70,207 +73,207 @@ friend class GivMMRefCount;
// All members are static methods.
class GivMMFreeList {
public:
-
- // -- Free all internal data structures
-static void Destroy();
-
- // -- Allocation of a new bloc.
- // These two next functions returns a pointer or 0.
- // The frequently required bloc is treated in a special version
- // in order to speed-up the allocation.
-static BlocFreeList* _allocate (const size_t sz);
-inline static void* allocate (const size_t sz)
-{
+
+ // -- Free all internal data structures
+ static void Destroy();
+
+ // -- Allocation of a new bloc.
+ // These two next functions returns a pointer or 0.
+ // The frequently required bloc is treated in a special version
+ // in order to speed-up the allocation.
+ static BlocFreeList* _allocate (const size_t sz);
+ inline static void* allocate (const size_t sz)
+ {
#ifdef GIVARO_DEBUG
- if (sz ==0) return 0 ;
-#endif
- size_t index;
- register BlocFreeList* tmp;
- if ((sz <= 32) && ((tmp=BlocFreeList::TabFree[index =sz-1]) !=0)) {
- BlocFreeList::TabFree[index] = tmp->u.nextfree;
- tmp->u.index = index;
-#ifdef GIVARO_STATMEM
- tablog[index] ++; logalloc += BlocFreeList::TabSize[index];
-#endif
- return (void*) tmp->data;
- }
- tmp = _allocate(sz);
- return tmp->data ;
-}
-
- // -- Reallocation of a bloc.
- // The function returns a pointer to the possibly new
- // bloc. If the bloc must be moved then only oldsize are
- // recopied.
-static void* reallocate (void* p, const size_t oldsize, const size_t newsize);
-
- // -- Free the bloc pointed by p and allocated by the manager GivMMFreeList.
-inline static void desallocate(void* p, const size_t size=0)
-{
- if (p==0) return ;
- register BlocFreeList* tmp = (BlocFreeList*)(((char*)p) -
- (sizeof(BlocFreeList)-sizeof(long)));
- register int index = tmp->u.index;
+ if (sz ==0) return 0 ;
+#endif
+ size_t index;
+ BlocFreeList* tmp;
+ if ((sz <= 32) && ((tmp=BlocFreeList::TabFree[index =sz-1]) !=0)) {
+ BlocFreeList::TabFree[index] = tmp->u.nextfree;
+ tmp->u.index = (int)index;
+#ifdef GIVARO_STATMEM
+ tablog[index] ++; logalloc += BlocFreeList::TabSize[index];
+#endif
+ return (void*) tmp->data;
+ }
+ tmp = _allocate(sz);
+ return tmp->data ;
+ }
+
+ // -- Reallocation of a bloc.
+ // The function returns a pointer to the possibly new
+ // bloc. If the bloc must be moved then only oldsize are
+ // recopied.
+ static void* reallocate (void* p, const size_t oldsize, const size_t newsize);
+
+ // -- Free the bloc pointed by p and allocated by the manager GivMMFreeList.
+ inline static void desallocate(void* p, const size_t = 0)
+ {
+ if (p==0) return ;
+ BlocFreeList* tmp = (BlocFreeList*)(((char*)p) -
+ (sizeof(BlocFreeList)-sizeof(long)));
+ int index = tmp->u.index;
#ifdef GIVARO_DEBUG
- if ((index <0) || (index >= BlocFreeList::lenTables))
- throw GivError("[GivMMFreeList::desallocate]: bad pointer.");
-#endif
- tmp->u.nextfree = BlocFreeList::TabFree[index];
- BlocFreeList::TabFree[index] = tmp;
-}
-
- // -- Recopy size bytes pointed by src into bytes pointer by dest
-static void memcpy( void* dest, const void* src, const size_t size );
-
- // -- Returns some memory usage informations
-static const GivMMInfo& Usage();
-
-//private:
-// -- bug (on CW10): must comment the private part to initialize next field
-static GivMMInfo info;
-
+ if ((index <0) || (index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMFreeList::desallocate]: bad pointer.");
+#endif
+ tmp->u.nextfree = BlocFreeList::TabFree[index];
+ BlocFreeList::TabFree[index] = tmp;
+ }
+
+ // -- Recopy size bytes pointed by src into bytes pointer by dest
+ static void memcpy( void* dest, const void* src, const size_t size );
+
+ // -- Returns some memory usage informations
+ static const GivMMInfo& Usage();
+
+ //private:
+ // -- bug (on CW10): must comment the private part to initialize next field
+ static GivMMInfo info;
+
#ifdef GIVARO_STATMEM
-friend class GivMMInfo;
-friend class GivMMRefCount;
-static size_t& physalloc; // total amount of physical allocated bloc
-static size_t& logalloc; // total amoun of "logical" allocated bloc
-static long*& tablog; // number of each logical allocated bloc
-static long*& tabphy; // number of each physical allocated bloc
+ friend class GivMMInfo;
+ friend class GivMMRefCount;
+ static size_t& physalloc; // total amount of physical allocated bloc
+ static size_t& logalloc; // total amoun of "logical" allocated bloc
+ static long*& tablog; // number of each logical allocated bloc
+ static long*& tabphy; // number of each physical allocated bloc
#endif
- // -- Initialization module
+ // -- Initialization module
public:
-static GivModule Module;
+ static GivModule Module;
private:
-static void Init(int* argc, char***argv);
-static void End();
-friend class GivModule;
+ static void Init(int* argc, char***argv);
+ static void End();
+ friend class GivModule;
};
- // -- Memory management with reference counter on allocated data.
- // The memory manager uses the BlocFreeList data structure
- // and stores the refcounter in the field data[0]
+// -- Memory management with reference counter on allocated data.
+// The memory manager uses the BlocFreeList data structure
+// and stores the refcounter in the field data[0]
class GivMMRefCount {
-public:
- // -- Allocation of a new bloc of size at least s
-inline static void* allocate (const size_t s)
-{
-
+public:
+ // -- Allocation of a new bloc of size at least s
+ inline static void* allocate (const size_t s)
+ {
+
#ifdef GIVARO_DEBUG
- if (s ==0) return 0 ;
-#endif
- register int index;
- register BlocFreeList* tmp;
- register size_t sz = s + sizeof(long);
- if ((sz <= 32) && ((tmp=BlocFreeList::TabFree[index =sz-1]) !=0)) {
- BlocFreeList::TabFree[index] = tmp->u.nextfree;
- tmp->u.index = index;
-#ifdef GIVARO_STATMEM
- GivMMFreeList::tablog[index] ++; GivMMFreeList::logalloc += BlocFreeList::TabSize[index];
-#endif
- tmp->data[0] = 1 ;
- return (void*) &(tmp->data[1]);
- }
- tmp = GivMMFreeList::_allocate(sz);
- tmp->data[0] = 1 ;
-
-
- return (void*) &(tmp->data[1]);
-}
-
- // -- Reallocation of a bloc. See description in GivMMFreeList's class.
- // Here, if ref count on p is >1 then a new bloc is allocated.
-static void* reallocate (void* p, const size_t oldsize, const size_t newsize);
-
- // -- Free the bloc allocated by the manager GivMMRefCount.
-inline static void desallocate(void* p, const size_t size=0)
-{
- if (p==0) return ;
- register BlocFreeList* tmp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
- if ( --(tmp->data[0]) ==0) {
- register int index = tmp->u.index;
+ if (s ==0) return 0 ;
+#endif
+ int index;
+ BlocFreeList* tmp;
+ size_t sz = s + sizeof(long);
+ if ((sz <= 32) && ((tmp=BlocFreeList::TabFree[index =int(sz-1)]) !=0)) {
+ BlocFreeList::TabFree[index] = tmp->u.nextfree;
+ tmp->u.index = index;
+#ifdef GIVARO_STATMEM
+ GivMMFreeList::tablog[index] ++; GivMMFreeList::logalloc += BlocFreeList::TabSize[index];
+#endif
+ tmp->data[0] = 1 ;
+ return (void*) &(tmp->data[1]);
+ }
+ tmp = GivMMFreeList::_allocate(sz);
+ tmp->data[0] = 1 ;
+
+
+ return (void*) &(tmp->data[1]);
+ }
+
+ // -- Reallocation of a bloc. See description in GivMMFreeList's class.
+ // Here, if ref count on p is >1 then a new bloc is allocated.
+ static void* reallocate (void* p, const size_t oldsize, const size_t newsize);
+
+ // -- Free the bloc allocated by the manager GivMMRefCount.
+ inline static void desallocate(void* p, const size_t = 0)
+ {
+ if (p==0) return ;
+ BlocFreeList* tmp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
+ if ( --(tmp->data[0]) ==0) {
+ int index = tmp->u.index;
#ifdef GIVARO_DEBUG
- if ((index <0) || (index >= BlocFreeList::lenTables))
- GivError::throw_error(GivError("[GivMMRefCount::desallocate]: bad pointer."));
-#endif
+ if ((index <0) || (index >= BlocFreeList::lenTables))
+ GivError::throw_error(GivError("[GivMMRefCount::desallocate]: bad pointer."));
+#endif
#ifdef GIVARO_JGD
- if ((index <0) || (index >= BlocFreeList::lenTables))
- cerr << "[GivMMRefCount::desallocate]: bad pointer with index " << index << ", doing nothing ..." << endl;
- else {
+ if ((index <0) || (index >= BlocFreeList::lenTables))
+ cerr << "[GivMMRefCount::desallocate]: bad pointer with index " << index << ", doing nothing ..." << endl;
+ else {
#endif
- tmp->u.nextfree = BlocFreeList::TabFree[index];
- BlocFreeList::TabFree[index] = tmp;
+ tmp->u.nextfree = BlocFreeList::TabFree[index];
+ BlocFreeList::TabFree[index] = tmp;
#ifdef GIVARO_JGD
- }
+ }
#endif
- }
-}
-
- // -- Assignement of pointer:
-inline static void* assign (void** dest, void*src)
-{
- if (src == *dest) return *dest ;
- if (*dest !=0) GivMMRefCount::desallocate( *dest );
- if (src ==0) return *dest=src;
- register BlocFreeList* s = (BlocFreeList*)(((char*)src) - sizeof(BlocFreeList));
+ }
+ }
+
+ // -- Assignement of pointer:
+ inline static void* assign (void** dest, void*src)
+ {
+ if (src == *dest) return *dest ;
+ if (*dest !=0) GivMMRefCount::desallocate( *dest );
+ if (src ==0) return *dest=src;
+ BlocFreeList* s = (BlocFreeList*)(((char*)src) - sizeof(BlocFreeList));
#ifdef GIVARO_DEBUG
- if ((s->u.index <0) || (s->u.index >= BlocFreeList::lenTables))
- GivError::throw_error(GivError("[GivMMRefCount::assign]: bad pointer 'src'."));
-#endif
- ++(s->data[0]);
- return *dest = src ;
-}
-
- // -- Increment, decrement and getvalue of the refcount.
- // Returns the value after increment/decrment.
-inline static int incrc(void* p)
-{
- if (p ==0) return 0;
- register BlocFreeList* bp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
+ if ((s->u.index <0) || (s->u.index >= BlocFreeList::lenTables))
+ GivError::throw_error(GivError("[GivMMRefCount::assign]: bad pointer 'src'."));
+#endif
+ ++(s->data[0]);
+ return *dest = src ;
+ }
+
+ // -- Increment, decrement and getvalue of the refcount.
+ // Returns the value after increment/decrment.
+ inline static int incrc(void* p)
+ {
+ if (p ==0) return 0;
+ BlocFreeList* bp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
#ifdef GIVARO_DEBUG
- if ((bp->u.index <0) || (bp->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMRefCount::incrc]: bad pointer.");
-#endif
- return ++(bp->data[0]);
-}
-inline static int decrc(void* p)
-{
- if (p ==0) return 0;
- register BlocFreeList* bp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
+ if ((bp->u.index <0) || (bp->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMRefCount::incrc]: bad pointer.");
+#endif
+ return int(++(bp->data[0]));
+ }
+ inline static int decrc(void* p)
+ {
+ if (p ==0) return 0;
+ BlocFreeList* bp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
#ifdef GIVARO_DEBUG
- if ((bp->u.index <0) || (bp->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMRefCount::incrc]: bad pointer.");
-#endif
- return --(bp->data[0]);
-}
-inline static int getrc(void* p)
-{
- if (p ==0) return 0;
- register BlocFreeList* bp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
+ if ((bp->u.index <0) || (bp->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMRefCount::incrc]: bad pointer.");
+#endif
+ return int(--(bp->data[0]));
+ }
+ inline static int getrc(void* p)
+ {
+ if (p ==0) return 0;
+ BlocFreeList* bp = (BlocFreeList*)(((char*)p) - sizeof(BlocFreeList));
#ifdef GIVARO_DEBUG
- if ((bp->u.index <0) || (bp->u.index >= BlocFreeList::lenTables))
- throw GivError("[GivMMRefCount::incrc]: bad pointer.");
-#endif
- return (bp->data[0]);
-}
+ if ((bp->u.index <0) || (bp->u.index >= BlocFreeList::lenTables))
+ throw GivError("[GivMMRefCount::incrc]: bad pointer.");
+#endif
+ return int(bp->data[0]);
+ }
};
- // -- Memory manager that allocates array of object of type T for
+// -- Memory manager that allocates array of object of type T for
template<class T>
class GivaroMM {
public:
- typedef T* ptT;
- // -- Allocation of a new bloc contains s unintialized elements
-static T* allocate (const size_t s);
- // -- Desallocation of bloc
-static void desallocate ( T* bloc, const size_t sz =0 );
- // -- Initialize each element pointed by bloc with value V
-static void initone( T*p, const T& V = T());
-static void initialize(T* bloc, const size_t s, const T& V =T());
- // -- Call destructor on each elements pointed by bloc
-static void destroy(T* bloc, const size_t s);
+ typedef T* ptT;
+ // -- Allocation of a new bloc contains s unintialized elements
+ static T* allocate (const size_t s);
+ // -- Desallocation of bloc
+ static void desallocate ( T* bloc, const size_t sz =0 );
+ // -- Initialize each element pointed by bloc with value V
+ static void initone( T*p, const T& V = T());
+ static void initialize(T* bloc, const size_t s, const T& V =T());
+ // -- Call destructor on each elements pointed by bloc
+ static void destroy(T* bloc, const size_t s);
};
template<class T>
inline T* GivaroMM<T>::allocate (const size_t s)
@@ -279,7 +282,7 @@ template<class T>
inline void GivaroMM<T>::desallocate(T* bloc, const size_t sz)
{ GivMMFreeList::desallocate((void*)bloc,sz); }
template<class T>
-inline void GivaroMM<T>::initone( T* p, const T& V)
+inline void GivaroMM<T>::initone( T* p, const T& V)
{ new (p) T(V); }
template<class T>
inline void GivaroMM<T>::initialize(T* bloc, const size_t s, const T& V)
@@ -288,17 +291,17 @@ template<class T>
inline void GivaroMM<T>::destroy(T* bloc, const size_t s)
{ for (size_t i=0; i<s; i++) bloc[i].~T(); }
- // -- specialized version: for basic C++ type and pointer on this type
+// -- specialized version: for basic C++ type and pointer on this type
#define GIVARO_MM_SPECIALIZED(TYPE) \
template<> class GivaroMM<TYPE> {\
public: \
-typedef TYPE* ptType;\
-typedef TYPE Type;\
-static ptType allocate (const size_t s);\
-static void desallocate ( ptType bloc, const size_t sz =0 );\
-static void initone( ptType p, const Type V = 0);\
-static void initialize(ptType bloc, const size_t s, const Type V =0);\
-static void destroy(GivaroMM<TYPE>::ptType bloc, const size_t s);\
+ typedef TYPE* ptType;\
+ typedef TYPE Type;\
+ static ptType allocate (const size_t s);\
+ static void desallocate ( ptType bloc, const size_t sz =0 );\
+ static void initone( ptType p, const Type V = 0);\
+ static void initialize(ptType bloc, const size_t s, const Type V =0);\
+ static void destroy(GivaroMM<TYPE>::ptType bloc, const size_t s);\
};\
inline GivaroMM<TYPE>::ptType GivaroMM<TYPE>::allocate (const size_t s)\
{ return (GivaroMM<TYPE>::ptType)GivMMFreeList::allocate(s*sizeof(GivaroMM<TYPE>::Type)); }\
@@ -310,30 +313,35 @@ inline void GivaroMM<TYPE>::initialize(GivaroMM<TYPE>::ptType bloc, const size_t
{ for (size_t i=0; i<s; i++) bloc[i] = V; }\
inline void GivaroMM<TYPE>::destroy(GivaroMM<TYPE>::ptType bloc, const size_t s){}
-/*
-GIVARO_MM_SPECIALIZED(char)
-GIVARO_MM_SPECIALIZED(short)
-GIVARO_MM_SPECIALIZED(int)
-GIVARO_MM_SPECIALIZED(long)
-GIVARO_MM_SPECIALIZED(float)
-GIVARO_MM_SPECIALIZED(double)
-
-GIVARO_MM_SPECIALIZED(unsigned char)
-GIVARO_MM_SPECIALIZED(unsigned short)
-GIVARO_MM_SPECIALIZED(unsigned int)
-GIVARO_MM_SPECIALIZED(unsigned long)
-
-GIVARO_MM_SPECIALIZED(char*)
-GIVARO_MM_SPECIALIZED(short*)
-GIVARO_MM_SPECIALIZED(int*)
-GIVARO_MM_SPECIALIZED(long*)
-GIVARO_MM_SPECIALIZED(float*)
-GIVARO_MM_SPECIALIZED(double*)
-
-GIVARO_MM_SPECIALIZED(unsigned char*)
-GIVARO_MM_SPECIALIZED(unsigned short*)
-GIVARO_MM_SPECIALIZED(unsigned int*)
-GIVARO_MM_SPECIALIZED(unsigned long*)
-*/
-
+#if 0
+ GIVARO_MM_SPECIALIZED(char)
+ GIVARO_MM_SPECIALIZED(short)
+ GIVARO_MM_SPECIALIZED(int)
+ GIVARO_MM_SPECIALIZED(long)
+ GIVARO_MM_SPECIALIZED(float)
+ GIVARO_MM_SPECIALIZED(double)
+
+ GIVARO_MM_SPECIALIZED(unsigned char)
+ GIVARO_MM_SPECIALIZED(unsigned short)
+ GIVARO_MM_SPECIALIZED(unsigned int)
+ GIVARO_MM_SPECIALIZED(unsigned long)
+
+ GIVARO_MM_SPECIALIZED(char*)
+ GIVARO_MM_SPECIALIZED(short*)
+ GIVARO_MM_SPECIALIZED(int*)
+ GIVARO_MM_SPECIALIZED(long*)
+ GIVARO_MM_SPECIALIZED(float*)
+ GIVARO_MM_SPECIALIZED(double*)
+
+ GIVARO_MM_SPECIALIZED(unsigned char*)
+ GIVARO_MM_SPECIALIZED(unsigned short*)
+ GIVARO_MM_SPECIALIZED(unsigned int*)
+ GIVARO_MM_SPECIALIZED(unsigned long*)
#endif
+
+} // namespace Givaro
+
+#endif // __GIVARO_mm_H
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/memory/givpointer.h b/src/kernel/memory/givpointer.h
index 2d4e206..524fa63 100644
--- a/src/kernel/memory/givpointer.h
+++ b/src/kernel/memory/givpointer.h
@@ -1,17 +1,21 @@
-#ifndef _GIVARO_POINTER_H_
-#define _GIVARO_POINTER_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/memory/givpointer.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: T. Gautier
-// $Id: givpointer.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givpointer.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// - auto ptr management
+#ifndef __GIVARO_pointer_H
+#define __GIVARO_pointer_H
#include "givaro/givaromm.h"
+namespace Givaro {
// ==================================================================== //
@@ -20,14 +24,14 @@ class RefCountPtr {
T* _data;
mutable int* _count;
public:
- explicit RefCountPtr ( T* data )
- : _data( data ), _count(0)
+ explicit RefCountPtr ( T* data )
+ : _data( data ), _count(0)
{
_count = GivaroMM<int>::allocate(1);
*_count = 1;
}
- RefCountPtr ( const RefCountPtr<T>& ptr )
- : _data( ptr._data), _count(ptr._count)
+ RefCountPtr ( const RefCountPtr<T>& ptr )
+ : _data( ptr._data), _count(ptr._count)
{
if (_count !=0) *_count += 1;
}
@@ -39,13 +43,13 @@ public:
}
}
- RefCountPtr<T>& operator=( const RefCountPtr<T>& ptr )
+ RefCountPtr<T>& operator=( const RefCountPtr<T>& ptr )
{
if (--*_count ==0) {
delete data;
GivaroMM<int>::desallocate(_count);
}
- _data = ptr._data; _count = ptr._count;
+ _data = ptr._data; _count = ptr._count;
if (_count !=0) *_count += 1;
}
@@ -53,4 +57,6 @@ public:
T* operator-> () const { return _data; }
};
-#endif
+} // namespace Givaro
+
+#endif // __GIVARO_pointer_H
diff --git a/src/kernel/memory/givref_count.h b/src/kernel/memory/givref_count.h
index 96ec87d..4b5c82c 100644
--- a/src/kernel/memory/givref_count.h
+++ b/src/kernel/memory/givref_count.h
@@ -1,35 +1,42 @@
-#ifndef _GIVARO_REF_COUNTER_H_
-#define _GIVARO_REF_COUNTER_H_
// ==================================================================== //
-// Definition of the Counter class, Counter
-// (c) copyright GIVARO 1994
-// author: Th. Gautier
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// author: Th. Gautier
// version : 2.7
// date: 1995
+// Definition of the Counter class, Counter
// This class definition objects to handle reference
-// counter for memory allocation (eg array0).
+// counter for memory allocation (eg array0).
// ==================================================================== //
+#ifndef __GIVARO_ref_counter_H
+#define __GIVARO_ref_counter_H
#include <stddef.h>
+namespace Givaro {
+
class RefCounter {
public:
// Cstor and Dstor
-inline RefCounter( long l = 0) : counter(l) {}
-//inline RefCounter( const RefCounter& ) : counter(C.counter) {}
+inline RefCounter( long l = 0) : counter(l) {}
+//inline RefCounter( const RefCounter& ) : counter(C.counter) {}
inline ~RefCounter() {}
// Return the value
-inline long getvalue() const { return counter ; }
+inline long getvalue() const { return counter ; }
inline long val() const { return counter ; }
// Return a ref to the counter
inline long& refvalue() { return counter ; }
- // Increments the counter and returns the new value
+ // Increments the counter and returns the new value
inline long incr() { return ++counter ; }
- // Decrements the value and returns the new value
+ // Decrements the value and returns the new value
inline long decr() { return --counter ; }
protected:
long counter ;
} ;
-#endif
+} // namespace Givaro
+#endif // __GIVARO_ref_counter_H
diff --git a/src/kernel/rational/Makefile.am b/src/kernel/rational/Makefile.am
index 317ad77..29a8ab8 100644
--- a/src/kernel/rational/Makefile.am
+++ b/src/kernel/rational/Makefile.am
@@ -1,19 +1,26 @@
-INCLUDES=-I$(top_srcdir) ${GMP_VERSION}
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS=-I$(top_srcdir) ${GMP_VERSION}
-pkginclude_HEADERS=\
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+
+pkginclude_HEADERS= \
givrational.h \
givrational.inl
noinst_LTLIBRARIES=libgivrational.la
-libgivrational_la_SOURCES=\
- givratcstor.C \
- givratio.C \
- givratmisc.C \
- givratmuldiv.C \
- givrataddsub.C \
- givratcpy.C \
- givratcompare.C \
+libgivrational_la_SOURCES= \
+ givratcstor.C \
+ givratio.C \
+ givratmisc.C \
+ givratmuldiv.C \
+ givrataddsub.C \
+ givratcpy.C \
+ givratcompare.C \
givratreconstruct.C
diff --git a/src/kernel/rational/Makefile.in b/src/kernel/rational/Makefile.in
index f7069c4..812243d 100644
--- a/src/kernel/rational/Makefile.in
+++ b/src/kernel/rational/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -52,8 +66,8 @@ am_libgivrational_la_OBJECTS = givratcstor.lo givratio.lo \
givratcompare.lo givratreconstruct.lo
libgivrational_la_OBJECTS = $(am_libgivrational_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -85,26 +99,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -114,40 +129,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -187,23 +212,27 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir) ${GMP_VERSION}
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS = -I$(top_srcdir) ${GMP_VERSION} \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
givrational.h \
givrational.inl
noinst_LTLIBRARIES = libgivrational.la
libgivrational_la_SOURCES = \
- givratcstor.C \
- givratio.C \
- givratmisc.C \
- givratmuldiv.C \
- givrataddsub.C \
- givratcpy.C \
- givratcompare.C \
+ givratcstor.C \
+ givratio.C \
+ givratmisc.C \
+ givratmuldiv.C \
+ givrataddsub.C \
+ givratcpy.C \
+ givratcompare.C \
givratreconstruct.C
all: all-am
@@ -214,14 +243,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/rational/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/rational/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/rational/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/rational/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -257,35 +286,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givrataddsub.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratcompare.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratcpy.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratcstor.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratio.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratmisc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratmuldiv.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givratreconstruct.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -315,7 +323,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -420,7 +428,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -431,6 +438,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -439,22 +448,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/kernel/rational/givrataddsub.C b/src/kernel/rational/givrataddsub.C
index b3e15c5..4834871 100644
--- a/src/kernel/rational/givrataddsub.C
+++ b/src/kernel/rational/givrataddsub.C
@@ -1,20 +1,24 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givrataddsub.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givrataddsub.C,v 1.3 2006-06-06 12:52:39 jgdumas Exp $
+// $Id: givrataddsub.C,v 1.4 2009-09-17 14:28:22 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givrational.h"
+namespace Givaro {
// ----------------------------------------- Rational::operator +
-Rational Rational::operator + (const Rational& r) const
+Rational Rational::operator + (const Rational& r) const
{
if (isZero(r)) return *this ;
if (isZero(*this)) return r ;
- if (isInteger(*this) && isInteger(r))
+ if (isInteger(*this) && isInteger(r))
return Rational(num+r.num) ;
if (Rational::flags == Rational::NoReduce)
@@ -28,9 +32,9 @@ Rational Rational::operator + (const Rational& r) const
return Rational( t / d2, (den / d1) * (r.den / d2), 0 );
}
-
-Rational& Rational::operator += (const Rational& r)
+
+Rational& Rational::operator += (const Rational& r)
{
if (isZero(r)) return *this ;
if (isZero(*this)) {
@@ -48,7 +52,7 @@ Rational& Rational::operator += (const Rational& r)
den *= r.den;
return *this;
}
-
+
Integer d1 = gcd(den, r.den);
if (d1 == 1) {
num *= r.den;
@@ -56,13 +60,13 @@ Rational& Rational::operator += (const Rational& r)
den *= r.den;
return *this;
}
-
+
num *= (r.den / d1);
num += ( r.num * (den / d1) );
Integer d2 = gcd(num, d1);
num /= d2;
-
+
den /= d1;
den *= r.den;
den /= d2;
@@ -70,14 +74,14 @@ Rational& Rational::operator += (const Rational& r)
return *this;
}
-
+
// ----------------------------------------- Rational::operator -
-Rational Rational::operator - (const Rational& r) const
+Rational Rational::operator - (const Rational& r) const
{
if (isZero(r)) return *this ;
if (isZero(*this)) return Rational(-r.num,r.den, 0) ;
- if (isInteger(*this) && isInteger(r))
+ if (isInteger(*this) && isInteger(r))
return Rational(num-r.num) ;
if (Rational::flags == Rational::NoReduce)
@@ -91,9 +95,9 @@ Rational Rational::operator - (const Rational& r) const
return Rational( t / d2, (den / d1) * (r.den / d2), 0 );
}
-
-Rational& Rational::operator -= (const Rational& r)
+
+Rational& Rational::operator -= (const Rational& r)
{
if (isZero(r)) return *this ;
if (isZero(*this)) {
@@ -111,7 +115,7 @@ Rational& Rational::operator -= (const Rational& r)
den *= r.den;
return *this;
}
-
+
Integer d1 = gcd(den, r.den);
if (d1 == 1) {
num *= r.den;
@@ -119,13 +123,13 @@ Rational& Rational::operator -= (const Rational& r)
den *= r.den;
return *this;
}
-
+
num *= (r.den / d1);
num -= ( r.num * (den / d1) );
Integer d2 = gcd(num, d1);
num /= d2;
-
+
den /= d1;
den *= r.den;
den /= d2;
@@ -133,9 +137,11 @@ Rational& Rational::operator -= (const Rational& r)
return *this;
}
-
+
// ----------------------------------------- Rational::operator -
-Rational Rational::operator - () const
+Rational Rational::operator - () const
{ return Rational (-num, den, 0) ; }
+
+} // namespace Givaro
diff --git a/src/kernel/rational/givratcompare.C b/src/kernel/rational/givratcompare.C
index da247bb..10b8ff8 100644
--- a/src/kernel/rational/givratcompare.C
+++ b/src/kernel/rational/givratcompare.C
@@ -1,36 +1,41 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratcompare.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givratcompare.C,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: givratcompare.C,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givrational.h"
+namespace Givaro {
+
// -------------------------------------------- compare
// returns 1 if a > b, 0 if a == b and -1 otherwise.
-int compare (const Rational& a, const Rational &b)
-{
- if (isZero(a.num) && isZero(b.num))
+int compare (const Rational& a, const Rational &b)
+{
+ if (isZero(a.num) && isZero(b.num))
return 0 ;
- if (isZero(a.num))
+ if (isZero(a.num))
return -sign(b.num);
if (isZero(b.num))
return sign(a.num);
- if (sign(a.num) != sign(b.num))
+ if (sign(a.num) != sign(b.num))
return (sign(a.num) == -1 ? -1 : 1 ) ;
- if (sign(a.num) > 0)
+ if (sign(a.num) > 0)
return absCompare(a,b) ;
else return -absCompare(a,b) ;
-}
+}
// -------------------------------------------- absCompare
int absCompare (const Rational& a, const Rational& b)
-{
+{
int cnum = absCompare(a.num, b.num) ;
int cden = absCompare(a.den, b.den) ;
-
+
if ( (cnum == -1) && (cden == 1) )
return -1 ;
if ( (cnum == 1) && (cden == -1) )
@@ -43,5 +48,6 @@ int absCompare (const Rational& a, const Rational& b)
Integer p1 = a.num * b.den;
Integer p2 = a.den * b.num;
return absCompare(p1,p2);
-}
+}
+} // namespace Givaro
diff --git a/src/kernel/rational/givratcpy.C b/src/kernel/rational/givratcpy.C
index 66df140..2a831ca 100644
--- a/src/kernel/rational/givratcpy.C
+++ b/src/kernel/rational/givratcpy.C
@@ -1,35 +1,40 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratcpy.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givratcpy.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givratcpy.C,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givrational.h"
+namespace Givaro {
+
Rational& Rational::logcpy (const Rational &r)
-{
+{
if (this == &r) return *this ;
- num.logcpy(r.num) ; den.logcpy(r.den) ;
+ num.logcpy(r.num) ; den.logcpy(r.den) ;
return *this ;
-}
+}
// same that Rational::logcpy function
Rational& Rational::operator= (const Rational &r)
{
if (this == &r) return *this ;
- num.logcpy(r.num) ; den.logcpy(r.den) ;
+ num.logcpy(r.num) ; den.logcpy(r.den) ;
return *this ;
-}
+}
Rational& Rational::copy (const Rational &r)
{
if (this == &r) return *this ;
- num.copy(r.num) ; den.copy(r.den) ;
+ num.copy(r.num) ; den.copy(r.den) ;
return *this ;
}
+} // namespace Givaro
-
diff --git a/src/kernel/rational/givratcstor.C b/src/kernel/rational/givratcstor.C
index c2993f3..17b776c 100644
--- a/src/kernel/rational/givratcstor.C
+++ b/src/kernel/rational/givratcstor.C
@@ -1,12 +1,16 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratcstor.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givratcstor.C,v 1.4 2008-09-19 17:58:17 pernet Exp $
+// $Id: givratcstor.C,v 1.9 2011-02-04 14:50:07 bboyer Exp $
// ==========================================================================
// Description:
+#include <givaro/givconfig.h>
#include "givaro/givrational.h"
#include "givaro/giverror.h"
#include "givaro/givpower.h"
@@ -22,36 +26,34 @@
#include <sstream>
#endif
- // -- Predefined cstes
-const Rational Rational::zero = givNoInit();
-const Rational Rational::one = givNoInit();
+namespace Givaro {
Rational::ReduceFlag Rational::flags = Rational::Reduce ;
void Rational::SetReduce() { Rational::flags = Rational::Reduce ; }
void Rational::SetNoReduce() { Rational::flags = Rational::NoReduce ; }
// Explicit instanciation
-template double power(double x, unsigned int p) ;
+template double power(double x, unsigned int p) ;
struct ieee {
#if HAVE_BIG_ENDIAN
- uint64 negative:1;
- uint64 exponent:11;
- uint64 mantissa:52;
+ uint64_t negative:1;
+ uint64_t exponent:11;
+ uint64_t mantissa:52;
#else
- uint64 mantissa:52;
- uint64 exponent:11;
- uint64 negative:1;
-#endif
+ uint64_t mantissa:52;
+ uint64_t exponent:11;
+ uint64_t negative:1;
+#endif
};
Rational::Rational(double x) {
- union {
- uint64 l;
- ieee u;
- double d;
+ union {
+ uint64_t l;
+ ieee u;
+ double d;
} t; // temp
t.d = x;
@@ -84,20 +86,47 @@ Rational::Rational(Neutral n ) : den(Integer::one)
if (n == Neutral::zero) {
num = Integer::zero;
}
- else { // n = one
+ else { // n = one
num = Integer::one;
}
}
// ------------------------------ Rational(int n)
-Rational::Rational(int n ) : num(n), den(Integer::one)
+Rational::Rational(int n ) : num(n), den(Integer::one)
{ }
// ------------------------------ Rational(long n)
-Rational::Rational(long n ) : num(n), den(Integer::one)
+Rational::Rational(long n ) : num(n), den(Integer::one)
+{ }
+
+
+// ------------------------------ Rational(unsigned long n)
+Rational::Rational(unsigned long n ) : num(n), den(Integer::one)
{ }
+// ------------------------------ Rational(unsigned long n, unsigned long d )
+Rational::Rational(unsigned long n, unsigned long d )
+{
+ if (d == 0)
+ {
+ throw GivMathDivZero("[Rational::Rational]: null denominator of the rational.") ;
+ }
+
+ if (n == 0)
+ {
+ num = Integer::zero;
+ den = Integer::one;
+ }
+ else
+ {
+ num = Integer(n);
+ den = Integer(d);
+ }
+ reduce();
+}
+
+
// ------------------------------ Rational(long n, long d )
Rational::Rational(long n, long d )
{
@@ -105,7 +134,7 @@ Rational::Rational(long n, long d )
{
throw GivMathDivZero("[Rational::Rational]: null denominator of the rational.") ;
}
-
+
if (n == 0)
{
num = Integer::zero;
@@ -126,7 +155,7 @@ Rational::Rational(long n, long d )
// ------------------------------ Rational(const char* s )
-Rational::Rational(const char* s )
+Rational::Rational(const char* s )
{
#ifdef __GIVARO_OLD_SSTREAM__
std::istrstream input (s) ;
@@ -160,7 +189,7 @@ Rational::Rational(const Integer &n, const Integer &d, int red)
{
throw GivMathDivZero( "[Rational::Rational]: null denominator of the rational.") ;
}
-
+
if (isZero(n))
{
num = Integer::zero;
@@ -180,25 +209,21 @@ Rational::Rational(const Integer &n, const Integer &d, int red)
}
// ------------------------------ Rational(const Rational &n)
-Rational::Rational(const Rational &r) : num(r.num), den(r.den)
-{ }
+Rational::Rational(const Rational &r) : num(r.num), den(r.den)
+{ }
-Rational::Rational( givNoInit gi) : num(Integer::zero), den(Integer::one)
-{ }
+Rational::Rational( givNoInit ) : num(Integer::zero), den(Integer::one)
+{ }
// ------ Initialization module:
//GivModule Rational::Module (Rational::Init,
-// Rational::End,
+// Rational::End,
// InitAfter(Integer::Module),
-// "Rational package") ;
-void Rational::Init(int* argc, char***argv)
-{
- new ((Rational*)&Rational::zero.num) Integer(Integer::zero);
- new ((Rational*)&Rational::zero.den) Integer(Integer::one);
- new ((Rational*)&Rational::one.num) Integer(Integer::one);
- new ((Rational*)&Rational::one.den) Integer(Integer::one);
-}
+// "Rational package") ;
+void Rational::Init(int* , char***)
+{}
void Rational::End()
{}
+} // namespace Givaro
diff --git a/src/kernel/rational/givratio.C b/src/kernel/rational/givratio.C
index 4a70070..d1be418 100644
--- a/src/kernel/rational/givratio.C
+++ b/src/kernel/rational/givratio.C
@@ -1,22 +1,26 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratio.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givratio.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givratio.C,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
#include <iostream>
#include "givaro/givrational.h"
+namespace Givaro {
std::ostream& Rational::print(std::ostream& s) const
{
if (den > 1) {
s << num << "/" << den ;
}
- else
+ else
s << num;
return s;
}
@@ -51,3 +55,4 @@ std::istream& operator>> (std::istream& in, Rational& r)
return in ;
}
+} // namespace Givaro
diff --git a/src/kernel/rational/givrational.h b/src/kernel/rational/givrational.h
index d4ee127..359c2f4 100644
--- a/src/kernel/rational/givrational.h
+++ b/src/kernel/rational/givrational.h
@@ -1,17 +1,20 @@
-#ifndef _RATIONAL_H_
-#define _RATIONAL_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givrational.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama, T. Gautier
-// $Id: givrational.h,v 1.6 2008-07-18 12:42:37 jgdumas Exp $
+// $Id: givrational.h,v 1.13 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
+#ifndef __GIVARO_rational_H
+#define __GIVARO_rational_H
#include "givaro/givinteger.h"
#include "givaro/givmodule.h"
+namespace Givaro {
// ----------------------------------- Functions Rational
@@ -23,14 +26,16 @@ const Integer floor (const Rational &r) ;
const Integer ceil (const Rational &r) ;
const Integer round (const Rational &r) ;
const Integer trunc (const Rational &r) ;
-const Rational abs (const Rational &r) ;
+const Rational abs (const Rational &r) ;
const Rational pow (const Rational& n, unsigned int l);
const Rational pow (const Rational& n, unsigned long l);
unsigned long length (const Rational& r) ;
int sign (const Rational& r) ;
int isZero (const Rational& r) ;
int isOne (const Rational& r) ;
-int isInteger(const Rational& r);
+int isInteger(const Rational& r);
+
+class RationalDom;
// ----------------------------------- Class Rational
@@ -41,7 +46,9 @@ public :
Rational(Neutral n = Neutral::zero) ;
Rational(int n) ;
Rational(long n) ;
+ Rational(unsigned long n) ;
Rational(long n, long d ) ;
+ Rational(unsigned long n, unsigned long d ) ;
Rational(double x) ;
Rational(const char* s) ;
Rational(const Integer& n) ;
@@ -57,15 +64,15 @@ public :
// Logical and physical copies
Rational& operator = (const Rational& );
- Rational& logcpy (const Rational& ) ;
- Rational& copy (const Rational& ) ;
+ Rational& logcpy (const Rational& ) ;
+ Rational& copy (const Rational& ) ;
-//------------------Equalities and inequalities between rationals
+//------------------Equalities and inequalities between rationals
friend int compare(const Rational& a, const Rational& b) ;
friend int absCompare(const Rational& a, const Rational& b) ;
-//----------------Elementary arithmetic between Rational
+//----------------Elementary arithmetic between Rational
Rational operator + (const Rational& r) const ;
Rational operator - (const Rational& r) const ;
Rational operator -() const ;
@@ -79,49 +86,49 @@ public :
//-----------------------------------------Arithmetic functions
friend const Rational pow(const Rational &r, const long l);
-
+
//-----------------------------------------Miscellaneous
friend const Integer floor (const Rational &r) ;
friend const Integer ceil (const Rational &r) ;
friend const Integer round (const Rational &r) ;
friend const Integer trunc (const Rational &r) ;
- inline friend const Rational abs (const Rational &r) ;
+ inline friend const Rational abs (const Rational &r) ;
- friend const Rational pow (const Rational& n, unsigned int l) {
+ friend const Rational pow (const Rational& n, unsigned int l) {
Rational r;
- r.num = ::pow(n.num, l); r.den = ::pow(n.den, l);
+ r.num = ::Givaro::pow(n.num, l); r.den = ::Givaro::pow(n.den, l);
return r;
}
-
- friend const Rational pow (const Rational& n, unsigned long l) {
+
+ friend const Rational pow (const Rational& n, unsigned long l) {
Rational r;
- r.num = ::pow(n.num, l); r.den = ::pow(n.den, l);
+ r.num = ::Givaro::pow(n.num, l); r.den = ::Givaro::pow(n.den, l);
return r;
}
-
+
const Integer nume() const ;
const Integer deno() const ;
inline friend unsigned long length (const Rational& r) ;
inline friend int sign (const Rational& r) ;
inline friend int isZero (const Rational& r) ;
inline friend int isOne (const Rational& r) ;
- inline friend int isInteger(const Rational& r);
+ inline friend int isInteger(const Rational& r);
std::ostream& print ( std::ostream& o ) const ;
inline Rational reduce(const Rational& R) const ;
- static void SetReduce() ;
- static void SetNoReduce() ;
-
+ static void SetReduce() ;
+ static void SetNoReduce() ;
+
// -- Cast operators
- operator short() const { return (int) *this; }
- operator unsigned short() const { return (unsigned int) *this; }
- operator unsigned char() const { return (unsigned int) *this; }
+ operator short() const { return (short)(int) *this; }
+ operator unsigned short() const { return (unsigned short) (unsigned int) *this; }
+ operator unsigned char() const { return (unsigned char)(unsigned int) *this; }
operator unsigned int() const { return (unsigned int) (this->num/this->den); }
operator int() const { return (int) (this->num/this->den); }
- operator signed char() const { return (int) *this; }
+ operator signed char() const { return (signed char) (int) *this; }
operator unsigned long() const { return (unsigned long) (this->num/this->den); }
operator long() const { return (long) (this->num/this->den); }
#ifndef __GIVARO__DONOTUSE_longlong__
@@ -132,49 +139,54 @@ public :
operator float() const { return ((float)this->num)/((float)this->den); }
operator double() const { return ((double)this->num)/((double)this->den); }
-protected: // Internal Representation : num/den
+protected: // Internal Representation : num/den
Integer num, den;
public:
enum ReduceFlag { Reduce = 0x1, NoReduce = 0x0 } ;
protected:
static ReduceFlag flags ; // flags that indicates is reduction is done or not
- // by default = Reduce
- void reduce(void) ;
+ // by default = Reduce
+ Rational& reduce() ;
// -- module initialization
static void Init(int* argc, char***argv);
static void End();
friend class GivModule;
+ friend class RationalDom;
// Rational number reconstruction
bool ratrecon(const Integer& f, const Integer& m, const Integer& k, bool recurs = false ) ;
public:
// - exportation of the module
- static GivModule Module;
+ static GivModule Module;
// -- Cstor for Zero and One to delay initialization after the main
Rational( givNoInit );
-}; // ----------------------------------- End of Class Rationalional
+}; // ----------------------------------- End of Class Rationalional
extern std::istream& operator>> (std::istream& in, Rational& r) ;
#include "givaro/givrational.inl"
//------------------------------------------------------ Class RationalDom
-class RationalDom : public Rational {
+class RationalDom {
public:
typedef Rational Element;
typedef Rational Rep;
// -- Cstor
RationalDom() : one(1), zero(0) {}
+ template<class X> RationalDom(const X& x) : one(1), zero(0) {}
- int operator==( const RationalDom& BC) const { return 1;}
- int operator!=( const RationalDom& BC) const { return 0;}
+ int operator==( const RationalDom& ) const { return 1;}
+ int operator!=( const RationalDom& ) const { return 0;}
// -- Constants
const Rational one;
const Rational zero;
+ unsigned long characteristic() const { return 0UL; }
+ Integer& characteristic(Integer& p) const { return p=characteristic();}
+
// -- assignement
Rep& init( Rep& a ) const{ return a; }
Rep& init ( Rep& a, const Rep& b) const { return a = b ; }
@@ -195,45 +207,54 @@ public:
{ return r = a * b + c; };
Rep& axpyin( Rep& r, const Rep& a, const Rep& b ) const
{ return r += a * b; };
- Rep& amxy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
- { return r = a - b * c; };
+ Rep& maxpy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
+ { return r = c - a * b; };
Rep& axmy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const
{ return r = a * b - c; };
Rep& axmyin( Rep& r, const Rep& a, const Rep& b ) const
+ { return r = a * b - r ; };
+ Rep& maxpyin( Rep& r, const Rep& a, const Rep& b ) const
{ return r -= a * b; };
// -- unary methods
Rep& neg( Rep& r, const Rep& a ) const { return r = -a; };
- Rep& inv( Rep& r, const Rep& a ) const { return r = Rational::one/a; };
+ Rep& inv( Rep& r, const Rep& a ) const { r.num=a.den; r.den=a.num; return r; }
+ Rep& negin( Rep& r ) const { r.num=-r.num; return r; }
+ Rep& invin( Rep& r ) const { std::swap(r.num,r.den); return r; }
- // - return n^l
- Rep& pow(Rep& r, const Rep& n, const unsigned long l) const { return r = ::pow(n, l); }
- Rep& pow(Rep& r, const Rep& n, const unsigned int l) const { return r = ::pow(n, l); }
+ // - return n^l
+ Rep& pow(Rep& r, const Rep& n, const unsigned long l) const { return r = ::Givaro::pow(n, l); }
+ Rep& pow(Rep& r, const Rep& n, const unsigned int l) const { return r = ::Givaro::pow(n, l); }
// - Rational number reconstruction
- Rep& ratrecon(Rep& r, const Integer& f, const Integer& m, const Integer& k, bool recurs = false) {
+ Rep& ratrecon(Rep& r, const Integer& f, const Integer& m, const Integer& k, bool recurs = false) const {
return r = Rational(f,m,k,recurs);
- }
- Rep& ratrecon(Rep& r, const Integer& f, const Integer& m, bool recurs=true) {
- return r = Rational(f,m,::sqrt(m),recurs);
- }
+ }
+ Rep& ratrecon(Rep& r, const Integer& f, const Integer& m, bool recurs=true) const {
+ return r = Rational(f,m, ::Givaro::sqrt(m),recurs);
+ }
// - Misc
- size_t length (const Rep& a) const { return ::length(a); }
- int sign (const Rep& a) const { return ::sign(a); }
+ size_t length (const Rep& a) const { return ::Givaro::length(a); }
+ int sign (const Rep& a) const { return ::Givaro::sign(a); }
int isOne (const Rep& a) const { return compare(a, one) ==0; }
int isZero (const Rep& a) const { return compare(a, zero) ==0; }
int areEqual (const Rep& a, const Rep& b) const { return compare(a, b) ==0; }
int areNEqual(const Rep& a, const Rep& b) const { return compare(a, b) !=0; }
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, long s = 1) const { return r=Rational(Integer::random(s), Integer::nonzerorandom(s)); }
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, const Rep& b) const { Integer rnum,rden; Integer::random(rnum,b.nume()); Integer::nonzerorandom(rden,b.deno()); return r=Rational(rnum,rden); }
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, long s = 1) const { return r=Rational(Integer::nonzerorandom(s), Integer::nonzerorandom(s)); }
+ template< class RandIter > Rep& nonzerorandom (RandIter& g,Rep& r, const Rep& b) const { Integer rnum,rden; Integer::nonzerorandom(rnum,b.nume()); Integer::nonzerorandom(rden,b.deno()); return r=Rational(rnum,rden); }
+
// -- IO
// -- IO
- std::istream& read ( std::istream& i )
+ std::istream& read ( std::istream& i )
{ char ch;
- i >> std::ws >> ch;
- if (ch != 'R')
+ i >> std::ws >> ch;
+ if (ch != 'R')
GivError::throw_error(GivBadFormat("RationalDom::read: bad signature domain"));
return i;
}
@@ -242,5 +263,6 @@ public:
std::ostream& write( std::ostream& o, const Rep& n) const { return n.print(o); }
};
+} //namespace Givaro
-#endif
+#endif // __GIVARO_rational_H
diff --git a/src/kernel/rational/givrational.inl b/src/kernel/rational/givrational.inl
index a041c2d..d0a0763 100644
--- a/src/kernel/rational/givrational.inl
+++ b/src/kernel/rational/givrational.inl
@@ -1,13 +1,17 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givrational.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givrational.inl,v 1.3 2006-06-06 12:52:39 jgdumas Exp $
+// $Id: givrational.inl,v 1.5 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
-
+#ifndef __GIVARO_rational_INL
+#define __GIVARO_rational_INL
//-------------------------------------------------inline comparaison operators
inline int operator != (const Rational& a , const Rational& b)
@@ -30,25 +34,25 @@ inline int operator >= (const Rational& a, const Rational& b)
//----------------------------------arithmetic inline operators
inline const Rational operator + (const Rational& r, const int i)
- { return r + Rational(i) ; }
+ { return r + Rational(i) ; }
inline const Rational operator - (const Rational& r, const int i)
- { return r - Rational(i) ; }
+ { return r - Rational(i) ; }
inline const Rational operator * (const Rational& r, const int i)
- { return r * Rational(i) ; }
+ { return r * Rational(i) ; }
inline const Rational operator / (const Rational &r, const int i)
- { return r / Rational(i) ; }
+ { return r / Rational(i) ; }
-inline const Rational operator + (const int i, const Rational& r)
- { return Rational(i) + r; }
-inline const Rational operator - (const int i, const Rational& r)
- { return Rational(i) - r; }
-inline const Rational operator * (const int i, const Rational& r)
- { return Rational(i) * r; }
-inline const Rational operator / (const int i, const Rational& r)
- { return Rational(i) / r ; }
+inline const Rational operator + (const int i, const Rational& r)
+ { return Rational(i) + r; }
+inline const Rational operator - (const int i, const Rational& r)
+ { return Rational(i) - r; }
+inline const Rational operator * (const int i, const Rational& r)
+ { return Rational(i) * r; }
+inline const Rational operator / (const int i, const Rational& r)
+ { return Rational(i) / r ; }
-inline Rational Rational::operator + () const
- { return *this ; }
+inline Rational Rational::operator + () const
+ { return *this ; }
//----------------------------------miscellaneous inline functions
inline int isInteger(const Rational& r)
@@ -69,16 +73,17 @@ inline unsigned long length(const Rational& a)
inline const Rational abs(const Rational &r)
{ return Rational(abs(r.num), r.den, 0); }
-inline const Integer Rational::nume() const
+inline const Integer Rational::nume() const
{ return num ; }
-inline const Integer Rational::deno() const
+inline const Integer Rational::deno() const
{ return den ; }
-inline Rational Rational::reduce( const Rational& R) const
+inline Rational Rational::reduce( const Rational& R) const
{ Rational tmp ; tmp = R ; tmp.reduce() ; return tmp ; }
//-------------------------------------------------inline >> & << operators
inline std::ostream& operator<< (std::ostream& o, const Rational& a)
{ return a.print(o); }
+#endif // __GIVARO_rational_INL
diff --git a/src/kernel/rational/givratmisc.C b/src/kernel/rational/givratmisc.C
index 0f0af6d..584fd8a 100644
--- a/src/kernel/rational/givratmisc.C
+++ b/src/kernel/rational/givratmisc.C
@@ -1,25 +1,31 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratmisc.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givratmisc.C,v 1.3 2008-07-18 12:42:37 jgdumas Exp $
+// $Id: givratmisc.C,v 1.5 2009-10-01 09:07:36 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givrational.h"
-//
-void Rational::reduce(void)
+namespace Givaro {
+
+//
+Rational& Rational::reduce()
{
Integer t = gcd(num, den);
if (!isOne(t) )
{
num /= t;
den /= t;
- }
+ }
+ return *this;
}
-
+
const Integer trunc(const Rational &r)
{
return r.num / r.den;
@@ -42,7 +48,7 @@ const Integer ceil(const Rational &x)
return q;
}
-const Integer round(const Rational& x)
+const Integer round(const Rational& x)
{
Integer q;
Integer r;
@@ -72,10 +78,11 @@ const Rational pow (const Rational& x, const long y)
r.num = pow(x.den, (long) -y);
if (sign(r.den) < 0)
{
- r.num = -r.num ;
+ r.num = -r.num ;
r.den = -r.den ;
}
}
return r;
}
+} // namespace Givaro
diff --git a/src/kernel/rational/givratmuldiv.C b/src/kernel/rational/givratmuldiv.C
index acbf9c3..64cfb71 100644
--- a/src/kernel/rational/givratmuldiv.C
+++ b/src/kernel/rational/givratmuldiv.C
@@ -1,16 +1,21 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratmuldiv.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: M. Samama
-// $Id: givratmuldiv.C,v 1.3 2006-06-06 12:52:39 jgdumas Exp $
+// $Id: givratmuldiv.C,v 1.7 2010-04-14 16:20:30 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givrational.h"
#include "givaro/giverror.h"
-// --------------------------------------- operator *
+namespace Givaro {
+
+// --------------------------------------- operator *
Rational Rational::operator * (const Rational& r) const
{
@@ -28,14 +33,14 @@ Rational Rational::operator * (const Rational& r) const
{
return Rational( num*r.num, den*r.den, 0) ;
}
-
Integer d1 = gcd(num, r.den);
Integer d2 = gcd(den, r.num);
+
return Rational( (num / d1) * (r.num / d2), (den / d2) * (r.den / d1), 0 );
}
-// --------------------------------------- operator *=
+// --------------------------------------- operator *=
Rational& Rational::operator *= (const Rational& r)
{
@@ -53,7 +58,7 @@ Rational& Rational::operator *= (const Rational& r)
den *= r.den;
return *this;
}
-
+
Integer d1 = gcd(num, r.den);
Integer d2 = gcd(den, r.num);
@@ -61,13 +66,13 @@ Rational& Rational::operator *= (const Rational& r)
num *= (r.num / d2);
den /= d2;
den *= (r.den / d1);
-
+
return *this;
}
-// --------------------------------------- operator /
-Rational Rational::operator / (const Rational& r) const
+// --------------------------------------- operator /
+Rational Rational::operator / (const Rational& r) const
{
if ( isZero(r) ) {
throw GivMathDivZero("*** division by zero, in operator / (const Rational&)") ;
@@ -77,16 +82,16 @@ Rational Rational::operator / (const Rational& r) const
if (isOne(*this)) {
if (sign(r) < 0)
return Rational(r.den, r.num, 0) ;
- else
+ else
return Rational(-r.den, -r.num, 0) ;
}
- if (absCompare(den, r.den) == 0)
+ if (absCompare(den, r.den) == 0)
return Rational(num, r.num) ;
if (Rational::flags == Rational::NoReduce)
return Rational( num*r.den, den*r.num, 0) ;
-
+
Integer d1 = gcd(num, r.num);
Integer d2 = gcd(den, r.den);
Integer resnum = (num / d1) * (r.den / d2);
@@ -98,52 +103,77 @@ Rational Rational::operator / (const Rational& r) const
return Rational(resnum, resden, 0);
}
-
-// --------------------------------------- operator /=
+
+// --------------------------------------- operator /=
Rational& Rational::operator /= (const Rational& r)
{
+// std::cerr << " BEGIN divin: " << *this << " /= " << r << std::endl;
+
if ( isZero(r) ) {
throw GivMathDivZero("*** division by zero, in operator / (const Rational&)") ;
}
if (isZero(*this)) return *this ;
if (isOne(r)) return *this ;
if (isOne(*this)) {
- if (sign(r) < 0) {
- num = r.den;
- den = r.num;
- return *this;
+ if (sign(r.num)<0) {
+ Integer::neg(this->num,r.den);
+ Integer::neg(this->den,r.num);
} else {
- num = -r.den;
- den = -r.num;
- return *this;
+ this->num = r.den;
+ this->den = r.num;
}
- }
-
- if (absCompare(den, r.den) == 0) {
- den = r.num;
+// std::cerr << " DIVIN isone result: " << *this << std::endl;
return *this;
}
+ if (compare(this->den, r.den) == 0) {
+ if (sign(r.num)<0) {
+ Integer::neg(this->den,r.num);
+ Integer::negin( this->num );
+ } else {
+ this->den = r.num;
+ }
+// std::cerr << " DIVIN id result: " << this->num << " / " << this->den << std::endl;
+// std::cerr << " DIVIN id den result: " << *this << std::endl;
+ return this->reduce();
+ }
+
if (Rational::flags == Rational::NoReduce) {
- num *= r.den;
- den *= r.num;
+ if (sign(r.num)<0) {
+ this->num *= r.den;
+ this->den *= r.num;
+ Integer::negin( this->num );
+ Integer::negin( this->den );
+ } else {
+ this->num *= r.den;
+ this->den *= r.num;
+ }
return *this;
}
-
- Integer d1 = gcd(num, r.num);
- Integer d2 = gcd(den, r.den);
- num /= d1;
- num *= (r.den / d2);
- if (sign(r.num) < 0)
- num = -num ;
+ Integer d1 = gcd(this->num, r.num);
+ Integer d2 = gcd(this->den, r.den);
+// std::cerr << " d1: " << d1 << ", d2: " << d2 << std::endl;
+
+ this->num /= d1;
+ this->num *= (r.den / d2);
+// if (sign(r.num) < 0)
+// num = -num ;
+
+ this->den /= d2;
+ this->den *= (r.num / d1);
+
+ //rden can't be neg
+ if (sign(den) <0) {
+ Integer::negin( this->num );
+ Integer::negin( this->den );
+ }
+
+// std::cerr << " num: " << num << ", den: " << den << std::endl;
+// std::cerr << " DIVIN result: " << *this << std::endl;
- den /= d2;
- den *= (r.num / d1);
-
- //rden can't be nul
- if (sign(den) <0) den = abs(den) ;
return *this;
}
-
+
+} // namespace Givaro
diff --git a/src/kernel/rational/givratreconstruct.C b/src/kernel/rational/givratreconstruct.C
index 1fa5679..a00e731 100644
--- a/src/kernel/rational/givratreconstruct.C
+++ b/src/kernel/rational/givratreconstruct.C
@@ -1,137 +1,148 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/rational/givratreconstruct.C,v $
-// Copyright(c)'2003 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: Jean-Guillaume Dumas
-// $Id: givratreconstruct.C,v 1.2 2005/07/16 11:33:43 jgdumas Exp $
+// $Id: givratreconstruct.C,v 1.4 2010-04-12 15:54:39 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givrational.h"
#include <iostream>
+namespace Givaro {
+ /*! @brief Rational number reconstruction.
+ * \f$ num/den \equiv f \mod m\f$, with \f$|num|<k\f$ and \f$0 < |den| \leq f/kf\f$
+ * @bib See [von zur Gathen & Gerhard, Modern Computer Algebra, 5.10, Cambridge Univ. Press 1999]
+ */
+ Rational::Rational(const Integer& f, const Integer& m, const Integer& k, bool recurs )
+ {
+ bool res = this->ratrecon(f,m,k,recurs);
+ if (recurs)
+ for( Integer newk = k + 1; (!res) && (newk<f) ; ++newk)
+ res = this->ratrecon(f,m,newk,true);
+ }
-// Rational number reconstruction:
-// num/den \equiv f modulo m, with |num|<k and 0 < |den| \leq f/k
-// See [von zur Gathen & Gerhard, Modern Computer Algebra, 5.10, Cambridge Univ. Press 1999]
-Rational::Rational(const Integer& f, const Integer& m, const Integer& k, bool recurs ) {
- bool res = this->ratrecon(f,m,k,recurs);
- if (recurs)
- for( Integer newk = k + 1; (!res) && (newk<f) ; ++newk)
- res = this->ratrecon(f,m,newk,true);
-}
-
-
-
-bool Rational::ratrecon(const Integer& f, const Integer& m, const Integer& k, bool recurs )
-{
-
-// std::cerr << "RatRecon : " << f << " " << m << " " << k << std::endl;
-
-
- Integer r0, t0, r1, t1, q, u;
- r0=m;
- t0=0;
- r1=f;
- if (f<0) r1+= m;
- t1=1;
- while(r1>=k)
- {
-// std::cerr << "r0: " << r0
-// << ", r1: " << r1
-// << ", q: " << q
-// // << ", s0: " << s0
-// // << ", s1: " << s1
-// << ", t0: " << t0
-// << ", t1: " << t1
-// << std::endl;
-
- q = r0;
- q /= r1; // r0/r1
-
- u = r1;
- r1 = r0; // r1 <-- r0
- r0 = u; // r0 <-- r1
- u *= q;
- r1 -= u; // r1 <-- r0-q*r1
- if (r1 == 0) break;
-
- u = t1;
- t1 = t0; // r1 <-- r0
- t0 = u; // r0 <-- r1
- u *= q;
- t1 -= u; // r1 <-- r0-q*r1
- }
-
- // [GG, MCA, 1999] Theorem 5.26
- // (i)
- if (t1 < 0) {
- num = -r1;
- den = -t1;
- } else {
- num = r1;
- den = t1;
- }
-
- // (ii)
- if (gcd(num,den) != 1) {
-// std::cerr << "r0: " << r0
-// << ", r1: " << r1
-// << ", k: " << k
-// << std::endl;
-
- Integer gar1, gar2;
- for( q = 1, gar1 = r0-r1, gar2 = r0 ; (gar1 >= k) || (gar2<k); ++q ) {
- gar1 -= r1;
- gar2 -= r1;
- }
-
- r0 -= q * r1;
- t0 -= q * t1;
-
- if (t0 < 0) {
- num = -r0;
- den = -t0;
- } else {
- num = r0;
- den = t0;
- }
-
- if (t0 > m/k) {
- if (!recurs)
- std::cerr
- << "*** Error *** No rational reconstruction of "
- << f
- << " modulo "
- << m
- << " with denominator <= "
- << (m/k)
- << std::endl;
- }
- if (gcd(num,den) != 1) {
- if (!recurs)
- std::cerr
- << "*** Error *** There exists no rational reconstruction of "
- << f
- << " modulo "
- << m
- << " with |numerator| < "
- << k
- << std::endl
- << "*** Error *** But "
- << num
- << " = "
- << den
- << " * "
- << f
- << " modulo "
- << m
- << std::endl;
- return false;
- }
- }
-// std::cerr << "RatRecon End " << std::endl;
- return true;
-}
+
+
+ bool Rational::ratrecon(const Integer& f, const Integer& m, const Integer& k, bool recurs )
+ {
+
+#ifdef DEBUG
+ std::cerr << "RatRecon : " << f << " " << m << " " << k << std::endl;
+#endif
+
+
+ Integer r0, t0, r1, t1, q, u;
+ r0=m;
+ t0=0;
+ r1=f;
+ if (f<0) r1+= m;
+ t1=1;
+ while(r1>=k)
+ {
+#ifdef DEBUG
+ std::cerr << "r0: " << r0
+ << ", r1: " << r1
+ << ", q: " << q
+ << ", t0: " << t0
+ << ", t1: " << t1
+ << std::endl;
+#endif
+ q = r0;
+ q /= r1; // r0/r1
+
+ u = r1;
+ r1 = r0; // r1 <-- r0
+ r0 = u; // r0 <-- r1
+ u *= q;
+ r1 -= u; // r1 <-- r0-q*r1
+ if (r1 == 0) break;
+
+ u = t1;
+ t1 = t0; // r1 <-- r0
+ t0 = u; // r0 <-- r1
+ u *= q;
+ t1 -= u; // r1 <-- r0-q*r1
+ }
+
+ // [GG, MCA, 1999] Theorem 5.26
+ // (i)
+ if (t1 < 0) {
+ num = -r1;
+ den = -t1;
+ } else {
+ num = r1;
+ den = t1;
+ }
+
+ // (ii)
+ if (gcd(num,den) != 1) {
+ // std::cerr << "r0: " << r0
+ // << ", r1: " << r1
+ // << ", k: " << k
+ // << std::endl;
+
+ Integer gar1, gar2;
+ for( q = 1, gar1 = r0-r1, gar2 = r0 ; (gar1 >= k) || (gar2<k); ++q ) {
+ gar1 -= r1;
+ gar2 -= r1;
+ }
+
+ r0 -= q * r1;
+ t0 -= q * t1;
+
+ if (t0 < 0) {
+ num = -r0;
+ den = -t0;
+ } else {
+ num = r0;
+ den = t0;
+ }
+
+ if (t0 > m/k) {
+ if (!recurs)
+ std::cerr
+ << "*** Error *** No rational reconstruction of "
+ << f
+ << " modulo "
+ << m
+ << " with denominator <= "
+ << (m/k)
+ << std::endl;
+ }
+ if (gcd(num,den) != 1) {
+ if (!recurs)
+ std::cerr
+ << "*** Error *** There exists no rational reconstruction of "
+ << f
+ << " modulo "
+ << m
+ << " with |numerator| < "
+ << k
+ << std::endl
+ << "*** Error *** But "
+ << num
+ << " = "
+ << den
+ << " * "
+ << f
+ << " modulo "
+ << m
+ << std::endl;
+ return false;
+ }
+ }
+ // std::cerr << "RatRecon End " << std::endl;
+ return true;
+ }
+
+
+} // namespace Givaro
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/system/Makefile.am b/src/kernel/system/Makefile.am
index 3f207f4..086b885 100644
--- a/src/kernel/system/Makefile.am
+++ b/src/kernel/system/Makefile.am
@@ -1,24 +1,31 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
+AM_CXXFLAGS=@DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/memory
+
+pkginclude_HEADERS= \
givbasictype.h \
- givconfig.h \
- giverror.h \
+ givconfig.h \
+ giverror.h \
givgenarith.h \
- givinit.h \
- givmodule.h \
- givperf.h \
- givpower.h \
- givrandom.h \
+ givinit.h \
+ givmodule.h \
+ givperf.h \
+ givpower.h \
+ givrandom.h \
givtimer.h
noinst_LTLIBRARIES=libgivsystem.la
-libgivsystem_la_SOURCES=\
- givbasictype.C \
- giverror.C \
- givinit.C \
- givmodule.C \
+libgivsystem_la_SOURCES= \
+ givbasictype.C \
+ giverror.C \
+ givinit.C \
+ givmodule.C \
givtimer.C
diff --git a/src/kernel/system/Makefile.in b/src/kernel/system/Makefile.in
index dca17d1..a064241 100644
--- a/src/kernel/system/Makefile.in
+++ b/src/kernel/system/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -51,8 +65,8 @@ am_libgivsystem_la_OBJECTS = givbasictype.lo giverror.lo givinit.lo \
givmodule.lo givtimer.lo
libgivsystem_la_OBJECTS = $(am_libgivsystem_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -84,26 +98,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -113,40 +128,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -186,28 +211,29 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/kernel/memory
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
givbasictype.h \
- givconfig.h \
- giverror.h \
+ givconfig.h \
+ giverror.h \
givgenarith.h \
- givinit.h \
- givmodule.h \
- givperf.h \
- givpower.h \
- givrandom.h \
+ givinit.h \
+ givmodule.h \
+ givperf.h \
+ givpower.h \
+ givrandom.h \
givtimer.h
noinst_LTLIBRARIES = libgivsystem.la
libgivsystem_la_SOURCES = \
- givbasictype.C \
- giverror.C \
- givinit.C \
- givmodule.C \
+ givbasictype.C \
+ giverror.C \
+ givinit.C \
+ givmodule.C \
givtimer.C
all: all-am
@@ -218,14 +244,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/system/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/system/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/system/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/system/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -261,32 +287,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givbasictype.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/giverror.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givinit.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givmodule.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givtimer.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -316,7 +324,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -421,7 +429,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -432,6 +439,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -440,22 +449,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/kernel/system/givbasictype.C b/src/kernel/system/givbasictype.C
index 729909d..97e225b 100644
--- a/src/kernel/system/givbasictype.C
+++ b/src/kernel/system/givbasictype.C
@@ -1,14 +1,18 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givbasictype.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givbasictype.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givbasictype.C,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
#include "givaro/givbasictype.h"
-
-// -- Neutral type: definition of zero and one
-Neutral Neutral::zero =0;
-Neutral Neutral::one =1;
+namespace Givaro {
+ // -- Neutral type: definition of zero and one
+ Neutral Neutral::zero =0;
+ Neutral Neutral::one =1;
+} //namespace Givaro
diff --git a/src/kernel/system/givbasictype.h b/src/kernel/system/givbasictype.h
index df2d720..a5fb43e 100644
--- a/src/kernel/system/givbasictype.h
+++ b/src/kernel/system/givbasictype.h
@@ -1,37 +1,43 @@
-#ifndef _GIVARO_BASICTYPE_H_
-#define _GIVARO_BASICTYPE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givbasictype.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givbasictype.h,v 1.2 2008-02-21 19:36:02 pernet Exp $
+// $Id: givbasictype.h,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
+#ifndef __GIVARO_basictype_H
+#define __GIVARO_basictype_H
#include "givaro/givconfig.h"
#include <stdlib.h> // for size_t
#include <sys/types.h> // needed on MacOS X 10.5 for uint type
-// -- Neutral type: definition of zero and one
-class Neutral {
-public:
- static Neutral zero;
- static Neutral one;
- inline operator int() const { return _val; }
- inline int operator==( const Neutral& n) const { return _val==n._val; }
- inline int operator!=( const Neutral& n) const { return _val!=n._val; }
-private:
- Neutral( int val ) : _val(val) {};
- int _val;
-};
+namespace Givaro {
-// -- Used to build no initialized object as static object
-class givNoInit {};
-// -- Used to call cstor without copy
-class givNoCopy {};
-// -- Used to call cstor with copy
-class givWithCopy {};
+ // -- Neutral type: definition of zero and one
+ class Neutral {
+ public:
+ static Neutral zero;
+ static Neutral one;
+ inline operator int() const { return _val; }
+ inline int operator==( const Neutral& n) const { return _val==n._val; }
+ inline int operator!=( const Neutral& n) const { return _val!=n._val; }
+ private:
+ Neutral( int val ) : _val(val) {};
+ int _val;
+ };
-#endif
+ // -- Used to build no initialized object as static object
+ class givNoInit {};
+ // -- Used to call cstor without copy
+ class givNoCopy {};
+ // -- Used to call cstor with copy
+ class givWithCopy {};
+
+} // namespace Givaro
+
+#endif // __GIVARO_basictype_H
diff --git a/src/kernel/system/givconfig.h b/src/kernel/system/givconfig.h
index 96f8526..c21078e 100644
--- a/src/kernel/system/givconfig.h
+++ b/src/kernel/system/givconfig.h
@@ -1,13 +1,16 @@
-#ifndef _GIVARO_INTERNAL_CONFIG_H_
-#define _GIVARO_INTERNAL_CONFIG_H_ 1
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givconfig.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givconfig.h,v 1.8 2007-10-02 14:37:45 jgdumas Exp $
+// $Id: givconfig.h,v 1.22 2011-02-04 14:50:07 bboyer Exp $
// ==========================================================================
// Description: configuration file for Givaro
+#ifndef _GIVARO_INTERNAL_CONFIG_H_
+#define _GIVARO_INTERNAL_CONFIG_H_ 1
// * GIVARO_HAVE_ANSI_NAMESPACE:
@@ -23,8 +26,8 @@
// as based classes for exceptions.
// * GIVARO_HAVE_ANSI_LIBRARY:
// value: defined/undefined
-// purpose: define it in order to use ANSI library utilities (except for
-// container) as allocation without throwing exception, new str stream,
+// purpose: define it in order to use ANSI library utilities (except for
+// container) as allocation without throwing exception, new str stream,
// std header files...
// * GIVARO_HAVE_LBLAS:
// value: defined/undefined
@@ -58,57 +61,124 @@
// - xx: major version number
// - yy: minor version number
// - zz: revision number
-#define GIVARO_VERSION 0x030103
+#define GIVARO_MAJOR_VERSION 3
+#define GIVARO_MINOR_VERSION 4
+#define GIVARO_REVISION_VERSION 2
+#define GIVARO_VERSION 30402
// -- Defines this value both to compile the library of user program
// value: integer that defines debug level trace information (not well defined)
-//#define GIVARO_DEBUG 1
+#ifdef DEBUG
+#define GIVARO_DEBUG 1
+#endif
// ==========================================================================
// -- Defines the basic integer arithmetics available on this machine
#include <givaro-config.h>
+#ifdef __GIVARO_HAVE_STDINT_H
+#define __STDC_LIMIT_MACROS
+#include <stdint.h>
+#ifndef INT64_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define INT64_MAX std::numeric_limits<int64_t>::max()
+#endif
+
+#ifndef UINT64_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define UINT64_MAX std::numeric_limits<uint64_t>::max()
+#endif
+
+#ifndef INT32_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define INT32_MAX std::numeric_limits<int32_t>::max()
+#endif
+
+#ifndef UINT32_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define UINT32_MAX std::numeric_limits<uint32_t>::max()
+#endif
+
+#ifndef INT16_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define INT16_MAX std::numeric_limits<int16_t>::max()
+#endif
+
+#ifndef UINT16_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define UINT16_MAX std::numeric_limits<uint16_t>::max()
+#endif
+
+#ifndef INT8_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define INT8_MAX std::numeric_limits<int8_t>::max()
+#endif
+
+#ifndef UINT8_MAX
+#warning "somebody nasty previously included <stdint.h> without __STDC_LIMIT_MACROS :)"
+#include <limits>
+#define UINT8_MAX std::numeric_limits<uint8_t>::max()
+#endif
+
+
+#endif
+
# define GIVARO_BITS_PER_LONGINT SIZEOF_LONG
# define GIVARO_BITS_PER_INT SIZEOF_INT
# define GIVARO_BITS_PER_SHORTINT SIZEOF_SHORT
# define GIVARO_BITS_PER_CHAR SIZEOF_CHAR
-typedef signed __GIVARO_INT8 int8;
-typedef signed __GIVARO_INT16 int16;
-typedef signed __GIVARO_INT32 int32;
-typedef unsigned __GIVARO_INT8 uint8;
-typedef unsigned __GIVARO_INT16 uint16;
-typedef unsigned __GIVARO_INT32 uint32;
+#ifndef __GIVARO_HAVE_STDINT_H
+typedef signed __GIVARO_INT8 int8_t;
+typedef signed __GIVARO_INT16 int16_t;
+typedef signed __GIVARO_INT32 int32_t;
+typedef unsigned __GIVARO_INT8 uint8_t;
+typedef unsigned __GIVARO_INT16 uint16_t;
+typedef unsigned __GIVARO_INT32 uint32_t;
# if defined(__GIVARO_INT64)
-# undef GIVARO_DONOTUSE_SIXTYFOUR
-typedef signed __GIVARO_INT64 int64;
-typedef unsigned __GIVARO_INT64 uint64;
+# undef GIVARO_DONOTUSE_SIXTYFOUR
+typedef signed __GIVARO_INT64 int64_t;
+typedef unsigned __GIVARO_INT64 uint64_t;
# else
# undef GIVARO_USE_SIXTYFOUR
# define GIVARO_DONOTUSE_SIXTYFOUR 1
# endif
+#endif
-# define GIVARO_MAXUINT8 255U // 2^8-1
-# define GIVARO_MAXUINT16 65535U // 2^16-1
+#ifndef __GIVARO_HAVE_STDINT_H
+# define GIVARO_MAXUINT8 255U // 2^8-1
+# define GIVARO_MAXUINT16 65535U // 2^16-1
# define GIVARO_MAXUINT32 4294967295U // 2^32-1
# define GIVARO_MAXULONG 4294967295U // 2^32-1
-
+#else
+# define GIVARO_MAXUINT8 UINT8_MAX // 2^8-1
+# define GIVARO_MAXUINT16 UINT16_MAX // 2^16-1
+# define GIVARO_MAXUINT32 UINT32_MAX // 2^32-1
+# define GIVARO_MAXULONG 4294967295U //! @bug 2^32-1
+#endif
// ==========================================================================
// -- Code expansion depending on the previous defined macros
-// -- specialized template
+// -- specialized template
#ifdef GIVARO_HAVE_ANSI_SPECIALIZED
-# define GIVARO_SPECIALIZED template<>
+# define GIVARO_SPECIALIZED template<>
#else
-# define GIVARO_SPECIALIZED
+# define GIVARO_SPECIALIZED
#endif
@@ -131,34 +201,43 @@ typedef unsigned __GIVARO_INT64 uint64;
# include <sstream>
# define GIVARO_ASSERT(cond, msg) { \
if (!(cond)) {\
- ostringstream ostr;\
+ std::ostringstream ostr;\
ostr << msg << "\nFile:"##__FILE__##", Line:" << __LINE__;\
GivError::throw_error( GivError(ostr.str().c_str()) );\
}}
# define GIVARO_ASSERT2(cond, msg1, msg2) { \
if (!(cond)) {\
- ostringstream ostr;\
+ std::ostringstream ostr;\
ostr << msg1 << msg2 << "\nFile:"##__FILE__##", Line:" << __LINE__;\
GivError::throw_error( GivError(ostr.str().c_str()) );\
}}
# else
-# include <strstream>
+# include <sstream>
# define GIVARO_ASSERT(cond, msg) { \
if (!(cond)) {\
- ostrstream ostr;\
+ std::ostringstream ostr;\
ostr << msg << "\nFile:" << __FILE__ << ", Line:" << __LINE__;\
- GivError::throw_error( GivError(ostr.str()) );\
+ GivError::throw_error( GivError(ostr.str().c_str()) );\
}}
# define GIVARO_ASSERT2(cond, msg1, msg2) { \
if (!(cond)) {\
- ostrstream ostr;\
+ std::ostringstream ostr;\
ostr << msg1 << msg2 << "\nFile:" << __FILE__ << ", Line:" << __LINE__;\
- GivError::throw_error( GivError(ostr.str()) );\
+ GivError::throw_error( GivError(ostr.str().c_str()) );\
}}
# endif
+
+#define GIVARO_REQUIRE(bool_expression, msg) GIVARO_ASSERT2(bool_expression, "Givaro required: ", msg)
+#define GIVARO_ENSURE(bool_expression, msg) GIVARO_ASSERT2(bool_expression, "Givaro ensured: ", msg)
+#define GIVARO_STATE(expression) expression
#else
#define GIVARO_ASSERT(cond, msg)
#define GIVARO_ASSERT2(cond, msg1, msg2)
+#define GIVARO_REQUIRE(ignore, msg) ((void) 0)
+#define GIVARO_ENSURE(ignore, msg) ((void) 0)
+// #define GIVARO_STATE(expression) do { (expression) } while (0)
+#define GIVARO_STATE(ignore) ((void) 0)
+
#endif
// ==========================================================================
@@ -170,8 +249,9 @@ typedef unsigned __GIVARO_INT64 uint64;
// ==========================================================================
// -- System variable
+#ifndef GIVARO_SYS
#define GIVARO_SYS _SYS_UNDEF
-
+#endif
// ==========================================================================
@@ -179,10 +259,12 @@ typedef unsigned __GIVARO_INT64 uint64;
// -- Define this macro to store a log of memory address
// allocated during computation
-//#define GIVARO_MAPMEM
+//#define GIVARO_MAPMEM
// -- Define this variable to compute statistics about memory usage
+#ifndef GIVARO_STATMEM
#define GIVARO_STATMEM 1
+#endif
@@ -250,6 +332,7 @@ template<> inline unsigned long long GIVARO_numeric_limits<unsigned long long>::
template<class XXX> struct Signed_Trait : public GIVARO_numeric_limits<XXX> {
typedef XXX signed_type;
+ typedef XXX unsigned_type;
};
template<> struct Signed_Trait<float> : public GIVARO_numeric_limits<float> {
@@ -316,6 +399,6 @@ template<> struct Signed_Trait<unsigned long> : public GIVARO_numeric_limits<un
typedef long long signed_type;
typedef unsigned long long unsigned_type;
};
- #endif
+ #endif
#endif
diff --git a/src/kernel/system/giverror.C b/src/kernel/system/giverror.C
index 0abad05..3f68b2d 100644
--- a/src/kernel/system/giverror.C
+++ b/src/kernel/system/giverror.C
@@ -1,16 +1,21 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/giverror.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: giverror.C,v 1.2 2005/07/13 09:59:37 pernet Exp $
+// $Id: giverror.C,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
-// - error exception
+// - error exception
#include "givaro/giverror.h"
#include <iostream>
+namespace Givaro {
+
std::ostream& GivError::print( std::ostream& o ) const
{ return o << strg ; }
@@ -23,13 +28,13 @@ GivBadFormat::~GivBadFormat(){}
GivMathDivZero::~GivMathDivZero(){}
-void GivError::throw_error( const GivError& err )
+void GivError::throw_error( const GivError& err )
{
throw err;
}
-std::ostream& operator<< (std::ostream& o, const GivError& E)
+std::ostream& operator<< (std::ostream& o, const GivError& E)
{
- return E.print(o) ;
+ return E.print(o) ;
}
-
+} // namespace Givaro
diff --git a/src/kernel/system/giverror.h b/src/kernel/system/giverror.h
index e66b3b8..bbd4ee2 100644
--- a/src/kernel/system/giverror.h
+++ b/src/kernel/system/giverror.h
@@ -1,28 +1,35 @@
-#ifndef _GIVERROR_H_
-#define _GIVERROR_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/giverror.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: giverror.h,v 1.2 2005/07/13 09:59:37 pernet Exp $
+// $Id: giverror.h,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
-// - error exception
-#include <iostream>
+/*! @file system/giverror.h
+ * @ingroup system
+ * @brief error exception.
+ */
+
+#ifndef __GIVARO_error_H
+#define __GIVARO_error_H
+#include <iostream>
+namespace Givaro {
// ------------------------------- GivError
-// - Base class for execption handling in Givaro
+// - Base class for exeception handling in Givaro
class GivError {
public:
- GivError(const char* msg =0 )
+ GivError(const char* msg =0 )
: strg(msg) {};
virtual ~GivError() ;
// -- virtual print of the error message
virtual std::ostream& print( std::ostream& o ) const;
-
+
// -- non virtual output operator
friend std::ostream& operator<< (std::ostream& o, const GivError& E) ;
@@ -30,7 +37,7 @@ public:
static void throw_error( const GivError& err );
protected:
- const char* strg;
+ const char* strg;
};
class GivMathError : public GivError {
@@ -40,7 +47,7 @@ public:
GivMathError(const char* msg = 0) : GivError(msg) { }
};
-// -- Exception thrown in input of data structure
+// -- Exception thrown in input of data structure
class GivBadFormat : public GivError {
public:
virtual ~GivBadFormat();
@@ -53,6 +60,6 @@ public:
GivMathDivZero(const char* msg = 0) : GivError(msg) { }
};
+} // namespace Givaro
-
-#endif
+#endif // __GIVARO_error_H
diff --git a/src/kernel/system/givgenarith.h b/src/kernel/system/givgenarith.h
index e8707a2..8951e10 100644
--- a/src/kernel/system/givgenarith.h
+++ b/src/kernel/system/givgenarith.h
@@ -1,17 +1,20 @@
-#ifndef _GENARITH_H_
-#define _GENARITH_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givgenarith.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givgenarith.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: givgenarith.h,v 1.5 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// Domain definition for basic type of the language.
+#ifndef __GIVARO_genarith_H
+#define __GIVARO_genarith_H
#include "givaro/givbasictype.h"
-
+namespace Givaro {
// -- give a name for /read/write
template<class T>
struct __givdom_trait_name { enum { val = '?' }; };
@@ -31,8 +34,8 @@ public:
BaseDomain() : zero((T)0), one((T)1) {}
- // -- Assignment of domain: default operator=
- // -- Comparizon of domain:
+ // -- Assignment of domain: default operator=
+ // -- Comparizon of domain:
int operator==( const BaseDomain<T>& BC) const { return 1;}
int operator!=( const BaseDomain<T>& BC) const { return 0;}
@@ -60,12 +63,12 @@ public:
void addin( Rep& r, const Rep a) const { r += a; };
void subin( Rep& r, const Rep a) const { r -= a; };
- void axpy( Rep& r, const Rep a, const Rep b, const Rep c ) const
+ void axpy( Rep& r, const Rep a, const Rep b, const Rep c ) const
{ r = a * b + c; };
void axpyin( Rep& r, const Rep a, const Rep b ) const { r += a * b; };
- void axmy( Rep& r, const Rep a, const Rep b, const Rep c ) const
+ void axmy( Rep& r, const Rep a, const Rep b, const Rep c ) const
{ r = a * b - c; };
- void axmyin( Rep& r, const Rep a, const Rep b ) const { r -= a * b; };
+ void axmyin( Rep& r, const Rep a, const Rep b ) const { r = a * b - r; };
// -- unary methods
void neg( Rep& r, const Rep a ) const { r = -a; };
@@ -74,11 +77,11 @@ public:
void invin( Rep& r ) const { r = 1/r; };
// -- IO methods: of the object domain
- ostream& write( ostream& s ) const
+ ostream& write( ostream& s ) const
{ return s << (char)__givdom_trait_name<T>::val; }
- istream& read ( istream& s )
- {
- char c; s >> std::ws >> c;
+ istream& read ( istream& s )
+ {
+ char c; s >> std::ws >> c;
if (c != (char)__givdom_trait_name<T>::val)
GivError::throw_error(GivBadFormat("Bad domain"));
}
@@ -104,4 +107,6 @@ __GIVARO_SPEC_NAME(float, 'f')
typedef BaseDomain<double> DoubleDom;
__GIVARO_SPEC_NAME(double, 'd')
-#endif
+} // namespace Givaro
+
+#endif // __GIVARO_genarith_H
diff --git a/src/kernel/system/givinit.C b/src/kernel/system/givinit.C
index 3555aa5..2b2cb4e 100644
--- a/src/kernel/system/givinit.C
+++ b/src/kernel/system/givinit.C
@@ -1,9 +1,12 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givinit.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givinit.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givinit.C,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// - Initialisation method
@@ -22,15 +25,16 @@
# endif
#endif
+namespace Givaro {
-void Givaro::DisplayVersion()
+void GivaroMain::DisplayVersion()
{
- Givaro::DisplayVersion( std::cout ) ;
+ GivaroMain::DisplayVersion( std::cout ) ;
}
-void Givaro::DisplayVersion(std::ostream& o)
+void GivaroMain::DisplayVersion(std::ostream& o)
{
-
+
o<<'\n' ;
o<<" /\\ \n" ;
o<<" / \\ /\\ GIVARO : Parallel Algebraic Computing\n" ;
@@ -42,27 +46,27 @@ o<<" / (c) 1987-1998 \\ Th. Gautier, J.L. Roch, M.Samama, G.Villard\n"
o<<" / Givaro-3.0 \\ co-Authors:\n" ;
o<<"/ (c) 1998-2002 \\ J-G. Dumas, P. Giorgi\n" ;
o<<"-- - - - - --\n" ;
-o<< "version: " << Givaro::Version() << std::endl;
-}
+o<< "version: " << GivaroMain::Version() << std::endl;
+}
-const char* Givaro::Version()
+const char* GivaroMain::Version()
{
- static const char* Givaro_version ="$Revision: 1.1.1.1 $ for ""GIVAROSYS";
+ static const char* Givaro_version ="$Revision: 1.2 $ for ""GIVAROSYS";
return Givaro_version;
}
-void Givaro::Init(int* argc, char***argv)
+void GivaroMain::Init(int* argc, char***argv)
{
GivModule::InitApp(argc, argv) ;
}
-void Givaro::Init()
+void GivaroMain::Init()
{
- Givaro::Init(0,0) ;
+ GivaroMain::Init(0,0) ;
}
// End of Givaro kernel :
-void Givaro::End()
+void GivaroMain::End()
{
GivModule::EndApp() ;
}
@@ -75,17 +79,17 @@ int GivaroAppli::run( int argc, char** argv)
#if ( __profile__ == 1)
OSErr err = ProfilerInit(collectDetailed, bestTimeBase, 100,10);
if (err != noErr) {
- cout << GivError("[Givaro::Init]: cannot initiliaze profile.");
+ cout << GivError("[Givaro::Init]: cannot initiliaze profile.");
return 0;
- }
+ }
ProfilerSetStatus(true);
#endif
#endif
// -- call main function
try {
- Givaro::Init(&argc, &argv);
+ GivaroMain::Init(&argc, &argv);
res = main(argc,argv);
- Givaro::End();
+ GivaroMain::End();
}
catch (GivError E) { std::cout << E << std::endl; }
catch (...) { std::cout << "[GivaroAppli::run]: an error has occurred." << std::endl; }
@@ -101,3 +105,5 @@ int GivaroAppli::run( int argc, char** argv)
return res;
}
+
+} // namespace Givaro
diff --git a/src/kernel/system/givinit.h b/src/kernel/system/givinit.h
index 55d12be..8ecfc1d 100644
--- a/src/kernel/system/givinit.h
+++ b/src/kernel/system/givinit.h
@@ -1,25 +1,29 @@
-#ifndef _GIV_INIT_H_
-#define _GIV_INIT_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givinit.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givinit.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givinit.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_init_H
+#define __GIVARO_init_H
#include "givaro/givconfig.h"
#include <iostream>
+namespace Givaro {
// ==========================================================================
// --
// -- Description:
// - Initialisation of GIVARO :
-// * handler to manage signal
+// * handler to manage signal
// * init the memory manager
// * init all other modules
-class Givaro {
+class GivaroMain {
public:
//- Init of Givaro kernel :
static void Init(int* argc, char*** argv) ;
@@ -41,7 +45,7 @@ static void DisplayVersion();
// --
// -- Main application class
// -- Could be not used
-class GivaroAppli : public Givaro {
+class GivaroAppli : public GivaroMain {
public:
//- Cstor, destor
GivaroAppli() {};
@@ -54,4 +58,5 @@ public:
int run( int argc=0, char** argv=0);
};
-#endif
+} // namespace Givaro
+#endif // __GIVARO_init_H
diff --git a/src/kernel/system/givmodule.C b/src/kernel/system/givmodule.C
index 4b1d140..e10ffd5 100644
--- a/src/kernel/system/givmodule.C
+++ b/src/kernel/system/givmodule.C
@@ -1,9 +1,12 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givmodule.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmodule.C,v 1.2 2005/07/13 09:59:37 pernet Exp $
+// $Id: givmodule.C,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// Definition of initialization module. Each predefined
@@ -16,7 +19,7 @@
// then Init method of M2 is call after Init method of M1
// (and in the reverse order for End methods). This leads
// to a block oriented initialization mecanism, where each
-// module can be see as a block: the Init method is call
+// module can be see as a block: the Init method is call
// when enter into the block, and End when go out. Precedent
// relationships are equivalent to block inclusion.
@@ -24,20 +27,21 @@
#include "givaro/giverror.h"
#include <iostream>
+namespace Givaro {
InitAfter::InitAfter( const GivModule& MI )
- : M(&MI), priority(GivModule::UndefPriority)
+ : M(&MI), priority(GivModule::UndefPriority)
{}
InitAfter::InitAfter(int p )
- : M(0), priority(p)
+ : M(0), priority(p)
{}
-int InitAfter::operator < ( const InitAfter& Mi ) const
+int InitAfter::operator < ( const InitAfter& Mi ) const
{
int pThis = ( this->M ==0 ? priority : M->priority ) ;
int pMi = ( Mi.M ==0 ? Mi.priority : Mi.M->priority ) ;
- return (pThis < pMi) ;
+ return (pThis < pMi) ;
}
@@ -56,13 +60,13 @@ static ObjectInit* head = 0;
ObjectInit::ObjectInit( )
{
#ifdef GIVARO_DEBUG
- cout << "[GivModule] ObjectInit::cstor " << (void*)head << endl ;
- cout << "[GivModule] ObjectInit::cstor curr:" << (void*)this << endl ;
+ std::cout << "[GivModule] ObjectInit::cstor " << (void*)head << std::endl ;
+ std::cout << "[GivModule] ObjectInit::cstor curr:" << (void*)this << std::endl ;
#endif
// - link the new object:
- _next = head; head = this ;
+ _next = head; head = this ;
#ifdef GIVARO_DEBUG
- cout << "[GivModule] ObjectInit::cstor " << (void*)head << endl ;
+ std::cout << "[GivModule] ObjectInit::cstor " << (void*)head << std::endl ;
#endif
}
@@ -72,21 +76,21 @@ GivModule::GivModule ( ptFuncInit init, ptFuncEnd end, const int p, const char*
: priority(UndefPriority), which(p), f_init(init), f_end(end), name(n)
{
All[counter++] = this ;
-}
-
+}
+
GivModule::GivModule ( ptFuncInit init, ptFuncEnd end, const InitAfter& M, const char* n)
: priority(UndefPriority), which(M), f_init(init), f_end(end), name(n)
{
All[counter++] = this ;
}
-
+
void GivModule::SortGivModule()
{
#ifdef GIVARO_DEBUG
{
- for (int j=0; j<counter; j++)
- cout << j << ':' << All[j]->which.priority << ' ' << All[j]->name << endl ;
- cout <<endl ;
+ for (int j=0; j<counter; j++)
+ std::cout << j << ':' << All[j]->which.priority << ' ' << All[j]->name << std::endl ;
+ std::cout <<std::endl ;
}
#endif
@@ -103,26 +107,26 @@ void GivModule::SortGivModule()
SortedAll[curr] = curr ;
}
}
-
+
// - Set priority of modules
int isundef ; // - ==1 if exists undef priority
- int cpt = 0 ; // - count the number of tentative to resolve constraint
- do {
+ int cpt = 0 ; // - count the number of tentative to resolve constraint
+ do {
isundef = 0 ;
for (curr=0; curr<counter; curr++)
if (All[curr]->priority == GivModule::UndefPriority) {
- if (All[curr]->which.M ==0)
- // -- Set the priority field with those of which
+ if (All[curr]->which.M ==0)
+ // -- Set the priority field with those of which
All[curr]->priority = All[curr]->which.priority+1 ;
else {
- // -- Set the priority field with the value pointed by which
+ // -- Set the priority field with the value pointed by which
All[curr]->priority = All[curr]->which.M->priority+1 ;
if (All[curr]->priority == GivModule::UndefPriority) isundef = 1 ;
}
}
} while ((isundef) && (cpt <= counter*counter));
-
- if (cpt > counter*counter)
+
+ if (cpt > counter*counter)
throw GivError("*** Can't resolve constraint of initialization of modules");
// -- Sort Initialization Module by priority
@@ -132,7 +136,7 @@ void GivModule::SortGivModule()
{
GivModule* currM = All[curr] ;
#ifdef GIVARO_DEBUG
-cout << " Search for : " << currM->name << endl ;
+std::cout << " Search for : " << currM->name << std::endl ;
#endif
// -- Search the first GivModule with strict less priority
@@ -141,7 +145,7 @@ cout << " Search for : " << currM->name << endl ;
if ( currM->priority < All[SortedAll[k]]->priority) break ;
#ifdef GIVARO_DEBUG
-cout << currM->name << " inserted at : " << k << endl ;
+std::cout << currM->name << " inserted at : " << k << std::endl ;
#endif
// -- either k == curr, and this is inserted at position curr
@@ -155,16 +159,16 @@ cout << currM->name << " inserted at : " << k << endl ;
}
#ifdef GIVARO_DEBUG
{
-for (int j=0; j<=curr; j++) cout << All[SortedAll[j]]->name << ',' ;
-cout <<endl << endl ;
+for (int j=0; j<=curr; j++) std::cout << All[SortedAll[j]]->name << ',' ;
+std::cout <<std::endl << std::endl ;
}
#endif
}
#ifdef GIVARO_DEBUG
{
- for (int j=0; j<counter; j++) cout << j << ':' << All[SortedAll[j]]->name << endl ;
- cout <<endl ;
+ for (int j=0; j<counter; j++) std::cout << j << ':' << All[SortedAll[j]]->name << std::endl ;
+ std::cout <<std::endl ;
}
#endif
}
@@ -177,33 +181,33 @@ void GivModule::InitApp(int* argc, char***argv)
{
// -- Computation of a topological sort from All[]
SortGivModule() ;
-
+
// -- Initialization of the modules
for (int i=0; i<counter; i++)
{
GivModule* curr = All[SortedAll[i]] ;
#ifdef GIVARO_DEBUG
- if (curr->name !=0) cout << curr->name << " initializing..." ;
+ if (curr->name !=0) std::cout << curr->name << " initializing..." ;
#endif
if (curr->f_init !=0) curr->f_init(argc, argv) ;
#ifdef GIVARO_DEBUG
- if (curr->name !=0) cout << "done !" << endl ;
+ if (curr->name !=0) std::cout << "done !" << std::endl ;
#endif
}
// -- Init of object:
ObjectInit* curr = head;
#ifdef GIVARO_DEBUG
- cout << "[GivModule] ObjectInit::Head: " << (void*)head << endl;
+ std::cout << "[GivModule] ObjectInit::Head: " << (void*)head << std::endl;
#endif
while (curr !=0) {
curr->objinit();
- curr = curr->_next;
+ curr = curr->_next;
#ifdef GIVARO_DEBUG
- cout << "[GivModule] ObjectInit::next one: " << (void*)curr << endl;
+ std::cout << "[GivModule] ObjectInit::next one: " << (void*)curr << std::endl;
#endif
if (curr ==head) break ; // -- on MacOS I can make circular list !!! (shared lib)
- }
+ }
}
void GivModule::EndApp()
@@ -212,12 +216,13 @@ void GivModule::EndApp()
{
GivModule* curr = All[SortedAll[i]] ;
#ifdef GIVARO_DEBUG
- if (curr->name !=0) cout << curr->name << " freeing..." ;
+ if (curr->name !=0) std::cout << curr->name << " freeing..." ;
#endif
if (curr->f_end !=0) curr->f_end() ;
#ifdef GIVARO_DEBUG
- if (curr->name !=0) cout << "done !" << endl ;
+ if (curr->name !=0) std::cout << "done !" << std::endl ;
#endif
}
}
+} // namespace Givaro
diff --git a/src/kernel/system/givmodule.h b/src/kernel/system/givmodule.h
index b3d7fd6..125d566 100644
--- a/src/kernel/system/givmodule.h
+++ b/src/kernel/system/givmodule.h
@@ -1,13 +1,17 @@
-#ifndef _MODULE_INIT_H_
-#define _MODULE_INIT_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givmodule.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmodule.h,v 1.2 2005/07/13 09:59:37 pernet Exp $
+// $Id: givmodule.h,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
+#ifndef __GIVARO_module_init_H
+#define __GIVARO_module_init_H
+
+namespace Givaro {
// -------------------------------------------------------- Fwd declaration
@@ -66,9 +70,9 @@ private:
// - Call by the Givaro::Init and Givaro::End functions
static void InitApp(int* argc, char***argv);
static void EndApp();
-friend class Givaro;
+friend class GivaroMain;
-private:
+private:
// - Internal data of a module
int priority;
InitAfter which;
@@ -97,4 +101,5 @@ private:
friend class GivModule;
};
-#endif
+} // namespace Givaro
+#endif // __GIVARO_module_init_H
diff --git a/src/kernel/system/givperf.h b/src/kernel/system/givperf.h
index 224ea6a..d9dffb0 100644
--- a/src/kernel/system/givperf.h
+++ b/src/kernel/system/givperf.h
@@ -1,39 +1,48 @@
-#ifndef _GIV_PERF_H_
-#define _GIV_PERF_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givperf.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givperf.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givperf.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// - performance analysis
+#ifndef __GIVARO_perf_H
+#define __GIVARO_perf_H
#ifdef GIVARO_PERF
#include <stddef>
#include <iostream>
+namespace Givaro {
struct __CoutCounter {
void (*print)(ostream&);
- __CoutCounter( void (*prn)(ostream& ) ) : print(prn)
+ __CoutCounter( void (*prn)(ostream& ) ) : print(prn)
{
cout << "New Counter" << endl;
}
- ~__CoutCounter( )
- {
+ ~__CoutCounter( )
+ {
cout << "Destroy a counter" << endl;
- (*print)(cout << endl); cout << endl;
+ (*print)(cout << endl); cout << endl;
}
};
+} // namespace Givaro
+
-// --- Class that store a set of counters:
-// - _count_cstor: #cstor calls except the recopy constructor calls
-// - _count_cstor_recopy: #recopy cstor calls
-// - _count_assign: #assignment calls
-// - _count_dstor: #dstor calls
+namespace Givaro {
+/*! @brief Class that store a set of counters.
+ * - _count_cstor: \#cstor calls except the recopy constructor calls
+ * - _count_cstor_recopy: \#recopy cstor calls
+ * - _count_assign: \#assignment calls
+ * - _count_dstor: \#dstor calls
+ * *
+ */
#define GIVARO_PERF_DEFCLASS(Name,Type) \
template<class Type> \
@@ -79,18 +88,23 @@ __CoutCounter _Giv_perf##Name<Type>::_coutcout= &_Giv_perf##Name<Type>::print;
#define GIVARO_PERF_DISPLAY(Name,Type) _Giv_perf##Name<Type>::print(cout), cout << endl;
+} // namespace Givaro
#else // #ifdef GIVARO_PERF
-#define GIVARO_PERF_DEFCLASS(N,T)
+// namespace Givaro {
+
+#define GIVARO_PERF_DEFCLASS(N,T)
#define GIVARO_PERF_INEHERIT(N,T)
-#define GIVARO_PERF_CSTOR(Name,Type)
-#define GIVARO_PERF_RECOPY(Name,Type)
-#define GIVARO_PERF_DSTOR(Name,Type)
+#define GIVARO_PERF_CSTOR(Name,Type)
+#define GIVARO_PERF_RECOPY(Name,Type)
+#define GIVARO_PERF_DSTOR(Name,Type)
#define GIVARO_PERF_ASSIGN(Name,Type)
-#define GIVARO_PERF_DISPLAY(Name,Type)
+#define GIVARO_PERF_DISPLAY(Name,Type)
+// } // namespace Givaro
#endif
+#endif // __GIVARO_perf_H
-#endif
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h
index 2938978..5d16849 100644
--- a/src/kernel/system/givpower.h
+++ b/src/kernel/system/givpower.h
@@ -1,16 +1,32 @@
// ==========================================================================
-// file: givpowers.h
-// Time-stamp: <28 Feb 08 14:17:46 Jean-Guillaume.Dumas at imag.fr>
-// (c) 1999 Givaro Team
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// file: givpowers.h
+// Time-stamp: <25 Feb 11 13:34:07 Jean-Guillaume.Dumas at imag.fr>
// ==========================================================================
-#ifndef _GIVARO_POWER_H_
-#define _GIVARO_POWER_H_
+#ifndef __GIVARO_power_H
+#define __GIVARO_power_H
+
+namespace Givaro {
// -------------------------------------------------------------
-// Powering
+// Integer log
// -------------------------------------------------------------
+template<typename T> inline unsigned GIVINTLOG(const T& a) {
+ unsigned l(0);
+ for(T v(a); v >>= 1; ++l) {}
+ return l;
+}
+
+
+// -------------------------------------------------------------
+// Powering
+// -------------------------------------------------------------
template<class TT, class UU> TT power(const TT n, const UU l) {
if (l == 0) return 1 ;
@@ -22,15 +38,16 @@ template<class TT, class UU> TT power(const TT n, const UU l) {
while (p != 0) {
if (p & 0x1) {
- if (is_assg)
+ if (is_assg)
res *= puiss ;
- else {
- is_assg = 1 ;
- res = puiss ;
- }
+ else {
+ is_assg = 1 ;
+ res = puiss ;
+ }
}
- if ((p >>= 1) != 0) puiss = puiss * puiss ;
-
+// if ((p >>= 1) != 0) puiss = puiss * puiss ;
+ if ((p >>= 1) != 0) puiss *= puiss ;
+
}
return res ;
}
@@ -48,20 +65,21 @@ template<class D, class TT> TT& dom_power(TT& res, const TT& n, long l, const D&
unsigned long p = l ;
short is_assg = 0 ;
- TT puiss = n, tmp ;
+ TT puiss = n ;
res = F.one ;
while (p != 0) {
if (p & 0x1) {
if (is_assg)
F.mulin(res,puiss) ;
- else {
- is_assg = 1 ;
- res = puiss ;
+ else {
+ is_assg = 1 ;
+ res = puiss ;
}
- }
- if ((p >>= 1) != 0) { F.mul(tmp,puiss,puiss) ; puiss = tmp; }
- }
+ }
+ if ((p >>= 1) != 0) { F.mulin(puiss,puiss) ; }
+// if ((p >>= 1) != 0) { F.mul(tmp,puiss,puiss) ; puiss = tmp; }
+ }
return res ;
}
@@ -74,4 +92,6 @@ template<> double power<double>(const double a, const double e) {
}
*/
-#endif
+} // namespace Givaro
+
+#endif // __GIVARO_power_H
diff --git a/src/kernel/system/givrandom.h b/src/kernel/system/givrandom.h
index 549f566..4ea8cd6 100644
--- a/src/kernel/system/givrandom.h
+++ b/src/kernel/system/givrandom.h
@@ -1,10 +1,23 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro : random generator
// a la Linbox ...
-// Time-stamp: <13 Jul 07 14:40:27 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <13 Jul 07 14:40:27 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef __GIVARO_RTANDOM__H__
-#define __GIVARO_RTANDOM__H__
+
+/*! @file system/givrandom.h
+ * @ingroup system
+ * @brief NO DOC
+ * @bib Fishman, G.S. "Multiplicative congruential random
+ * number generators ..." Math. Comp. 54:331-344 (1990)
+ */
+
+#ifndef __GIVARO_random_H
+#define __GIVARO_random_H
#include <givaro/givconfig.h>
extern "C" {
@@ -12,9 +25,6 @@ extern "C" {
# include <sys/resource.h>
}
-// -----------------------------------------------------
-// Fishman, G.S. "Multiplicative congruential random
-// number generators ..." Math. Comp. 54:331-344 (1990)
#if __GIVARO__DONOTUSE_longlong__
#define _GIVRAN_MULTIPLYER_ 950706376UL
@@ -24,45 +34,64 @@ extern "C" {
#define _GIVRAN_MODULO_ 2147483647ULL
#endif
+namespace Givaro {
+
class GivRandom {
mutable unsigned long _seed;
public:
typedef GivRandom random_generator;
- GivRandom(const unsigned long s = 0)
- : _seed(s) {
+ GivRandom(const unsigned long s = 0)
+ : _seed(s)
+ {
if (! s) {
struct timeval tp;
gettimeofday(&tp, 0) ;
_seed = (long)(tp.tv_usec);
}
- }
-
- GivRandom(const GivRandom& R) : _seed(R._seed) {}
- GivRandom& operator= (const GivRandom& R) { _seed = R._seed; return *this; }
+ }
+
+ GivRandom(const GivRandom& R) :
+ _seed(R._seed)
+ {}
+
+ GivRandom& operator= (const GivRandom& R)
+ {
+ _seed = R._seed;
+ return *this;
+ }
+
+ unsigned long seed() const
+ {
+ return _seed;
+ }
- unsigned long seed() const { return _seed; }
-
#if defined(__GIVARO_INT64)
- unsigned long operator() () const {
- return _seed = (unsigned long)(
- (__GIVARO_INT64)_GIVRAN_MULTIPLYER_
+ unsigned long operator() () const
+ {
+ return _seed = (unsigned long)(
+ (__GIVARO_INT64)_GIVRAN_MULTIPLYER_
* (__GIVARO_INT64)_seed
% (__GIVARO_INT64)_GIVRAN_MODULO_ );
}
#else
- unsigned long operator() () const {
- return _seed = (unsigned long)(
- (unsigned long)_GIVRAN_MULTIPLYER_
+ unsigned long operator() () const
+ {
+ return _seed = (unsigned long)(
+ (unsigned long)_GIVRAN_MULTIPLYER_
* _seed
% (unsigned long)_GIVRAN_MODULO_ );
}
#endif
- template<class XXX> XXX& operator() (XXX& x) const {
+ template<class XXX> XXX& operator() (XXX& x) const
+ {
return x = (XXX)this->operator() ();
- }
-
+ }
+
};
-#endif
+} // namespace Givaro
+
+#endif // __GIVARO_random_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/system/givtimer.C b/src/kernel/system/givtimer.C
index 9fb367b..e0230e7 100644
--- a/src/kernel/system/givtimer.C
+++ b/src/kernel/system/givtimer.C
@@ -1,224 +1,249 @@
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/system/givtimer.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givtimer.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givtimer.C,v 1.4 2011-02-02 14:15:45 jgdumas Exp $
// ==========================================================================
// Description:
// - various timer objects
// - to be rewritten to be more efficient
-#include <math.h>
+#include <cmath>
#include "givaro/givconfig.h"
#if (GIVARO_SYS == _SYS_MACOS)
-#include <time.h> // for use of clock()
+#include <time.h> // for use of clock()
#define USER_TIME ((double) ( (double)clock()/ (double)CLOCKS_PER_SEC))
#else
extern "C" {
# include <sys/time.h>
# include <sys/resource.h>
-// int getrusage (int, struct rusage*) ;
+ // int getrusage (int, struct rusage*) ;
}
#endif
#include <iostream>
#include "givaro/givtimer.h"
+namespace Givaro {
- // Return a value to initialize random generator
-long BaseTimer::seed()
+// Return a value to initialize random generator
+long BaseTimer::seed()
{
#if (GIVARO_SYS == _SYS_MACOS)
- return clock() ;
+ return clock() ;
#else
- struct timeval tp;
- gettimeofday(&tp, 0) ;
- return(tp.tv_usec);
-#endif
+ struct timeval tp;
+ gettimeofday(&tp, 0) ;
+ return(tp.tv_usec);
+#endif
}
- // Output the value of the timer :
-std::ostream& BaseTimer::print( std::ostream& o ) const
-{ return o << _t ; }
+// Output the value of the timer :
+std::ostream& BaseTimer::print( std::ostream& o ) const
+{
+ return o << _t ;
+}
- // Some arithmetic operator :
-BaseTimer& BaseTimer::operator = (const BaseTimer & T)
-{
- _t = T._t ;
- return *this ;
+// Some arithmetic operator :
+BaseTimer& BaseTimer::operator = (const BaseTimer & T)
+{
+ _start_t = T._start_t ;
+ _t = T._t ;
+ return *this ;
}
-
- // Computes and returns interval of time
- // beteween *this and T
+
+// Computes and returns interval of time
+// beteween *this and T
const BaseTimer BaseTimer::operator - (const BaseTimer & T) const
{
- BaseTimer Tmp ;
- Tmp._t = _t - T._t ;
- return Tmp ;
+ BaseTimer Tmp ;
+ Tmp._t = _t - T._t ;
+ return Tmp ;
}
-const BaseTimer BaseTimer::operator - ()
+const BaseTimer BaseTimer::operator - ()
{
- BaseTimer Tmp ;
- Tmp._t = -_t ;
- return Tmp ;
+ BaseTimer Tmp ;
+ Tmp._t = -_t ;
+ return Tmp ;
}
const BaseTimer BaseTimer::operator + (const BaseTimer & T) const
{
- BaseTimer Tmp ;
- Tmp._t = _t + T._t ;
- return Tmp ;
+ BaseTimer Tmp ;
+ Tmp._t = _t + T._t ;
+ return Tmp ;
}
- // Start timer
+// Start timer
void RealTimer::start()
-{
+{
#if (GIVARO_SYS == _SYS_MACOS)
- _t = USER_TIME ;
+ _t = _start_t = USER_TIME ;
#else
- struct timeval tmp2 ;
- gettimeofday (&tmp2, 0) ;
+ struct timeval tmp2 ;
+ gettimeofday (&tmp2, 0) ;
- // real time
- _t = (double) tmp2.tv_sec +
- ((double) tmp2.tv_usec)/ (double)BaseTimer::MSPSEC ;
-#endif
+ // real time
+ _t = _start_t = (double) tmp2.tv_sec +
+ ((double) tmp2.tv_usec)/ (double)BaseTimer::MSPSEC ;
+#endif
}
- // Stop timer
+// Stop timer
void RealTimer::stop()
-{
+{
#if (GIVARO_SYS == _SYS_MACOS)
- _t = USER_TIME - _t ;
+ _t = USER_TIME - _start_t ;
#else
- struct timeval tmp2 ;
- gettimeofday (&tmp2, 0) ;
+ struct timeval tmp2 ;
+ gettimeofday (&tmp2, 0) ;
- // real time
- _t = (double) tmp2.tv_sec +
- ((double) tmp2.tv_usec)/ (double)BaseTimer::MSPSEC - _t ;
-#endif
+ // real time
+ _t = (double) tmp2.tv_sec +
+ ((double) tmp2.tv_usec)/ (double)BaseTimer::MSPSEC - _start_t ;
+#endif
}
- // Start timer
+// Start timer
void UserTimer::start()
{
#if (GIVARO_SYS == _SYS_MACOS)
- _t = USER_TIME ;
+ _t = _start_t = USER_TIME ;
#else
- struct rusage tmp1 ; // to getrusage (sys+user times)
- getrusage (RUSAGE_SELF, &tmp1) ;
- // user time
- _t = (double) tmp1.ru_utime.tv_sec +
- ((double) tmp1.ru_utime.tv_usec)/ (double)MSPSEC ;
-#endif
-}
+ struct rusage tmp1 ; // to getrusage (sys+user times)
+ getrusage (RUSAGE_SELF, &tmp1) ;
+ // user time
+ _t = _start_t = (double) tmp1.ru_utime.tv_sec + ((double) tmp1.ru_utime.tv_usec)/ (double)MSPSEC ;
+#endif
+}
- // Stop timer
+// Stop timer
void UserTimer::stop()
{
#if (GIVARO_SYS == _SYS_MACOS)
- _t = USER_TIME - _t;
-#else
- struct rusage tmp1 ; // to getrusage (sys+user times)
- getrusage (RUSAGE_SELF, &tmp1) ;
- // user time
- _t = (double) tmp1.ru_utime.tv_sec +
- ((double) tmp1.ru_utime.tv_usec)/ (double)MSPSEC - _t ;
-#endif
+ _t = USER_TIME - _start_t;
+#else
+ struct rusage tmp1 ; // to getrusage (sys+user times)
+ getrusage (RUSAGE_SELF, &tmp1) ;
+ // user time
+ _t = (double) tmp1.ru_utime.tv_sec + ((double) tmp1.ru_utime.tv_usec) / (double) MSPSEC - _start_t;
+#endif
}
- // Start timer
+// Start timer
void SysTimer::start()
{
#if (GIVARO_SYS == _SYS_MACOS)
- _t = USER_TIME ;
+ _t = _start_t = USER_TIME ; //! @bug here.
#else
- struct rusage tmp1 ; // to getrusage (sys+user times)
- getrusage (RUSAGE_SELF, &tmp1) ;
- // user time
- _t = (double) tmp1.ru_stime.tv_sec +
- ((double) tmp1.ru_stime.tv_usec)/ (double)MSPSEC ;
-#endif
+ struct rusage tmp1 ; // to getrusage (sys+user times)
+ getrusage (RUSAGE_SELF, &tmp1) ;
+ // user time
+ _t = _start_t = (double) tmp1.ru_stime.tv_sec + ((double) tmp1.ru_stime.tv_usec)/ (double)MSPSEC ;
+#endif
}
- // Stop timer
+// Stop timer
void SysTimer::stop()
{
#if (GIVARO_SYS == _SYS_MACOS)
- _t = USER_TIME - _t ;
+ _t = USER_TIME - _start_t ;
#else
- struct rusage tmp1 ; // to getrusage (sys+user times)
- getrusage (RUSAGE_SELF, &tmp1) ;
- // user time
- _t = (double) tmp1.ru_stime.tv_sec +
- ((double) tmp1.ru_stime.tv_usec)/ (double)MSPSEC - _t ;
-#endif
+ struct rusage tmp1 ; // to getrusage (sys+user times)
+ getrusage (RUSAGE_SELF, &tmp1) ;
+ // user time
+ _t = (double) tmp1.ru_stime.tv_sec +
+ ((double) tmp1.ru_stime.tv_usec)/ (double)MSPSEC - _start_t ;
+#endif
}
- // Clear timer :
-void Timer::clear()
-{ rt.clear() ; ut.clear(); st.clear() ; }
+// Clear timer :
+void Timer::clear()
+{
+ rt.clear();
+ ut.clear();
+ st.clear();
+ _count = 0;
+}
- // Start timer
-void Timer::start()
-{ rt.start() ; ut.start(); st.start() ; }
+// Start timer
+void Timer::start()
+{
+ rt.start() ;
+ ut.start() ;
+ st.start() ;
+}
- // Stop timer
-void Timer::stop()
-{ rt.stop() ; ut.stop(); st.stop() ; }
+// Stop timer
+void Timer::stop()
+{
+ rt.stop() ;
+ ut.stop() ;
+ st.stop() ;
+ _count = 1;
+}
std::ostream& Timer::print( std::ostream& o ) const
{
- o << "user time: " << usertime() << '\n' ;
- o << "sys. time: " << systime() << '\n' ;
- return o << "real time: " << realtime() << std::endl ;
+ o << "user time: " << usertime() << '\n' ;
+ o << "sys. time: " << systime() << '\n' ;
+ return o << "real time: " << realtime() << std::endl ;
}
- // Some arithmetic operator :
+// Some arithmetic operator :
Timer& Timer::operator = (const Timer & T)
{
- ut = T.ut ;
- st = T.st ;
- rt = T.rt ;
- return *this ;
+ ut = T.ut ;
+ st = T.st ;
+ rt = T.rt ;
+ _count = T._count;
+ return *this ;
}
- // Comput._tes and returns interval of time
- // beteween *this and T
+// Comput._tes and returns interval of time
+// beteween *this and T
const Timer Timer::operator - (const Timer & T) const
{
- Timer Tmp ;
- Tmp.ut = ut - T.ut ;
- Tmp.st = st - T.st ;
- Tmp.rt = rt - T.rt ;
- return Tmp ;
+ Timer Tmp ;
+ Tmp.ut = ut - T.ut ;
+ Tmp.st = st - T.st ;
+ Tmp.rt = rt - T.rt ;
+ Tmp._count = _count - T._count;
+ return Tmp ;
}
const Timer Timer::operator - ()
{
- Timer Tmp ;
- Tmp.ut = -ut ;
- Tmp.st = -st ;
- Tmp.rt = -rt ;
- return Tmp ;
+ Timer Tmp ;
+ Tmp.ut = -ut ;
+ Tmp.st = -st ;
+ Tmp.rt = -rt ;
+ Tmp._count = - _count;
+ return Tmp ;
}
const Timer Timer::operator + (const Timer & T) const
{
- Timer Tmp ;
- Tmp.ut = ut + T.ut ;
- Tmp.st = st + T.st ;
- Tmp.rt = rt + T.rt ;
- return Tmp ;
-}
+ Timer Tmp ;
+ Tmp.ut = ut + T.ut ;
+ Tmp.st = st + T.st ;
+ Tmp.rt = rt + T.rt ;
+ Tmp._count = _count + T._count;
+ return Tmp ;
+}
+} // namespace Givaro
diff --git a/src/kernel/system/givtimer.h b/src/kernel/system/givtimer.h
index 689cddf..e2605ce 100644
--- a/src/kernel/system/givtimer.h
+++ b/src/kernel/system/givtimer.h
@@ -1,125 +1,255 @@
-#ifndef _TIMER_H_
-#define _TIMER_H_
-// ==========================================================================
-// $Source: /var/lib/cvs/Givaro/src/kernel/system/givtimer.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
-// Authors: T. Gautier
-// $Id: givtimer.h,v 1.3 2006-06-06 12:52:39 jgdumas Exp $
-// ==========================================================================
-// Description:
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
+/* kernel/system/givtimer.h
+ * Copyright (C) 1994-1997 Givaro Team
+ *
+ * Written by T. Gautier
+ *
+ * ------------------------------------
+ * Modified by Bradford Hovinen <hovinen at cis.udel.edu>
+ *
+ * Added _start_t member to BaseTimer, so that stop () does not clobber the
+ * class' memory of its start time. This allows it to be called repeatedly to
+ * get elapsed times.
+ * ------------------------------------
+ *
+ * See COPYING for license information.
+ *
+ */
+
+#ifndef __GIVARO_timer_H
+#define __GIVARO_timer_H
#include <iostream>
+namespace Givaro {
+// class BaseTimer; class RealTimer; class SysTimer; class UserTimer;
-class BaseTimer; class RealTimer; class SysTimer; class UserTimer;
+/** \brief base for class RealTimer; class SysTimer; class UserTimer;
+ \ingroup util
+ */
-class BaseTimer {
+class BaseTimer {
public:
-enum {
- MSPSEC = 1000000 // microsecond per second
+ enum {
+ MSPSEC = 1000000 // microsecond per second
+ };
+
+ BaseTimer() : _start_t(0.), _t(0.) {}
+
+ // -- Clear timer :
+ inline void clear()
+ {
+ _t = 0.0;
+ }
+
+ // -- total amount of second spent
+ inline double time() const
+ {
+ return _t;
+ }
+
+ // -- Return a value to initialize random generator
+ static long seed();
+
+ // -- basic methods:
+ std::ostream& print( std::ostream& ) const;
+
+ // -- Some arithmetic operators to compute cumulative time :
+ BaseTimer& operator = (const BaseTimer & T) ;
+ const BaseTimer operator - (const BaseTimer & T) const;
+ const BaseTimer operator - () ;
+ const BaseTimer operator + (const BaseTimer & T) const;
+ BaseTimer& operator += (const BaseTimer & T) { return *this = *this + T; };
+ BaseTimer& operator -= (const BaseTimer & T) { return *this = *this - T; };
+ public:
+ double _start_t; // time as of start ()
+ double _t; // time
};
- // -- Clear timer :
- inline void clear() { _t = 0; }
-
- // -- total amount of second spent
- inline double time() const { return _t; }
-
- // -- Return a value to initialize random generator*
- static long seed();
-
- // -- basic methods:
- std::ostream& print( std::ostream& ) const;
-
- // -- Some arithmetic operators to compute cumulative time :
- BaseTimer& operator = (const BaseTimer & T) ;
- const BaseTimer operator - (const BaseTimer & T) const;
- const BaseTimer operator - () ;
- const BaseTimer operator + (const BaseTimer & T) const;
- const BaseTimer operator += (const BaseTimer & T) { return *this = *this + T; };
- const BaseTimer operator -= (const BaseTimer & T) { return *this = *this - T; };
-
- friend std::ostream& operator<< (std::ostream& o, const BaseTimer& BT)
- { return BT.print(o);}
-
-
-public:
- double _t; // time
-};
+inline std::ostream& operator<< (std::ostream& o, const BaseTimer& BT)
+{
+ return BT.print(o);
+}
class RealTimer : public BaseTimer {
public:
- inline RealTimer( const BaseTimer& BT ): BaseTimer(BT) {};
- inline RealTimer( ){};
- void start();
- void stop();
+ inline RealTimer( const BaseTimer& BT ): BaseTimer(BT) {};
+ inline RealTimer(){};
+ void start();
+ void stop();
+ inline double elapsed()
+ {
+ stop();
+ return _t ; // time()
+ }
+
};
class UserTimer : public BaseTimer {
public:
- inline UserTimer( const BaseTimer& BT ): BaseTimer(BT) {};
- inline UserTimer( ) {};
- void start();
- void stop();
+ inline UserTimer( const BaseTimer& BT ) : BaseTimer(BT) {};
+ inline UserTimer() {};
+ void start();
+ void stop();
+ inline double elapsed()
+ {
+ stop();
+ return _t ; // time()
+ }
+
};
class SysTimer : public BaseTimer {
public:
- inline SysTimer( const BaseTimer& BT ): BaseTimer(BT) {};
- inline SysTimer( ) {};
- void start();
- void stop();
+ inline SysTimer( const BaseTimer& BT ): BaseTimer(BT) {};
+ inline SysTimer() {};
+ void start();
+ void stop();
+ inline double elapsed()
+ {
+ stop();
+ return _t ; // time()
+ }
+
};
class Timer {
public :
- // Clear timer :
- void clear();
-
- // Start timer
- void start();
-
- // Stop timer
- void stop();
-
- // total amount of second spent in user mode
- double usertime() const { return ut.time(); }
-
- // total amount of second spent in system mode
- double systime () const { return st.time(); }
-
- // real total amount of second spent.
- double realtime () const { return rt.time(); }
-
- // retourne une petite graine
- // long seed() const { return RealTimer::seed(); }
-
- // Some arithmetic operators to compute cumulative time :
- Timer& operator = (const Timer & T) ;
- const Timer operator - (const Timer & T) const;
- const Timer operator - () ;
- const Timer operator + (const Timer & T) const;
- const Timer operator += (const Timer & T) { return *this = *this + T; };
- const Timer operator -= (const Timer & T) { return *this = *this - T; };
-
-
- // -- methods :
- std::ostream& print( std::ostream& ) const;
-
-public:
- RealTimer rt;
- UserTimer ut;
- SysTimer st;
+ Timer() : _count(0)
+ {
+ rt.clear();
+ ut.clear();
+ st.clear();
+ }
+
+ /*! Clear timer.
+ * Everything reset to 0. This need not be called before the first
+ * start since the constructor does it.
+ */
+ void clear();
+
+ /*! Start timer.
+ * Starts the timer.
+ * If called after another \c start() or a \c stop(), it sets the timer
+ * to a totally fresh new start.
+ */
+ void start();
+
+ /*! Stop timer.
+ * Stops the timer. The time since the previous \c start() is stored.
+ * If called again, \c stop() will store the time since the previous \c
+ * start() again, acting as a \c pause().
+ * @pre \c start() should have been called before...
+ */
+ void stop();
+
+ /*! total amount of second spent in user mode.
+ * @return the user time elapsed between the latest \c start() and the
+ * latest \c stop().
+ * @pre \c stop() is called before.
+ */
+ double usertime() const { return ut.time(); }
+
+ /*! total amount of second spent in system mode.
+ * @return the system time elapsed between the latest \c start() and
+ * the latest \c stop().
+ * @pre \c stop() is called before.
+ */
+ double systime () const { return st.time(); }
+
+ /*! real total amount of second spent.
+ * @return the real total time elapsed between the latest \c start()
+ * and the latest \c stop().
+ * @pre \c stop() is called before.
+ */
+ double realtime () const { return rt.time(); }
+
+ /*! User mode time spent since start.
+ * A call to \c stop() is useless.
+ * @return elpased time (in seconds) since \c start() in user mode.
+ */
+ double userElapsedTime() { return ut.elapsed(); }
+
+ /*! System mode time spent since start.
+ * A call to \c stop() is useless.
+ * @return elpased time (in seconds) since \c start() in system mode.
+ */
+ double sysElapsedTime () { return st.elapsed(); }
+
+ /*! real total amount of second spent since start.
+ * A call to \c stop() is useless.
+ * @return elpased time (in seconds) since \c start().
+ */
+ double realElapsedTime () { return rt.elapsed(); }
+
+
+ // retourne une petite graine
+ // long seed() const { return RealTimer::seed(); }
+
+ // Some arithmetic operators to compute cumulative time :
+ Timer& operator = (const Timer & T) ;
+ const Timer operator - (const Timer & T) const;
+ const Timer operator - () ;
+ const Timer operator + (const Timer & T) const;
+ Timer& operator += (const Timer & T) { return *this = *this + T; };
+ Timer& operator -= (const Timer & T) { return *this = *this - T; };
+
+
+ // -- methods :
+ std::ostream& print( std::ostream& ) const;
+
+ size_t count() const
+ {
+ return _count;
+ }
+
+private:
+ size_t _count; // how many
+ RealTimer rt;
+ UserTimer ut;
+ SysTimer st;
};
-// inline std::ostream& operator<<( std::ostream& o, const Timer& T)
-// { return T.print(o);}
-inline std::ostream& operator<<( std::ostream& o, const Timer& T)
-{ return o << T.realtime() << "s (" << T.usertime() << " cpu)"; }
+inline std::ostream &operator << (std::ostream &o, const Timer &T)
+{
+ double ut = T.usertime();
+ if (ut < 0.0000000001) ut = 0;
+ return o << T.realtime() << "s (" << ut << " cpu) [" << T.count() << "]";
+}
+
+#if defined(_OPENMP) || defined(OMP_H) || defined(__OMP_H)
+#include <omp.h>
+struct OMPTimer {
+ double _c;
+ void start() { _c = omp_get_wtime(); }
+ void stop() { _c = omp_get_wtime() - _c; }
+ void clear() { _c = 0.0; }
+ double realtime() { return _c; }
+ double usertime() { return _c; }
+ double time() const { return _c; }
+ friend std::ostream& operator<<(std::ostream& o, const OMPTimer& t) {
+ return o << t._c << 's';
+ }
+
+ OMPTimer& operator =(const OMPTimer& t) { _c = t._c; return *this; }
+ OMPTimer& operator+=(const OMPTimer& t) { _c += t._c; return *this; }
+ OMPTimer& operator-=(const OMPTimer& t) { _c -= t._c; return *this; }
+ OMPTimer operator +(const OMPTimer& t) const
+ {
+ OMPTimer r; r._c = _c + t._c; return r;
+ }
+ OMPTimer operator -(const OMPTimer& t) const
+ {
+ OMPTimer r; r._c = _c - t._c; return r;
+ }
+ OMPTimer operator -() { OMPTimer r; r._c = - _c; return r; }
+};
+#endif
+} // namespace Givaro
-#endif
+#endif // __GIVARO_timer_H
diff --git a/src/kernel/zpz/Makefile.am b/src/kernel/zpz/Makefile.am
index 7027d2e..7e64c6b 100644
--- a/src/kernel/zpz/Makefile.am
+++ b/src/kernel/zpz/Makefile.am
@@ -1,30 +1,41 @@
-INCLUDES=-I$(top_srcdir) ${GMP_VERSION}
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/bstruct
+AM_CPPFLAGS=-I$(top_srcdir) ${GMP_VERSION}
-pkginclude_HEADERS=\
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/bstruct
+
+pkginclude_HEADERS= \
StaticElement.h \
- givzpz.h \
- givgfq.h \
+ givzpz.h \
+ givzpztypes.h \
+ givgfq.h \
givzpz16std.h \
givzpz32std.h \
givzpz32uns.h \
- givzpzInt.h \
+ givzpzInt.h \
givzpz64std.h \
givprimes16.h \
- givrns.h \
- givcra.h \
+ givrns.h \
+ givrnsfixed.h \
+ givcra.h \
givzpz16table1.h \
givmontg32.h \
giv_randiter.h \
givextension.h \
- givgfqext.h \
+ givgfqext.h \
givtablelimits.h \
+ givgfqkron.h \
givzpz16std.inl \
givzpz32std.inl \
givzpz32uns.inl \
givzpzInt.inl \
givzpz64std.inl \
+ givrnsfixed.inl \
givrnscstor.inl \
givrnsconvert.inl \
givzpz16table1.inl \
@@ -33,12 +44,12 @@ pkginclude_HEADERS=\
noinst_LTLIBRARIES=libgivzpz.la
-libgivzpz_la_SOURCES=\
+libgivzpz_la_SOURCES= \
givzpz16std.C \
givzpz32std.C \
givzpz32uns.C \
givmontg32.C \
- givzpzInt.C \
+ givzpzInt.C \
givzpz64std.C \
givprimes16.C \
givtablelimits.C \
diff --git a/src/kernel/zpz/Makefile.in b/src/kernel/zpz/Makefile.in
index e9e1ed4..9352398 100644
--- a/src/kernel/zpz/Makefile.in
+++ b/src/kernel/zpz/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -52,8 +66,8 @@ am_libgivzpz_la_OBJECTS = givzpz16std.lo givzpz32std.lo givzpz32uns.lo \
givtablelimits.lo givzpz16table1.lo
libgivzpz_la_OBJECTS = $(am_libgivzpz_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -85,26 +99,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -114,40 +129,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -187,33 +212,42 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir) ${GMP_VERSION}
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/bstruct
+AM_CPPFLAGS = -I$(top_srcdir) ${GMP_VERSION} \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/bstruct
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
StaticElement.h \
- givzpz.h \
- givgfq.h \
+ givzpz.h \
+ givzpztypes.h \
+ givgfq.h \
givzpz16std.h \
givzpz32std.h \
givzpz32uns.h \
- givzpzInt.h \
+ givzpzInt.h \
givzpz64std.h \
givprimes16.h \
- givrns.h \
- givcra.h \
+ givrns.h \
+ givrnsfixed.h \
+ givcra.h \
givzpz16table1.h \
givmontg32.h \
giv_randiter.h \
givextension.h \
- givgfqext.h \
+ givgfqext.h \
givtablelimits.h \
+ givgfqkron.h \
givzpz16std.inl \
givzpz32std.inl \
givzpz32uns.inl \
givzpzInt.inl \
givzpz64std.inl \
+ givrnsfixed.inl \
givrnscstor.inl \
givrnsconvert.inl \
givzpz16table1.inl \
@@ -226,7 +260,7 @@ libgivzpz_la_SOURCES = \
givzpz32std.C \
givzpz32uns.C \
givmontg32.C \
- givzpzInt.C \
+ givzpzInt.C \
givzpz64std.C \
givprimes16.C \
givtablelimits.C \
@@ -240,14 +274,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/kernel/zpz/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/kernel/zpz/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/kernel/zpz/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/kernel/zpz/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -283,36 +317,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givmontg32.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givprimes16.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givtablelimits.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givzpz16std.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givzpz16table1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givzpz32std.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givzpz32uns.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givzpz64std.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givzpzInt.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -342,7 +354,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -447,7 +459,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -458,6 +469,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -466,22 +479,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/kernel/zpz/StaticElement.h b/src/kernel/zpz/StaticElement.h
index a4be1f7..4ddea72 100644
--- a/src/kernel/zpz/StaticElement.h
+++ b/src/kernel/zpz/StaticElement.h
@@ -1,35 +1,29 @@
-/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-// ------------------------------------------------------------------------
-// Time-stamp: <19 Dec 06 10:55:08 Jean-Guillaume.Dumas at imag.fr>
-// ------------------------------------------------------------------------
-
-/* StaticElement.h
- * Copyright (C) 2004 Jean-Guillaume.Dumas
- *
- * Written by Jean-Guillaume.Dumas
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+//==================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// -----------------------------------------------------------------
+// Time-stamp: <19 Dec 06 10:55:08 Jean-Guillaume.Dumas at imag.fr>
+// -----------------------------------------------------------------
+// author: Jean-Guillaume.Dumas
+// date: 2004
+//==================================================================
+
+/*! @file zpz/taticElement.h
+ * @ingroup zpz
+ * @brief NO DOC
*/
-#ifndef __STATIC_ELEMENT_H__
-#define __STATIC_ELEMENT_H__
+#ifndef __GIVARO_static_element_H
+#define __GIVARO_static_element_H
#include <iostream>
#include <gmp++/gmp++.h>
+namespace Givaro {
+
template <class Domain>
class StaticElement {
static Domain _domain;
@@ -39,14 +33,14 @@ public:
static void setDomain(const Domain& D) {
StaticElement::_domain = D;
}
-
+
static Domain getDomain() {
return StaticElement::_domain;
- }
-
- StaticElement() { _domain.init(_elem); }
+ }
+
+ StaticElement() { _domain.init(_elem); }
+
-
StaticElement(const Integer& i) { _domain.init( (_elem), i); }
StaticElement(const double& i) { _domain.init( (_elem), i); }
StaticElement(const int& i) { _domain.init( (_elem), (long)i); }
@@ -71,31 +65,31 @@ public:
#endif
template<class INITCST>
operator INITCST() const { INITCST tmp; return _domain.convert(tmp,_elem); }
-
-
+
+
template<class INITCST>
StaticElement(const INITCST& i) { _domain.init( (_elem), i); }
template<class INITCST>
- StaticElement(const INITCST& i, const Domain& D) {
+ StaticElement(const INITCST& i, const Domain& D) {
setDomain(D);
- _domain.init((_elem), i);
+ _domain.init((_elem), i);
}
StaticElement& operator=( const StaticElement& e) {
_domain.assign((_elem), e._elem); return *this;
}
-
+
bool operator==(const StaticElement& e) {
return _domain.areEqual((_elem), e._elem);
}
-
+
bool operator!=(const StaticElement& e) {
return !_domain.areEqual((_elem), e._elem);
}
-
+
inline const StaticElement operator* (const StaticElement& e) const {
StaticElement tmp;
@@ -107,51 +101,54 @@ public:
StaticElement(_domain.div(tmp._elem,(_elem), e._elem));
return tmp;
}
-
+
inline const StaticElement operator+ (const StaticElement& e) const {
StaticElement tmp;
StaticElement(_domain.add(tmp._elem,(_elem), e._elem));
return tmp;
}
-
+
inline const StaticElement operator- (const StaticElement& e) const {
StaticElement tmp;
StaticElement(_domain.sub(tmp._elem,(_elem), e._elem));
return tmp;
}
-
+
inline const StaticElement operator- () const {
StaticElement tmp;
StaticElement(_domain.neg(tmp._elem,(_elem)));
return tmp;
}
-
-
-
+
+
+
inline StaticElement& operator*= (const StaticElement& e) {
_domain.mulin((_elem), e._elem); return *this;
}
-
+
inline StaticElement& operator/= (const StaticElement& e) {
_domain.divin((_elem), e._elem); return *this;
}
-
+
inline StaticElement& operator+= (const StaticElement& e) {
_domain.addin((_elem), e._elem); return *this;
}
-
+
inline StaticElement& operator-= (const StaticElement& e) {
_domain.subin((_elem), e._elem); return *this;
}
-
+
friend inline std::istream& operator>> (std::istream& i, StaticElement& a) {
return _domain.read(i,(a._elem));
}
-
-
+
+
friend inline std::ostream& operator<< (std::ostream& o, const StaticElement a) {
return _domain.write(o,(a._elem));
}
-
+
};
-#endif // __STATIC_ELEMENT_H__
+
+} // namespace Givaro
+
+#endif // __GIVARO_static_element_H
diff --git a/src/kernel/zpz/giv_randiter.h b/src/kernel/zpz/giv_randiter.h
index 0258c26..d35d42c 100644
--- a/src/kernel/zpz/giv_randiter.h
+++ b/src/kernel/zpz/giv_randiter.h
@@ -1,22 +1,28 @@
-/* Givaro field Elements generator
- * Author : Giorgi Pascal pascal.giorgi at ens-lyon.fr
- */
+//==================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Givaro field Elements generator
+// Author : Giorgi Pascal pascal.giorgi at ens-lyon.fr
+//==================================================================
-#ifndef _GIV_RANDITER_
-#define _GIV_RANDITER_
+#ifndef __GIVARO_randiter_H
+#define __GIVARO_randiter_H
#include "givaro/givinteger.h"
#include "givaro/givrandom.h"
-
+namespace Givaro {
template<class TAG>
class ZpzDom ;
// -- Tag for arithmetic:
-class Std16 /*{public: typedef int16 type;}*/ ; // -- standard arithmetic over 16bits representations.
-class Std32 /*{public: typedef int32 type;}*/ ; // -- standard arithmetic over 32bits representations.
+class Std16 /*{public: typedef int16_t type;}*/ ; // -- standard arithmetic over 16bits representations.
+class Std32 /*{public: typedef int32_t type;}*/ ; // -- standard arithmetic over 32bits representations.
class Log16 ; // -- log arithmetic over 16bits representations.
@@ -26,26 +32,25 @@ template<> class ZpzDom<Log16>;
template<class TT> class GFqDom;
/** Random field Element generator.
- This class defines a field Element generator for all givaro field (Gfq and Zpz)
- throught a template argument as a field.
- The random generator used is the givrandom.
- */
-
+ * This class defines a field Element generator for all givaro field (Gfq and Zpz)
+ * throught a template argument as a field.
+ * The random generator used is the givrandom.
+ */
template <class Field , class Type> class GIV_randIter
-{
+{
public:
-
+
/** @name Common Object Interface.
* These methods are required of all LinBox random field Element generators.
*/
//@{
-
+
/** Field Element type.
- * The field Element must contain a default constructor,
+ * The field Element must contain a default constructor,
* a copy constructor, a destructor, and an assignment operator.
*/
- typedef typename Field::Element Element;
+ typedef typename Field::Element Element;
/** Constructor from field, sampling size, and seed.
* The random field Element iterator works in the field F, is seeded
@@ -56,20 +61,20 @@ template <class Field , class Type> class GIV_randIter
* This implementation sets the sampling size to be no more than the
* cardinality of the field.
* @param F LinBox field archetype object in which to do arithmetic
- * @param size constant integer reference of sample size from which to
+ * @param size constant integer reference of sample size from which to
* sample (default = 0)
* @param seed constant integer reference from which to seed random number
* generator (default = 0)
*/
GIV_randIter(const Field& F,
- const Type& size = 0,
+ const Type& size = 0,
const Type& seed = 0)
: _size(size), _givrand( GivRandom(seed) ), _field(F)
- {
+ {
Type cardinality = Type( F.size() );
if ((_size > cardinality) || (_size == 0) )
- _size = cardinality;
+ _size = cardinality;
}
/** Copy constructor.
@@ -86,11 +91,11 @@ template <class Field , class Type> class GIV_randIter
/** Destructor.
* This destructs the random field Element generator object.
- * In this implementation, this destroys the generator by deleting
+ * In this implementation, this destroys the generator by deleting
* the random generator object to which _randIter_ptr points.
*/
~GIV_randIter(void) {}
-
+
/** Assignment operator.
* Assigns ALP_randIter object R to generator.
* In this implementation, this means copying the generator to
@@ -108,7 +113,7 @@ template <class Field , class Type> class GIV_randIter
return *this;
}
-
+
/** Random field Element creator.
* This returns a random field Element from the information supplied
* at the creation of the generator.
@@ -116,45 +121,45 @@ template <class Field , class Type> class GIV_randIter
*/
Element& operator() (void)
{
- // Create new random Elements
+ // Create new random Elements
long tmp = static_cast<long>((double (_givrand()) / double(_GIVRAN_MODULO_)) * double(_size));
Element* x=new Element;
_field.assign(*x , tmp);
return *x;
} // Element& operator() (void)
-
-
+
+
/** Random field Element creator with assignement.
* This returns a random field Element from the information supplied
* at the creation of the generator.
* @return random field Element
- */
+ */
Element& random(Element& elt) const
{
- // Create new random Elements
+ // Create new random Elements
//atroce
//long tmp = static_cast<long>((double (_givrand()) / double(_GIVRAN_MODULO_)) * double(_size));
//_field.assign(elt , tmp);
_field.random (_givrand, elt);
return elt;
-
+
} // Element& random(Element& )
-
+
//@} Common Object Iterface
-
+
/** @name Implementation-Specific Methods.
- * These methods are not required of all
+ * These methods are not required of all
* \Ref{LinBox Random field Element generators}
* and are included only for this implementation of the archetype.
*/
//@{
/// Default constructor
- GIV_randIter(void) : _size(0) {GivRandom tmp();_givrand=tmp;Field f(); _field=f;}
-
+ GIV_randIter(void) : _size(0), _givrand(), _field() {}
+
//@}
private:
@@ -165,10 +170,11 @@ template <class Field , class Type> class GIV_randIter
/// Random generator
GivRandom _givrand;
- /// Field
- Field _field;
+ /// Field
+ Field _field;
}; // class GIV_randIter
+} // namespace Givaro
-#endif
+#endif // __GIVARO_randiter_H
diff --git a/src/kernel/zpz/givcra.h b/src/kernel/zpz/givcra.h
index a6a705d..c71f8d7 100644
--- a/src/kernel/zpz/givcra.h
+++ b/src/kernel/zpz/givcra.h
@@ -1,19 +1,28 @@
-#ifndef _CRA_H
-#define _CRA_H
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givcra.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givcra.h,v 1.10 2007-12-05 15:45:21 jgdumas Exp $
+// $Id: givcra.h,v 1.12 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
-// Chinese Remainder Algorithm for 2 Elements.
-// For any number of moduli see givrns.h
+
+/*!@file zpz/givcra.h
+ * @ingroup zpz
+ * @brief Chinese Remainder Algorithm for 2 Elements.
+ * @sa
+ * For any number of moduli see zpz/givrns.h or zpz/givrnsfixed.h
+ */
+
+#ifndef __GIVARO_cra_H
+#define __GIVARO_cra_H
#include "givaro/givconfig.h"
#include "givaro/giverror.h"
+namespace Givaro {
template<class Ring, class Domain, bool REDUCE = true>
struct ChineseRemainder {
@@ -23,7 +32,7 @@ struct ChineseRemainder {
// Computes u = M^-1 in the domain
// Then C_12 = (M^-1 mod D)M
- ChineseRemainder(const Ring& R, const RingElement& M, const Domain& D)
+ ChineseRemainder(const Ring& R, const RingElement& M, const Domain& D)
: _domain(D) {
DomainElement u;
_domain.invin( _domain.init(u, M) );
@@ -33,7 +42,7 @@ struct ChineseRemainder {
- // Computes res = A + ((e-A) mod D)*(M^-1 mod D)M
+ // Computes res = A + ((e-A) mod D)*(M^-1 mod D)M
// Then res mod M == A
// And res mod D == e
RingElement & operator()( RingElement& res, const RingElement& A, const DomainElement& e) const {
@@ -61,7 +70,7 @@ struct ChineseRemainder<Ring, Domain, false> {
// Computes u = M^-1 in the domain
// Then C_12 = (M^-1 mod D)M
- ChineseRemainder(const Ring& R, const RingElement& M, const Domain& D)
+ ChineseRemainder(const Ring& R, const RingElement& M, const Domain& D)
: _domain(D) {
DomainElement u;
_domain.invin( _domain.init(u, M) );
@@ -85,5 +94,5 @@ private:
RingElement C_12;
};
-
-#endif
+} // namespace Givaro
+#endif // __GIVARO_cra_H
diff --git a/src/kernel/zpz/givextension.h b/src/kernel/zpz/givextension.h
index 4f451b4..e5fbcfd 100644
--- a/src/kernel/zpz/givextension.h
+++ b/src/kernel/zpz/givextension.h
@@ -1,377 +1,540 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file givextension.h
+ * @brief NO DOX
+ */
+
+#ifndef __GIVARO_extension_H
+#define __GIVARO_extension_H
+
#include <gmp.h>
+#include <givaro/givconfig.h>
#include <givaro/givgfq.h>
#include <givaro/givpoly1.h>
#include <givaro/givpoly1factor.h>
#include "givaro/givtablelimits.h"
+namespace Givaro {
template<class Rt> Rt FF_EXPONENT_MAX(const Rt p, const Rt e = 1) {
- Rt f = 0;
- for(Rt i = p; (i < (Rt)FF_TABLE_MAX) && (f < e); ++f, i*=p)
- ;
- for( ; f > 1; --f)
- if ((e % f) == 0) break;
- return f;
+ Rt f = 0;
+ for(Rt i = p; (i < (Rt)FF_TABLE_MAX) && (f < e); ++f, i*=p)
+ ;
+ for( ; f > 1; --f)
+ if ((e % f) == 0) break;
+ return f;
}
#define NEED_POLYNOMIAL_REPRESENTATION(p,e) ((e) > FF_EXPONENT_MAX((p),(e)))
#define EXTENSION(q,expo) ( NEED_POLYNOMIAL_REPRESENTATION((q),(expo)) ? Extension<>((q), (expo)) : GFqDom<long>((q), (expo)) )
+
+template<typename Field> unsigned long Exponent_Trait(const Field& F) {
+ return 1;
+}
+
+
+template<> unsigned long Exponent_Trait(const GFqDom<long>& F) {
+ return F.exponent();
+}
+
+template<typename BaseField> class Extension;
+
+template<typename BaseField>
+unsigned long Exponent_Trait(const Extension<BaseField>& F) {
+ return F.exponent();
+}
+
+
template<class BFT = GFqDom<long> >
class Extension {
public:
- typedef Extension<BFT> Self_t;
- typedef BFT BaseField_t;
- typedef typename BFT::Element BFElement;
- typedef typename Signed_Trait<BFElement>::unsigned_type Residu_t;
+ typedef Extension<BFT> Self_t;
+ typedef BFT BaseField_t;
+ typedef typename BFT::Element BFElement;
+ typedef typename Signed_Trait<BFElement>::unsigned_type Residu_t;
- typedef Poly1FactorDom< BFT, Dense > Pol_t;
- typedef typename Pol_t::Element PolElement;
+ typedef Poly1FactorDom< BFT, Dense > Pol_t;
+ typedef typename Pol_t::Element PolElement;
protected:
- BaseField_t _bF;
- Pol_t _pD;
- PolElement _irred;
- Residu_t _characteristic;
- Residu_t _exponent;
- Residu_t _extension_order;
- Integer _cardinality;
+ BaseField_t _bF;
+ Pol_t _pD;
+ PolElement _irred;
+ Residu_t _characteristic;
+ Residu_t _exponent;
+ Residu_t _extension_order;
+ Integer _cardinality;
public:
- bool extension_type () const { return true; }
-
- typedef PolElement Element;
-
-
- Extension ( const Residu_t p, const Residu_t e = 1)
-: _bF(p, FF_EXPONENT_MAX(p,e) ), _pD( _bF, Indeter("ý") ), _characteristic( p ), _exponent ( e ) , _extension_order( e/FF_EXPONENT_MAX(p,e) ) , _cardinality( pow(Integer(p),(unsigned long)(e)) ) {
-/* cerr << "Pol Cstor" << endl; */
- unsigned long basedegree = FF_EXPONENT_MAX(p,e) ;
- if (basedegree >= e)
- cerr << "ERROR : Try a direct extension field GFDom instead of a polynomial extension" << endl;
- else
- _pD.creux_random_irreducible( _irred, _extension_order );
- }
-
- Extension ( const BaseField_t& bF, const Residu_t ex = 1)
-: _bF( bF ), _pD( _bF, Indeter("ý") ), _characteristic( bF.characteristic() ), _exponent( ex + bF.exponent() ), _extension_order( ex ), _cardinality( pow( Integer(bF.cardinality()), (unsigned long)(ex) ) ) {
- if (_cardinality < (1<<20) )
- _pD.creux_random_irreducible( _irred, (unsigned long)(ex));
- else
- _pD.random_irreducible( _irred, (unsigned long)(ex));
- }
-
- Extension ( const Self_t& eF)
- : _bF( eF._bF ), _pD( eF._pD ), _irred( eF._irred ), _characteristic( eF._characteristic ), _exponent( eF._exponent ) , _extension_order( eF._extension_order ), _cardinality( eF._cardinality ) { }
-
- Self_t & operator=(const Self_t& eF) {
- if (this != &eF) {
- _bF = eF._bF;
- _pD = eF._pD;
- _irred = eF._irred;
- _characteristic = eF._characteristic;
- _exponent = eF._exponent;
- _extension_order = eF._extension_order;
- _cardinality = eF._cardinality;
- }
- return *this;
- }
-
- PolElement& init( PolElement& e) const {
- return _pD.init(e) ;
- }
-
- template<class XXX>
- PolElement& init( PolElement& e, const XXX& i) const {
- return _pD.modin( _pD.init(e, i), _irred) ;
- }
-
- PolElement& assign( PolElement& e, const BFElement& a) const {
- return _pD.assign(e, a) ;
- }
-
- PolElement& assign( PolElement& e, const PolElement& a) const {
- return _pD.assign(e, a) ;
- }
-
- template<class XXX>
- XXX& convert( XXX& i, const PolElement& e) const {
- return _pD.convert( i, e) ;
- }
-
- PolElement& add (PolElement& r, const PolElement& a, const PolElement& b) const {
- return _pD.add( r, a, b);
- }
-
- PolElement& sub (PolElement& r, const PolElement& a, const PolElement& b) const {
- return _pD.sub( r, a, b);
- }
-
- PolElement& neg (PolElement& r, const PolElement& a) const {
- return _pD.neg( r, a );
- }
-
- PolElement& mul (PolElement& r, const PolElement& a, const PolElement& b) const {
- return _pD.modin( _pD.mul( r, a, b), _irred );
- }
-
- PolElement& inv (PolElement& r, const PolElement& a) const {
-// _pD.write(_pD.write(_pD.write( std::cerr << "(", _pD.invmod( r, a, _irred)) << ") * (", a) << ") == 1 + V * (", _irred) << std::endl;
- return _pD.invmod( r, a, _irred);
- }
-
- PolElement& div (PolElement& r, const PolElement& a, const PolElement& b) const {
- return _pD.modin( _pD.mulin( inv(r, b), a), _irred );
- }
-
- PolElement& axpy (PolElement& r, const PolElement& a, const PolElement& b, const PolElement& c) const {
- return _pD.modin( _pD.addin(_pD.mul( r, a, b), c), _irred );
- }
-
- PolElement& addin(PolElement& r, const PolElement& b) const {
- return _pD.addin( r, b);
- }
-
- PolElement& subin(PolElement& r, const PolElement& b) const {
- return _pD.subin( r, b);
- }
-
- PolElement& negin(PolElement& r) const {
- return _pD.negin( r );
- }
-
- PolElement& mulin(PolElement& r, const PolElement& b) const {
- return _pD.modin( _pD.mulin( r, b), _irred );
- }
-
- PolElement& invin(PolElement& r) const {
- PolElement a(r);
- return _pD.invmod( r, a, _irred);
- }
-
- PolElement& divin(PolElement& r, const PolElement& b) const {
- PolElement tmp;
- inv(tmp,b);
- return _pD.modin( _pD.mulin( r, tmp), _irred );
- }
-
- PolElement& axpyin(PolElement& r, const PolElement& b, const PolElement& c) const {
- PolElement tmp; _pD.mul(tmp,b,c);
- return _pD.modin( _pD.addin( r, tmp), _irred );
- }
-
- bool areEqual (const PolElement& b, const PolElement& c) const {
- return _pD.areEqual( b, c) ;
- }
-
- bool isZero (const PolElement& b) const {
- return _pD.isZero(b) ;
- }
-
- bool isOne (const PolElement& b) const {
- return _pD.isOne(b) ;
- }
-
-
- Integer &cardinality (Integer &c) const
- { return c=_cardinality; }
-
- Integer &characteristic (Integer &c) const
- { return c=_characteristic; }
-
- Residu_t characteristic() const {
- return _characteristic;
- }
-
- Residu_t exponent() const {
- return _exponent;
- }
-
- Residu_t order() const {
- return _extension_order;
- }
-
-
- const BaseField_t& base_field() const {
- return _bF;
- }
-
-
- const Pol_t& polynomial_domain() const {
- return _pD;
- }
-
-
-
- std::ostream& write( std::ostream& o ) const {
- return _pD.write( _pD.write(o) << "/(", _irred) << ")";
- }
-
-
- std::istream& read ( std::istream& s, PolElement& a ) const {
- _pD.read( s, a);
- _pD.modin( a, _irred);
- return s;
- }
-
- std::ostream& write( std::ostream& o, const PolElement& R) const {
- return _pD.write( o, R );
- }
-
-
- std::istream& read( std::istream& o ) const {
- std::cerr << "READ Extension, NOT YET IMPLEMENTED" << std::endl;
- return o;
- }
-
+ bool extension_type () const
+ {
+ return true;
+ }
+
+ typedef PolElement Element;
+
+ Element zero;
+ Element one;
+
+ Extension() {}
+
+
+ Extension ( const Residu_t p, const Residu_t e = 1, const Indeter Y="Y") :
+ _bF(p, FF_EXPONENT_MAX(p,e) ), _pD( _bF, Y ), _characteristic( p )
+ , _exponent ( e ) , _extension_order( e/FF_EXPONENT_MAX(p,e) )
+ , _cardinality( pow(Integer(p),(unsigned long)(e)) ), zero (_pD.zero)
+ , one (_pD.one)
+ {
+ /* cerr << "Pol Cstor" << endl; */
+ unsigned long basedegree = FF_EXPONENT_MAX(p,e) ;
+ if (basedegree >= e) {
+ std::cerr << "WARNING : Try a direct extension field GFDom instead of a polynomial extension" << std::endl;
+ _bF = BaseField_t(p, 1);
+ _pD = Pol_t(_bF, Y);
+ _extension_order = _exponent;
+ }
+ _pD.creux_random_irreducible( _irred, _extension_order );
+ }
+
+ Extension ( const BaseField_t& bF, const Residu_t ex = 1, const Indeter Y="Y") :
+ _bF( bF )
+ , _pD( _bF, Y )
+ , _characteristic( (Residu_t) bF.characteristic() )
+ , _exponent( (Residu_t)(ex + (Residu_t)Exponent_Trait(bF)) )
+ , _extension_order( (Residu_t)( ex ) )
+ , _cardinality( (Integer) pow( Integer(bF.cardinality()) , (unsigned long)(ex) ) )
+ , zero( (Element)(_pD.zero))
+ , one ( (Element)(_pD.one))
+ {
+ if (_cardinality < (1<<20) )
+ _pD.creux_random_irreducible( _irred, (unsigned long)(ex));
+ else
+ _pD.random_irreducible( _irred, (unsigned long)(ex));
+ }
+
+ Extension ( const Self_t& eF) :
+ _bF( eF._bF ), _pD( eF._pD ), _irred( eF._irred )
+ , _characteristic( eF._characteristic ), _exponent( eF._exponent )
+ , _extension_order( eF._extension_order ), _cardinality( eF._cardinality )
+ , zero (_pD.zero), one (_pD.one)
+ { }
+
+ Self_t & operator=(const Self_t& eF)
+ {
+ if (this != &eF) {
+ _bF = eF._bF;
+ _pD = eF._pD;
+ _irred = eF._irred;
+ _characteristic = eF._characteristic;
+ _exponent = eF._exponent;
+ _extension_order = eF._extension_order;
+ _cardinality = eF._cardinality;
+ }
+ return *this;
+ }
+
+ PolElement& init( PolElement& e) const
+ {
+ return _pD.init(e) ;
+ }
+
+ template<class XXX>
+ PolElement& init( PolElement& e, const XXX& i) const
+ {
+ return _pD.modin( _pD.init(e, i), _irred) ;
+ }
+
+ PolElement& assign( PolElement& e, const BFElement& a) const
+ {
+ return _pD.assign(e, a) ;
+ }
+
+ PolElement& assign( PolElement& e, const PolElement& a) const
+ {
+ return _pD.assign(e, a) ;
+ }
+
+ template<class XXX>
+ XXX& convert( XXX& i, const PolElement& e) const
+ {
+ return _pD.convert( i, e) ;
+ }
+
+ PolElement& add (PolElement& r, const PolElement& a, const PolElement& b) const
+ {
+ return _pD.add( r, a, b);
+ }
+
+ PolElement& sub (PolElement& r, const PolElement& a, const PolElement& b) const
+ {
+ return _pD.sub( r, a, b);
+ }
+
+ PolElement& neg (PolElement& r, const PolElement& a) const
+ {
+ return _pD.neg( r, a );
+ }
+
+ PolElement& mul (PolElement& r, const PolElement& a, const PolElement& b) const
+ {
+ return _pD.modin( _pD.mul( r, a, b), _irred );
+ }
+
+ PolElement& inv (PolElement& r, const PolElement& a) const
+ {
+ // _pD.write(_pD.write(_pD.write( std::cerr << "(", _pD.invmod( r, a, _irred)) << ") * (", a) << ") == 1 + V * (", _irred) << std::endl;
+ return _pD.invmod( r, a, _irred);
+ }
+
+ PolElement& div (PolElement& r, const PolElement& a, const PolElement& b) const
+ {
+ return _pD.modin( _pD.mulin( inv(r, b), a), _irred );
+ }
+
+ PolElement& axpy (PolElement& r, const PolElement& a, const PolElement& b, const PolElement& c) const
+ {
+ // return _pD.modin( _pD.addin(_pD.mul( r, a, b), c), _irred );
+ // return _pD.modin( _pD.axpy(r, a, b, c), _irred );
+ return addin(mul(r,a,b),c);
+ }
+
+ // -- maxpy: r <- c - a * b mod p
+ PolElement& maxpy (PolElement& r, const PolElement a, const PolElement b, const PolElement c) const
+ {
+ return _pD.modin( _pD.maxpy( r, a, b, c), _irred );
+ }
+
+ // -- maxpyin: r <- r - a * b mod p
+ PolElement& maxpyin(PolElement& r, const PolElement a, const PolElement b) const
+ {
+ return _pD.modin( _pD.maxpyin( r, a, b), _irred );
+ }
+
+ // -- axmy: r <- a * x - y mod p
+ PolElement& axmy (PolElement& r, const PolElement a, const PolElement b, const PolElement c) const
+ {
+ return subin(mul(r,a,b),c);
+ }
+
+ // -- axmyin: r <- a * x - r mod p
+ PolElement& axmyin(PolElement& r, const PolElement a, const PolElement b) const
+ {
+ maxpyin(r,a,b);
+ return negin(r);
+ }
+
+ PolElement& addin(PolElement& r, const PolElement& b) const
+ {
+ return _pD.addin( r, b);
+ }
+
+ PolElement& subin(PolElement& r, const PolElement& b) const
+ {
+ return _pD.subin( r, b);
+ }
+
+ PolElement& negin(PolElement& r) const
+ {
+ return _pD.negin( r );
+ }
+
+ PolElement& mulin(PolElement& r, const PolElement& b) const
+ {
+ return _pD.modin( _pD.mulin( r, b), _irred );
+ }
+
+ PolElement& invin(PolElement& r) const
+ {
+ PolElement a(r);
+ return _pD.invmod( r, a, _irred);
+ }
+
+ PolElement& divin(PolElement& r, const PolElement& b) const
+ {
+ PolElement tmp;
+ inv(tmp,b);
+ return _pD.modin( _pD.mulin( r, tmp), _irred );
+ }
+
+ PolElement& axpyin(PolElement& r, const PolElement& b, const PolElement& c) const
+ {
+ PolElement tmp; _pD.mul(tmp,b,c);
+ return _pD.modin( _pD.addin( r, tmp), _irred );
+ }
+
+ bool areEqual (const PolElement& b, const PolElement& c) const
+ {
+ return _pD.areEqual( b, c) ;
+ }
+
+ bool isZero (const PolElement& b) const
+ {
+ return _pD.isZero(b) ;
+ }
+
+ bool isOne (const PolElement& b) const
+ {
+ return _pD.isOne(b) ;
+ }
+
+
+ template<class RandIter> Element& random(RandIter& g, Element& r) const
+ {
+ return _pD.random(g,r,Degree(_exponent-1));
+ }
+ template<class RandIter> Element& random(RandIter& g, Element& r, long s) const
+ {
+ return _pD.random(g,r,(s>=_exponent?_exponent-1:s));
+ }
+ template<class RandIter> Element& random(RandIter& g, Element& r, const Element& b) const
+ {
+ return _pD.random(g,r,b.size());
+ }
+ template<class RandIter> Element& nonzerorandom(RandIter& g, Element& r) const
+ {
+ return _pD.nonzerorandom(g,r,Degree(_exponent-1));
+ }
+ template<class RandIter> Element& nonzerorandom(RandIter& g, Element& r, long s) const
+ {
+ return _pD.nonzerorandom(g,r,(s>=_exponent?_exponent-1:s));
+ }
+ template<class RandIter> Element& nonzerorandom(RandIter& g, Element& r, const Element& b) const
+ {
+ return _pD.nonzerorandom(g,r,b.size());
+ }
+
+
+
+
+ Integer &cardinality (Integer &c) const
+ {
+ return c=_cardinality;
+ }
+
+ Residu_t cardinality() const
+ {
+ return _cardinality ;
+ }
+
+ Integer &characteristic (Integer &c) const
+ {
+ return c=_characteristic;
+ }
+
+ Residu_t characteristic() const
+ {
+ return _characteristic;
+ }
+
+ Residu_t exponent() const
+ {
+ return _exponent;
+ }
+
+ Residu_t order() const
+ {
+ return _extension_order;
+ }
+
+
+ const BaseField_t& base_field() const
+ {
+ return _bF;
+ }
+
+
+ const Pol_t& polynomial_domain() const
+ {
+ return _pD;
+ }
+
+
+
+ std::ostream& write( std::ostream& o ) const
+ {
+ return _pD.write( _pD.write(o) << "/(", _irred) << ")";
+ }
+
+
+ std::istream& read ( std::istream& s, PolElement& a ) const
+ {
+ _pD.read( s, a);
+ _pD.modin( a, _irred);
+ return s;
+ }
+
+ std::ostream& write( std::ostream& o, const PolElement& R) const
+ {
+ return _pD.write( o, R );
+ }
+
+
+ std::istream& read( std::istream& o ) const
+ {
+ std::cerr << "READ Extension, NOT YET IMPLEMENTED" << std::endl;
+ return o;
+ }
+
};
-template <class ExtensionField, class Type>
-class GIV_ExtensionrandIter
-{
-
- public:
-
- /** @name Common Object Interface.
- * These methods are required of all LinBox random field Element generators.
- */
- //@{
-
- /** Field Element type.
- * The field Element must contain a default constructor,
- * a copy constructor, a destructor, and an assignment operator.
- */
- typedef typename ExtensionField::PolElement Element;
-
- /** Constructor from field, sampling size, and seed.
- * The random field Element iterator works in the field F, is seeded
- * by seed, and it returns any one Element with probability no more
- * than 1/min(size, F.cardinality()).
- * A sampling size of zero means to sample from the entire field.
- * A seed of zero means to use some arbitrary seed for the generator.
- * This implementation sets the sampling size to be no more than the
- * cardinality of the field.
- * @param F LinBox field archetype object in which to do arithmetic
- * @param size constant integer reference of sample size from which to
- * sample (default = 0)
- * @param seed constant integer reference from which to seed random number
- * generator (default = 0)
- */
- GIV_ExtensionrandIter(const ExtensionField& F,
- const Type& size = 0,
- const Type& seed = 0)
- : _size(size), _givrand( GivRandom(seed) ), _field(F)
- {
- Type charact = Type( F.characteristic() );
- if ((_size > charact) || (_size == 0) )
- _size = charact;
- }
-
- /** Copy constructor.
- * Constructs ALP_randIter object by copying the random field
- * Element generator.
- * This is required to allow generator objects to be passed by value
- * into functions.
- * In this implementation, this means copying the random field Element
- * generator to which R._randIter_ptr points.
- * @param R ALP_randIter object.
- */
- GIV_ExtensionrandIter(const GIV_ExtensionrandIter& R)
- : _size(R._size), _givrand(R._givrand) , _field(R._field) {}
-
- /** Destructor.
- * This destructs the random field Element generator object.
- * In this implementation, this destroys the generator by deleting
- * the random generator object to which _randIter_ptr points.
- */
- ~GIV_ExtensionrandIter(void) {}
-
- /** Assignment operator.
- * Assigns ALP_randIter object R to generator.
- * In this implementation, this means copying the generator to
- * which R._randIter_ptr points.
- * @param R ALP_randIter object.
- */
- GIV_ExtensionrandIter<ExtensionField,Type>& operator=(const GIV_ExtensionrandIter<ExtensionField,Type>& R)
- {
- if (this != &R) // guard against self-assignment
- {
- _size = R._size;
- _givrand = R._givrand;
- _field = R._field;
- }
-
- return *this;
- }
-
- /** Random field Element creator with assignement.
- * This returns a random field Element from the information supplied
- * at the creation of the generator.
- * @return random field Element
- */
- Element& random(Element& elt) const
- {
- // Create new random Elements
- elt.resize( (size_t)(_field.order()));
- for(typename Element::iterator it = elt.begin(); it != elt.end() ; ++ it) {
- long tmp = static_cast<long>((double (_givrand()) / double(_GIVRAN_MODULO_)) * double(_size));
- (_field.base_field()).init(*it , tmp);
- //(_field.base_field()) . random (*it);
- }
- return elt;
- } // Element& random(Element& )
-
- /** Random field Element creator with assignement.
- * This returns a random field Element from the information supplied
- * at the creation of the generator.
- * @return random field Element
- */
- Element& operator()(Element& elt) const
- {
- return this->random(elt);
- }
-
- /** Random field Element creator.
- * This returns a random field Element from the information supplied
- * at the creation of the generator.
- * @return random field Element
- */
- Element& operator() (void)
- {
- Element* x=new Element;
- return this->random(*x);
-
- } // Element& operator() (void)
-
-
-
- //@} Common Object Iterface
-
- /** @name Implementation-Specific Methods.
- * These methods are not required of all
- * \Ref{LinBox Random field Element generators}
- * and are included only for this implementation of the archetype.
- */
- //@{
-
- /// Default constructor
- GIV_ExtensionrandIter(void) : _size(0) {GivRandom tmp();_givrand=tmp;ExtensionField f(); _field=f;}
-
- //@}
-
- private:
-
- /// Sampling size
- Type _size;
-
- /// Random generator
- GivRandom _givrand;
-
- /// ExtensionField
- ExtensionField _field;
-
- }; // class GIV_ExtensionrandIter
+template <class ExtensionField, class Type>
+class GIV_ExtensionrandIter {
+
+public:
+
+ /** @name Common Object Interface.
+ * These methods are required of all LinBox random field Element generators.
+ */
+ //@{
+
+ /** Field Element type.
+ * The field Element must contain a default constructor,
+ * a copy constructor, a destructor, and an assignment operator.
+ */
+ typedef typename ExtensionField::PolElement Element;
+
+ /** Constructor from field, sampling size, and seed.
+ * The random field Element iterator works in the field F, is seeded
+ * by seed, and it returns any one Element with probability no more
+ * than 1/min(size, F.cardinality()).
+ * A sampling size of zero means to sample from the entire field.
+ * A seed of zero means to use some arbitrary seed for the generator.
+ * This implementation sets the sampling size to be no more than the
+ * cardinality of the field.
+ * @param F LinBox field archetype object in which to do arithmetic
+ * @param size constant integer reference of sample size from which to
+ * sample (default = 0)
+ * @param seed constant integer reference from which to seed random number
+ * generator (default = 0)
+ */
+ GIV_ExtensionrandIter(const ExtensionField& F,
+ const Type& size = 0,
+ const Type& seed = 0) :
+ _size(size), _givrand( GivRandom(seed) ), _field(F)
+ {
+ Type charact = Type( F.characteristic() );
+ if ((_size > charact) || (_size == 0) )
+ _size = charact;
+ }
+
+ /** Copy constructor.
+ * Constructs ALP_randIter object by copying the random field
+ * Element generator.
+ * This is required to allow generator objects to be passed by value
+ * into functions.
+ * In this implementation, this means copying the random field Element
+ * generator to which R._randIter_ptr points.
+ * @param R ALP_randIter object.
+ */
+ GIV_ExtensionrandIter(const GIV_ExtensionrandIter& R) :
+ _size(R._size), _givrand(R._givrand) , _field(R._field)
+ {}
+
+ /** Destructor.
+ * This destructs the random field Element generator object.
+ * In this implementation, this destroys the generator by deleting
+ * the random generator object to which _randIter_ptr points.
+ */
+ ~GIV_ExtensionrandIter(void) {}
+
+ /** Assignment operator.
+ * Assigns ALP_randIter object R to generator.
+ * In this implementation, this means copying the generator to
+ * which R._randIter_ptr points.
+ * @param R ALP_randIter object.
+ */
+ GIV_ExtensionrandIter<ExtensionField,Type>& operator= ( const GIV_ExtensionrandIter< ExtensionField, Type >& R )
+ {
+ if (this != &R) // guard against self-assignment
+ {
+ _size = R._size;
+ _givrand = R._givrand;
+ _field = R._field;
+ }
+
+ return *this;
+ }
+
+ /** Random field Element creator with assignement.
+ * This returns a random field Element from the information supplied
+ * at the creation of the generator.
+ * @return random field Element
+ */
+ Element& random(Element& elt) const
+ {
+ // Create new random Elements
+ elt.resize( (size_t)(_field.order()));
+ for(typename Element::iterator it = elt.begin(); it != elt.end() ; ++ it) {
+ long tmp = static_cast<long>((double (_givrand()) / double(_GIVRAN_MODULO_)) * double(_size));
+ (_field.base_field()).init(*it , tmp);
+ //(_field.base_field()) . random (*it);
+ }
+ return elt;
+ } // Element& random(Element& )
+
+ /** Random field Element creator with assignement.
+ * This returns a random field Element from the information supplied
+ * at the creation of the generator.
+ * @return random field Element
+ */
+ Element& operator()(Element& elt) const
+ {
+ return this->random(elt);
+ }
+
+ /** Random field Element creator.
+ * This returns a random field Element from the information supplied
+ * at the creation of the generator.
+ * @return random field Element
+ */
+ Element& operator() (void)
+ {
+ Element* x=new Element;
+ return this->random(*x);
+
+ } // Element& operator() (void)
+
+
+
+ //@} Common Object Iterface
+
+ /** @name Implementation-Specific Methods.
+ * These methods are not required of all
+ * \Ref{LinBox Random field Element generators}
+ * and are included only for this implementation of the archetype.
+ */
+ //@{
+
+ /// Default constructor
+ GIV_ExtensionrandIter(void) : _size(0), _givrand(), _field() {}
+
+ //@}
+
+private:
+
+ /// Sampling size
+ Type _size;
+
+ /// Random generator
+ GivRandom _givrand;
+
+ /// ExtensionField
+ ExtensionField _field;
+
+}; // class GIV_ExtensionrandIter
+
+} // namespace Givaro
+
+#endif //__GIVARO_extension_H
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givgfq.h b/src/kernel/zpz/givgfq.h
index eb369e1..e8d6ed3 100644
--- a/src/kernel/zpz/givgfq.h
+++ b/src/kernel/zpz/givgfq.h
@@ -1,16 +1,22 @@
-#ifndef _GIVARO_GFQ1_H_
-#define _GIVARO_GFQ1_H_
-
// ==========================================================================
-// file: givgfq.h
-// Time-stamp: <22 Apr 08 17:24:36 Jean-Guillaume.Dumas at imag.fr>
-// (c) Givaro Team
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// file: givgfq.h
+// Time-stamp: <04 Feb 11 13:42:23 Jean-Guillaume.Dumas at imag.fr>
// date: 1999
-// version:
+// version:
// author: Jean-Guillaume.Dumas
-// Description:
-// Arithmetic on GF(p^k), with p a prime number less than 2^15
-// ==========================================================================
+
+/*! @file zpz/givgfq.h
+ * @ingroup zpz
+ * @brief Arithmetic on GF(p^k), with p a prime number less than 2^16.
+ */
+
+#ifndef __GIVARO_gfq1_H
+#define __GIVARO_gfq1_H
#include "givaro/givconfig.h"
#include "givaro/givinteger.h"
@@ -19,306 +25,316 @@
#include "givaro/giv_randiter.h"
#include "givaro/givpoly1factor.h"
- // ------------------------------------------------- class GFqDom
+namespace Givaro {
+
+// ------------------------------------------------- class GFqDom
template<class TT> class GFqDom {
protected:
- typedef typename Signed_Trait<TT>::unsigned_type UTT;
- typedef TT Rep;
+ typedef typename Signed_Trait<TT>::unsigned_type UTT;
+ typedef TT Rep;
public:
- Rep zero;
- Rep one;
+ Rep zero;
+ Rep one;
protected:
- UTT _characteristic; // Field Characteristic (p)
- UTT _exponent; // Extension degree (k)
- UTT _irred; // Irreducible polynomial in p-adic
- UTT _q; // p^k
- UTT _qm1; // p^k-1
- UTT _qm1o2; // (p^k-1)/2
-
- // G is a generator of GF(q)
- // p is GF(q)'s characteristic
- // log2pol[ i ] = G^i(p)
- // pol2log[ j ] = i such that log2pol[i] = j
- // plus1[i] = k such that G^i + 1 = G^k
- std::vector<UTT> _log2pol;
- std::vector<UTT> _pol2log;
- std::vector<TT> _plus1;
-
- // Floating point representations
- double _dcharacteristic;
+ UTT _characteristic; // Field Characteristic (p)
+ UTT _exponent; // Extension degree (k)
+ UTT _irred; // Irreducible polynomial in p-adic
+ UTT _q; // p^k
+ UTT _qm1; // p^k-1
+ UTT _qm1o2; // (p^k-1)/2
+
+ // G is a generator of GF(q)
+ // p is GF(q)'s characteristic
+ // log2pol[ i ] = G^i(p)
+ // pol2log[ j ] = i such that log2pol[i] = j
+ // plus1[i] = k such that G^i + 1 = G^k
+ std::vector<UTT> _log2pol;
+ std::vector<UTT> _pol2log;
+ std::vector<TT> _plus1;
+
+ // Floating point representations
+ double _dcharacteristic;
public:
- typedef GFqDom<TT> Self_t;
- typedef Rep Element;
-// class Element {
-// public:
-// mutable Rep _value;
-
-// Element() {}
-// };
-
- typedef UTT Residu_t;
-
- // ----- Representation of vector of the Element
- typedef Rep* Array;
- typedef const Rep* constArray;
-
- GFqDom(): zero(0), _log2pol(0), _pol2log(0),_plus1(0) {}
-
- GFqDom( const UTT P, const UTT e = 1);
-
- GFqDom( const UTT P, const UTT e, const std::vector<UTT>& modPoly);
-
- GFqDom( const GFqDom<TT>& F)
- {
- zero = F.zero;
- one = F.one;
- _characteristic = F._characteristic;
- _dcharacteristic = F._dcharacteristic;
- _exponent = F._exponent;
- _irred = F._irred;
- _q = F._q;
- _qm1 = F._qm1;
- _qm1o2 = F._qm1o2;
- _log2pol = F._log2pol;
- _pol2log = F._pol2log;
- _plus1 = F._plus1;
- }
-
- // Allows to choose the randomization
- // and therefore the field generator
-// template<class RandIter >
-// GFqDom(RandIter& g, const UTT P, const UTT e = 1);
- ~GFqDom() {};
-
-
- GFqDom<TT> operator=( const GFqDom<TT>& F)
- {
- this->zero = F.zero;
- this->one = F.one;
- this->_characteristic = F._characteristic;
- this->_dcharacteristic = F._dcharacteristic;
- this->_exponent = F._exponent;
- this->_irred = F._irred;
- this->_q = F._q;
- this->_qm1 = F._qm1;
- this->_qm1o2 = F._qm1o2;
- this->_log2pol = F._log2pol;
- this->_pol2log = F._pol2log;
- this->_plus1 = F._plus1;
- return *this;
- }
-
-
-
- // Access to the modulus, characteristic, size, exponent
- UTT residu() const;
- UTT characteristic() const;
- Integer& characteristic(Integer& p) const{return p=characteristic();}
- UTT cardinality() const;
- UTT size() const;
- UTT exponent() const;
- // Internal representation of the used generator
- Rep& generator(Rep&) const;
- // p-adic representation of the used generator
- UTT generator() const;
- // an integer representation of the polynomial
- // where the indeterminate is replaced by the characteristic
- // This has no meaning if exponent is 1
- UTT sage_generator() const;
- UTT irreducible() const;
-
- // Initialization of Elements
- Rep& init( Rep&) const;
- Rep& init( Rep&, const int) const ;
- Rep& init( Rep&, const unsigned int) const ;
- Rep& init( Rep&, const long) const ;
- Rep& init( Rep&, const unsigned long) const ;
- Rep& init( Rep&, const Integer) const;
- Rep& init( Rep&, const float) const ;
- Rep& init( Rep&, const double) const ;
+ typedef GFqDom<TT> Self_t;
+ typedef Rep Element;
+ // class Element {
+ // public:
+ // mutable Rep _value;
+
+ // Element() {}
+ // };
+
+ typedef UTT Residu_t;
+
+ // ----- Representation of vector of the Element
+ typedef Rep* Array;
+ typedef const Rep* constArray;
+
+ GFqDom(): zero(0), one(1), _log2pol(0), _pol2log(0),_plus1(0) {}
+
+ GFqDom( const UTT P, const UTT e = 1);
+
+ GFqDom( const UTT P, const UTT e, const std::vector<UTT>& modPoly);
+
+ GFqDom( const GFqDom<TT>& F)
+ {
+ zero = F.zero;
+ one = F.one;
+ _characteristic = F._characteristic;
+ _dcharacteristic = F._dcharacteristic;
+ _exponent = F._exponent;
+ _irred = F._irred;
+ _q = F._q;
+ _qm1 = F._qm1;
+ _qm1o2 = F._qm1o2;
+ _log2pol = F._log2pol;
+ _pol2log = F._pol2log;
+ _plus1 = F._plus1;
+ }
+
+ // Allows to choose the randomization
+ // and therefore the field generator
+ // template<class RandIter >
+ // GFqDom(RandIter& g, const UTT P, const UTT e = 1);
+
+ // Destructor
+ // ~GFqDom() {};
+
+
+ GFqDom<TT> operator=( const GFqDom<TT>& F)
+ {
+ this->zero = F.zero;
+ this->one = F.one;
+ this->_characteristic = F._characteristic;
+ this->_dcharacteristic = F._dcharacteristic;
+ this->_exponent = F._exponent;
+ this->_irred = F._irred;
+ this->_q = F._q;
+ this->_qm1 = F._qm1;
+ this->_qm1o2 = F._qm1o2;
+ this->_log2pol = F._log2pol;
+ this->_pol2log = F._pol2log;
+ this->_plus1 = F._plus1;
+ return *this;
+ }
+
+
+
+ // Access to the modulus, characteristic, size, exponent
+ UTT residu() const;
+ UTT characteristic() const;
+ Integer& characteristic(Integer& p) const{return p=characteristic();}
+ UTT cardinality() const;
+ UTT size() const;
+ UTT exponent() const;
+ // Internal representation of the used generator
+ Rep& generator(Rep&) const;
+ // p-adic representation of the used generator
+ UTT generator() const;
+ // an integer representation of the polynomial
+ // where the indeterminate is replaced by the characteristic
+ // This has no meaning if exponent is 1
+ UTT sage_generator() const;
+ UTT irreducible() const;
+
+ // Initialization of Elements
+ Rep& init( Rep&) const;
+ Rep& init( Rep&, const int) const ;
+ Rep& init( Rep&, const unsigned int) const ;
+ Rep& init( Rep&, const long) const ;
+ Rep& init( Rep&, const unsigned long) const ;
+ Rep& init( Rep&, const Integer) const;
+ Rep& init( Rep&, const float) const ;
+ Rep& init( Rep&, const double) const ;
#ifndef __GIVARO__DONOTUSE_longlong__
- Rep& init( Rep&, const long long) const;
- Rep& init( Rep&, const unsigned long long) const ;
+ Rep& init( Rep&, const long long) const;
+ Rep& init( Rep&, const unsigned long long) const ;
#endif
- Rep& init( Rep& a, std::istream& s ) const { return read(a,s); }
- // Initialization of a polynomial
- template<typename val_t, template<class,class> class Vector,template <class> class Alloc>
- Rep& init( Rep&, const Vector<val_t,Alloc<val_t> >&);
-
-
- // -- Misc: r <- a mod p
- Rep& assign (Rep&, const Integer) const;
- Rep& assign (Rep&, const Rep) const;
- void assign ( const size_t sz, Array r, constArray a ) const;
-
- // --- IO methods for the Domain
- std::istream& read ( std::istream& s );
- std::ostream& write( std::ostream& s ) const;
- // --- IO methods for the Elements
- std::istream& read ( std::istream& s, Rep& a ) const;
- std::ostream& write( std::ostream& s, const Rep a ) const;
-
- // Conversions of the elements
- std::ostream& convert(std::ostream& s, const Rep a ) const { return write(s,a); }
- TT convert(const Rep) const ;
- long& convert(long&, const Rep) const ;
- unsigned long& convert(unsigned long&, const Rep) const ;
- int& convert(int&, const Rep) const ;
- float& convert(float&, const Rep) const ;
- double& convert(double&, const Rep) const ;
- unsigned int& convert(unsigned int&, const Rep) const ;
- Integer& convert(Integer&, const Rep) const ;
+ Rep& init( Rep& a, std::istream& s ) const { return read(a,s); }
+ // Initialization of a polynomial
+ template<typename val_t, template<class,class> class Vector,template <class> class Alloc>
+ Rep& init( Rep&, const Vector<val_t,Alloc<val_t> >&);
+
+
+ // -- Misc: r <- a mod p
+ Rep& assign (Rep&, const Integer) const;
+ Rep& assign (Rep&, const Rep) const;
+ void assign ( const size_t sz, Array r, constArray a ) const;
+
+ // --- IO methods for the Domain
+ std::istream& read ( std::istream& s );
+ std::ostream& write( std::ostream& s ) const;
+ // --- IO methods for the Elements
+ std::istream& read ( std::istream& s, Rep& a ) const;
+ std::ostream& write( std::ostream& s, const Rep a ) const;
+
+ // Conversions of the elements
+ std::ostream& convert(std::ostream& s, const Rep a ) const { return write(s,a); }
+ TT convert(const Rep) const ;
+ long& convert(long&, const Rep) const ;
+ unsigned long& convert(unsigned long&, const Rep) const ;
+ int& convert(int&, const Rep) const ;
+ float& convert(float&, const Rep) const ;
+ double& convert(double&, const Rep) const ;
+ unsigned int& convert(unsigned int&, const Rep) const ;
+ Integer& convert(Integer&, const Rep) const ;
#ifndef __GIVARO__DONOTUSE_longlong__
- long long& convert(long long&, const Rep) const ;
- unsigned long long& convert(unsigned long long&, const Rep) const ;
+ long long& convert(long long&, const Rep) const ;
+ unsigned long long& convert(unsigned long long&, const Rep) const ;
+#endif
+
+ // Test operators
+ inline int operator== (const GFqDom<TT>& a) const;
+ inline int operator!= (const GFqDom<TT>& a) const;
+
+ // Miscellaneous functions
+ bool areEqual( const Rep&, const Rep& ) const;
+ bool areNEqual ( const Rep , const Rep ) const;
+ bool isZero( const Rep ) const;
+ bool isnzero( const Rep ) const;
+ bool isOne ( const Rep ) const;
+ bool isunit ( const Rep ) const; // Element belongs to prime subfield
+ size_t length ( const Rep ) const;
+
+
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ Rep& mul (Rep& r, const Rep a, const Rep b) const;
+ Rep& div (Rep& r, const Rep a, const Rep b) const;
+ Rep& add (Rep& r, const Rep a, const Rep b) const;
+ Rep& sub (Rep& r, const Rep a, const Rep b) const;
+ Rep& neg (Rep& r, const Rep a) const;
+ Rep& inv (Rep& r, const Rep a) const;
+
+ Rep& mulin (Rep& r, const Rep a) const;
+ Rep& divin (Rep& r, const Rep a) const;
+ Rep& addin (Rep& r, const Rep a) const;
+ Rep& subin (Rep& r, const Rep a) const;
+ Rep& negin (Rep& r) const;
+ Rep& invin (Rep& r) const;
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ void mul (const size_t sz, Array r, constArray a, constArray b) const;
+ void mul (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void div (const size_t sz, Array r, constArray a, constArray b) const;
+ void div (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void add (const size_t sz, Array r, constArray a, constArray b) const;
+ void add (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void sub (const size_t sz, Array r, constArray a, constArray b) const;
+ void sub (const size_t sz, Array r, constArray a, Rep b) const;
+ void neg (const size_t sz, Array r, constArray a) const;
+ void inv (const size_t sz, Array r, constArray a) const;
+
+ Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axpy (const size_t sz, Array r, Rep a, constArray x, constArray y) const;
+ void axpy (const size_t sz, Array r, Rep a, constArray x, Rep c) const;
+
+ // -- axpyin: r <- r + a * x mod p
+ Rep& axpyin (Rep& r, const Rep a, const Rep b) const;
+ void axpyin (const size_t sz, Array r, Rep a, constArray x) const;
+
+ // -- axmy: r <- a * b - c mod p
+ Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axmy (const size_t sz, Array r, Rep a, constArray x, constArray y) const;
+ void axmy (const size_t sz, Array r, Rep a, constArray x, Rep c) const;
+
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+
+ // -- axmyin: r <- a * b - r mod p
+ Rep& axmyin (Rep& r, const Rep a, const Rep b) const;
+ // void axmyin (const size_t sz, Array r, Rep a, constArray x) const;
+
+ // // -- sqpyin: r <- r + a * a mod p
+ // Rep& sqpyin (Rep& r, const Rep a) const;
+
+
+ // -- maxpyin: r <- r - a * b mod p
+ Rep& maxpyin (Rep& r, const Rep a, const Rep b) const;
+ void maxpyin (const size_t sz, Array r, Rep a, constArray x) const;
+
+ // <- \sum_i a[i], return 1 if a.size() ==0,
+ void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+
+ // <- \prod_i a[i], return 1 if a.size() ==0,
+ void reducemul ( Rep& r, const size_t sz, constArray a ) const;
+
+ // <- \sum_i a[i] * b[i]
+ Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+
+ // ----- random generators
+ // ----- random generators
+
+ template<class RandIter> Rep& random(RandIter& g, Rep& r) const ;
+ template<class RandIter> Rep& random(RandIter& g, Rep& r, long s) const ;
+ template<class RandIter> Rep& random(RandIter& g, Rep& r, const Rep& b) const ;
+ template<class RandIter> Rep& nonzerorandom(RandIter& g, Rep& r) const ;
+ template<class RandIter> Rep& nonzerorandom(RandIter& g, Rep& r, long s) const ;
+ template<class RandIter> Rep& nonzerorandom(RandIter& g, Rep& r, const Rep& b) const ;
+
+ typedef GIV_randIter< GFqDom<TT> , Rep> randIter;
+#if 0
+ // - Set to a non zero random value
+ void set_nrand(Rep&) const;
+ // - Set to a random value
+ void set_rand(Rep&) const;
#endif
- // Test operators
- inline int operator== (const GFqDom<TT>& a) const;
- inline int operator!= (const GFqDom<TT>& a) const;
-
- // Miscellaneous functions
- bool areEqual( const Rep&, const Rep& ) const;
- bool areNEqual ( const Rep , const Rep ) const;
- bool isZero( const Rep ) const;
- bool isnzero( const Rep ) const;
- bool isOne ( const Rep ) const;
- bool isunit ( const Rep ) const; // Element belongs to prime subfield
- size_t length ( const Rep ) const;
-
-
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- Rep& mul (Rep& r, const Rep a, const Rep b) const;
- Rep& div (Rep& r, const Rep a, const Rep b) const;
- Rep& add (Rep& r, const Rep a, const Rep b) const;
- Rep& sub (Rep& r, const Rep a, const Rep b) const;
- Rep& neg (Rep& r, const Rep a) const;
- Rep& inv (Rep& r, const Rep a) const;
-
- Rep& mulin (Rep& r, const Rep a) const;
- Rep& divin (Rep& r, const Rep a) const;
- Rep& addin (Rep& r, const Rep a) const;
- Rep& subin (Rep& r, const Rep a) const;
- Rep& negin (Rep& r) const;
- Rep& invin (Rep& r) const;
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- void mul (const size_t sz, Array r, constArray a, constArray b) const;
- void mul (const size_t sz, Array r, constArray a, Rep b) const;
-
- void div (const size_t sz, Array r, constArray a, constArray b) const;
- void div (const size_t sz, Array r, constArray a, Rep b) const;
-
- void add (const size_t sz, Array r, constArray a, constArray b) const;
- void add (const size_t sz, Array r, constArray a, Rep b) const;
-
- void sub (const size_t sz, Array r, constArray a, constArray b) const;
- void sub (const size_t sz, Array r, constArray a, Rep b) const;
- void neg (const size_t sz, Array r, constArray a) const;
- void inv (const size_t sz, Array r, constArray a) const;
-
- Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axpy (const size_t sz, Array r, Rep a, constArray x, constArray y) const;
- void axpy (const size_t sz, Array r, Rep a, constArray x, Rep c) const;
-
- // -- axpyin: r <- r + a * x mod p
- Rep& axpyin (Rep& r, const Rep a, const Rep b) const;
- void axpyin (const size_t sz, Array r, Rep a, constArray x) const;
-
- // -- axmy: r <- a * x - y mod p
- Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axmy (const size_t sz, Array r, Rep a, constArray x, constArray y) const;
- void axmy (const size_t sz, Array r, Rep a, constArray x, Rep c) const;
-
- // -- amxy: r <- c - a * b mod p
- Rep& amxy (Rep& r, const Rep a, const Rep b, const Rep c) const;
-
- // -- axmyin: r <- r - a * b mod p
- Rep& axmyin (Rep& r, const Rep a, const Rep b) const;
- void axmyin (const size_t sz, Array r, Rep a, constArray x) const;
-
-// // -- sqpyin: r <- r + a * a mod p
-// Rep& sqpyin (Rep& r, const Rep a) const;
-
-
- // -- axpyin: r <- r - a * b mod p
- Rep& amxyin (Rep& r, const Rep a, const Rep b) const;
-
- // <- \sum_i a[i], return 1 if a.size() ==0,
- void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
-
- // <- \prod_i a[i], return 1 if a.size() ==0,
- void reducemul ( Rep& r, const size_t sz, constArray a ) const;
-
- // <- \sum_i a[i] * b[i]
- Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
-
- // ----- random generators
- // ----- random generators
-
- template<class RandIter> Rep& random(RandIter& g, Rep& r) const ;
- template<class RandIter> Rep& random(RandIter& g, Rep& r, long s) const ;
- template<class RandIter> Rep& random(RandIter& g, Rep& r, const Rep& b) const ;
- template<class RandIter> Rep& nonzerorandom(RandIter& g, Rep& r) const ;
- template<class RandIter> Rep& nonzerorandom(RandIter& g, Rep& r, long s) const ;
- template<class RandIter> Rep& nonzerorandom(RandIter& g, Rep& r, const Rep& b) const ;
-
- typedef GIV_randIter< GFqDom<TT> , Rep> randIter;
-
-// // - Set to a non zero random value
-// void set_nrand(Rep&) const;
-// // - Set to a random value
-// void set_rand(Rep&) const;
-
#ifdef __GIVARO_COUNT__
- void clear() {
- _add_count = 0;
- _mul_count = 0;
- _neg_count = 0;
- _div_count = 0;
- _sub_count = 0;
- _inv_count = 0;
- _add_call = 0;
- _mul_call = 0;
- _neg_call = 0;
- _div_call = 0;
- _sub_call = 0;
- _inv_call = 0;
- }
-
- void info() const {
- cerr << "Mul Call: " << _mul_call << ", real: " << _mul_count << endl;
- cerr << "Add Call: " << _add_call << ", real: " << _add_count << endl;
- cerr << "Div Call: " << _div_call << ", real: " << _div_count << endl;
- cerr << "Sub Call: " << _sub_call << ", real: " << _sub_count << endl;
- cerr << "Neg Call: " << _neg_call << ", real: " << _neg_count << endl;
- cerr << "Inv Call: " << _inv_call << ", real: " << _inv_count << endl;
- }
+ void clear()
+ {
+ _add_count = 0;
+ _mul_count = 0;
+ _neg_count = 0;
+ _div_count = 0;
+ _sub_count = 0;
+ _inv_count = 0;
+ _add_call = 0;
+ _mul_call = 0;
+ _neg_call = 0;
+ _div_call = 0;
+ _sub_call = 0;
+ _inv_call = 0;
+ }
+
+ void info() const
+ {
+ cerr << "Mul Call: " << _mul_call << ", real: " << _mul_count << endl;
+ cerr << "Add Call: " << _add_call << ", real: " << _add_count << endl;
+ cerr << "Div Call: " << _div_call << ", real: " << _div_count << endl;
+ cerr << "Sub Call: " << _sub_call << ", real: " << _sub_count << endl;
+ cerr << "Neg Call: " << _neg_call << ", real: " << _neg_count << endl;
+ cerr << "Inv Call: " << _inv_call << ", real: " << _inv_count << endl;
+ }
#endif
#ifdef __GIVARO_COUNT__
-static long long _add_count;
-static long long _mul_count;
-static long long _neg_count;
-static long long _div_count;
-static long long _sub_count;
-static long long _inv_count;
-static long long _add_call;
-static long long _mul_call;
-static long long _neg_call;
-static long long _div_call;
-static long long _sub_call;
-static long long _inv_call;
+ static long long _add_count;
+ static long long _mul_count;
+ static long long _neg_count;
+ static long long _div_count;
+ static long long _sub_count;
+ static long long _inv_count;
+ static long long _add_call;
+ static long long _mul_call;
+ static long long _neg_call;
+ static long long _div_call;
+ static long long _sub_call;
+ static long long _inv_call;
#endif
- static void Init();
- static void End();
+ static void Init();
+ static void End();
};
+} // namespace Givaro
#include "givaro/givgfq.inl"
-#endif
+#endif // __GIVARO_gfq1_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givgfq.inl b/src/kernel/zpz/givgfq.inl
index 5fb3466..de07fff 100644
--- a/src/kernel/zpz/givgfq.inl
+++ b/src/kernel/zpz/givgfq.inl
@@ -1,105 +1,120 @@
// ==========================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// file: givgfq.inl
// Description:
// Arithmetic on GF(q)
// Bugs:
// Authors : JG Dumas
// Modified 20 Mar 03 by Clement Pernet
-// Time-stamp: <09 Jul 08 08:47:17 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <09 Jul 08 08:47:17 Jean-Guillaume.Dumas at imag.fr>
// ==========================================================================
+
+#ifndef __GIVARO_gfq_INL
+#define __GIVARO_gfq_INL
+
#include <math.h>
#include <givaro/givpoly1padic.h>
+#include <givaro/givinteger.h>
+#include <givaro/givintnumtheo.h>
+#include <givaro/givpower.h>
+
+#include <vector>
+
// Warning : valid iff b != c
#ifndef __GIVARO_COUNT__
#define _GIVARO_GFQ_ADD(c, a, b, mun, plun) { if ((b)==0) (c)=(a); else if ((a)==0) (c)=(b); else { \
- (c) = (a)-(b); \
- (c) = ((c)>0)?(c):(c)+ (mun); \
- (c) = (plun)[(UTT)(c)]; \
- if (c) { \
- (c) = (c)+(b); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- } } }
+ (c) = (a)-(b); \
+ (c) = ((c)>0)?(c):(c)+ (mun); \
+ (c) = (plun)[(UTT)(c)]; \
+ if (c) { \
+ (c) = (c)+(b); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ } } }
#define _GIVARO_GFQ_NEG(res, a, mo, mun) { if ( (a)==0 ) (res)=0; else\
- { (res) = (a) - (mo) ; (res) = ((res)>0)?(res):(res)+(mun); } }
+ { (res) = (a) - (mo) ; (res) = ((res)>0)?(res):(res)+(mun); } }
// Warning : valid iff a != c
// if not use AUTOSUB ...
#define _GIVARO_GFQ_SUB(c, a, b, mo, mun, plun) { if ((a)==0) {_GIVARO_GFQ_NEG(c,b,mo,mun);} else if ((b)==0) (c)=(a); else { \
- (c) = (b)-(a)-(mo); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- (c) = ((c)>0)?(c):(c)+ (mun); \
- (c) = (plun)[(UTT)(c)]; \
- if (c) { \
- (c) = (c)+(a); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- } } }
+ (c) = (b)-(a)-(mo); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ (c) = ((c)>0)?(c):(c)+ (mun); \
+ (c) = (plun)[(UTT)(c)]; \
+ if (c) { \
+ (c) = (c)+(a); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ } } }
#define _GIVARO_GFQ_AUTOSUB(c, b, mo, mun, plun) { if ((c)==0) {_GIVARO_GFQ_NEG(c,b,mo,mun);} else if ((b)!=0) { \
- (c) = (c)-(b)-(mo); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- (c) = ((c)>0)?(c):(c)+ (mun); \
- (c) = (plun)[(UTT)(c)]; \
- if (c) { \
- (c) = (c)+(b); \
- (c) = ((c)>0)?(c)-(mo):(c)+(mo); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- } } }
+ (c) = (c)-(b)-(mo); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ (c) = ((c)>0)?(c):(c)+ (mun); \
+ (c) = (plun)[(UTT)(c)]; \
+ if (c) { \
+ (c) = (c)+(b); \
+ (c) = ((c)>0)?(c)-(mo):(c)+(mo); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ } } }
- #define _GIVARO_GFQ_MUL(res, a, b, mun) { if ( ((a)==0) || ((b)==0) ) { (res) =0; } else { (res) = (((res) = (a)+(b) )>(TT)(mun))?(res)-(mun):(res); } }
+#define _GIVARO_GFQ_MUL(res, a, b, mun) { if ( ((a)==0) || ((b)==0) ) { (res) =0; } else { (res) = (((res) = (a)+(b) )>(TT)(mun))?(res)-(mun):(res); } }
// JGD 02.04.1998 : if a==1, a /= a used to be --> 0 !!!
#define _GIVARO_GFQ_INV(res, a, mun) { (res) = (mun)-(a); (res)=(res)?(res):(mun); }
#define _GIVARO_GFQ_DIV(res, a, b, mun) { \
-if ( (a)==0 ) { (res)=0; } else { (res) = (((res)=(a)-(b))>0)?(res):(res)+(mun); } }
+ if ( (a)==0 ) { (res)=0; } else { (res) = (((res)=(a)-(b))>0)?(res):(res)+(mun); } }
#define _GIVARO_GFQ_SQ(res, a, mun) { if ( (a)==0) (res) = 0; else \
- { (res) = ( (a) << 1) - (mun); \
- (res) = ((res)>0)?(res):(res)+ (mun); } }
+ { (res) = ( (a) << 1) - (mun); \
+ (res) = ((res)>0)?(res):(res)+ (mun); } }
// plun -> 1+^c - (q-1) !!!
// Warning : valid iff b != c
#define _GIVARO_GFQ_SQADD(c,a,b,mun,plun) { \
-if ((a)==0) { (c)=(b); \
-} else if ((b)==0) { \
- (c) = (( (c)=((a) << 1) - (mun) )>0)?(c):(c) + (mun); \
-} else { \
- (c) = (( (c) = ((a) << 1)-(b)-(mun) )<0)?(c)+(mun):(c); \
- if ( (c) = (plun)[(UTT)(((c)>0)?(c):(c)+(mun))] ) { \
- (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); } \
- }\
+ if ((a)==0) { (c)=(b); \
+ } else if ((b)==0) { \
+ (c) = (( (c)=((a) << 1) - (mun) )>0)?(c):(c) + (mun); \
+ } else { \
+ (c) = (( (c) = ((a) << 1)-(b)-(mun) )<0)?(c)+(mun):(c); \
+ if ( (c) = (plun)[(UTT)(((c)>0)?(c):(c)+(mun))] ) { \
+ (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); } \
+ }\
}
// Warning : valid iff b != c
#define _GIVARO_GFQ_MULADD(c,a1,a2,b,mun,plun) { \
-if (((a1)==0) || ((a2)==0)) { (c)=(b); \
-} else if ((b)==0) { \
- (c) = (( (c)=(a1)+(a2) - (mun) )>0)?(c):(c) + (mun); \
-} else { \
- (c) = (( (c) = (a1)+(a2)-(b)-(mun) )<0)?(c)+(mun):(c); \
- if (( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )]) ) { \
- (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
- }\
+ if (((a1)==0) || ((a2)==0)) { (c)=(b); \
+ } else if ((b)==0) { \
+ (c) = (( (c)=(a1)+(a2) - (mun) )>0)?(c):(c) + (mun); \
+ } else { \
+ (c) = (( (c) = (a1)+(a2)-(b)-(mun) )<0)?(c)+(mun):(c); \
+ if (( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )]) ) { \
+ (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
+ }\
}
// Warning : valid iff b != c
#define _GIVARO_GFQ_MULSUB(c,a1,a2,b,mo,mun,plun) { \
-if (((a1)==0) || ((a2)==0)) { (c)=(b); \
-} else if ((b)==0) { \
- (c) = (( (c)=(a1)+(a2) - (mo) -(mun) )>0)?(c):(c) + (mun); \
- (c) = (c)>0?(c):(c) + (mun); \
-} else { \
- (c) = (( (c) = (a1)+(a2)-(b)-(mun) - (mo) )<0)?(c)+(mun):(c); \
- (c) = (c)<0?(c)+(mun):(c); \
- if ( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )] ) { \
- (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
- }\
+ if (((a1)==0) || ((a2)==0)) { (c)=(b); \
+ } else if ((b)==0) { \
+ (c) = (( (c)=(a1)+(a2) - (mo) -(mun) )>0)?(c):(c) + (mun); \
+ (c) = (c)>0?(c):(c) + (mun); \
+ } else { \
+ (c) = (( (c) = (a1)+(a2)-(b)-(mun) - (mo) )<0)?(c)+(mun):(c); \
+ (c) = (c)<0?(c)+(mun):(c); \
+ if ( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )] ) { \
+ (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
+ }\
}
@@ -110,38 +125,38 @@ if (((a1)==0) || ((a2)==0)) { (c)=(b); \
// Warning : valid iff b != c
#define _GIVARO_GFQ_ADD(c, a, b, mun, plun) { ++_add_call; if ((b)==0) (c)=(a); else if ((a)==0) (c)=(b); else { \
- (c) = (a)-(b); \
- (c) = ((c)>0)?(c):(c)+ (mun); \
- (c) = (plun)[(UTT)(c)]; \
- if (c) { \
- (c) = (c)+(b); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- } ++_add_count; } }
+ (c) = (a)-(b); \
+ (c) = ((c)>0)?(c):(c)+ (mun); \
+ (c) = (plun)[(UTT)(c)]; \
+ if (c) { \
+ (c) = (c)+(b); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ } ++_add_count; } }
#define _GIVARO_GFQ_NEG(res, a, mo, mun) { ++_neg_call; if ( (a)==0 ) (res)=0; else\
- { (res) = (a) - (mo) ; (res) = ((res)>0)?(res):(res)+(mun); ++_neg_count; } }
+ { (res) = (a) - (mo) ; (res) = ((res)>0)?(res):(res)+(mun); ++_neg_count; } }
// Warning : valid iff a != c
// if not use AUTOSUB ...
#define _GIVARO_GFQ_SUB(c, a, b, mo, mun, plun) { ++_sub_call; if ((a)==0) {_GIVARO_GFQ_NEG(c,b,mo,mun);} else if ((b)==0) (c)=(a); else { \
- (c) = (b)-(a)-(mo); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- (c) = ((c)>0)?(c):(c)+ (mun); \
- (c) = (plun)[(UTT)(c)]; \
- if (c) { \
- (c) = (c)+(a); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- } ++_sub_count; } }
+ (c) = (b)-(a)-(mo); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ (c) = ((c)>0)?(c):(c)+ (mun); \
+ (c) = (plun)[(UTT)(c)]; \
+ if (c) { \
+ (c) = (c)+(a); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ } ++_sub_count; } }
#define _GIVARO_GFQ_AUTOSUB(c, b, mo, mun, plun) { ++_sub_call; if ((c)==0) {_GIVARO_GFQ_NEG(c,b,mo,mun);} else if ((b)!=0) { \
- (c) = (c)-(b)-(mo); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- (c) = ((c)>0)?(c):(c)+ (mun); \
- (c) = (plun)[(UTT)(c)]; \
- if (c) { \
- (c) = (c)+(b); \
- (c) = ((c)>0)?(c)-(mo):(c)+(mo); \
- (c) = ((c)>0)?(c):(c)+(mun); \
- } ++_sub_count; } }
+ (c) = (c)-(b)-(mo); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ (c) = ((c)>0)?(c):(c)+ (mun); \
+ (c) = (plun)[(UTT)(c)]; \
+ if (c) { \
+ (c) = (c)+(b); \
+ (c) = ((c)>0)?(c)-(mo):(c)+(mo); \
+ (c) = ((c)>0)?(c):(c)+(mun); \
+ } ++_sub_count; } }
#define _GIVARO_GFQ_MUL(res, a, b, mun) { ++_mul_call; if ( ((a)==0) || ((b)==0) ) { (res) =0; } else { (res) = (((res) = (a)+(b)-(mun) )>0)?(res):(res)+ (mun); ++_mul_count; } }
@@ -150,959 +165,985 @@ if (((a1)==0) || ((a2)==0)) { (c)=(b); \
#define _GIVARO_GFQ_INV(res, a, mun) { ++_inv_call; (res) = (mun)-(a); (res)=(res)?(res):(mun); ++_inv_count; }
#define _GIVARO_GFQ_DIV(res, a, b, mun) { ++_div_call; \
-if ( (a)==0 ) { (res)=0; } else { (res) = (((res)=(a)-(b))>0)?(res):(res)+(mun); ++_div_count; } }
+ if ( (a)==0 ) { (res)=0; } else { (res) = (((res)=(a)-(b))>0)?(res):(res)+(mun); ++_div_count; } }
#define _GIVARO_GFQ_SQ(res, a, mun) { ++_mul_call; if ( (a)==0) (res) = 0; else \
- { (res) = ( (a) << 1) - (mun); \
- (res) = ((res)>0)?(res):(res)+ (mun); ++_mul_count; } }
+ { (res) = ( (a) << 1) - (mun); \
+ (res) = ((res)>0)?(res):(res)+ (mun); ++_mul_count; } }
// plun -> 1+^c - (q-1) !!!
// Warning : valid iff b != c
#define _GIVARO_GFQ_SQADD(c,a,b,mun,plun) { ++_mul_call; ++_add_call; \
-if ((a)==0) { (c)=(b); \
-} else if ((b)==0) { \
- (c) = (( (c)=((a) << 1) - (mun) )>0)?(c):(c) + (mun); \
-++_mul_count; } else { \
- (c) = (( (c) = ((a) << 1)-(b)-(mun) )<0)?(c)+(mun):(c); \
- if ( (c) = (plun)[(UTT)(((c)>0)?(c):(c)+(mun))] ) { \
- (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); } \
-++_mul_count; ++_add_count; }\
+ if ((a)==0) { (c)=(b); \
+ } else if ((b)==0) { \
+ (c) = (( (c)=((a) << 1) - (mun) )>0)?(c):(c) + (mun); \
+ ++_mul_count; } else { \
+ (c) = (( (c) = ((a) << 1)-(b)-(mun) )<0)?(c)+(mun):(c); \
+ if ( (c) = (plun)[(UTT)(((c)>0)?(c):(c)+(mun))] ) { \
+ (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); } \
+ ++_mul_count; ++_add_count; }\
}
// Warning : valid iff b != c
#define _GIVARO_GFQ_MULADD(c,a1,a2,b,mun,plun) { ++_mul_call; ++_add_call; \
-if (((a1)==0) || ((a2)==0)) { (c)=(b); \
-} else if ((b)==0) { \
- (c) = (( (c)=(a1)+(a2) - (mun) )>0)?(c):(c) + (mun); \
-++_mul_count; } else { \
- (c) = (( (c) = (a1)+(a2)-(b)-(mun) )<0)?(c)+(mun):(c); \
- if ( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )] ) { \
- (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
-++_mul_count; ++_add_count; }\
+ if (((a1)==0) || ((a2)==0)) { (c)=(b); \
+ } else if ((b)==0) { \
+ (c) = (( (c)=(a1)+(a2) - (mun) )>0)?(c):(c) + (mun); \
+ ++_mul_count; } else { \
+ (c) = (( (c) = (a1)+(a2)-(b)-(mun) )<0)?(c)+(mun):(c); \
+ if ( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )] ) { \
+ (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
+ ++_mul_count; ++_add_count; }\
}
// Warning : valid iff b != c
#define _GIVARO_GFQ_MULSUB(c,a1,a2,b,mo,mun,plun) { ++_mul_call; ++_sub_call; \
-if (((a1)==0) || ((a2)==0)) { (c)=(b); \
-} else if ((b)==0) { \
- (c) = (( (c)=(a1)+(a2) - (mo) -(mun) )>0)?(c):(c) + (mun); \
- (c) = (c)>0?(c):(c) + (mun); \
-++_mul_count; ++_neg_count; } else { \
- (c) = (( (c) = (a1)+(a2)-(b)-(mun) - (mo) )<0)?(c)+(mun):(c); \
- (c) = (c)<0?(c)+(mun):(c); \
- if ( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )] ) { \
- (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
-++_mul_count; ++_sub_count; }\
+ if (((a1)==0) || ((a2)==0)) { (c)=(b); \
+ } else if ((b)==0) { \
+ (c) = (( (c)=(a1)+(a2) - (mo) -(mun) )>0)?(c):(c) + (mun); \
+ (c) = (c)>0?(c):(c) + (mun); \
+ ++_mul_count; ++_neg_count; } else { \
+ (c) = (( (c) = (a1)+(a2)-(b)-(mun) - (mo) )<0)?(c)+(mun):(c); \
+ (c) = (c)<0?(c)+(mun):(c); \
+ if ( (c) = (plun)[(UTT)( ((c)>0)?(c):(c)+(mun) )] ) { \
+ (c) = (( (c) = (c)+(b) )>0)?(c):(c)+(mun); }\
+ ++_mul_count; ++_sub_count; }\
}
#endif
-
-
-template<typename TT>
-inline typename GFqDom<TT>::Residu_t GFqDom<TT>::residu() const
-{ return _q; }
-
-template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::cardinality() const
-{ return _q; }
-template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::characteristic() const
-{ return _characteristic; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Residu_t GFqDom<TT>::generator() const
-{ return _log2pol[1]; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::generator(Rep& g) const
-{ return g=1; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Residu_t GFqDom<TT>::sage_generator() const
-{
- if (exponent()>1) {
- return _pol2log[_characteristic];
- } else {
- return one;
- }
-}
-
-template<typename TT>
-inline typename GFqDom<TT>::Residu_t GFqDom<TT>::irreducible() const
-{ return _irred; }
-
-template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::exponent() const
-{ return _exponent; }
-
-template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::size() const
-{ return _q; }
-
-
- // ------------------------- Miscellaneous functions
-
-template<typename TT>
-inline bool GFqDom<TT>::areEqual(const Rep& a, const Rep& b) const
- { return a == b ; }
-
-template<typename TT>
-inline bool GFqDom<TT>::areNEqual(const Rep a, const Rep b) const
- { return a != b ; }
-
-template<typename TT>
-inline bool GFqDom<TT>::isZero(const Rep a) const
- { return a == GFqDom<TT>::zero ; }
-
-template<typename TT>
-inline bool GFqDom<TT>::isnzero(const Rep a) const
- { return a != GFqDom<TT>::zero ; }
-
-template<typename TT>
-inline bool GFqDom<TT>::isOne(const Rep a) const
- { return a == GFqDom<TT>::one ; }
-
-template<typename TT>
-inline bool GFqDom<TT>::isunit(const Rep a) const {
- // Fermat : x^(p-1) = 1 whenever x is a unit
- return ( ( a * (_characteristic-1) ) % _qm1 ) == 0;
-}
-
-template<typename TT>
-inline size_t GFqDom<TT>::length(const Rep ) const
- { return sizeof(TT) ;}
-
- // ----------- Usefull method :
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::mul
- (Rep& r, const Rep a, const Rep b) const
-{ _GIVARO_GFQ_MUL(r,a,b, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::mulin
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
-{ _GIVARO_GFQ_MUL(r,r,a, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::div
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
-{ _GIVARO_GFQ_DIV(r, a, b, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::divin
-(GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
-{ _GIVARO_GFQ_DIV(r, r, a, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::add
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
-{ _GIVARO_GFQ_ADD(r, a, b, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::addin
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
-{ _GIVARO_GFQ_ADD(r, r, a, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::sub
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
-{ _GIVARO_GFQ_SUB(r, a, b, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::subin
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
-{ _GIVARO_GFQ_AUTOSUB(r, a, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::neg
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
-{ _GIVARO_GFQ_NEG(r, a, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::negin
- (GFqDom<TT>::Rep& r) const
-{ _GIVARO_GFQ_NEG(r, r, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::inv
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
-{ _GIVARO_GFQ_INV(r, a, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::invin
- (GFqDom<TT>::Rep& r) const
-{ _GIVARO_GFQ_INV(r, r, GFqDom<TT>::_qm1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::axpy
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b, const GFqDom<TT>::Rep c)
- const
-{ _GIVARO_GFQ_MULADD(r,a,b,c, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::axpyin
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
-{
- Rep tmp = r;
- _GIVARO_GFQ_MULADD((r),a,b,tmp, (GFqDom<TT>::_qm1), (GFqDom<TT>::_plus1)) ;
-return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::axmyin
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
-{
-// Rep tmp = r;
-// _GIVARO_GFQ_MULSUB(r,a,b,tmp, _qm1o2, _qm1, _plus1) ;
- Rep tmp; _GIVARO_GFQ_MUL(tmp,a,b, _qm1) ;
- _GIVARO_GFQ_AUTOSUB(r,tmp, _qm1o2, _qm1, _plus1) ;
-return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::axmy
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b, const GFqDom<TT>::Rep c)
- const
-{
- _GIVARO_GFQ_MUL(r,a,b, GFqDom<TT>::_qm1) ;
- _GIVARO_GFQ_AUTOSUB(r,c, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
-return r; }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::amxy
- (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b, const GFqDom<TT>::Rep c)
- const
-{
- _GIVARO_GFQ_MUL(r,a,b, GFqDom<TT>::_qm1) ;
- _GIVARO_GFQ_SUB(r,c,r, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
-return r; }
-
-
- // -- inline array operations between Reps
-template<typename TT>
-inline void GFqDom<TT>::mul
- (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MUL(r[i],a[i],b[i], GFqDom<TT>::_qm1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::mul
- (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MUL(r[i],a[i],b, GFqDom<TT>::_qm1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::div
- (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_DIV(r[i],a[i],b[i], GFqDom<TT>::_qm1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::div
- (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_DIV(r[i],a[i],b, GFqDom<TT>::_qm1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::add
- (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_ADD(r[i], a[i], b[i], GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::add
- (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_ADD(r[i], a[i], b, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::sub
- (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_SUB(r[i], a[i], b[i], GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::sub
- (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_SUB(r[i], a[i], b, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::neg
- (const size_t sz, Array r, constArray a) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_NEG(r[i], a[i], GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::inv
- (const size_t sz, Array r, constArray a) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_INV(r[i], a[i], GFqDom<TT>::_qm1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::axpy
-(const size_t sz, Array r, Rep a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MULADD(r[i], a, x[i], y[i], GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::axpyin
- (const size_t sz, Array r, Rep a, constArray x) const
-{
- Rep tmp;
- for (register size_t i=sz-1; i!=0; --i) {
- tmp = r[i];
- _GIVARO_GFQ_MULADD(r[i], a, x[i], tmp, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::axpy
- (const size_t sz, Array r, Rep a, constArray x, Rep y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MULADD(r[i], a, x[i], y, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::axmy
- (const size_t sz, Array r, Rep a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MUL(r[i], a, x[i], GFqDom<TT>::_qm1) ;
- _GIVARO_GFQ_AUTOSUB(r[i], y[i], GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::axmy
- (const size_t sz, Array r, Rep a, constArray x, Rep y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MUL(r[i], a, x[i], GFqDom<TT>::_qm1) ;
- _GIVARO_GFQ_AUTOSUB(r[i], y, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
-template<typename TT>
-inline void GFqDom<TT>::axmyin
- (const size_t sz, Array r, Rep a, constArray x) const
-{
- Rep tmp;
- for (register size_t i=sz-1; i!=0; --i) {
- _GIVARO_GFQ_MUL(tmp, a, x[i], GFqDom<TT>::_qm1) ;
- _GIVARO_GFQ_AUTOSUB(r[i], tmp, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
- }
-}
-
- // ------------------------------------
- // Input - Output of the Domain
- //
-template<typename TT>
-inline std::istream& GFqDom<TT>::read (std::istream& s) {
- char ch;
- s >> std::ws >> ch;
- if (ch != '(')
- std::cerr << "GFqDom::read: syntax error: no '('" << std::endl;
- UTT p;
- s >> p;
- s >> std::ws >> ch;
- if (ch == ')')
- *this = GFqDom<TT>(p,UTT(1));
- else {
- if (ch != '^')
- std::cerr << "GFqDom::read: syntax error: no '^'" << std::endl;
- UTT k;
- s >> std::ws >> k;
- if (ch != ')')
- std::cerr << "GFqDom::read: syntax error: no ')'" << std::endl;
-
- *this = GFqDom<TT>(p,k);
- }
- return s;
-}
-
-template<typename TT>
-inline std::ostream& GFqDom<TT>::write (std::ostream& o) const {
- return o << "Givaro Gfq of (" << GFqDom<TT>::_characteristic << '^' << GFqDom<TT>::_exponent << ')';
-}
-
- // ------------------------------------
- // Input - Output of the Elements
- //
-template<typename TT>
-inline std::istream& GFqDom<TT>::read (std::istream& i, Rep& a) const {
- TT t;
- i >> t;
- init(a,t);
- return i;
-}
-
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const double residu ) const {
- double tr = residu ;
- if (tr <0) {
- // -a = b [p] <==> a = p-b [p]
- tr = -tr;
- if (tr > Signed_Trait<UTT>::max() )
- tr = fmod(tr,_dcharacteristic);
- //tr -= (double)floor(tr * _inversecharacteristic)*_dcharacteristic;
- else{
- if (tr >= (TT)_characteristic )
- tr = (UTT)tr % _characteristic ;
- }
-
- if (tr)
- return r = _pol2log[ _characteristic - (UTT)tr ];
- else
- return r = zero;
- } else {
- if (tr > Signed_Trait<UTT>::max() )
- tr = fmod(tr,_dcharacteristic);
- //tr -= (double)floor(tr * _inversecharacteristic)*_dcharacteristic;
- else{
- if (tr >= (TT)_characteristic )
- tr = (UTT)tr % _characteristic ;
- }
- return r = _pol2log[ (UTT)tr ];
- }
- }
-
- template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const float residu ) const {
- return init(r, (const double)residu);
- }
-
-
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const int residu ) const {
- int tr = residu ;
- if (tr <0) {
- // -a = b [p]
- // a = p-b [p]
- tr = -tr;
- if (tr >= (int)_characteristic ) tr = (unsigned int)tr % _characteristic ;
- if (tr)
- return r = _pol2log[ _characteristic - (unsigned int)tr ];
- else
- return r = zero;
- } else {
- if (tr >= (int)_characteristic ) tr = (unsigned int)tr % _characteristic ;
- return r = _pol2log[ tr ];
- }
-}
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const long residu ) const {
- long tr = residu ;
- if (tr <0) {
- // -a = b [p]
- // a = p-b [p]
- tr = -tr;
- if (tr >= (long)_characteristic ) tr = (unsigned long)tr % _characteristic ;
- if (tr)
- return r = _pol2log[ _characteristic - (unsigned long)tr ];
- else
- return r = zero;
- } else {
- if (tr >= (long)_characteristic ) tr = (unsigned long)tr % _characteristic ;
- return r = _pol2log[ tr ];
- }
-}
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const Integer residu ) const
-{
- UTT tr;
- if (residu <0) {
- // -a = b [p]
- // a = p-b [p]
- if ( residu <= (Integer)(-_characteristic) ) tr = (-residu) % (UTT)_characteristic ;
- else tr = long(-residu);
- if (tr)
- return r = _pol2log[ _characteristic - (UTT)tr ];
- else
- return r = zero;
- } else {
- if (residu >= (Integer)_characteristic ) tr = residu % (UTT)_characteristic ;
- else tr = long(residu);
- return r = _pol2log[ tr ];
- }
-}
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const unsigned long residu ) const
-{
- unsigned long tr = residu ;
- if (tr >= _characteristic ) tr = tr % _characteristic ;
- return r = _pol2log[ tr ];
-}
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const unsigned int residu ) const
-{
- unsigned int tr = residu ;
- if (tr >= _characteristic ) tr = tr % _characteristic ;
- return r = _pol2log[ tr ];
-}
+namespace Givaro {
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Residu_t GFqDom<TT>::residu() const
+ { return _q; }
+
+ template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::cardinality() const
+ { return _q; }
+ template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::characteristic() const
+ { return _characteristic; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Residu_t GFqDom<TT>::generator() const
+ { return _log2pol[1]; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::generator(Rep& g) const
+ { return g=1; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Residu_t GFqDom<TT>::sage_generator() const
+ {
+ if (exponent()>1) {
+ return _pol2log[_characteristic];
+ } else {
+ return one;
+ }
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Residu_t GFqDom<TT>::irreducible() const
+ { return _irred; }
+
+ template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::exponent() const
+ { return _exponent; }
+
+ template<typename TT> inline typename GFqDom<TT>::Residu_t GFqDom<TT>::size() const
+ { return _q; }
+
+
+ // ------------------------- Miscellaneous functions
+
+ template<typename TT>
+ inline bool GFqDom<TT>::areEqual(const Rep& a, const Rep& b) const
+ { return a == b ; }
+
+ template<typename TT>
+ inline bool GFqDom<TT>::areNEqual(const Rep a, const Rep b) const
+ { return a != b ; }
+
+ template<typename TT>
+ inline bool GFqDom<TT>::isZero(const Rep a) const
+ { return a == GFqDom<TT>::zero ; }
+
+ template<typename TT>
+ inline bool GFqDom<TT>::isnzero(const Rep a) const
+ { return a != GFqDom<TT>::zero ; }
+
+ template<typename TT>
+ inline bool GFqDom<TT>::isOne(const Rep a) const
+ { return a == GFqDom<TT>::one ; }
+
+ template<typename TT>
+ inline bool GFqDom<TT>::isunit(const Rep a) const
+ {
+ // Fermat : x^(p-1) = 1 whenever x is a unit
+ return ( ( a * (_characteristic-1) ) % _qm1 ) == 0;
+ }
+
+ template<typename TT>
+ inline size_t GFqDom<TT>::length(const Rep ) const
+ { return sizeof(TT) ;}
+
+ // ----------- Usefull method :
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::mul
+ (Rep& r, const Rep a, const Rep b) const
+ { _GIVARO_GFQ_MUL(r,a,b, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::mulin
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
+ { _GIVARO_GFQ_MUL(r,r,a, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::div
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
+ { _GIVARO_GFQ_DIV(r, a, b, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::divin
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
+ { _GIVARO_GFQ_DIV(r, r, a, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::add
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
+ { _GIVARO_GFQ_ADD(r, a, b, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::addin
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
+ { _GIVARO_GFQ_ADD(r, r, a, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::sub
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
+ { _GIVARO_GFQ_SUB(r, a, b, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::subin
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
+ { _GIVARO_GFQ_AUTOSUB(r, a, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::neg
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
+ { _GIVARO_GFQ_NEG(r, a, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::negin
+ (GFqDom<TT>::Rep& r) const
+ { _GIVARO_GFQ_NEG(r, r, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::inv
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a) const
+ { _GIVARO_GFQ_INV(r, a, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::invin
+ (GFqDom<TT>::Rep& r) const
+ { _GIVARO_GFQ_INV(r, r, GFqDom<TT>::_qm1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::axpy
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b, const GFqDom<TT>::Rep c)
+ const
+ { _GIVARO_GFQ_MULADD(r,a,b,c, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ; return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::axpyin
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b) const
+ {
+ Rep tmp = r;
+ _GIVARO_GFQ_MULADD((r),a,b,tmp, (GFqDom<TT>::_qm1), (GFqDom<TT>::_plus1)) ;
+ return r; }
+
+ // r <- r-a*b
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::maxpyin (GFqDom<TT>::Rep& r,
+ const GFqDom<TT>::Rep a,
+ const GFqDom<TT>::Rep b) const
+ {
+ // Rep tmp = r;
+ // _GIVARO_GFQ_MULSUB(r,a,b,tmp, _qm1o2, _qm1, _plus1) ;
+ Rep tmp; _GIVARO_GFQ_MUL(tmp,a,b, _qm1) ;
+ _GIVARO_GFQ_AUTOSUB(r,tmp, _qm1o2, _qm1, _plus1) ;
+ return r;
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::axmyin (GFqDom<TT>::Rep& r,
+ const GFqDom<TT>::Rep a,
+ const GFqDom<TT>::Rep b) const
+ {
+ this->maxpyin(r,a,b);
+ return this->negin(r);
+ }
+
+ // r <- a*b-c
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::axmy
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b, const GFqDom<TT>::Rep c)
+ const
+ {
+ _GIVARO_GFQ_MUL(r,a,b, GFqDom<TT>::_qm1) ;
+ _GIVARO_GFQ_AUTOSUB(r,c, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ return r; }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::maxpy
+ (GFqDom<TT>::Rep& r, const GFqDom<TT>::Rep a, const GFqDom<TT>::Rep b, const GFqDom<TT>::Rep c)
+ const
+ {
+ _GIVARO_GFQ_MUL(r,a,b, GFqDom<TT>::_qm1) ;
+ _GIVARO_GFQ_SUB(r,c,r, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ return r; }
+
+
+ // -- inline array operations between Reps
+ template<typename TT>
+ inline void GFqDom<TT>::mul
+ (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MUL(r[i],a[i],b[i], GFqDom<TT>::_qm1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::mul
+ (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MUL(r[i],a[i],b, GFqDom<TT>::_qm1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::div
+ (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_DIV(r[i],a[i],b[i], GFqDom<TT>::_qm1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::div
+ (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_DIV(r[i],a[i],b, GFqDom<TT>::_qm1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::add
+ (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_ADD(r[i], a[i], b[i], GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::add
+ (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_ADD(r[i], a[i], b, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::sub
+ (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_SUB(r[i], a[i], b[i], GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::sub
+ (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_SUB(r[i], a[i], b, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::neg
+ (const size_t sz, Array r, constArray a) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_NEG(r[i], a[i], GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::inv
+ (const size_t sz, Array r, constArray a) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_INV(r[i], a[i], GFqDom<TT>::_qm1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::axpy
+ (const size_t sz, Array r, Rep a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MULADD(r[i], a, x[i], y[i], GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::axpyin
+ (const size_t sz, Array r, Rep a, constArray x) const
+ {
+ Rep tmp;
+ for ( size_t i=sz ; --i ; ) {
+ tmp = r[i];
+ _GIVARO_GFQ_MULADD(r[i], a, x[i], tmp, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::axpy
+ (const size_t sz, Array r, Rep a, constArray x, Rep y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MULADD(r[i], a, x[i], y, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::axmy
+ (const size_t sz, Array r, Rep a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MUL(r[i], a, x[i], GFqDom<TT>::_qm1) ;
+ _GIVARO_GFQ_AUTOSUB(r[i], y[i], GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::axmy
+ (const size_t sz, Array r, Rep a, constArray x, Rep y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MUL(r[i], a, x[i], GFqDom<TT>::_qm1) ;
+ _GIVARO_GFQ_AUTOSUB(r[i], y, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ template<typename TT>
+ inline void GFqDom<TT>::maxpyin (const size_t sz, Array r,
+ Rep a, constArray x) const
+ {
+ Rep tmp;
+ for ( size_t i=sz ; --i ; ) {
+ _GIVARO_GFQ_MUL(tmp, a, x[i], GFqDom<TT>::_qm1) ;
+ _GIVARO_GFQ_AUTOSUB(r[i], tmp, GFqDom<TT>::_qm1o2, GFqDom<TT>::_qm1, GFqDom<TT>::_plus1) ;
+ }
+ }
+
+ // ------------------------------------
+ // Input - Output of the Domain
+ //
+ template<typename TT>
+ inline std::istream& GFqDom<TT>::read (std::istream& s) {
+ char ch;
+ s >> std::ws >> ch;
+ if (ch != '(')
+ std::cerr << "GFqDom::read: syntax error: no '('" << std::endl;
+ UTT p;
+ s >> p;
+ s >> std::ws >> ch;
+ if (ch == ')')
+ *this = GFqDom<TT>(p,UTT(1));
+ else {
+ if (ch != '^')
+ std::cerr << "GFqDom::read: syntax error: no '^'" << std::endl;
+ UTT k;
+ s >> std::ws >> k;
+ if (ch != ')')
+ std::cerr << "GFqDom::read: syntax error: no ')'" << std::endl;
+
+ *this = GFqDom<TT>(p,k);
+ }
+ return s;
+ }
+
+ template<typename TT>
+ inline std::ostream& GFqDom<TT>::write (std::ostream& o) const
+ {
+ return o << "Givaro Gfq of (" << GFqDom<TT>::_characteristic << '^' << GFqDom<TT>::_exponent << ')';
+ }
+
+ // ------------------------------------
+ // Input - Output of the Elements
+ //
+ template<typename TT>
+ inline std::istream& GFqDom<TT>::read (std::istream& i, Rep& a) const
+ {
+ TT t;
+ i >> t;
+ init(a,t);
+ return i;
+ }
+
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const double Residu ) const
+ {
+ double tr = Residu ;
+ if (tr <0) {
+ // -a = b [p] <==> a = p-b [p]
+ tr = -tr;
+ if (tr > Signed_Trait<UTT>::max() )
+ tr = fmod(tr,_dcharacteristic);
+ //tr -= (double)floor(tr * _inversecharacteristic)*_dcharacteristic;
+ else{
+ if (tr >= (TT)_characteristic )
+ tr = double((UTT)tr % _characteristic) ;
+ }
+
+ if (tr)
+ return r = _pol2log[ _characteristic - (UTT)tr ];
+ else
+ return r = zero;
+ } else {
+ if (tr > Signed_Trait<UTT>::max() )
+ tr = fmod(tr,_dcharacteristic);
+ //tr -= (double)floor(tr * _inversecharacteristic)*_dcharacteristic;
+ else{
+ if (tr >= (TT)_characteristic )
+ tr = double((UTT)tr % _characteristic) ;
+ }
+ return r = _pol2log[ (UTT)tr ];
+ }
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const float Residu ) const
+ {
+ return init(r, static_cast<double>(Residu));
+ }
+
+
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const int Residu ) const
+ {
+ int tr = Residu ;
+ if (tr <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ tr = -tr;
+ if (tr >= (int)_characteristic )
+ tr =(int)( (unsigned int)tr % _characteristic ) ;
+ if (tr)
+ return r = _pol2log[ _characteristic - (unsigned int)tr ];
+ else
+ return r = zero;
+ }
+ else {
+ if (tr >= (int)_characteristic )
+ tr = int((unsigned int)tr % _characteristic ) ;
+ return r = _pol2log[ tr ];
+ }
+ }
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const long Residu ) const
+ {
+ long tr = Residu ;
+ if (tr <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ tr = -tr;
+ if (tr >= (long)_characteristic ) tr = (unsigned long)tr % _characteristic ;
+ if (tr)
+ return r = _pol2log[ _characteristic - (unsigned long)tr ];
+ else
+ return r = zero;
+ } else {
+ if (tr >= (long)_characteristic ) tr = (unsigned long)tr % _characteristic ;
+ return r = _pol2log[ tr ];
+ }
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const Integer Residu ) const
+ {
+ UTT tr;
+ if (Residu <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ if ( Residu <= (Integer)(-_characteristic) ) tr = (-Residu) % (UTT)_characteristic ;
+ else
+ tr = UTT(-Residu);
+ if (tr)
+ return r = _pol2log[ _characteristic - (UTT)tr ];
+ else
+ return r = zero;
+ } else {
+ if (Residu >= (Integer)_characteristic ) tr = Residu % (UTT)_characteristic ;
+ else tr = UTT(Residu);
+ return r = _pol2log[ tr ];
+ }
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const unsigned long Residu ) const
+ {
+ unsigned long tr = Residu ;
+ if (tr >= _characteristic ) tr = tr % _characteristic ;
+ return r = _pol2log[ tr ];
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const unsigned int Residu ) const
+ {
+ unsigned int tr = Residu ;
+ if (tr >= _characteristic ) tr = tr % _characteristic ;
+ return r = _pol2log[ tr ];
+ }
#ifndef __GIVARO__DONOTUSE_longlong__
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const unsigned long long residu ) const
-{
- unsigned long long tr = residu ;
- if (tr >= _characteristic ) tr = tr % _characteristic ;
- return r = _pol2log[ tr ];
-}
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const long long residu ) const {
- long long tr = residu ;
- if (tr <0) {
- // -a = b [p]
- // a = p-b [p]
- tr = -tr;
- if (tr >= (long long)_characteristic ) tr = (unsigned long long)tr % _characteristic ;
- if (tr)
- return r = _pol2log[ _characteristic - (unsigned long long)tr ];
- else
- return r = zero;
- } else {
- if (tr >= (long long)_characteristic ) tr = (unsigned long long)tr % _characteristic ;
- return r = _pol2log[ tr ];
- }
-}
-
-
-template<typename TT>
-inline unsigned long long& GFqDom<TT>::convert (unsigned long long& r, const Rep a) const
-{
- return r = (unsigned long long)_log2pol[ (unsigned long)a] ;
-}
-template<typename TT>
-inline long long& GFqDom<TT>::convert (long long& r, const Rep a) const
-{
- return r = (long long)_log2pol[ (unsigned long)a] ;
-}
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const unsigned long long Residu ) const
+ {
+ unsigned long long tr = Residu ;
+ if (tr >= _characteristic ) tr = tr % _characteristic ;
+ return r = _pol2log[ tr ];
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const long long Residu ) const
+ {
+ long long tr = Residu ;
+ if (tr <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ tr = -tr;
+ if (tr >= (long long)_characteristic ) tr = (unsigned long long)tr % _characteristic ;
+ if (tr)
+ return r = _pol2log[ _characteristic - (unsigned long long)tr ];
+ else
+ return r = zero;
+ } else {
+ if (tr >= (long long)_characteristic ) tr = (unsigned long long)tr % _characteristic ;
+ return r = _pol2log[ tr ];
+ }
+ }
+
+
+ template<typename TT>
+ inline unsigned long long& GFqDom<TT>::convert (unsigned long long& r, const Rep a) const
+ {
+ return r = (unsigned long long)_log2pol[ (unsigned long)a] ;
+ }
+ template<typename TT>
+ inline long long& GFqDom<TT>::convert (long long& r, const Rep a) const
+ {
+ return r = (long long)_log2pol[ (unsigned long)a] ;
+ }
#endif
-template<typename TT>
-inline double& GFqDom<TT>::convert (double& r, const Rep a) const {
- return r = (double)_log2pol[ (UTT)a] ;
-}
-
-template<typename TT>
-inline float& GFqDom<TT>::convert (float& r, const Rep a) const {
- return r = (float)_log2pol[ (UTT)a] ;
-}
-
-template<typename TT>
-inline std::ostream& GFqDom<TT>::write (std::ostream& o, const Rep a) const {
- return o << _log2pol[ (UTT)a] ;
-}
-
-
-
-template<typename TT>
-inline long& GFqDom<TT>::convert (long& r, const Rep a) const
-{
- return r = (long)_log2pol[ (unsigned long)a] ;
-}
-
-template<typename TT>
-inline unsigned long& GFqDom<TT>::convert (unsigned long& r, const Rep a) const
-{
- return r = (unsigned long)_log2pol[ (unsigned long)a] ;
-}
-
-template<typename TT>
-inline int& GFqDom<TT>::convert (int& r, const Rep a) const
-{
- return r = (int)_log2pol[ (UTT)a] ;
-}
-
-template<typename TT>
-inline unsigned int& GFqDom<TT>::convert (unsigned int& r, const Rep a) const
-{
- return r = (unsigned int)_log2pol[ (UTT)a] ;
-}
-
-template<typename TT>
-inline TT GFqDom<TT>::convert (const Rep a) const
-{
- return (TT)_log2pol[ (UTT)a] ;
-}
+ template<typename TT>
+ inline double& GFqDom<TT>::convert (double& r, const Rep a) const
+ {
+ return r = (double)_log2pol[ (UTT)a] ;
+ }
+
+ template<typename TT>
+ inline float& GFqDom<TT>::convert (float& r, const Rep a) const
+ {
+ return r = (float)_log2pol[ (UTT)a] ;
+ }
+
+ template<typename TT>
+ inline std::ostream& GFqDom<TT>::write (std::ostream& o, const Rep a) const
+ {
+ return o << _log2pol[ (UTT)a] ;
+ }
+
+
+
+ template<typename TT>
+ inline long& GFqDom<TT>::convert (long& r, const Rep a) const
+ {
+ return r = (long)_log2pol[ (unsigned long)a] ;
+ }
+
+ template<typename TT>
+ inline unsigned long& GFqDom<TT>::convert (unsigned long& r, const Rep a) const
+ {
+ return r = (unsigned long)_log2pol[ (unsigned long)a] ;
+ }
+
+ template<typename TT>
+ inline int& GFqDom<TT>::convert (int& r, const Rep a) const
+ {
+ return r = (int)_log2pol[ (UTT)a] ;
+ }
+
+ template<typename TT>
+ inline unsigned int& GFqDom<TT>::convert (unsigned int& r, const Rep a) const
+ {
+ return r = (unsigned int)_log2pol[ (UTT)a] ;
+ }
+
+ template<typename TT>
+ inline TT GFqDom<TT>::convert (const Rep a) const
+ {
+ return (TT)_log2pol[ (UTT)a] ;
+ }
+
+ template<typename TT>
+ inline Integer& GFqDom<TT>::convert (Integer& r, const Rep a) const
+ {
+ return r = (Integer)_log2pol[ (UTT)a] ;
+ }
+
+
+ // ---------
+ // -- Initialization operations
+ // ---------
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r) const
+ { return r = zero; }
+
+
+ template<typename TT>
+ template<typename val_t, template<class, class> class Vector, template <class> class Alloc>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const Vector<val_t, Alloc<val_t> >& P) {
+ static Self_t PrimeField(this->_characteristic);
+ typedef Poly1Dom< Self_t, Dense > PolDom;
+ static PolDom Pdom( PrimeField );
+ typedef Poly1PadicDom< GFqDom<TT>, Dense > PadicDom;
+ static PadicDom PAD(Pdom);
+ Degree d; Pdom.degree(d, P);
+ if (d >= this->_exponent) {
+ static typename PadicDom::Element tmp;
+ static typename PadicDom::Element Irreducible = PAD.radix(tmp, this->_irred);
+ // All this was to get the irreducible polynomial
+ // Now we can mod it out
+ typename PolDom::Element modP; Pdom.mod(modP, P, Irreducible);
+ TT tr;
+ PAD.eval(tr, modP);
+ return r = this->_pol2log[ tr ];
+ } else {
+ TT tr;
+ PAD.eval(tr, P);
+ return r = this->_pol2log[ tr ];
+ }
+ }
+
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::assign( Rep& r, const Integer a) const
+ { return init (r, a); }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::assign( Rep& r, const Rep a) const
+ { return r = a; }
+
+
+ template<typename TT> inline void GFqDom<TT>::assign( const size_t sz, Array r, constArray a ) const
+ {
+ TT tr;
+ // for ( size_t i=sz ; --i ; )
+ for ( size_t i=sz; i--;) {
+ tr = a[i] ;
+ if (tr <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ tr = -tr;
+ if (tr >=_characteristic ) tr = tr % _characteristic ;
+ if (tr)
+ r[i] = _pol2log[ _characteristic - tr ];
+ else
+ r[i] = 0;
+ } else {
+ if (tr >=_characteristic ) tr = tr % _characteristic ;
+ r[i] = _pol2log[ tr ];
+ }
+ }
+ }
+
+ template<typename TT>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::dotprod
+ ( Rep& r, const size_t sz, constArray a, constArray b ) const
+ {
+ if (sz) {
+ _GIVARO_GFQ_MUL(r,a[0],b[0],_qm1);
+ Rep tmp;
+ for( int i= sz; --i; ) {
+ _GIVARO_GFQ_MUL(tmp,a[i],b[i],_qm1);
+ _GIVARO_GFQ_ADD(r,r,tmp,_qm1,_plus1);
+ }
+ return r;
+ } else
+ return r = zero;
+ }
+
+
+ // ----- random generators
+ template<typename TT> template<typename RandIter> inline typename GFqDom<TT>::Rep& GFqDom<TT>::nonzerorandom(RandIter& g, Rep& a) const
+ {
+ // do
+ // a = Rep( (UTT)(lrand48()) % _q);
+ // while (isZero(a));
+ // a = (a<0?a+_q:a);
+ // return a;
+ a = Rep( ((UTT)(g()) % (_q-1)) + 1);
+ return a = (a<0?a+_q:a);
+
+ }
+
+ template<typename TT> template<typename RandIter> inline typename GFqDom<TT>::Rep& GFqDom<TT>::random(RandIter& g, Rep& a) const
+ {
+ a = Rep( (UTT)(g()) % _q);
+ return a = (a<0?a+_q:a);
+ }
+
+ template<typename TT> template<typename RandIter>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::random(RandIter& g, Rep& r, long s) const
+ {
+ return random(g,r);
+ }
+
+
+ template<typename TT> template<typename RandIter>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::random(RandIter& g, Rep& r, const Rep& b) const
+ {
+ return random(g,r);
+ }
+
+ template<typename TT> template<typename RandIter>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::nonzerorandom(RandIter& g, Rep& r, long s) const
+ {
+ return nonzerorandom(g,r);
+ }
+
+ template<typename TT> template<typename RandIter>
+ inline typename GFqDom<TT>::Rep& GFqDom<TT>::nonzerorandom(RandIter& g, Rep& r, const Rep& b) const
+ {
+ return nonzerorandom(g,r);
+ }
+
+
+
+
+ template<typename TT>
+ inline GFqDom<TT>::GFqDom(const UTT P, const UTT e)
+ // Precondition P prime
+ : zero(0)
+ , one (power(P,e) - 1 )
+ , _characteristic(P)
+ , _exponent(e)
+ , _q( one + 1 )
+ , _qm1 ( one )
+ , _qm1o2( (P==2)? (one) : (_q >> 1) ) // 1 == -1 in GF(2^k)
+ , _log2pol( _q )
+ , _pol2log( _q )
+ , _plus1( _q )
+ , _dcharacteristic( (double)P )
+ {
+
+ // 1 is represented by q-1, zero by 0
+ _log2pol[0] = zero;
+
+ if (e <= 1) {
+ IntNumTheoDom<> NTD;
+ IntNumTheoDom<>::Rep IP(P), pr;
+ // UTT seed = (UTT) ( NTD.Integer2long( NTD.lowest_prim_root(pr, IP) ) );
+ UTT seed;
+ NTD.convert(seed, NTD.lowest_prim_root(pr, IP) );
+ UTT accu = 1;
+ for(UTT i=1; i<P; i++) {
+ accu = (accu * seed) % P;
+ _log2pol[i] = accu;
+ }
+ } else {
+ // Fisrt compute an irreductible polynomial F over Z/pZ of degree e
+ // Then a primitive root G (i.e. a generator of GF(q))
+ GFqDom<TT> Zp(P,1);
+ // typedef CyclotomicTable< GFqDom<TT>, Dense > PolDom;
+ // PolDom Pdom( Zp, e );
+ typedef Poly1FactorDom< Self_t, Dense > PolDom;
+ PolDom Pdom( Zp );
+ typename PolDom::Element F, G, H;
+
+ // F is irreducible of degree e over Zp
+ // G is a primitive polynomial for F
+ // Pdom.random_prim_root(F,G, Degree(e));
+
+ // F is an irreducible factor of the
+ // (p^e-1) th cyclotomic polynomial
+ // G is a primitive polynomial for F : X
+ // Pdom.getcyclo(F);
+ // Pdom.init(G, Degree(1), Zp.one);
+
+ // F is irreducible of degree e over Zp
+ // with X as a primitive polynomial
+#ifndef GIVARO_RANDOM_IRREDUCTIBLE_PRIMITIVE_ROOT
+ Pdom.ixe_irreducible(F, Degree(e));
+ // Pdom.init(G, Degree(1), Zp.one);
+ // Pdom.assign(G, Degree(1), Zp.one);
+ Pdom.init(G, Degree(1));
+#else
+ Pdom.random_irreducible(F, Degree(e));
+ Pdom.give_random_prim_root(G,F);
+#endif
-template<typename TT>
-inline Integer& GFqDom<TT>::convert (Integer& r, const Rep a) const
-{
- return r = (Integer)_log2pol[ (UTT)a] ;
-}
+ Pdom.assign(H, G);
+
+ typedef Poly1PadicDom< GFqDom<TT>, Dense > PadicDom;
+ PadicDom PAD(Pdom);
+
+ PAD.eval(_log2pol[1], H);
+ PAD.eval(_irred, F);
+
+ for (UTT i = 2; i < _qm1; ++i) {
+ Pdom.mulin(H, G);
+ Pdom.modin(H, F);
+ PAD.eval(_log2pol[i], H);
+ }
+
+ _log2pol[_qm1] = 1;
+
+ }
+ _log2pol[0] = 0;
-// ---------
-// -- Initialization operations
-// ---------
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r) const { return r = zero; }
-
-
-template<typename TT>
-template<typename val_t, template<class, class> class Vector, template <class> class Alloc>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::init( Rep& r, const Vector<val_t, Alloc<val_t> >& P) {
- static Self_t PrimeField(this->_characteristic);
- typedef Poly1Dom< Self_t, Dense > PolDom;
- static PolDom Pdom( PrimeField );
- typedef Poly1PadicDom< GFqDom<TT>, Dense > PadicDom;
- static PadicDom PAD(Pdom);
- Degree d; Pdom.degree(d, P);
- if (d >= this->_exponent) {
- static typename PadicDom::Element tmp;
- static typename PadicDom::Element Irreducible = PAD.radix(tmp, this->_irred);
- // All this was to get the irreducible polynomial
- // Now we can mod it out
- typename PolDom::Element modP; Pdom.mod(modP, P, Irreducible);
- TT tr;
- PAD.eval(tr, modP);
- return r = this->_pol2log[ tr ];
- } else {
- TT tr;
- PAD.eval(tr, P);
- return r = this->_pol2log[ tr ];
- }
-}
+ // pol2log[ j ] = i such that log2pol[i] = j
+ for (UTT i = 0; i < _q; ++i)
+ _pol2log[ _log2pol[i] ] = i;
+ // plus1[i] = k such that G^i + 1 = G^k
+ // WARNING : in the plus1 table, we now pre-substract (_q - 1)
+ _plus1[0] = 0;
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::assign( Rep& r, const Integer a) const { return init (r, a); }
-
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::assign( Rep& r, const Rep a) const { return r = a; }
-
-
-template<typename TT> inline void GFqDom<TT>::assign( const size_t sz, Array r, constArray a ) const {
- TT tr;
-// for (register size_t i=sz-1; i!=0; --i) {
- for (register size_t i=sz; i--;) {
- tr = a[i] ;
- if (tr <0) {
- // -a = b [p]
- // a = p-b [p]
- tr = -tr;
- if (tr >=_characteristic ) tr = tr % _characteristic ;
- if (tr)
- r[i] = _pol2log[ _characteristic - tr ];
- else
- r[i] = 0;
- } else {
- if (tr >=_characteristic ) tr = tr % _characteristic ;
- r[i] = _pol2log[ tr ];
- }
- }
-}
+ UTT a,b,r;
+ for (UTT i = 1; i < _q; ++i) {
+ a = _log2pol[i];
+ r = a % P;
+ if (r == (P - 1))
+ b = a - r;
+ else
+ b = a + 1;
+ // WARNING : in the plus1 table we pre-substract (_q - 1)
+ _plus1[i] = _pol2log[b] - _qm1;
+ }
+ // -1 + 1 == 0
+ _plus1[_qm1o2] = 0;
+ }
-template<typename TT>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::dotprod
- ( Rep& r, const size_t sz, constArray a, constArray b ) const
-{
- if (sz) {
- _GIVARO_GFQ_MUL(r,a[0],b[0],_qm1);
- Rep tmp;
- for( register int i= sz-1; i>0; --i) {
- _GIVARO_GFQ_MUL(tmp,a[i],b[i],_qm1);
- _GIVARO_GFQ_ADD(r,r,tmp,_qm1,_plus1);
- }
- return r;
- } else
- return r = zero;
-}
+ // Dan Roche 6-15-04, adapted my/ported back to Givaro
+ // by Martin Albrecht 10-06-06
+ // This constructor takes a vector of ints that represent the polynomial
+ // to use (for modular arithmetic on the extension field).
+ template<typename TT>
+ inline GFqDom<TT>::GFqDom(const UTT P, const UTT e, const std::vector<UTT>& modPoly):
+ zero(0)
+ , one (power(P,e) - 1 )
+ , _characteristic(P)
+ , _exponent(e)
+ , _q( one + 1 )
+ , _qm1 ( one )
+ , _qm1o2( (P==2)? (one) : (_q >> 1) ) // 1 == -1 in GF(2^k)
+ , _log2pol( _q )
+ , _pol2log( _q )
+ , _plus1( _q )
+ , _dcharacteristic( (double)P )
+ {
-
- // ----- random generators
-template<typename TT> template<typename RandIter> inline typename GFqDom<TT>::Rep& GFqDom<TT>::nonzerorandom(RandIter& g, Rep& a) const {
-// do
-// a = Rep( (UTT)(lrand48()) % _q);
-// while (isZero(a));
-// a = (a<0?a+_q:a);
-// return a;
- a = Rep( ((UTT)(g()) % (_q-1)) + 1);
- return a = (a<0?a+_q:a);
-
-}
+ // 1 is represented by q-1, zero by 0
+ _log2pol[0] = zero;
-template<typename TT> template<typename RandIter> inline typename GFqDom<TT>::Rep& GFqDom<TT>::random(RandIter& g, Rep& a) const {
- a = Rep( (UTT)(g()) % _q);
- return a = (a<0?a+_q:a);
-}
-
-template<typename TT> template<typename RandIter>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::random(RandIter& g, Rep& r, long s) const {
- return random(g,r);
-}
+ GFqDom<TT> Zp(P,1);
+ typedef Poly1FactorDom< GFqDom<TT>, Dense > PolDom;
+ PolDom Pdom( Zp );
+ typename PolDom::Element Ft, F, G, H;
-
-template<typename TT> template<typename RandIter>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::random(RandIter& g, Rep& r, const Rep& b) const {
- return random(g,r);
-}
+ typename PolDom::Element tempVector(e+1);
+ for( int i = 0; i < e+1; i++ )
+ Zp.init( tempVector[i], modPoly[i]);
+ Pdom.assign( F, tempVector );
-template<typename TT> template<typename RandIter>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::nonzerorandom(RandIter& g, Rep& r, long s) const {
- return nonzerorandom(g,r);
-}
+ Pdom.give_prim_root(G,F);
+ Pdom.assign(H,G);
-template<typename TT> template<typename RandIter>
-inline typename GFqDom<TT>::Rep& GFqDom<TT>::nonzerorandom(RandIter& g, Rep& r, const Rep& b) const {
- return nonzerorandom(g,r);
-}
+ typedef Poly1PadicDom< GFqDom<TT>, Dense > PadicDom;
+ PadicDom PAD(Pdom);
+ PAD.eval(_log2pol[1],H);
+ for (UTT i = 2; i < _qm1; ++i) {
+ Pdom.mulin(H, G);
+ Pdom.modin(H, F);
+ PAD.eval(_log2pol[i], H);
+ }
+ _log2pol[_qm1] = 1;
-// ==========================================================================
-// file: givgfq.C
-// Time-stamp: <20 Dec 99 11:18:32 Jean-Guillaume.Dumas at imag.fr>
-// ==========================================================================
-// #include "givgfq.h"
-#ifndef __GIVARO_GFQ_C__
-#define __GIVARO_GFQ_C__
+ _log2pol[0] = 0;
-#include <givaro/givinteger.h>
-#include <givaro/givintnumtheo.h>
-#include <givaro/givpower.h>
+ for (UTT i = 0; i < _q; ++i)
+ _pol2log[ _log2pol[i] ] = i;
+
+ _plus1[0] = 0;
+
+ UTT a,b,r;
+ for (UTT i = 1; i < _q; ++i) {
+ a = _log2pol[i];
+ r = a % P;
+ if (r == (P - 1))
+ b = a - r;
+ else
+ b = a + 1;
+ _plus1[i] = _pol2log[b] - _qm1;
+ }
+
+ _plus1[_qm1o2] = 0;
+ }
-#include <vector>
-template<typename TT>
-inline GFqDom<TT>::GFqDom(const UTT P, const UTT e)
- // Precondition P prime
- : zero(0)
- , one (power(P,e) - 1 )
- , _characteristic(P)
- , _exponent(e)
- , _q( one + 1 )
- , _qm1 ( one )
- , _qm1o2( (P==2)? (one) : (_q >> 1) ) // 1 == -1 in GF(2^k)
- , _log2pol( _q )
- , _pol2log( _q )
- , _plus1( _q )
- , _dcharacteristic( (double)P )
-{
-
-
- // 1 is represented by q-1, zero by 0
- _log2pol[0] = zero;
-
- if (e <= 1) {
- IntNumTheoDom<> NTD;
- IntNumTheoDom<>::Rep IP(P), pr;
-// UTT seed = (UTT) ( NTD.Integer2long( NTD.lowest_prim_root(pr, IP) ) );
- UTT seed;
- NTD.convert(seed, NTD.lowest_prim_root(pr, IP) );
- UTT accu = 1;
- for(UTT i=1; i<P; i++) {
- accu = (accu * seed) % P;
- _log2pol[i] = accu;
- }
- } else {
- // Fisrt compute an irreductible polynomial F over Z/pZ of degree e
- // Then a primitive root G (i.e. a generator of GF(q))
- GFqDom<TT> Zp(P,1);
-// typedef CyclotomicTable< GFqDom<TT>, Dense > PolDom;
-// PolDom Pdom( Zp, e );
- typedef Poly1FactorDom< Self_t, Dense > PolDom;
- PolDom Pdom( Zp );
- typename PolDom::Element F, G, H;
-
- // F is irreducible of degree e over Zp
- // G is a primitive polynomial for F
-// Pdom.random_prim_root(F,G, Degree(e));
-
- // F is an irreducible factor of the
- // (p^e-1) th cyclotomic polynomial
- // G is a primitive polynomial for F : X
-// Pdom.getcyclo(F);
-// Pdom.init(G, Degree(1), Zp.one);
-
- // F is irreducible of degree e over Zp
- // with X as a primitive polynomial
-#ifndef GIVARO_RANDOM_IRREDUCTIBLE_PRIMITIVE_ROOT
- Pdom.ixe_irreducible(F, Degree(e));
- Pdom.init(G, Degree(1), Zp.one);
-#else
- Pdom.random_irreducible(F, Degree(e));
- Pdom.give_random_prim_root(G,F);
-#endif
- Pdom.assign(H, G);
-
- typedef Poly1PadicDom< GFqDom<TT>, Dense > PadicDom;
- PadicDom PAD(Pdom);
-
- PAD.eval(_log2pol[1], H);
- PAD.eval(_irred, F);
-
- for (UTT i = 2; i < _qm1; ++i) {
- Pdom.mulin(H, G);
- Pdom.modin(H, F);
- PAD.eval(_log2pol[i], H);
- }
-
- _log2pol[_qm1] = 1;
-
- }
-
- _log2pol[0] = 0;
-
- // pol2log[ j ] = i such that log2pol[i] = j
- for (UTT i = 0; i < _q; ++i)
- _pol2log[ _log2pol[i] ] = i;
-
- // plus1[i] = k such that G^i + 1 = G^k
- // WARNING : in the plus1 table, we now pre-substract (_q - 1)
- _plus1[0] = 0;
-
- UTT a,b,r;
- for (UTT i = 1; i < _q; ++i) {
- a = _log2pol[i];
- r = a % P;
- if (r == (P - 1))
- b = a - r;
- else
- b = a + 1;
- // WARNING : in the plus1 table we pre-substract (_q - 1)
- _plus1[i] = _pol2log[b] - _qm1;
- }
- // -1 + 1 == 0
- _plus1[_qm1o2] = 0;
-}
-
-// Dan Roche 6-15-04, adapted my/ported back to Givaro
-// by Martin Albrecht 10-06-06
-// This constructor takes a vector of ints that represent the polynomial
-// to use (for modular arithmetic on the extension field).
-template<typename TT>
- inline GFqDom<TT>::GFqDom(const UTT P, const UTT e, const std::vector<UTT>& modPoly):
- zero(0)
- , one (power(P,e) - 1 )
- , _characteristic(P)
- , _exponent(e)
- , _q( one + 1 )
- , _qm1 ( one )
- , _qm1o2( (P==2)? (one) : (_q >> 1) ) // 1 == -1 in GF(2^k)
- , _log2pol( _q )
- , _pol2log( _q )
- , _plus1( _q )
- , _dcharacteristic( (double)P )
-{
-
- // 1 is represented by q-1, zero by 0
- _log2pol[0] = zero;
-
- GFqDom<TT> Zp(P,1);
- typedef Poly1FactorDom< GFqDom<TT>, Dense > PolDom;
- PolDom Pdom( Zp );
- typename PolDom::Element Ft, F, G, H;
-
- typename PolDom::Element tempVector(e+1);
- for( int i = 0; i < e+1; i++ )
- Zp.init( tempVector[i], modPoly[i]);
- Pdom.assign( F, tempVector );
-
- Pdom.give_prim_root(G,F);
- Pdom.assign(H,G);
-
- typedef Poly1PadicDom< GFqDom<TT>, Dense > PadicDom;
- PadicDom PAD(Pdom);
-
- PAD.eval(_log2pol[1],H);
-
- for (UTT i = 2; i < _qm1; ++i) {
- Pdom.mulin(H, G);
- Pdom.modin(H, F);
- PAD.eval(_log2pol[i], H);
- }
- _log2pol[_qm1] = 1;
-
- _log2pol[0] = 0;
-
- for (UTT i = 0; i < _q; ++i)
- _pol2log[ _log2pol[i] ] = i;
-
- _plus1[0] = 0;
-
- UTT a,b,r;
- for (UTT i = 1; i < _q; ++i) {
- a = _log2pol[i];
- r = a % P;
- if (r == (P - 1))
- b = a - r;
- else
- b = a + 1;
- _plus1[i] = _pol2log[b] - _qm1;
- }
-
- _plus1[_qm1o2] = 0;
-}
-
-
-
-
-template<typename TT> inline void GFqDom<TT>::Init() {}
-
-template<typename TT> inline void GFqDom<TT>::End() {}
+ template<typename TT> inline void GFqDom<TT>::Init() {}
+
+ template<typename TT> inline void GFqDom<TT>::End() {}
#ifdef __GIVARO_COUNT__
-template<typename TT> long long GFqDom<TT>::_mul_count = 0;
-template<typename TT> long long GFqDom<TT>::_add_count = 0;
-template<typename TT> long long GFqDom<TT>::_div_count = 0;
-template<typename TT> long long GFqDom<TT>::_sub_count = 0;
-template<typename TT> long long GFqDom<TT>::_neg_count = 0;
-template<typename TT> long long GFqDom<TT>::_inv_count = 0;
-template<typename TT> long long GFqDom<TT>::_mul_call = 0;
-template<typename TT> long long GFqDom<TT>::_add_call = 0;
-template<typename TT> long long GFqDom<TT>::_div_call = 0;
-template<typename TT> long long GFqDom<TT>::_sub_call = 0;
-template<typename TT> long long GFqDom<TT>::_neg_call = 0;
-template<typename TT> long long GFqDom<TT>::_inv_call = 0;
+ template<typename TT> long long GFqDom<TT>::_mul_count = 0;
+ template<typename TT> long long GFqDom<TT>::_add_count = 0;
+ template<typename TT> long long GFqDom<TT>::_div_count = 0;
+ template<typename TT> long long GFqDom<TT>::_sub_count = 0;
+ template<typename TT> long long GFqDom<TT>::_neg_count = 0;
+ template<typename TT> long long GFqDom<TT>::_inv_count = 0;
+ template<typename TT> long long GFqDom<TT>::_mul_call = 0;
+ template<typename TT> long long GFqDom<TT>::_add_call = 0;
+ template<typename TT> long long GFqDom<TT>::_div_call = 0;
+ template<typename TT> long long GFqDom<TT>::_sub_call = 0;
+ template<typename TT> long long GFqDom<TT>::_neg_call = 0;
+ template<typename TT> long long GFqDom<TT>::_inv_call = 0;
#endif
-#endif
+} // namespace Givaro
-
+#endif // __GIVARO_gfq_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givgfqext.h b/src/kernel/zpz/givgfqext.h
index 31bed84..ed14c17 100644
--- a/src/kernel/zpz/givgfqext.h
+++ b/src/kernel/zpz/givgfqext.h
@@ -1,20 +1,24 @@
-#ifndef _GIVARO_GFQ_EXTENSION_H_
-#define _GIVARO_GFQ_EXTENSION_H_
-
// ==========================================================================
-// file: givgfqext.h
-// Time-stamp: <26 May 08 10:01:26 Jean-Guillaume.Dumas at imag.fr>
-// (c) Givaro Team
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// file: givgfqext.h
+// Time-stamp: <29 Sep 09 18:10:13 Jean-Guillaume.Dumas at imag.fr>
// date: 2007
-// version:
+// version:
// author: Jean-Guillaume.Dumas
-// Description:
-// Arithmetic on GF(p^k), with p a prime number less than 2^15
-// WARNING : k strictly greater than 1
-// Specialized for fast conversions to floating point numbers
-// See [JG Dumas, Q-adic Transform Revisited, ISSAC 2008]
-// Main difference in interface is init/convert
-// ==========================================================================
+
+/*! @brief Arithmetic on GF(p^k), with p a prime number less than 2^15.
+ * Specialized for fast conversions to floating point numbers.
+ * Main difference in interface is init/convert.
+ * @bib [JG Dumas, Q-adic Transform Revisited, ISSAC 2008]
+ * @warning k strictly greater than 1
+ */
+
+#ifndef __GIVARO_gfq_extension_H
+#define __GIVARO_gfq_extension_H
#include "givaro/givgfq.h"
#include "givaro/givpower.h"
@@ -22,288 +26,305 @@
#include <vector>
#include <deque>
-// init with preconditions, bad entry could segfault
-template<class TT> class GFqExtFast;
-
-// init defensive, bad entry are transformed, to the cost of slowdown
-template<class TT> class GFqExt;
-
-
-template<class TT> class GFqExtFast : public GFqDom<TT> {
-protected:
- typedef typename Signed_Trait<TT>::unsigned_type UTT;
- typedef TT Rep;
- typedef GFqDom<TT> Father_t;
-
- UTT _BITS; // the q-adic transform will be with q=2^_BITS
- UTT _BASE; // this is 2^_BITS
- UTT _MASK; // 2^_BITS - 1
- UTT _maxn; // Worst case Maximal number of multiplications
- // without reduction
- UTT _degree;// exponent-1
- UTT _pceil; // smallest such that characteristic<2^_pceil,
- // used for fast for table indexing
- UTT _MODOUT;// Largest accepted double for init
-
- // Conversion tables from exponent to double z-adic representation
- std::vector<double> _log2dbl; // Exponent to double
- std::vector<UTT> _high2log; // Half double to exponent
- std::vector<UTT> _low2log; // Other half in Time-Memory Trade-Off
-
-
-public:
- typedef GFqExtFast<TT> Self_t;
-
- typedef Rep Element;
- typedef UTT Residu_t;
-
- typedef Rep* Array;
- typedef const Rep* constArray;
-
- typedef GIV_randIter< GFqExtFast<TT> , Rep> RandIter;
-
- GFqExtFast(): Father_t(), balanced(false) {}
-
- // Extension MUST be a parameter of the constructor
- GFqExtFast( const UTT P, const UTT e) : Father_t(P,e),
- _BITS( std::numeric_limits< double >::digits/( (e<<1)-1) ),
- _BASE(1 << _BITS),
- _MASK( _BASE - 1),
- _maxn( _BASE/(P-1)/(P-1)/e),
- _degree( e-1 ),
- balanced(false)
- {
-
- GIVARO_ASSERT(_maxn>0 , "[GFqExtFast]: field too large");
- builddoubletables();
-
- }
-
- virtual ~GFqExtFast() {};
-
- Self_t operator=( const Self_t& F)
- {
- this->zero = F.zero;
- this->one = F.one;
- this->_characteristic = F._characteristic;
- this->_dcharacteristic = F._dcharacteristic;
- this->_exponent = F._exponent;
- this->_q = F._q;
- this->_qm1 = F._qm1;
- this->_qm1o2 = F._qm1o2;
- this->_log2pol = F._log2pol;
- this->_pol2log = F._pol2log;
- this->_plus1 = F._plus1;
- this->_BITS = F._BITS;
- this->_BASE = F._BASE;
- this->_MASK = F._MASK;
- this->_maxn = F._maxn;
- this->_degree = F._degree;
- this->_log2dbl = F._log2dbl;
- this->_low2log = F._low2log;
- this->_high2log = F._high2log;
- return *this;
- }
-
- GFqExtFast( const GFqDom<TT>& F) : Father_t(F),
- _BITS( F._BITS ), _BASE( F._BASE ),_MASK( F._MASK ),
- _maxn( F._maxn ),_degree( F._degree ),
- _log2dbl ( F._log2dbl ), _low2log( F._low2log ),
- _high2log (F._high2log ), balanced(false) {
- }
-
- // Accesses
-
- UTT bits() const { return _BITS;}
- UTT base() const { return _BASE;}
- UTT mask() const { return _MASK;}
- UTT maxdot() const { return _maxn; }
- UTT& characteristic(UTT& a) const { return a=this->_characteristic; }
- const bool balanced;
-
- Rep& init( Rep& r, const unsigned long l) const {
- return Father_t::init(r,l);
- }
-
-
- using Father_t::init;
-
-
- virtual double& convert(double& d, const Rep a) const {
- return d=_log2dbl[a];
- }
-
- virtual float& convert(float& d, const Rep a) const {
- return d=(float)_log2dbl[a];
- }
-
- virtual Rep& init(Rep& pad, const double d) const {
- // WARNING WARNING WARNING WARNING
- // Precondition : 0 <= d < _MODOUT
- // Can segfault if d is too large
- // WARNING WARNING WARNING WARNING
- unsigned __GIVARO_INT64 rll( static_cast<__GIVARO_INT64>(d) );
- unsigned __GIVARO_INT64 tll( static_cast<__GIVARO_INT64>(d/this->_dcharacteristic) );
- UTT prec(0);
- UTT padl = (UTT)(rll - tll*this->_characteristic);
- if (padl == this->_characteristic) {
- padl -= this->_characteristic;
- tll += 1;
- }
- for(size_t j = 0;j<_degree;++j) {
- rll >>= _BITS;
- tll >>= _BITS;
- prec = (UTT)(rll-tll*this->_characteristic);
-
- padl <<= _pceil;
- padl ^= prec;
- }
-
- pad = prec;
- for(size_t j = 0;j<_degree;++j) {
- rll >>= _BITS;
- tll >>= _BITS;
- prec = (UTT)(rll-tll*this->_characteristic);
-
- pad <<= _pceil;
- pad ^= prec;
- }
-
- padl = this->_low2log[padl];
- pad = this->_high2log[pad];
- return this->addin(pad,padl);
- }
-
- virtual Rep& init(Rep& pad, const float d) const {
- return init(pad, (double)d);
- }
-
-
-
-
-protected:
-
- void builddoubletables() {
- _log2dbl.resize(this->_log2pol.size());
- _pceil = 1;
- for(unsigned long ppow = 2; ppow < this->_characteristic; ppow <<= 1,++_pceil) {}
- unsigned long powersize = 1<<(_pceil * this->_exponent);
- _MODOUT = powersize - 1;
- _high2log.resize(powersize);
- _low2log.resize(powersize);
-
-
-
- typedef typename Father_t::Element ZElem;
- Father_t Zp(this->_characteristic,1);
- ZElem q,mq; Zp.init(q,2UL);
- dom_power(q,q,_BITS,Zp);
- Zp.neg(mq,q);
-
- Element xkmu;
- // This is X
- xkmu = this->_pol2log[this->_characteristic];
- // This is X^{e-1}
- dom_power(xkmu,xkmu,this->_exponent-1,*this);
-
-
-
- typedef Poly1FactorDom< Father_t, Dense > PolDom;
- PolDom Pdom( Zp );
-
- typedef Poly1PadicDom< Father_t, Dense > PadicDom;
- PadicDom PAD(Pdom);
-
- Father_t Z2B(2,_BITS);
- PolDom P2dom( Z2B );
- PadicDom P2AD( P2dom );
-
- std::vector<double>::iterator dblit = _log2dbl.begin();
- typename std::vector<UTT>::const_iterator polit = this->_log2pol.begin();
-
-
- for( ; polit != this->_log2pol.end(); ++polit, ++dblit) {
-
- std::vector<double> vect;
- std::deque<ZElem> low_ui;
-
- P2AD.evaldirect( *dblit,
- PAD.radixdirect(
- vect,
- (double)(*polit),
- this->_exponent)
- );
-
- unsigned long binpolit = static_cast<unsigned long>(vect[0]);
- for(size_t i =1; i<this->_exponent; ++i) {
- binpolit <<= _pceil;
- binpolit += static_cast<unsigned long>(vect[i]);
- }
-
- ZElem tmp, prec, cour;
- Zp.init(prec, vect[0]);
- for(size_t i = 1; i<this->_exponent; ++i) {
- Zp.init(cour, vect[i]);
- Zp.axpy(tmp, mq, cour, prec);
- low_ui.push_back(tmp);
- prec = cour;
- }
-
- PAD.eval(tmp , low_ui );
- _low2log[binpolit] = this->_pol2log[tmp];
-
- low_ui.push_back(cour);
- PAD.eval( tmp, low_ui);
- Father_t::mul((Element&)_high2log[binpolit],(Element)this->_pol2log[tmp], xkmu);
- }
- }
-};
-
-
-
-
-template<class TT> class GFqExt : public GFqExtFast<TT> {
-protected:
- typedef typename Signed_Trait<TT>::unsigned_type UTT;
- typedef TT Rep;
- typedef GFqDom<TT> Father_t;
- typedef GFqExtFast<TT> DirectFather_t;
-
- double _fMODOUT;
-
-public:
- typedef GFqExt<TT> Self_t;
-
- typedef Rep Element;
- typedef UTT Residu_t;
-
- typedef Rep* Array;
- typedef const Rep* constArray;
-
- typedef GIV_randIter< GFqExt<TT> , Rep> RandIter;
-
- GFqExt(): DirectFather_t(),
- _fMODOUT(static_cast<double>(this->_MODOUT)) {}
-
- GFqExt( const UTT P, const UTT e) :
- DirectFather_t(P,e),
- _fMODOUT(static_cast<double>(this->_MODOUT)) {}
-
- GFqExt( const GFqDom<TT>& F) :
- DirectFather_t(F),
- _fMODOUT(static_cast<double>(this->_MODOUT)) {}
-
- ~GFqExt() {}
-
- using Father_t::init;
-
- virtual Rep& init(Rep& pad, const double d) const {
- // Defensive init
- const double tmp(fmod(d,this->_fMODOUT));
- return DirectFather_t::init(pad, (tmp>0.0)?tmp:(tmp+_fMODOUT) );
- }
-};
-
-
-
-#endif
+namespace Givaro {
+
+ // init with preconditions, bad entry could segfault
+ template<class TT> class GFqExtFast;
+
+ // init defensive, bad entry are transformed, to the cost of slowdown
+ template<class TT> class GFqExt;
+
+
+ template<class TT> class GFqExtFast : public GFqDom<TT> {
+ protected:
+ typedef typename Signed_Trait<TT>::unsigned_type UTT;
+ typedef TT Rep;
+ typedef GFqDom<TT> Father_t;
+
+ UTT _BITS; // the q-adic transform will be with q=2^_BITS
+ UTT _BASE; // this is 2^_BITS
+ UTT _MASK; // 2^_BITS - 1
+ UTT _maxn; // Worst case Maximal number of multiplications
+ // without reduction
+ UTT _degree;// exponent-1
+ UTT _pceil; // smallest such that characteristic<2^_pceil,
+ // used for fast for table indexing
+ UTT _MODOUT;// Largest accepted double for init
+
+ // Conversion tables from exponent to double z-adic representation
+ std::vector<double> _log2dbl; // Exponent to double
+ std::vector<UTT> _high2log; // Half double to exponent
+ std::vector<UTT> _low2log; // Other half in Time-Memory Trade-Off
+
+
+ public:
+ typedef GFqExtFast<TT> Self_t;
+
+ typedef Rep Element;
+ typedef UTT Residu_t;
+
+ typedef Rep* Array;
+ typedef const Rep* constArray;
+
+ typedef GIV_randIter< GFqExtFast<TT> , Rep> RandIter;
+
+ GFqExtFast(): Father_t(), balanced(false) {}
+
+ // Extension MUST be a parameter of the constructor
+ GFqExtFast( const UTT P, const UTT e) : Father_t(P,e),
+ _BITS( std::numeric_limits< double >::digits/( (e<<1)-1) ),
+ _BASE(1 << _BITS),
+ _MASK( _BASE - 1),
+ _maxn( _BASE/(P-1)/(P-1)/e),
+ _degree( e-1 ),
+ balanced(false)
+ {
+
+ GIVARO_ASSERT(_maxn>0 , "[GFqExtFast]: field too large");
+ builddoubletables();
+
+ }
+
+ virtual ~GFqExtFast() {};
+
+ Self_t operator=( const Self_t& F)
+ {
+ this->zero = F.zero;
+ this->one = F.one;
+ this->_characteristic = F._characteristic;
+ this->_dcharacteristic = F._dcharacteristic;
+ this->_exponent = F._exponent;
+ this->_q = F._q;
+ this->_qm1 = F._qm1;
+ this->_qm1o2 = F._qm1o2;
+ this->_log2pol = F._log2pol;
+ this->_pol2log = F._pol2log;
+ this->_plus1 = F._plus1;
+ this->_BITS = F._BITS;
+ this->_BASE = F._BASE;
+ this->_MASK = F._MASK;
+ this->_maxn = F._maxn;
+ this->_degree = F._degree;
+ this->_log2dbl = F._log2dbl;
+ this->_low2log = F._low2log;
+ this->_high2log = F._high2log;
+ return *this;
+ }
+
+ GFqExtFast( const GFqDom<TT>& F) : Father_t(F),
+ _BITS( F._BITS ), _BASE( F._BASE ),_MASK( F._MASK ),
+ _maxn( F._maxn ),_degree( F._degree ),
+ _log2dbl ( F._log2dbl ), _low2log( F._low2log ),
+ _high2log (F._high2log ), balanced(false) {
+ }
+
+ // Accesses
+
+ UTT bits() const
+{ return _BITS;}
+ UTT base() const
+{ return _BASE;}
+ UTT mask() const
+{ return _MASK;}
+ UTT maxdot() const
+{ return _maxn; }
+ UTT& characteristic(UTT& a) const
+{ return a=this->_characteristic; }
+ UTT characteristic() const
+{ return this->_characteristic; }
+ const bool balanced;
+
+ Rep& init( Rep& r, const unsigned long l) const
+{
+ return Father_t::init(r,l);
+ }
+
+
+ using Father_t::init;
+
+
+ virtual double& convert(double& d, const Rep a) const
+{
+ return d=_log2dbl[a];
+ }
+
+ virtual float& convert(float& d, const Rep a) const
+{
+ return d=(float)_log2dbl[a];
+ }
+
+ virtual Rep& init(Rep& pad, const double d) const
+{
+ // WARNING WARNING WARNING WARNING
+ // Precondition : 0 <= d < _MODOUT
+ // Can segfault if d is too large
+ // WARNING WARNING WARNING WARNING
+ unsigned __GIVARO_INT64 rll( static_cast<__GIVARO_INT64>(d) );
+ unsigned __GIVARO_INT64 tll( static_cast<__GIVARO_INT64>(d/this->_dcharacteristic) );
+ UTT prec(0);
+ UTT padl = (UTT)(rll - tll*this->_characteristic);
+ if (padl == this->_characteristic) {
+ padl -= this->_characteristic;
+ tll += 1;
+ }
+ for(size_t j = 0;j<_degree;++j) {
+ rll >>= _BITS;
+ tll >>= _BITS;
+ prec = (UTT)(rll-tll*this->_characteristic);
+
+ padl <<= _pceil;
+ padl ^= prec;
+ }
+
+ pad = prec;
+ for(size_t j = 0;j<_degree;++j) {
+ rll >>= _BITS;
+ tll >>= _BITS;
+ prec = (UTT)(rll-tll*this->_characteristic);
+
+ pad <<= _pceil;
+ pad ^= prec;
+ }
+
+ padl = this->_low2log[padl];
+ pad = this->_high2log[pad];
+ return this->addin(pad,padl);
+ }
+
+ virtual Rep& init(Rep& pad, const float d) const
+{
+ return init(pad, (double)d);
+ }
+
+
+
+
+ protected:
+
+ void builddoubletables()
+ {
+ _log2dbl.resize(this->_log2pol.size());
+ _pceil = 1;
+ for(unsigned long ppow = 2; ppow < this->_characteristic; ppow <<= 1,++_pceil) {}
+ unsigned long powersize = 1<<(_pceil * this->_exponent);
+ _MODOUT = UTT(powersize - 1);
+ _high2log.resize(powersize);
+ _low2log.resize(powersize);
+
+
+
+ typedef typename Father_t::Element ZElem;
+ Father_t Zp(this->_characteristic,1);
+ ZElem q,mq; Zp.init(q,2UL);
+ dom_power(q,q,_BITS,Zp);
+ Zp.neg(mq,q);
+
+ Element xkmu;
+ // This is X
+ xkmu = this->_pol2log[this->_characteristic];
+ // This is X^{e-1}
+ dom_power(xkmu,xkmu,this->_exponent-1,*this);
+
+
+
+ typedef Poly1FactorDom< Father_t, Dense > PolDom;
+ PolDom Pdom( Zp );
+
+ typedef Poly1PadicDom< Father_t, Dense > PadicDom;
+ PadicDom PAD(Pdom);
+
+ Father_t Z2B(2,_BITS);
+ PolDom P2dom( Z2B );
+ PadicDom P2AD( P2dom );
+
+ std::vector<double>::iterator dblit = _log2dbl.begin();
+ typename std::vector<UTT>::const_iterator polit = this->_log2pol.begin();
+
+
+ for( ; polit != this->_log2pol.end(); ++polit, ++dblit) {
+
+ std::vector<double> vect;
+ std::deque<ZElem> low_ui;
+
+ P2AD.evaldirect( *dblit,
+ PAD.radixdirect(
+ vect,
+ (double)(*polit),
+ this->_exponent)
+ );
+
+ unsigned long binpolit = static_cast<unsigned long>(vect[0]);
+ for(size_t i =1; i<this->_exponent; ++i) {
+ binpolit <<= _pceil;
+ binpolit += static_cast<unsigned long>(vect[i]);
+ }
+
+ ZElem tmp, prec, cour; Zp.init(cour);
+ Zp.init(prec, vect[0]);
+ for(size_t i = 1; i<this->_exponent; ++i) {
+ Zp.init(cour, vect[i]);
+ Zp.axpy(tmp, mq, cour, prec);
+ low_ui.push_back(tmp);
+ prec = cour;
+ }
+
+ PAD.eval(tmp , low_ui );
+ _low2log[binpolit] = this->_pol2log[tmp];
+
+ low_ui.push_back(cour);
+ PAD.eval( tmp, low_ui);
+ Father_t::mul((Element&)_high2log[binpolit],(Element)this->_pol2log[tmp], xkmu);
+ }
+ }
+ };
+
+
+
+
+ template<class TT> class GFqExt : public GFqExtFast<TT> {
+ protected:
+ typedef typename Signed_Trait<TT>::unsigned_type UTT;
+ typedef TT Rep;
+ typedef GFqDom<TT> Father_t;
+ typedef GFqExtFast<TT> DirectFather_t;
+
+ double _fMODOUT;
+
+ public:
+ typedef GFqExt<TT> Self_t;
+
+ typedef Rep Element;
+ typedef UTT Residu_t;
+
+ typedef Rep* Array;
+ typedef const Rep* constArray;
+
+ typedef GIV_randIter< GFqExt<TT> , Rep> RandIter;
+
+ GFqExt(): DirectFather_t(),
+ _fMODOUT(static_cast<double>(this->_MODOUT)) {}
+
+ GFqExt( const UTT P, const UTT e) :
+ DirectFather_t(P,e),
+ _fMODOUT(static_cast<double>(this->_MODOUT)) {}
+
+ GFqExt( const GFqDom<TT>& F) :
+ DirectFather_t(F),
+ _fMODOUT(static_cast<double>(this->_MODOUT)) {}
+
+ ~GFqExt() {}
+
+ using Father_t::init;
+
+ virtual Rep& init(Rep& pad, const double d) const
+{
+ // Defensive init
+ const double tmp(fmod(d,this->_fMODOUT));
+ return DirectFather_t::init(pad, (tmp>0.0)?tmp:(tmp+_fMODOUT) );
+ }
+ };
+
+} // namespace Givaro
+
+#endif // __GIVARO_gfq_extension_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givgfqkron.h b/src/kernel/zpz/givgfqkron.h
new file mode 100644
index 0000000..7ccfb80
--- /dev/null
+++ b/src/kernel/zpz/givgfqkron.h
@@ -0,0 +1,195 @@
+// ==========================================================================
+// Copyright(c)'1994-2010 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// file: givgfqkron.h
+// Time-stamp: <12 Apr 10 16:45:02 Jean-Guillaume.Dumas at imag.fr>
+// date: 2007
+// version:
+// author: Jean-Guillaume.Dumas
+
+/*! @file zpz/givgfqkron.h
+ * @ingroup zpz
+ * @brief Arithmetic on GF(p^k), with dynamic Kronecker substitution.
+ * @pre k(p-1)^2 < word size
+ */
+
+#ifndef __GIVARO_gfq_kronecker_H
+#define __GIVARO_gfq_kronecker_H
+
+#include "givaro/givgfq.h"
+#include "givaro/givpower.h"
+#include <limits>
+#include <vector>
+#include <deque>
+
+namespace Givaro {
+
+template<class TT, class Ints> struct GFqKronecker : public GFqDom<TT> {
+protected:
+ typedef typename Signed_Trait<TT>::unsigned_type UTT;
+ typedef TT Rep;
+ typedef GFqDom<TT> Father_t;
+
+public:
+ typedef GFqKronecker<TT,Ints> Self_t;
+
+ typedef Rep Element;
+ typedef UTT Residu_t;
+
+ typedef Rep* Array;
+ typedef const Rep* constArray;
+
+ typedef GIV_randIter< Father_t , Rep> RandIter;
+
+ GFqKronecker(): Father_t() {}
+
+ // Extension MUST be a parameter of the constructor
+ GFqKronecker( const UTT P, const UTT e) : Father_t(P,e), _degree(e-1),_epmunsq(e*(P-1)*(P-1)) {
+ buildsmalltables();
+ setShift(std::numeric_limits<UTT>::digits/( (e<<1)-1) );
+ }
+
+ // Set shifts, returns maxn
+ Ints setShift(const Ints& i) {
+ _SHIFTS=i;
+ _sBASE = Ints(1); _sBASE <<=_SHIFTS;
+ _sMASK = _sBASE - 1;
+ return _sMAXN = _sBASE / _epmunsq;
+ }
+
+ // Set maxn, returns shifts
+ UTT setMaxn(const Ints& n) {
+ _sMAXN = n;
+ Ints m = _sMAXN * _epmunsq;
+ _SHIFTS = 0;
+ for(_sBASE = 1; _sBASE < m; ++_SHIFTS, _sBASE<<=1);
+ _sMASK = _sBASE - 1;
+ return _SHIFTS;
+ }
+
+
+ virtual ~GFqKronecker() {};
+
+ using Father_t::init;
+ using Father_t::convert;
+
+ virtual Ints& convert(Ints& r, const Rep a) const {
+ // First Step
+ // from element to polynomial coefficient binary shifted
+ UTT binpol=_log2bin[a];
+ // Second step
+ // from a0|a1|...|ad
+ // to 0-0ad | ... | 0-0a1 | 0-0a0
+ r = binpol & _pMASK; // a0
+ for(size_t i=1; i<this->_exponent; ++i) {
+ r <<= _SHIFTS;
+ binpol >>= _pceil;
+ r |= ( binpol & _pMASK);
+ }
+ return r;
+ }
+
+
+
+ virtual Rep& init(Rep& a, const Ints r) const {
+ // WARNING: This could be speeded up with a REDQ transform
+
+ // First Step lower part
+ // from rd | ... | r1 | r0
+ // to a0|a1|...|ad
+ // where ai = ri mod p
+ Ints rs=r;
+ UTT binpolLOW = (UTT)( (rs & _sMASK) % this->_characteristic);
+ for(size_t i=1; i<this->_exponent; ++i) {
+ binpolLOW <<= _pceil;
+ rs >>= _SHIFTS;
+ binpolLOW |= (UTT)( (rs & _sMASK) % this->_characteristic);
+ }
+ // First Step upper part
+ rs >>= _SHIFTS;
+ UTT binpolHIGH = (UTT)( (rs & _sMASK) % this->_characteristic);
+ for(size_t i=1; i<this->_degree; ++i) {
+ binpolHIGH <<= _pceil;
+ rs >>= _SHIFTS;
+ binpolHIGH |= (UTT)( (rs & _sMASK) % this->_characteristic);
+ }
+ binpolHIGH <<= _pceil;
+
+ // Second step
+ // transform to element H*X^k+L
+ return this->axpy(a, _bin2log[binpolHIGH], _Xk, _bin2log[binpolLOW]);
+ }
+
+
+
+
+protected:
+ std::ostream& polywrite(std::ostream& out, const Element& a, const Indeter In= "B") const {
+ static ZpzDom<Integer> Zp(this->_characteristic);
+ static Poly1PadicDom<ZpzDom<Integer> > PAD(Zp ,In);
+ static Poly1PadicDom<ZpzDom<Integer> >::Element pol;
+ Integer r;
+ PAD.radixdirect(pol, this->convert(r, a), this->_exponent);
+ return PAD.write(out, pol);
+ }
+
+
+ void buildsmalltables() {
+ _log2bin.resize(this->_log2pol.size());
+ _pceil = 1;
+ for(unsigned long ppow = 2; ppow < this->_characteristic; ppow <<= 1,++_pceil) {}
+ _pMASK = (1<<_pceil) - 1;
+
+ Father_t Zp(this->_characteristic,1);
+ typedef Poly1FactorDom< Father_t, Dense > PolDom;
+ PolDom Pdom( Zp );
+ typedef Poly1PadicDom< Father_t, Dense > PadicDom;
+ PadicDom PAD(Pdom);
+
+ typename std::vector<UTT>::iterator binit = _log2bin.begin();
+ typename std::vector<UTT>::const_iterator polit = this->_log2pol.begin();
+ for( ; polit != this->_log2pol.end(); ++polit, ++binit) {
+
+ std::vector<unsigned long> vect;
+ PAD.radixdirect( vect, (unsigned long)(*polit), this->_exponent);
+
+ *binit = vect[0];
+ for(size_t i =1; i<this->_exponent; ++i) {
+ *binit <<= _pceil;
+ *binit += vect[i];
+ }
+ }
+
+ _bin2log.resize( 1<<(_pceil*this->_exponent) );
+ for(size_t i=0; i<_log2bin.size(); ++i)
+ _bin2log[ _log2bin[ i ] ] = i;
+
+
+ // This is X
+ _Xk = this->_pol2log[this->_characteristic];
+// polywrite(std::cerr << "Xk: " << _Xk << " rep ", _Xk) << std::endl;
+ // This is X^{e}
+ dom_power(_Xk,_Xk,this->_exponent,*this);
+// polywrite(std::cerr << "Xk: ", _Xk) << std::endl;
+ }
+
+
+
+ UTT _SHIFTS;
+ Ints _sBASE,_sMASK,_sMAXN;
+
+ Ints _epmunsq;
+ UTT _pceil,_pMASK,_degree;
+
+ std::vector<UTT> _log2bin;
+ std::vector<UTT> _bin2log;
+
+ Element _Xk;
+};
+
+} // namespace Givaro
+
+#endif // __GIVARO_gfq_kronecker_H
diff --git a/src/kernel/zpz/givmontg32.C b/src/kernel/zpz/givmontg32.C
index a9ee744..32f4e1a 100644
--- a/src/kernel/zpz/givmontg32.C
+++ b/src/kernel/zpz/givmontg32.C
@@ -1,72 +1,77 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givmontg32.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmontg32.C,v 1.2 2005/06/13 11:56:59 jgdumas Exp $
+// $Id: givmontg32.C,v 1.6 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
// Description:
#include <iostream>
-#include "givmontg32.h"
-
+#include "givaro/givmontg32.h"
+namespace Givaro {
// Returns d, and u and v such that u a + v b = d;
// JGD 04.11.1999
-// const int32 Montgomery<Std32>::gcdext
-// ( int32& u, int32& v, const int32 a, const int32 b )
-int32& Montgomery<Std32>::gcdext
- ( int32& d, int32& u, int32& v, const int32 a, const int32 b ) const
+// const int32_t Montgomery<Std32>::gcdext
+// ( int32_t& u, int32_t& v, const int32_t a, const int32_t b )
+int32_t& Montgomery<Std32>::gcdext
+ ( int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const
{
- register long u1,u2,u3;
- register long v1,v2,v3;
+ long u1,u2,u3;
+ long v1,v2,v3;
u1 = 1; u2 = 0; u3 = a;
v1 = 0; v2 = 1; v3 = b;
while (v3 != 0)
{
- register long q , t1, t2 ,t3;
+ long q , t1, t2 ,t3;
q = u3 / v3;
t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
}
- u = u1;
- v = u2;
- return d=u3;
+ u = int32_t(u1);
+ v = int32_t(u2);
+ return d=int32_t(u3);
// return u3;
-}
+}
-int32& Montgomery<Std32>::invext
- ( int32& u, const int32 a, const int32 b ) const
+int32_t& Montgomery<Std32>::invext
+ ( int32_t& u, const int32_t a, const int32_t b ) const
{
- register long u1,u3;
- register long v1,v3;
- u1 = 1; u3 = a;
- v1 = 0; v3 = b;
+ long u1,u3;
+ long v1,v3;
+ u1 = 1;
+ u3 = long(a);
+ v1 = 0;
+ v3 = long(b);
while (v3 != 0)
{
- register long q, t1, t3;
+ long q, t1, t3;
q = u3 / v3;
t1 = u1 - q * v1; t3 = u3 - q * v3;
u1 = v1; u3 = v3; v1 = t1; v3 = t3;
}
- if (u1 < 0)
- return u = u1+b;
+ if (u1 < 0)
+ return u = int32_t(u1+b);
else
- return u = u1;
-}
+ return u = int32_t(u1);
+}
-int32 Montgomery<Std32>::invext
- ( const int32 a, const int32 b ) const
+int32_t Montgomery<Std32>::invext
+ ( const int32_t a, const int32_t b ) const
{
- int32 tmp;
+ int32_t tmp;
return invext(tmp, a, b);
}
-void Montgomery<Std32>::Init()
+void Montgomery<Std32>::Init()
{
}
void Montgomery<Std32>::End()
{
}
-
+} // namespace Givaro
diff --git a/src/kernel/zpz/givmontg32.h b/src/kernel/zpz/givmontg32.h
index 2cc3aa3..a73c35b 100644
--- a/src/kernel/zpz/givmontg32.h
+++ b/src/kernel/zpz/givmontg32.h
@@ -1,207 +1,251 @@
-#ifndef _GIVARO_MONTG32_H_
-#define _GIVARO_MONTG32_H_
// ==========================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// author: JG Dumas (from P. Zimmermann's Montgomery implementation)
-// $Id: givmontg32.h,v 1.8 2008-04-22 15:57:14 jgdumas Exp $
+// $Id: givmontg32.h,v 1.15 2011-02-04 14:11:46 jgdumas Exp $
// ==========================================================================
-//
-#include "givbasictype.h"
-#include "giverror.h"
-#include "giv_randiter.h"
+
+/*! @file zpz/givmontg32.h
+ * @ingroup zpz
+ * @brief NO DOC
+ */
+
+#ifndef __GIVARO_montg32_H
+#define __GIVARO_montg32_H
+
+#include "givaro/givbasictype.h"
+#include "givaro/giverror.h"
+#include "givaro/giv_randiter.h"
#include <math.h>
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// Reduction is made through Montgomery's reduction
-// Representation of a is by storing (aB).
-//
-// We must have (p-1)^2 + p*(B-1) < B^2,
-// i.e. p<=40504 for B=2^16
-// ==========================================================================
#define B32 65536UL
#define MASK32 65535UL
#define HALF_BITS32 16
-template<class TYPE> class Montgomery;
-
-
-template<>
-class Montgomery<Std32> {
-public:
- // ----- Exported Types and constantes
- typedef uint32 Residu_t; // - type to store residue
- enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
- // ----- Representation of Element of the domain Montgomery
- typedef uint32 Rep;
- typedef uint32 Element;
-
- // ----- Constructor
- Montgomery() : _p(0UL), _dp(0.0), zero(0UL), one(1UL) {}
-
- Montgomery( Residu_t p, int expo = 1)
- : _p(p), _Bp(B32%p), _B2p( (_Bp<<HALF_BITS32) % p), _B3p( (_B2p<<HALF_BITS32) % p), _nim( -Montgomery<Std32>::invext(_p,B32) ), _dp((double)p), zero(0UL), one( redcsal(_B2p) ) {}
-
- Montgomery( const Montgomery<Std32>& F)
- : _p(F._p), _Bp(F._Bp), _B2p( F._B2p), _B3p( F._B3p), _nim(F._nim),_dp(F._dp), zero(0UL), one(F.one) { }
-
-
- int operator==( const Montgomery<Std32>& BC) const { return _p == BC._p;}
- int operator!=( const Montgomery<Std32>& BC) const { return _p != BC._p;}
-
- Montgomery<Std32>& operator=( const Montgomery<Std32>& F) {
- this->_p = F._p;
- this->_Bp = F._Bp;
- this->_B2p = F._B2p;
- this->_B3p = F._B3p;
- this->_nim = F._nim;
- this->_dp = F._dp;
- return *this;
- }
-
- // ----- Access to the modulus
- Residu_t residu() const;
- Residu_t size() const {return _p;}
- Rep access( const Rep a ) const { return a; }
- Residu_t characteristic() const { return _p; }
- Residu_t characteristic(Residu_t p) const { return p=_p; }
- Residu_t cardinality() const { return _p; }
-
-
- // ----- Access to the modulus
- Rep& init( Rep& a ) const;
- Rep& init( Rep& r, const long a) const ;
- Rep& init( Rep& r, const unsigned long a) const ;
- Rep& init( Rep& a, const int i) const ;
- Rep& init( Rep& a, const unsigned int i) const ;
- Rep& init ( Rep& r, const Integer& residu ) const ;
-
- // Initialisation from double ( added for FFLAS usage) (C Pernet)
- Rep& init( Rep& a, const double i) const;
- Rep& init( Rep& a, const float i) const;
-
- unsigned long int& convert(unsigned long int& r, const Rep a) const {
- uint32 ur;
- return r = (unsigned long)redc(ur,a);}
-
- uint32& convert(uint32& r, const Rep a) const {
- unsigned long ur;
- return r = (uint32)convert(ur, a);
- }
-
- int32& convert(int32& r, const Rep a) const {
- unsigned long ur;
- return r = (int32)convert(ur, a);
- }
-
- long int& convert(long int& r, const Rep a) const {
- unsigned long ur;
- return r = (long int)convert(ur, a);
- }
-
- Integer& convert(Integer& i, const Rep a) const {
- unsigned long ur;
- return i = (Integer)convert(ur, a);
- }
-
- // Conversion to double ( added for FFLAS usage) (C Pernet)
- float& convert(float& r, const Rep a ) const {
- unsigned long ur;
- return r = (float)convert(ur, a); }
- double& convert(double& r, const Rep a ) const {
- unsigned long ur;
- return r = (double)convert(ur, a); }
-
- // ----- Misc methods
- int isZero( const Rep a ) const;
- int isOne ( const Rep a ) const;
- size_t length ( const Rep a ) const;
-
- // ----- Equality between two Elements
- int areEqual(const Rep& a, const Rep& b) const {
- return a==b;
- }
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- Rep& mul (Rep& r, const Rep a, const Rep b) const;
- Rep& div (Rep& r, const Rep a, const Rep b) const;
- Rep& add (Rep& r, const Rep a, const Rep b) const;
- Rep& sub (Rep& r, const Rep a, const Rep b) const;
- Rep& neg (Rep& r, const Rep a) const;
- Rep& inv (Rep& r, const Rep a) const;
-
- Rep& mulin (Rep& r, const Rep a) const;
- Rep& divin (Rep& r, const Rep a) const;
- Rep& addin (Rep& r, const Rep a) const;
- Rep& subin (Rep& r, const Rep a) const;
- Rep& negin (Rep& r) const;
- Rep& invin (Rep& r) const;
-
- // -- axpy: r <- a * x + y mod p
- Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- // -- axpyin: r <- r + a * x mod p
- Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
- // -- axmy: r <- a * x - y mod p
- Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- // -- axmyin: r <- r - a * x mod p
- Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
- // -- Misc: r <- a mod p
- Rep& assign ( Rep& r, const Rep a) const;
-
- // ----- random generators
- template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r, long s) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
-
- typedef GIV_randIter< Montgomery<Std32> , Rep > randIter;
-
- // --- IO methods
- std::istream& read ( std::istream& s );
- std::ostream& write( std::ostream& s ) const;
- std::istream& read ( std::istream& s, Rep& a ) const;
- std::ostream& write( std::ostream& s, const Rep a ) const;
-
-protected:
- // -- based on modular inverse, d = a*u + b*v
-// static const int32 gcdext ( int32& u, int32& v, const int32 a, const int32 b );
- int32& gcdext (int32& d, int32& u, int32& v, const int32 a, const int32 b ) const;
- int32& invext (int32& u, const int32 a, const int32 b ) const;
- int32 invext(const int32 a, const int32 b ) const;
-
-
-
- Element& redc(Element&, const Element) const ;
- Element redcal(const Element) const;
- Element redcsal(const Element) const;
- Element& redcin(Element&) const;
- Element& redcs(Element&, const Element) const;
- Element& redcsin(Element&) const;
-
-
-protected:
- // -- data representation of the domain:
- Residu_t _p;
- Residu_t _Bp;
- Residu_t _B2p;
- Residu_t _B3p;
- Residu_t _nim;
- double _dp;
-
-
- static void Init();
- static void End();
-
-public:
- // ----- Constantes
- const Rep zero;
- const Rep one;
-};
-
-
-#include "givmontg32.inl"
-
-#endif
+namespace Givaro {
+
+ template<class TYPE> class Montgomery;
+
+
+ /*! @brief This class implements the standard arithmetic with Modulo Elements.
+ * Reduction is made through Montgomery's reduction.
+ * Representation of a is by storing (aB).
+ * - We must have p>2
+ * - We must have \f$(p-1)^2 + p(B-1) < B^2 \f$, i.e. \f$2<p \leq 40504\f$ for \f$B=2^16\f$.
+ */
+ template<>
+ class Montgomery<Std32> {
+ public:
+ // ----- Exported Types and constantes
+ typedef uint32_t Residu_t; // - type to store residue
+ enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
+ // ----- Representation of Element of the domain Montgomery
+ typedef uint32_t Rep;
+ typedef uint32_t Element;
+
+ // ----- Constructor
+ Montgomery() : _p(0UL), _dp(0.0), zero(0UL), one(1UL) {}
+
+ Montgomery( Residu_t p, int = 1) :
+ _p( (Residu_t) p),
+ _Bp( (Residu_t) B32%p),
+ _B2p((Residu_t) (_Bp<<HALF_BITS32) % p),
+ _B3p((Residu_t) (_B2p<<HALF_BITS32) % p),
+ _nim((Residu_t) -Montgomery<Std32>::invext(_p,B32) ),
+ _dp( (double) p),
+ zero((Residu_t) 0UL),
+ one( (Residu_t) redcsal( _B2p ) )
+ {}
+
+ Montgomery( const Montgomery<Std32>& F)
+ : _p(F._p), _Bp(F._Bp), _B2p( F._B2p), _B3p( F._B3p), _nim(F._nim),_dp(F._dp), zero(0UL), one(F.one)
+ { }
+
+
+ int operator==( const Montgomery<Std32>& BC) const
+ { return _p == BC._p;}
+ int operator!=( const Montgomery<Std32>& BC) const
+ { return _p != BC._p;}
+
+ Montgomery<Std32>& operator=( const Montgomery<Std32>& F)
+ {
+ this->_p = F._p;
+ this->_Bp = F._Bp;
+ this->_B2p = F._B2p;
+ this->_B3p = F._B3p;
+ this->_nim = F._nim;
+ this->_dp = F._dp;
+ return *this;
+ }
+
+ // ----- Access to the modulus
+ Residu_t residu() const;
+ Residu_t size() const
+ {return _p;}
+ Rep access( const Rep a ) const
+ { return a; }
+ Residu_t characteristic() const
+ { return _p; }
+ Residu_t characteristic(Residu_t p) const
+ { return p=_p; }
+ Residu_t cardinality() const
+ { return _p; }
+
+
+ // ----- Access to the modulus
+ Rep& init( Rep& a ) const;
+ Rep& init( Rep& r, const long a) const ;
+ Rep& init( Rep& r, const unsigned long a) const ;
+ Rep& init( Rep& a, const int i) const ;
+ Rep& init( Rep& a, const unsigned int i) const ;
+ Rep& init ( Rep& r, const Integer& residu ) const ;
+
+ // Initialisation from double ( added for FFLAS usage) (C Pernet)
+ Rep& init( Rep& a, const double i) const;
+ Rep& init( Rep& a, const float i) const;
+
+ unsigned long int& convert(unsigned long int& r, const Rep a) const
+ {
+ uint32_t ur;
+ return r = (unsigned long)redc(ur,a);}
+
+ uint32_t& convert(uint32_t& r, const Rep a) const
+ {
+ unsigned long ur;
+ return r = (uint32_t)convert(ur, a);
+ }
+
+ int32_t& convert(int32_t& r, const Rep a) const
+ {
+ unsigned long ur;
+ return r = (int32_t)convert(ur, a);
+ }
+
+ long int& convert(long int& r, const Rep a) const
+ {
+ unsigned long ur;
+ return r = (long int)convert(ur, a);
+ }
+
+ Integer& convert(Integer& i, const Rep a) const
+ {
+ unsigned long ur;
+ return i = (Integer)convert(ur, a);
+ }
+
+ // Conversion to double ( added for FFLAS usage) (C Pernet)
+ float& convert(float& r, const Rep a ) const
+ {
+ unsigned long ur;
+ return r = (float)convert(ur, a); }
+ double& convert(double& r, const Rep a ) const
+ {
+ unsigned long ur;
+ return r = (double)convert(ur, a); }
+
+ // ----- Misc methods
+ int isZero( const Rep a ) const;
+ int isOne ( const Rep a ) const;
+ size_t length ( const Rep a ) const;
+
+ // ----- Equality between two Elements
+ int areEqual(const Rep& a, const Rep& b) const
+ {
+ return a==b;
+ }
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ Rep& mul (Rep& r, const Rep a, const Rep b) const;
+ Rep& div (Rep& r, const Rep a, const Rep b) const;
+ Rep& add (Rep& r, const Rep a, const Rep b) const;
+ Rep& sub (Rep& r, const Rep a, const Rep b) const;
+ Rep& neg (Rep& r, const Rep a) const;
+ Rep& inv (Rep& r, const Rep a) const;
+
+ Rep& mulin (Rep& r, const Rep a) const;
+ Rep& divin (Rep& r, const Rep a) const;
+ Rep& addin (Rep& r, const Rep a) const;
+ Rep& subin (Rep& r, const Rep a) const;
+ Rep& negin (Rep& r) const;
+ Rep& invin (Rep& r) const;
+
+ // -- axpy: r <- a * x + y mod p
+ Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- axpyin: r <- r + a * x mod p
+ Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
+ // -- axmy: r <- a * x - y mod p
+ Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- axmyin: r <- a * x - r mod p
+ Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpyin: r <- r - a * x mod p
+ Rep& maxpyin(Rep& r, const Rep a, const Rep b) const;
+ // -- Misc: r <- a mod p
+ Rep& assign ( Rep& r, const Rep a) const;
+
+ // ----- random generators
+ template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r, long s) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
+
+ typedef GIV_randIter< Montgomery<Std32> , Rep > randIter;
+
+ // --- IO methods
+ std::istream& read ( std::istream& s );
+ std::ostream& write( std::ostream& s ) const;
+ std::istream& read ( std::istream& s, Rep& a ) const;
+ std::ostream& write( std::ostream& s, const Rep a ) const;
+
+ protected:
+ // -- based on modular inverse, d = a*u + b*v
+ // static const int32_t gcdext ( int32_t& u, int32_t& v, const int32_t a, const int32_t b );
+ int32_t& gcdext (int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const;
+ int32_t& invext (int32_t& u, const int32_t a, const int32_t b ) const;
+ int32_t invext(const int32_t a, const int32_t b ) const;
+
+
+
+ Element& redc(Element&, const Element) const ;
+ Element redcal(const Element) const;
+ Element redcsal(const Element) const;
+ Element& redcin(Element&) const;
+ Element& redcs(Element&, const Element) const;
+ Element& redcsin(Element&) const;
+
+
+ protected:
+ // -- data representation of the domain:
+ Residu_t _p;
+ Residu_t _Bp;
+ Residu_t _B2p;
+ Residu_t _B3p;
+ Residu_t _nim;
+ double _dp;
+
+
+ static void Init();
+ static void End();
+
+ public:
+ // ----- Constantes
+ const Rep zero;
+ const Rep one;
+ };
+
+
+} // namespace Givaro
+
+#include "givaro/givmontg32.inl"
+
+#endif // __GIVARO_montg32_H
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givmontg32.inl b/src/kernel/zpz/givmontg32.inl
index 1d047de..906e743 100644
--- a/src/kernel/zpz/givmontg32.inl
+++ b/src/kernel/zpz/givmontg32.inl
@@ -1,8 +1,19 @@
// ==========================================================================
-// $Id: givmontg32.inl,v 1.8 2008-04-22 15:57:14 jgdumas Exp $
+// $Id: givmontg32.inl,v 1.14 2011-02-04 14:11:46 jgdumas Exp $
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// ==========================================================================
-inline Montgomery<Std32>::Element Montgomery<Std32>::redcal(const Element c) const {
+#ifndef __GIVARO_mong32_INL
+#define __GIVARO_mong32_INL
+
+namespace Givaro {
+
+inline Montgomery<Std32>::Element Montgomery<Std32>::redcal(const Element c) const
+{
Element c0 = c & MASK32; /* c mod B */
c0 = (c0 * _nim) & MASK32; /* -c/p mod B */
// c0 *= _p;
@@ -11,14 +22,16 @@ inline Montgomery<Std32>::Element Montgomery<Std32>::redcal(const Element c) con
c0 >>= HALF_BITS32;
return (c0>_p?c0-=_p:c0);
}
-inline Montgomery<Std32>::Element Montgomery<Std32>::redcsal(const Element c) const {
+inline Montgomery<Std32>::Element Montgomery<Std32>::redcsal(const Element c) const
+{
Element c0 = (c * _nim) & MASK32; /* -c/p mod B */
c0 = c + c0 * _p; /* c = 0 mod B */
c0 >>= HALF_BITS32;
return (c0>_p?c0-=_p:c0);
}
-inline Montgomery<Std32>::Element& Montgomery<Std32>::redc(Element& r, const Element c) const {
+inline Montgomery<Std32>::Element& Montgomery<Std32>::redc(Element& r, const Element c) const
+{
r = c & MASK32; /* c mod B */
r *= _nim;
r &= MASK32;
@@ -28,27 +41,32 @@ inline Montgomery<Std32>::Element& Montgomery<Std32>::redc(Element& r, const Ele
return (r>_p?r-=_p:r);
}
-inline Montgomery<Std32>::Element& Montgomery<Std32>::redcs(Element& r, const Element c) const {
+inline Montgomery<Std32>::Element& Montgomery<Std32>::redcs(Element& r, const Element c) const
+{
r = (c * _nim) & MASK32; /* -c/p mod B */
r = c + r * _p; /* c = 0 mod B */
r >>= HALF_BITS32;
return (r>_p?r-=_p:r);
}
-inline Montgomery<Std32>::Element& Montgomery<Std32>::redcin(Element& r) const {
+inline Montgomery<Std32>::Element& Montgomery<Std32>::redcin(Element& r) const
+{
Element c0 = r & MASK32; /* c mod B */
c0 = (c0 * _nim) & MASK32; /* -c/p mod B */
r += c0 * _p; /* c = 0 mod B */
r >>= HALF_BITS32;
return (r>_p?r-=_p:r);
}
-inline Montgomery<Std32>::Element& Montgomery<Std32>::redcsin(Element& r) const {
+inline Montgomery<Std32>::Element& Montgomery<Std32>::redcsin(Element& r) const
+{
Element c0 = (r * _nim) & MASK32; /* -c/p mod B */
r += c0 * _p; /* c = 0 mod B */
r >>= HALF_BITS32;
return (r>_p?r-=_p:r);
}
+} // namespace Givaro
+
// r = a*b
#define __GIVARO_MONTG32_MUL(r,p,a,b) (redc(r,a*b))
// r *= a
@@ -72,116 +90,130 @@ inline Montgomery<Std32>::Element& Montgomery<Std32>::redcsin(Element& r) const
#define __GIVARO_MONTG32_MULADDIN(r,p,a,b) { r+=redcal(a*b); r= (r < p ? r : r-p); }
-// a*b-c
-#define __GIVARO_MONTG32_MULSUB(r,p,a,b,c) (r)
-// a*b-c
-#define __GIVARO_MONTG32_SUBMULIN(r,p,a,b) (r)
-
#define __GIVARO_MONTG32_NEG(r,p,a) (r = (a == 0 ? 0 : p-a))
#define __GIVARO_MONTG32_NEGIN(r,p) (r = (r == 0 ? 0 : p-r))
+namespace Givaro {
inline Montgomery<Std32>::Residu_t Montgomery<Std32>::residu( ) const
{ return _p; }
inline Montgomery<Std32>::Rep& Montgomery<Std32>::mul (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_MONTG32_MUL(r,_p,a,b);
+{
+ return __GIVARO_MONTG32_MUL(r,_p,a,b);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::sub (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_MONTG32_SUB(r,_p,a,b);
+{
+ return __GIVARO_MONTG32_SUB(r,_p,a,b);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::add (Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_MONTG32_ADD(r,_p,a,b);
- return r;
+{
+ __GIVARO_MONTG32_ADD(r,_p,a,b);
+ return r;
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::neg (Rep& r, const Rep a) const
-{
- return __GIVARO_MONTG32_NEG(r,_p,a);
+{
+ return __GIVARO_MONTG32_NEG(r,_p,a);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::inv (Rep& r, const Rep a) const
-{
+{
// invext(aB) --> 1/a*1/B
- // % * B^3 --> B²/a
+ // % * B^3 --> B²/a
// redc --> B/a
- int32 t;
- return redc(r, uint32( invext( t,int32(a),int32(_p)) ) * _B3p) ;
+ int32_t t;
+ return redc(r, uint32_t( invext( t,int32_t(a),int32_t(_p)) ) * _B3p) ;
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::div (Rep& r, const Rep a, const Rep b) const
-{
+{
return mulin( inv(r,b), a );
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::mulin (Rep& r, const Rep a) const
-{
- return __GIVARO_MONTG32_MULIN(r,_p, a);
+{
+ return __GIVARO_MONTG32_MULIN(r,_p, a);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::divin (Rep& r, const Rep a) const
-{
+{
Montgomery<Std32>::Rep ia;
inv(ia, a);
return mulin(r, ia);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::addin (Rep& r, const Rep a) const
-{
- __GIVARO_MONTG32_ADDIN(r,_p, a);
- return r;
+{
+ __GIVARO_MONTG32_ADDIN(r,_p, a);
+ return r;
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::subin (Rep& r, const Rep a) const
-{
- __GIVARO_MONTG32_SUBIN(r,_p, a);
- return r;
+{
+ __GIVARO_MONTG32_SUBIN(r,_p, a);
+ return r;
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::negin (Rep& r) const
-{
- return __GIVARO_MONTG32_NEGIN(r,_p);
+{
+ return __GIVARO_MONTG32_NEGIN(r,_p);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::invin (Rep& r) const
-{
- uint32 t;
+{
+ uint32_t t;
return r = inv(t,r);
}
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::axpy
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::axpy
(Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- __GIVARO_MONTG32_MULADD(r, _p, a, b, c);
+{
+ __GIVARO_MONTG32_MULADD(r, _p, a, b, c);
return r;
}
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::axpyin
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::axpyin
(Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_MONTG32_MULADDIN(r, _p, a, b);
+{
+ __GIVARO_MONTG32_MULADDIN(r, _p, a, b);
return r;
}
+// r <- a*b-c
inline Montgomery<Std32>::Rep& Montgomery<Std32>::axmy
(Rep& r, const Rep a, const Rep b, const Rep c) const
{
- return __GIVARO_MONTG32_MULSUB(r, _p, a, b, c);
+ return this->subin(this->mul(r,a,b), c);
+}
+
+// r = c - a*b
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::maxpy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+{
+ Rep t;
+ return this->sub(r, c, this->mul(t,a,b));
}
// r -= a*b
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::axmyin
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::maxpyin
(Rep& r, const Rep a, const Rep b) const
{
- return __GIVARO_MONTG32_SUBMULIN(r, _p, a, b );
+ Rep t;
+ return this->subin(r, this->mul(t,a,b));
+}
+
+// r = a*b - r
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::axmyin
+ (Rep& r, const Rep a, const Rep b) const
+{
+ maxpyin(r,a,b);
+ return negin(r);
}
@@ -196,7 +228,7 @@ inline int Montgomery<Std32>::isOne(const Rep a) const
-inline size_t Montgomery<Std32>::length(const Rep a) const
+inline size_t Montgomery<Std32>::length(const Rep) const
{ return Montgomery<Std32>::size_rep;}
// ---------
@@ -209,55 +241,65 @@ inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const double
int sign; double ua;
if (a < 0.0) { sign =-1; ua = -a;}
else { ua = a; sign =1; }
- if ( ua > Signed_Trait<uint32>::max()){
-// ua -= (double)floor(ua * _invdp)*_dp;
+ if ( ua > Signed_Trait<uint32_t>::max()){
+// ua -= (double)floor(ua * _invdp)*_dp;
ua = fmod(ua,_dp);
r = (Rep) ua;
} else
- r = (ua >=_p) ? (uint32) ua % (uint32)_p : (uint32) ua;
+ r = (ua >=_p) ? (uint32_t) ua % (uint32_t)_p : (uint32_t) ua;
if (r && (sign ==-1)) r = _p - r;
// std::cerr << a << "dbl --> " << r << "(" << redcal(r*_B2p) << ")" << std::endl;
return redc(r,r*_B2p);
}
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const float a ) const {
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const float a ) const
+{
return init(r, (double)a);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const unsigned long a ) const
-{ r = ( a >= (uint32)_p ? a % (uint32)_p : a);
+{
+ r = Rep( a >= (uint32_t)_p ? a % (uint32_t)_p : a);
return redc(r,r*_B2p);
}
inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const long a ) const
{
int sign; unsigned long ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = ( ua >= (uint32)_p ? ua % (uint32)_p : ua);
- if (r && (sign ==-1)) r = _p - r;
+ if (a <0)
+ {
+ sign =-1;
+ ua = -a;
+ }
+ else {
+ ua = a;
+ sign =1;
+ }
+ r =Rep ( ua >= (uint32_t)_p ? ua % (uint32_t)_p : ua);
+ if (r && (sign ==-1))
+ r = _p - r;
return redc(r,r*_B2p);
}
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const Integer& residu ) const
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const Integer& Residu ) const
{
long tr;
- if (residu <0) {
+ if (Residu <0) {
// -a = b [p]
// a = p-b [p]
- if ( residu <= (Integer)(-_p) ) tr = long( (-residu) % _p) ;
- else tr = long(-residu);
+ if ( Residu <= (Integer)(-_p) ) tr = long( (-Residu) % _p) ;
+ else tr = long(-Residu);
if (tr)
- r = _p - (unsigned long)tr;
+ r = Rep(_p - (unsigned long)tr);
else
r = zero;
} else {
- if (residu >= (Integer)_p ) tr = long(residu % _p) ;
- else tr = long(residu);
- r = tr;
+ if (Residu >= (Integer)_p ) tr = long(Residu % _p) ;
+ else tr = long(Residu);
+ r = Rep(tr);
}
return redc(r,r*_B2p);
}
@@ -266,11 +308,13 @@ inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r, const Integer
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::init( Rep& a, const int i) const { return init(a,(long)i); }
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::init( Rep& a, const int i) const
+{ return init(a,(long)i); }
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::init( Rep& a, const unsigned int i) const { return init(a,(unsigned long)i); }
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::init( Rep& a, const unsigned int i) const
+{ return init(a,(unsigned long)i); }
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::assign
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::assign
( Rep& r, const Rep a ) const
{ return r=a; }
@@ -281,43 +325,49 @@ inline Montgomery<Std32>::Rep& Montgomery<Std32>::init ( Rep& r ) const
template< class RandIter >
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::random(RandIter& g, Rep& a) const {
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::random(RandIter& g, Rep& a) const
+{
return init(a, g());
}
template< class RandIter >
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::random(RandIter& g, Rep& a, const Rep& b) const {
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::random(RandIter& g, Rep& a, const Rep& b) const
+{
return init(a, g());
}
template< class RandIter >
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::random(RandIter& g, Rep& a, long b) const {
- return init(a, g() %(uint32) b);
-
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::random(RandIter& g, Rep& a, long b) const
+{
+ return init(a, g() %(uint32_t) b);
+
}
template< class RandIter >
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::nonzerorandom(RandIter& g, Rep& a) const {
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::nonzerorandom(RandIter& g, Rep& a) const
+{
while (isZero(init(a, g()))) {};
return a;
}
template< class RandIter >
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const {
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const
+{
while (isZero(init(a, g()))) {};
return a;
}
template< class RandIter >
-inline Montgomery<Std32>::Rep& Montgomery<Std32>::nonzerorandom(RandIter& g, Rep& a, long b) const {
- while (isZero(init(a, g() %(uint32) b))) {};
+inline Montgomery<Std32>::Rep& Montgomery<Std32>::nonzerorandom(RandIter& g, Rep& a, long b) const
+{
+ while (isZero(init(a, g() %(uint32_t) b))) {};
return a;
}
// -- Input: (z, <_p>)
-inline std::istream& Montgomery<Std32>::read (std::istream& s)
+inline std::istream& Montgomery<Std32>::read (std::istream& s)
{
- char ch;
+ char ch;
s >> std::ws >> ch;
if (ch != '(')
// GivError::throw_error( GivBadFormat("Montgomery<Std32>::read: syntax error: no '('"));
@@ -360,3 +410,7 @@ inline std::ostream& Montgomery<Std32>::write (std::ostream& s, const Rep a) con
Rep tmp;
return s << redcs(tmp,a);
}
+
+} // namespace Givaro
+
+#endif // __GIVARO_mong32_INL
diff --git a/src/kernel/zpz/givprimes16.C b/src/kernel/zpz/givprimes16.C
index a6ab7fb..9120323 100644
--- a/src/kernel/zpz/givprimes16.C
+++ b/src/kernel/zpz/givprimes16.C
@@ -1,670 +1,677 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givprimes16.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// Time-stamp: <11 Jun 07 13:22:50 Jean-Guillaume.Dumas at imag.fr>
// ==========================================================================
// Description:
#include "givaro/givprimes16.h"
-// Number of primes <= 2^16-1
+namespace Givaro {
+
+// Number of primes <= 2^16-1
const size_t Primes16::_size = 6542 ;
const size_t Primes16::_primes[] = {
-2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
-31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
-73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
-127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
-179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
-233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
-283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
-353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
-419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
-467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
-547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
-607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
-661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
-739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
-811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
-877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
-947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013,
-1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069,
-1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
-1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
-1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291,
-1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373,
-1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,
-1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
-1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583,
-1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657,
-1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,
-1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
-1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
-1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987,
-1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,
-2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,
-2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213,
-2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287,
-2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,
-2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,
-2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531,
-2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617,
-2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,
-2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,
-2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819,
-2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903,
-2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,
-3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,
-3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181,
-3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257,
-3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,
-3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,
-3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511,
-3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571,
-3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,
-3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,
-3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821,
-3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907,
-3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,
-4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,
-4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139,
-4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231,
-4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,
-4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409,
-4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493,
-4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583,
-4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,
-4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751,
-4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831,
-4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937,
-4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003,
-5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087,
-5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179,
-5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279,
-5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387,
-5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443,
-5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521,
-5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639,
-5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693,
-5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791,
-5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857,
-5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939,
-5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053,
-6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133,
-6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221,
-6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301,
-6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367,
-6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473,
-6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571,
-6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673,
-6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761,
-6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833,
-6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917,
-6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997,
-7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103,
-7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207,
-7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297,
-7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411,
-7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499,
-7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561,
-7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643,
-7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723,
-7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829,
-7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919,
-7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017,
-8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111,
-8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219,
-8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291,
-8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387,
-8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501,
-8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597,
-8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677,
-8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741,
-8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831,
-8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929,
-8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011,
-9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109,
-9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199,
-9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283,
-9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377,
-9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439,
-9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533,
-9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631,
-9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733,
-9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811,
-9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887,
-9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007,
-10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099,
-10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177,
-10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271,
-10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343,
-10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459,
-10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567,
-10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657,
-10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739,
-10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859,
-10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949,
-10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059,
-11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149,
-11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251,
-11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329,
-11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443,
-11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527,
-11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657,
-11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777,
-11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833,
-11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933,
-11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011,
-12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109,
-12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211,
-12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289,
-12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401,
-12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487,
-12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553,
-12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641,
-12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739,
-12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829,
-12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923,
-12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007,
-13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109,
-13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187,
-13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309,
-13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411,
-13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499,
-13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619,
-13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697,
-13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781,
-13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879,
-13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967,
-13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081,
-14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197,
-14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323,
-14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419,
-14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519,
-14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593,
-14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699,
-14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767,
-14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851,
-14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947,
-14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073,
-15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149,
-15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259,
-15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319,
-15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401,
-15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497,
-15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607,
-15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679,
-15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773,
-15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881,
-15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971,
-15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069,
-16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183,
-16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267,
-16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381,
-16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481,
-16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603,
-16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691,
-16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811,
-16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903,
-16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993,
-17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093,
-17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191,
-17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317,
-17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389,
-17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477,
-17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573,
-17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669,
-17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783,
-17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891,
-17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971,
-17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059,
-18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143,
-18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233,
-18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313,
-18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427,
-18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517,
-18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637,
-18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749,
-18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899,
-18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009,
-19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121,
-19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219,
-19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319,
-19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423,
-19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477,
-19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571,
-19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699,
-19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793,
-19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891,
-19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991,
-19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071,
-20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149,
-20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261,
-20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357,
-20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443,
-20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551,
-20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693,
-20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771,
-20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897,
-20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983,
-21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067,
-21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169,
-21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277,
-21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383,
-21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491,
-21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563,
-21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647,
-21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751,
-21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841,
-21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943,
-21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039,
-22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123,
-22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229,
-22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307,
-22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441,
-22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543,
-22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643,
-22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727,
-22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817,
-22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943,
-22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029,
-23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099,
-23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203,
-23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321,
-23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447,
-23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561,
-23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629,
-23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743,
-23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827,
-23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909,
-23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007,
-24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091,
-24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169,
-24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281,
-24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413,
-24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517,
-24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659,
-24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767,
-24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877,
-24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977,
-24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097,
-25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183,
-25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303,
-25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391,
-25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471,
-25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603,
-25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693,
-25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799,
-25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913,
-25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999,
-26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111,
-26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203,
-26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297,
-26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399,
-26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497,
-26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633,
-26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711,
-26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801,
-26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891,
-26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987,
-26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077,
-27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211,
-27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329,
-27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449,
-27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551,
-27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691,
-27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767,
-27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827,
-27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947,
-27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051,
-28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151,
-28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283,
-28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403,
-28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499,
-28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579,
-28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649,
-28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729,
-28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837,
-28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933,
-28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059,
-29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167,
-29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251,
-29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363,
-29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443,
-29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573,
-29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671,
-29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819,
-29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921,
-29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059,
-30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137,
-30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241,
-30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341,
-30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469,
-30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559,
-30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689,
-30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803,
-30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871,
-30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983,
-31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091,
-31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183,
-31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259,
-31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357,
-31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511,
-31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601,
-31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721,
-31723, 31727, 31729, 31741, 31751, 31769, 31771, 31793, 31799, 31817,
-31847, 31849, 31859, 31873, 31883, 31891, 31907, 31957, 31963, 31973,
-31981, 31991, 32003, 32009, 32027, 32029, 32051, 32057, 32059, 32063,
-32069, 32077, 32083, 32089, 32099, 32117, 32119, 32141, 32143, 32159,
-32173, 32183, 32189, 32191, 32203, 32213, 32233, 32237, 32251, 32257,
-32261, 32297, 32299, 32303, 32309, 32321, 32323, 32327, 32341, 32353,
-32359, 32363, 32369, 32371, 32377, 32381, 32401, 32411, 32413, 32423,
-32429, 32441, 32443, 32467, 32479, 32491, 32497, 32503, 32507, 32531,
-32533, 32537, 32561, 32563, 32569, 32573, 32579, 32587, 32603, 32609,
-32611, 32621, 32633, 32647, 32653, 32687, 32693, 32707, 32713, 32717,
-32719, 32749, 32771, 32779, 32783, 32789, 32797, 32801, 32803, 32831,
-32833, 32839, 32843, 32869, 32887, 32909, 32911, 32917, 32933, 32939,
-32941, 32957, 32969, 32971, 32983, 32987, 32993, 32999, 33013, 33023,
-33029, 33037, 33049, 33053, 33071, 33073, 33083, 33091, 33107, 33113,
-33119, 33149, 33151, 33161, 33179, 33181, 33191, 33199, 33203, 33211,
-33223, 33247, 33287, 33289, 33301, 33311, 33317, 33329, 33331, 33343,
-33347, 33349, 33353, 33359, 33377, 33391, 33403, 33409, 33413, 33427,
-33457, 33461, 33469, 33479, 33487, 33493, 33503, 33521, 33529, 33533,
-33547, 33563, 33569, 33577, 33581, 33587, 33589, 33599, 33601, 33613,
-33617, 33619, 33623, 33629, 33637, 33641, 33647, 33679, 33703, 33713,
-33721, 33739, 33749, 33751, 33757, 33767, 33769, 33773, 33791, 33797,
-33809, 33811, 33827, 33829, 33851, 33857, 33863, 33871, 33889, 33893,
-33911, 33923, 33931, 33937, 33941, 33961, 33967, 33997, 34019, 34031,
-34033, 34039, 34057, 34061, 34123, 34127, 34129, 34141, 34147, 34157,
-34159, 34171, 34183, 34211, 34213, 34217, 34231, 34253, 34259, 34261,
-34267, 34273, 34283, 34297, 34301, 34303, 34313, 34319, 34327, 34337,
-34351, 34361, 34367, 34369, 34381, 34403, 34421, 34429, 34439, 34457,
-34469, 34471, 34483, 34487, 34499, 34501, 34511, 34513, 34519, 34537,
-34543, 34549, 34583, 34589, 34591, 34603, 34607, 34613, 34631, 34649,
-34651, 34667, 34673, 34679, 34687, 34693, 34703, 34721, 34729, 34739,
-34747, 34757, 34759, 34763, 34781, 34807, 34819, 34841, 34843, 34847,
-34849, 34871, 34877, 34883, 34897, 34913, 34919, 34939, 34949, 34961,
-34963, 34981, 35023, 35027, 35051, 35053, 35059, 35069, 35081, 35083,
-35089, 35099, 35107, 35111, 35117, 35129, 35141, 35149, 35153, 35159,
-35171, 35201, 35221, 35227, 35251, 35257, 35267, 35279, 35281, 35291,
-35311, 35317, 35323, 35327, 35339, 35353, 35363, 35381, 35393, 35401,
-35407, 35419, 35423, 35437, 35447, 35449, 35461, 35491, 35507, 35509,
-35521, 35527, 35531, 35533, 35537, 35543, 35569, 35573, 35591, 35593,
-35597, 35603, 35617, 35671, 35677, 35729, 35731, 35747, 35753, 35759,
-35771, 35797, 35801, 35803, 35809, 35831, 35837, 35839, 35851, 35863,
-35869, 35879, 35897, 35899, 35911, 35923, 35933, 35951, 35963, 35969,
-35977, 35983, 35993, 35999, 36007, 36011, 36013, 36017, 36037, 36061,
-36067, 36073, 36083, 36097, 36107, 36109, 36131, 36137, 36151, 36161,
-36187, 36191, 36209, 36217, 36229, 36241, 36251, 36263, 36269, 36277,
-36293, 36299, 36307, 36313, 36319, 36341, 36343, 36353, 36373, 36383,
-36389, 36433, 36451, 36457, 36467, 36469, 36473, 36479, 36493, 36497,
-36523, 36527, 36529, 36541, 36551, 36559, 36563, 36571, 36583, 36587,
-36599, 36607, 36629, 36637, 36643, 36653, 36671, 36677, 36683, 36691,
-36697, 36709, 36713, 36721, 36739, 36749, 36761, 36767, 36779, 36781,
-36787, 36791, 36793, 36809, 36821, 36833, 36847, 36857, 36871, 36877,
-36887, 36899, 36901, 36913, 36919, 36923, 36929, 36931, 36943, 36947,
-36973, 36979, 36997, 37003, 37013, 37019, 37021, 37039, 37049, 37057,
-37061, 37087, 37097, 37117, 37123, 37139, 37159, 37171, 37181, 37189,
-37199, 37201, 37217, 37223, 37243, 37253, 37273, 37277, 37307, 37309,
-37313, 37321, 37337, 37339, 37357, 37361, 37363, 37369, 37379, 37397,
-37409, 37423, 37441, 37447, 37463, 37483, 37489, 37493, 37501, 37507,
-37511, 37517, 37529, 37537, 37547, 37549, 37561, 37567, 37571, 37573,
-37579, 37589, 37591, 37607, 37619, 37633, 37643, 37649, 37657, 37663,
-37691, 37693, 37699, 37717, 37747, 37781, 37783, 37799, 37811, 37813,
-37831, 37847, 37853, 37861, 37871, 37879, 37889, 37897, 37907, 37951,
-37957, 37963, 37967, 37987, 37991, 37993, 37997, 38011, 38039, 38047,
-38053, 38069, 38083, 38113, 38119, 38149, 38153, 38167, 38177, 38183,
-38189, 38197, 38201, 38219, 38231, 38237, 38239, 38261, 38273, 38281,
-38287, 38299, 38303, 38317, 38321, 38327, 38329, 38333, 38351, 38371,
-38377, 38393, 38431, 38447, 38449, 38453, 38459, 38461, 38501, 38543,
-38557, 38561, 38567, 38569, 38593, 38603, 38609, 38611, 38629, 38639,
-38651, 38653, 38669, 38671, 38677, 38693, 38699, 38707, 38711, 38713,
-38723, 38729, 38737, 38747, 38749, 38767, 38783, 38791, 38803, 38821,
-38833, 38839, 38851, 38861, 38867, 38873, 38891, 38903, 38917, 38921,
-38923, 38933, 38953, 38959, 38971, 38977, 38993, 39019, 39023, 39041,
-39043, 39047, 39079, 39089, 39097, 39103, 39107, 39113, 39119, 39133,
-39139, 39157, 39161, 39163, 39181, 39191, 39199, 39209, 39217, 39227,
-39229, 39233, 39239, 39241, 39251, 39293, 39301, 39313, 39317, 39323,
-39341, 39343, 39359, 39367, 39371, 39373, 39383, 39397, 39409, 39419,
-39439, 39443, 39451, 39461, 39499, 39503, 39509, 39511, 39521, 39541,
-39551, 39563, 39569, 39581, 39607, 39619, 39623, 39631, 39659, 39667,
-39671, 39679, 39703, 39709, 39719, 39727, 39733, 39749, 39761, 39769,
-39779, 39791, 39799, 39821, 39827, 39829, 39839, 39841, 39847, 39857,
-39863, 39869, 39877, 39883, 39887, 39901, 39929, 39937, 39953, 39971,
-39979, 39983, 39989, 40009, 40013, 40031, 40037, 40039, 40063, 40087,
-40093, 40099, 40111, 40123, 40127, 40129, 40151, 40153, 40163, 40169,
-40177, 40189, 40193, 40213, 40231, 40237, 40241, 40253, 40277, 40283,
-40289, 40343, 40351, 40357, 40361, 40387, 40423, 40427, 40429, 40433,
-40459, 40471, 40483, 40487, 40493, 40499, 40507, 40519, 40529, 40531,
-40543, 40559, 40577, 40583, 40591, 40597, 40609, 40627, 40637, 40639,
-40693, 40697, 40699, 40709, 40739, 40751, 40759, 40763, 40771, 40787,
-40801, 40813, 40819, 40823, 40829, 40841, 40847, 40849, 40853, 40867,
-40879, 40883, 40897, 40903, 40927, 40933, 40939, 40949, 40961, 40973,
-40993, 41011, 41017, 41023, 41039, 41047, 41051, 41057, 41077, 41081,
-41113, 41117, 41131, 41141, 41143, 41149, 41161, 41177, 41179, 41183,
-41189, 41201, 41203, 41213, 41221, 41227, 41231, 41233, 41243, 41257,
-41263, 41269, 41281, 41299, 41333, 41341, 41351, 41357, 41381, 41387,
-41389, 41399, 41411, 41413, 41443, 41453, 41467, 41479, 41491, 41507,
-41513, 41519, 41521, 41539, 41543, 41549, 41579, 41593, 41597, 41603,
-41609, 41611, 41617, 41621, 41627, 41641, 41647, 41651, 41659, 41669,
-41681, 41687, 41719, 41729, 41737, 41759, 41761, 41771, 41777, 41801,
-41809, 41813, 41843, 41849, 41851, 41863, 41879, 41887, 41893, 41897,
-41903, 41911, 41927, 41941, 41947, 41953, 41957, 41959, 41969, 41981,
-41983, 41999, 42013, 42017, 42019, 42023, 42043, 42061, 42071, 42073,
-42083, 42089, 42101, 42131, 42139, 42157, 42169, 42179, 42181, 42187,
-42193, 42197, 42209, 42221, 42223, 42227, 42239, 42257, 42281, 42283,
-42293, 42299, 42307, 42323, 42331, 42337, 42349, 42359, 42373, 42379,
-42391, 42397, 42403, 42407, 42409, 42433, 42437, 42443, 42451, 42457,
-42461, 42463, 42467, 42473, 42487, 42491, 42499, 42509, 42533, 42557,
-42569, 42571, 42577, 42589, 42611, 42641, 42643, 42649, 42667, 42677,
-42683, 42689, 42697, 42701, 42703, 42709, 42719, 42727, 42737, 42743,
-42751, 42767, 42773, 42787, 42793, 42797, 42821, 42829, 42839, 42841,
-42853, 42859, 42863, 42899, 42901, 42923, 42929, 42937, 42943, 42953,
-42961, 42967, 42979, 42989, 43003, 43013, 43019, 43037, 43049, 43051,
-43063, 43067, 43093, 43103, 43117, 43133, 43151, 43159, 43177, 43189,
-43201, 43207, 43223, 43237, 43261, 43271, 43283, 43291, 43313, 43319,
-43321, 43331, 43391, 43397, 43399, 43403, 43411, 43427, 43441, 43451,
-43457, 43481, 43487, 43499, 43517, 43541, 43543, 43573, 43577, 43579,
-43591, 43597, 43607, 43609, 43613, 43627, 43633, 43649, 43651, 43661,
-43669, 43691, 43711, 43717, 43721, 43753, 43759, 43777, 43781, 43783,
-43787, 43789, 43793, 43801, 43853, 43867, 43889, 43891, 43913, 43933,
-43943, 43951, 43961, 43963, 43969, 43973, 43987, 43991, 43997, 44017,
-44021, 44027, 44029, 44041, 44053, 44059, 44071, 44087, 44089, 44101,
-44111, 44119, 44123, 44129, 44131, 44159, 44171, 44179, 44189, 44201,
-44203, 44207, 44221, 44249, 44257, 44263, 44267, 44269, 44273, 44279,
-44281, 44293, 44351, 44357, 44371, 44381, 44383, 44389, 44417, 44449,
-44453, 44483, 44491, 44497, 44501, 44507, 44519, 44531, 44533, 44537,
-44543, 44549, 44563, 44579, 44587, 44617, 44621, 44623, 44633, 44641,
-44647, 44651, 44657, 44683, 44687, 44699, 44701, 44711, 44729, 44741,
-44753, 44771, 44773, 44777, 44789, 44797, 44809, 44819, 44839, 44843,
-44851, 44867, 44879, 44887, 44893, 44909, 44917, 44927, 44939, 44953,
-44959, 44963, 44971, 44983, 44987, 45007, 45013, 45053, 45061, 45077,
-45083, 45119, 45121, 45127, 45131, 45137, 45139, 45161, 45179, 45181,
-45191, 45197, 45233, 45247, 45259, 45263, 45281, 45289, 45293, 45307,
-45317, 45319, 45329, 45337, 45341, 45343, 45361, 45377, 45389, 45403,
-45413, 45427, 45433, 45439, 45481, 45491, 45497, 45503, 45523, 45533,
-45541, 45553, 45557, 45569, 45587, 45589, 45599, 45613, 45631, 45641,
-45659, 45667, 45673, 45677, 45691, 45697, 45707, 45737, 45751, 45757,
-45763, 45767, 45779, 45817, 45821, 45823, 45827, 45833, 45841, 45853,
-45863, 45869, 45887, 45893, 45943, 45949, 45953, 45959, 45971, 45979,
-45989, 46021, 46027, 46049, 46051, 46061, 46073, 46091, 46093, 46099,
-46103, 46133, 46141, 46147, 46153, 46171, 46181, 46183, 46187, 46199,
-46219, 46229, 46237, 46261, 46271, 46273, 46279, 46301, 46307, 46309,
-46327, 46337, 46349, 46351, 46381, 46399, 46411, 46439, 46441, 46447,
-46451, 46457, 46471, 46477, 46489, 46499, 46507, 46511, 46523, 46549,
-46559, 46567, 46573, 46589, 46591, 46601, 46619, 46633, 46639, 46643,
-46649, 46663, 46679, 46681, 46687, 46691, 46703, 46723, 46727, 46747,
-46751, 46757, 46769, 46771, 46807, 46811, 46817, 46819, 46829, 46831,
-46853, 46861, 46867, 46877, 46889, 46901, 46919, 46933, 46957, 46993,
-46997, 47017, 47041, 47051, 47057, 47059, 47087, 47093, 47111, 47119,
-47123, 47129, 47137, 47143, 47147, 47149, 47161, 47189, 47207, 47221,
-47237, 47251, 47269, 47279, 47287, 47293, 47297, 47303, 47309, 47317,
-47339, 47351, 47353, 47363, 47381, 47387, 47389, 47407, 47417, 47419,
-47431, 47441, 47459, 47491, 47497, 47501, 47507, 47513, 47521, 47527,
-47533, 47543, 47563, 47569, 47581, 47591, 47599, 47609, 47623, 47629,
-47639, 47653, 47657, 47659, 47681, 47699, 47701, 47711, 47713, 47717,
-47737, 47741, 47743, 47777, 47779, 47791, 47797, 47807, 47809, 47819,
-47837, 47843, 47857, 47869, 47881, 47903, 47911, 47917, 47933, 47939,
-47947, 47951, 47963, 47969, 47977, 47981, 48017, 48023, 48029, 48049,
-48073, 48079, 48091, 48109, 48119, 48121, 48131, 48157, 48163, 48179,
-48187, 48193, 48197, 48221, 48239, 48247, 48259, 48271, 48281, 48299,
-48311, 48313, 48337, 48341, 48353, 48371, 48383, 48397, 48407, 48409,
-48413, 48437, 48449, 48463, 48473, 48479, 48481, 48487, 48491, 48497,
-48523, 48527, 48533, 48539, 48541, 48563, 48571, 48589, 48593, 48611,
-48619, 48623, 48647, 48649, 48661, 48673, 48677, 48679, 48731, 48733,
-48751, 48757, 48761, 48767, 48779, 48781, 48787, 48799, 48809, 48817,
-48821, 48823, 48847, 48857, 48859, 48869, 48871, 48883, 48889, 48907,
-48947, 48953, 48973, 48989, 48991, 49003, 49009, 49019, 49031, 49033,
-49037, 49043, 49057, 49069, 49081, 49103, 49109, 49117, 49121, 49123,
-49139, 49157, 49169, 49171, 49177, 49193, 49199, 49201, 49207, 49211,
-49223, 49253, 49261, 49277, 49279, 49297, 49307, 49331, 49333, 49339,
-49363, 49367, 49369, 49391, 49393, 49409, 49411, 49417, 49429, 49433,
-49451, 49459, 49463, 49477, 49481, 49499, 49523, 49529, 49531, 49537,
-49547, 49549, 49559, 49597, 49603, 49613, 49627, 49633, 49639, 49663,
-49667, 49669, 49681, 49697, 49711, 49727, 49739, 49741, 49747, 49757,
-49783, 49787, 49789, 49801, 49807, 49811, 49823, 49831, 49843, 49853,
-49871, 49877, 49891, 49919, 49921, 49927, 49937, 49939, 49943, 49957,
-49991, 49993, 49999, 50021, 50023, 50033, 50047, 50051, 50053, 50069,
-50077, 50087, 50093, 50101, 50111, 50119, 50123, 50129, 50131, 50147,
-50153, 50159, 50177, 50207, 50221, 50227, 50231, 50261, 50263, 50273,
-50287, 50291, 50311, 50321, 50329, 50333, 50341, 50359, 50363, 50377,
-50383, 50387, 50411, 50417, 50423, 50441, 50459, 50461, 50497, 50503,
-50513, 50527, 50539, 50543, 50549, 50551, 50581, 50587, 50591, 50593,
-50599, 50627, 50647, 50651, 50671, 50683, 50707, 50723, 50741, 50753,
-50767, 50773, 50777, 50789, 50821, 50833, 50839, 50849, 50857, 50867,
-50873, 50891, 50893, 50909, 50923, 50929, 50951, 50957, 50969, 50971,
-50989, 50993, 51001, 51031, 51043, 51047, 51059, 51061, 51071, 51109,
-51131, 51133, 51137, 51151, 51157, 51169, 51193, 51197, 51199, 51203,
-51217, 51229, 51239, 51241, 51257, 51263, 51283, 51287, 51307, 51329,
-51341, 51343, 51347, 51349, 51361, 51383, 51407, 51413, 51419, 51421,
-51427, 51431, 51437, 51439, 51449, 51461, 51473, 51479, 51481, 51487,
-51503, 51511, 51517, 51521, 51539, 51551, 51563, 51577, 51581, 51593,
-51599, 51607, 51613, 51631, 51637, 51647, 51659, 51673, 51679, 51683,
-51691, 51713, 51719, 51721, 51749, 51767, 51769, 51787, 51797, 51803,
-51817, 51827, 51829, 51839, 51853, 51859, 51869, 51871, 51893, 51899,
-51907, 51913, 51929, 51941, 51949, 51971, 51973, 51977, 51991, 52009,
-52021, 52027, 52051, 52057, 52067, 52069, 52081, 52103, 52121, 52127,
-52147, 52153, 52163, 52177, 52181, 52183, 52189, 52201, 52223, 52237,
-52249, 52253, 52259, 52267, 52289, 52291, 52301, 52313, 52321, 52361,
-52363, 52369, 52379, 52387, 52391, 52433, 52453, 52457, 52489, 52501,
-52511, 52517, 52529, 52541, 52543, 52553, 52561, 52567, 52571, 52579,
-52583, 52609, 52627, 52631, 52639, 52667, 52673, 52691, 52697, 52709,
-52711, 52721, 52727, 52733, 52747, 52757, 52769, 52783, 52807, 52813,
-52817, 52837, 52859, 52861, 52879, 52883, 52889, 52901, 52903, 52919,
-52937, 52951, 52957, 52963, 52967, 52973, 52981, 52999, 53003, 53017,
-53047, 53051, 53069, 53077, 53087, 53089, 53093, 53101, 53113, 53117,
-53129, 53147, 53149, 53161, 53171, 53173, 53189, 53197, 53201, 53231,
-53233, 53239, 53267, 53269, 53279, 53281, 53299, 53309, 53323, 53327,
-53353, 53359, 53377, 53381, 53401, 53407, 53411, 53419, 53437, 53441,
-53453, 53479, 53503, 53507, 53527, 53549, 53551, 53569, 53591, 53593,
-53597, 53609, 53611, 53617, 53623, 53629, 53633, 53639, 53653, 53657,
-53681, 53693, 53699, 53717, 53719, 53731, 53759, 53773, 53777, 53783,
-53791, 53813, 53819, 53831, 53849, 53857, 53861, 53881, 53887, 53891,
-53897, 53899, 53917, 53923, 53927, 53939, 53951, 53959, 53987, 53993,
-54001, 54011, 54013, 54037, 54049, 54059, 54083, 54091, 54101, 54121,
-54133, 54139, 54151, 54163, 54167, 54181, 54193, 54217, 54251, 54269,
-54277, 54287, 54293, 54311, 54319, 54323, 54331, 54347, 54361, 54367,
-54371, 54377, 54401, 54403, 54409, 54413, 54419, 54421, 54437, 54443,
-54449, 54469, 54493, 54497, 54499, 54503, 54517, 54521, 54539, 54541,
-54547, 54559, 54563, 54577, 54581, 54583, 54601, 54617, 54623, 54629,
-54631, 54647, 54667, 54673, 54679, 54709, 54713, 54721, 54727, 54751,
-54767, 54773, 54779, 54787, 54799, 54829, 54833, 54851, 54869, 54877,
-54881, 54907, 54917, 54919, 54941, 54949, 54959, 54973, 54979, 54983,
-55001, 55009, 55021, 55049, 55051, 55057, 55061, 55073, 55079, 55103,
-55109, 55117, 55127, 55147, 55163, 55171, 55201, 55207, 55213, 55217,
-55219, 55229, 55243, 55249, 55259, 55291, 55313, 55331, 55333, 55337,
-55339, 55343, 55351, 55373, 55381, 55399, 55411, 55439, 55441, 55457,
-55469, 55487, 55501, 55511, 55529, 55541, 55547, 55579, 55589, 55603,
-55609, 55619, 55621, 55631, 55633, 55639, 55661, 55663, 55667, 55673,
-55681, 55691, 55697, 55711, 55717, 55721, 55733, 55763, 55787, 55793,
-55799, 55807, 55813, 55817, 55819, 55823, 55829, 55837, 55843, 55849,
-55871, 55889, 55897, 55901, 55903, 55921, 55927, 55931, 55933, 55949,
-55967, 55987, 55997, 56003, 56009, 56039, 56041, 56053, 56081, 56087,
-56093, 56099, 56101, 56113, 56123, 56131, 56149, 56167, 56171, 56179,
-56197, 56207, 56209, 56237, 56239, 56249, 56263, 56267, 56269, 56299,
-56311, 56333, 56359, 56369, 56377, 56383, 56393, 56401, 56417, 56431,
-56437, 56443, 56453, 56467, 56473, 56477, 56479, 56489, 56501, 56503,
-56509, 56519, 56527, 56531, 56533, 56543, 56569, 56591, 56597, 56599,
-56611, 56629, 56633, 56659, 56663, 56671, 56681, 56687, 56701, 56711,
-56713, 56731, 56737, 56747, 56767, 56773, 56779, 56783, 56807, 56809,
-56813, 56821, 56827, 56843, 56857, 56873, 56891, 56893, 56897, 56909,
-56911, 56921, 56923, 56929, 56941, 56951, 56957, 56963, 56983, 56989,
-56993, 56999, 57037, 57041, 57047, 57059, 57073, 57077, 57089, 57097,
-57107, 57119, 57131, 57139, 57143, 57149, 57163, 57173, 57179, 57191,
-57193, 57203, 57221, 57223, 57241, 57251, 57259, 57269, 57271, 57283,
-57287, 57301, 57329, 57331, 57347, 57349, 57367, 57373, 57383, 57389,
-57397, 57413, 57427, 57457, 57467, 57487, 57493, 57503, 57527, 57529,
-57557, 57559, 57571, 57587, 57593, 57601, 57637, 57641, 57649, 57653,
-57667, 57679, 57689, 57697, 57709, 57713, 57719, 57727, 57731, 57737,
-57751, 57773, 57781, 57787, 57791, 57793, 57803, 57809, 57829, 57839,
-57847, 57853, 57859, 57881, 57899, 57901, 57917, 57923, 57943, 57947,
-57973, 57977, 57991, 58013, 58027, 58031, 58043, 58049, 58057, 58061,
-58067, 58073, 58099, 58109, 58111, 58129, 58147, 58151, 58153, 58169,
-58171, 58189, 58193, 58199, 58207, 58211, 58217, 58229, 58231, 58237,
-58243, 58271, 58309, 58313, 58321, 58337, 58363, 58367, 58369, 58379,
-58391, 58393, 58403, 58411, 58417, 58427, 58439, 58441, 58451, 58453,
-58477, 58481, 58511, 58537, 58543, 58549, 58567, 58573, 58579, 58601,
-58603, 58613, 58631, 58657, 58661, 58679, 58687, 58693, 58699, 58711,
-58727, 58733, 58741, 58757, 58763, 58771, 58787, 58789, 58831, 58889,
-58897, 58901, 58907, 58909, 58913, 58921, 58937, 58943, 58963, 58967,
-58979, 58991, 58997, 59009, 59011, 59021, 59023, 59029, 59051, 59053,
-59063, 59069, 59077, 59083, 59093, 59107, 59113, 59119, 59123, 59141,
-59149, 59159, 59167, 59183, 59197, 59207, 59209, 59219, 59221, 59233,
-59239, 59243, 59263, 59273, 59281, 59333, 59341, 59351, 59357, 59359,
-59369, 59377, 59387, 59393, 59399, 59407, 59417, 59419, 59441, 59443,
-59447, 59453, 59467, 59471, 59473, 59497, 59509, 59513, 59539, 59557,
-59561, 59567, 59581, 59611, 59617, 59621, 59627, 59629, 59651, 59659,
-59663, 59669, 59671, 59693, 59699, 59707, 59723, 59729, 59743, 59747,
-59753, 59771, 59779, 59791, 59797, 59809, 59833, 59863, 59879, 59887,
-59921, 59929, 59951, 59957, 59971, 59981, 59999, 60013, 60017, 60029,
-60037, 60041, 60077, 60083, 60089, 60091, 60101, 60103, 60107, 60127,
-60133, 60139, 60149, 60161, 60167, 60169, 60209, 60217, 60223, 60251,
-60257, 60259, 60271, 60289, 60293, 60317, 60331, 60337, 60343, 60353,
-60373, 60383, 60397, 60413, 60427, 60443, 60449, 60457, 60493, 60497,
-60509, 60521, 60527, 60539, 60589, 60601, 60607, 60611, 60617, 60623,
-60631, 60637, 60647, 60649, 60659, 60661, 60679, 60689, 60703, 60719,
-60727, 60733, 60737, 60757, 60761, 60763, 60773, 60779, 60793, 60811,
-60821, 60859, 60869, 60887, 60889, 60899, 60901, 60913, 60917, 60919,
-60923, 60937, 60943, 60953, 60961, 61001, 61007, 61027, 61031, 61043,
-61051, 61057, 61091, 61099, 61121, 61129, 61141, 61151, 61153, 61169,
-61211, 61223, 61231, 61253, 61261, 61283, 61291, 61297, 61331, 61333,
-61339, 61343, 61357, 61363, 61379, 61381, 61403, 61409, 61417, 61441,
-61463, 61469, 61471, 61483, 61487, 61493, 61507, 61511, 61519, 61543,
-61547, 61553, 61559, 61561, 61583, 61603, 61609, 61613, 61627, 61631,
-61637, 61643, 61651, 61657, 61667, 61673, 61681, 61687, 61703, 61717,
-61723, 61729, 61751, 61757, 61781, 61813, 61819, 61837, 61843, 61861,
-61871, 61879, 61909, 61927, 61933, 61949, 61961, 61967, 61979, 61981,
-61987, 61991, 62003, 62011, 62017, 62039, 62047, 62053, 62057, 62071,
-62081, 62099, 62119, 62129, 62131, 62137, 62141, 62143, 62171, 62189,
-62191, 62201, 62207, 62213, 62219, 62233, 62273, 62297, 62299, 62303,
-62311, 62323, 62327, 62347, 62351, 62383, 62401, 62417, 62423, 62459,
-62467, 62473, 62477, 62483, 62497, 62501, 62507, 62533, 62539, 62549,
-62563, 62581, 62591, 62597, 62603, 62617, 62627, 62633, 62639, 62653,
-62659, 62683, 62687, 62701, 62723, 62731, 62743, 62753, 62761, 62773,
-62791, 62801, 62819, 62827, 62851, 62861, 62869, 62873, 62897, 62903,
-62921, 62927, 62929, 62939, 62969, 62971, 62981, 62983, 62987, 62989,
-63029, 63031, 63059, 63067, 63073, 63079, 63097, 63103, 63113, 63127,
-63131, 63149, 63179, 63197, 63199, 63211, 63241, 63247, 63277, 63281,
-63299, 63311, 63313, 63317, 63331, 63337, 63347, 63353, 63361, 63367,
-63377, 63389, 63391, 63397, 63409, 63419, 63421, 63439, 63443, 63463,
-63467, 63473, 63487, 63493, 63499, 63521, 63527, 63533, 63541, 63559,
-63577, 63587, 63589, 63599, 63601, 63607, 63611, 63617, 63629, 63647,
-63649, 63659, 63667, 63671, 63689, 63691, 63697, 63703, 63709, 63719,
-63727, 63737, 63743, 63761, 63773, 63781, 63793, 63799, 63803, 63809,
-63823, 63839, 63841, 63853, 63857, 63863, 63901, 63907, 63913, 63929,
-63949, 63977, 63997, 64007, 64013, 64019, 64033, 64037, 64063, 64067,
-64081, 64091, 64109, 64123, 64151, 64153, 64157, 64171, 64187, 64189,
-64217, 64223, 64231, 64237, 64271, 64279, 64283, 64301, 64303, 64319,
-64327, 64333, 64373, 64381, 64399, 64403, 64433, 64439, 64451, 64453,
-64483, 64489, 64499, 64513, 64553, 64567, 64577, 64579, 64591, 64601,
-64609, 64613, 64621, 64627, 64633, 64661, 64663, 64667, 64679, 64693,
-64709, 64717, 64747, 64763, 64781, 64783, 64793, 64811, 64817, 64849,
-64853, 64871, 64877, 64879, 64891, 64901, 64919, 64921, 64927, 64937,
-64951, 64969, 64997, 65003, 65011, 65027, 65029, 65033, 65053, 65063,
-65071, 65089, 65099, 65101, 65111, 65119, 65123, 65129, 65141, 65147,
-65167, 65171, 65173, 65179, 65183, 65203, 65213, 65239, 65257, 65267,
-65269, 65287, 65293, 65309, 65323, 65327, 65353, 65357, 65371, 65381,
-65393, 65407, 65413, 65419, 65423, 65437, 65447, 65449, 65479, 65497,
+2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
+31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
+73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
+127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
+179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
+233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
+283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
+353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
+419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
+467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
+547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
+607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
+661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
+739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
+811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
+877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
+947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013,
+1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069,
+1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
+1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
+1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291,
+1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373,
+1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,
+1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
+1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583,
+1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657,
+1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,
+1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
+1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
+1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987,
+1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,
+2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,
+2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213,
+2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287,
+2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,
+2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,
+2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531,
+2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617,
+2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,
+2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,
+2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819,
+2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903,
+2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,
+3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,
+3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181,
+3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257,
+3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,
+3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,
+3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511,
+3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571,
+3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,
+3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,
+3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821,
+3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907,
+3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,
+4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,
+4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139,
+4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231,
+4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,
+4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409,
+4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493,
+4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583,
+4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,
+4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751,
+4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831,
+4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937,
+4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003,
+5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087,
+5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179,
+5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279,
+5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387,
+5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443,
+5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521,
+5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639,
+5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693,
+5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791,
+5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857,
+5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939,
+5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053,
+6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133,
+6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221,
+6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301,
+6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367,
+6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473,
+6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571,
+6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673,
+6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761,
+6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833,
+6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917,
+6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997,
+7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103,
+7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207,
+7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297,
+7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411,
+7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499,
+7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561,
+7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643,
+7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723,
+7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829,
+7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919,
+7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017,
+8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111,
+8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219,
+8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291,
+8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387,
+8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501,
+8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597,
+8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677,
+8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741,
+8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831,
+8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929,
+8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011,
+9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109,
+9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199,
+9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283,
+9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377,
+9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439,
+9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533,
+9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631,
+9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733,
+9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811,
+9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887,
+9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007,
+10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099,
+10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177,
+10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271,
+10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343,
+10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459,
+10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567,
+10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657,
+10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739,
+10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859,
+10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949,
+10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059,
+11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149,
+11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251,
+11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329,
+11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443,
+11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527,
+11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657,
+11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777,
+11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833,
+11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933,
+11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011,
+12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109,
+12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211,
+12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289,
+12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401,
+12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487,
+12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553,
+12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641,
+12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739,
+12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829,
+12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923,
+12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007,
+13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109,
+13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187,
+13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309,
+13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411,
+13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499,
+13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619,
+13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697,
+13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781,
+13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879,
+13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967,
+13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081,
+14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197,
+14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323,
+14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419,
+14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519,
+14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593,
+14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699,
+14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767,
+14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851,
+14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947,
+14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073,
+15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149,
+15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259,
+15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319,
+15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401,
+15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497,
+15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607,
+15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679,
+15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773,
+15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881,
+15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971,
+15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069,
+16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183,
+16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267,
+16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381,
+16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481,
+16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603,
+16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691,
+16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811,
+16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903,
+16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993,
+17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093,
+17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191,
+17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317,
+17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389,
+17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477,
+17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573,
+17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669,
+17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783,
+17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891,
+17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971,
+17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059,
+18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143,
+18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233,
+18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313,
+18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427,
+18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517,
+18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637,
+18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749,
+18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899,
+18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009,
+19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121,
+19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219,
+19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319,
+19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423,
+19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477,
+19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571,
+19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699,
+19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793,
+19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891,
+19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991,
+19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071,
+20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149,
+20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261,
+20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357,
+20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443,
+20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551,
+20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693,
+20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771,
+20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897,
+20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983,
+21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067,
+21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169,
+21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277,
+21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383,
+21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491,
+21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563,
+21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647,
+21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751,
+21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841,
+21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943,
+21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039,
+22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123,
+22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229,
+22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307,
+22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441,
+22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543,
+22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643,
+22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727,
+22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817,
+22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943,
+22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029,
+23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099,
+23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203,
+23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321,
+23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447,
+23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561,
+23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629,
+23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743,
+23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827,
+23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909,
+23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007,
+24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091,
+24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169,
+24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281,
+24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413,
+24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517,
+24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659,
+24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767,
+24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877,
+24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977,
+24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097,
+25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183,
+25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303,
+25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391,
+25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471,
+25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603,
+25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693,
+25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799,
+25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913,
+25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999,
+26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111,
+26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203,
+26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297,
+26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399,
+26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497,
+26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633,
+26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711,
+26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801,
+26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891,
+26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987,
+26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077,
+27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211,
+27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329,
+27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449,
+27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551,
+27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691,
+27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767,
+27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827,
+27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947,
+27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051,
+28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151,
+28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283,
+28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403,
+28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499,
+28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579,
+28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649,
+28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729,
+28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837,
+28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933,
+28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059,
+29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167,
+29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251,
+29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363,
+29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443,
+29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573,
+29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671,
+29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819,
+29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921,
+29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059,
+30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137,
+30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241,
+30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341,
+30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469,
+30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559,
+30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689,
+30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803,
+30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871,
+30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983,
+31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091,
+31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183,
+31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259,
+31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357,
+31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511,
+31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601,
+31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721,
+31723, 31727, 31729, 31741, 31751, 31769, 31771, 31793, 31799, 31817,
+31847, 31849, 31859, 31873, 31883, 31891, 31907, 31957, 31963, 31973,
+31981, 31991, 32003, 32009, 32027, 32029, 32051, 32057, 32059, 32063,
+32069, 32077, 32083, 32089, 32099, 32117, 32119, 32141, 32143, 32159,
+32173, 32183, 32189, 32191, 32203, 32213, 32233, 32237, 32251, 32257,
+32261, 32297, 32299, 32303, 32309, 32321, 32323, 32327, 32341, 32353,
+32359, 32363, 32369, 32371, 32377, 32381, 32401, 32411, 32413, 32423,
+32429, 32441, 32443, 32467, 32479, 32491, 32497, 32503, 32507, 32531,
+32533, 32537, 32561, 32563, 32569, 32573, 32579, 32587, 32603, 32609,
+32611, 32621, 32633, 32647, 32653, 32687, 32693, 32707, 32713, 32717,
+32719, 32749, 32771, 32779, 32783, 32789, 32797, 32801, 32803, 32831,
+32833, 32839, 32843, 32869, 32887, 32909, 32911, 32917, 32933, 32939,
+32941, 32957, 32969, 32971, 32983, 32987, 32993, 32999, 33013, 33023,
+33029, 33037, 33049, 33053, 33071, 33073, 33083, 33091, 33107, 33113,
+33119, 33149, 33151, 33161, 33179, 33181, 33191, 33199, 33203, 33211,
+33223, 33247, 33287, 33289, 33301, 33311, 33317, 33329, 33331, 33343,
+33347, 33349, 33353, 33359, 33377, 33391, 33403, 33409, 33413, 33427,
+33457, 33461, 33469, 33479, 33487, 33493, 33503, 33521, 33529, 33533,
+33547, 33563, 33569, 33577, 33581, 33587, 33589, 33599, 33601, 33613,
+33617, 33619, 33623, 33629, 33637, 33641, 33647, 33679, 33703, 33713,
+33721, 33739, 33749, 33751, 33757, 33767, 33769, 33773, 33791, 33797,
+33809, 33811, 33827, 33829, 33851, 33857, 33863, 33871, 33889, 33893,
+33911, 33923, 33931, 33937, 33941, 33961, 33967, 33997, 34019, 34031,
+34033, 34039, 34057, 34061, 34123, 34127, 34129, 34141, 34147, 34157,
+34159, 34171, 34183, 34211, 34213, 34217, 34231, 34253, 34259, 34261,
+34267, 34273, 34283, 34297, 34301, 34303, 34313, 34319, 34327, 34337,
+34351, 34361, 34367, 34369, 34381, 34403, 34421, 34429, 34439, 34457,
+34469, 34471, 34483, 34487, 34499, 34501, 34511, 34513, 34519, 34537,
+34543, 34549, 34583, 34589, 34591, 34603, 34607, 34613, 34631, 34649,
+34651, 34667, 34673, 34679, 34687, 34693, 34703, 34721, 34729, 34739,
+34747, 34757, 34759, 34763, 34781, 34807, 34819, 34841, 34843, 34847,
+34849, 34871, 34877, 34883, 34897, 34913, 34919, 34939, 34949, 34961,
+34963, 34981, 35023, 35027, 35051, 35053, 35059, 35069, 35081, 35083,
+35089, 35099, 35107, 35111, 35117, 35129, 35141, 35149, 35153, 35159,
+35171, 35201, 35221, 35227, 35251, 35257, 35267, 35279, 35281, 35291,
+35311, 35317, 35323, 35327, 35339, 35353, 35363, 35381, 35393, 35401,
+35407, 35419, 35423, 35437, 35447, 35449, 35461, 35491, 35507, 35509,
+35521, 35527, 35531, 35533, 35537, 35543, 35569, 35573, 35591, 35593,
+35597, 35603, 35617, 35671, 35677, 35729, 35731, 35747, 35753, 35759,
+35771, 35797, 35801, 35803, 35809, 35831, 35837, 35839, 35851, 35863,
+35869, 35879, 35897, 35899, 35911, 35923, 35933, 35951, 35963, 35969,
+35977, 35983, 35993, 35999, 36007, 36011, 36013, 36017, 36037, 36061,
+36067, 36073, 36083, 36097, 36107, 36109, 36131, 36137, 36151, 36161,
+36187, 36191, 36209, 36217, 36229, 36241, 36251, 36263, 36269, 36277,
+36293, 36299, 36307, 36313, 36319, 36341, 36343, 36353, 36373, 36383,
+36389, 36433, 36451, 36457, 36467, 36469, 36473, 36479, 36493, 36497,
+36523, 36527, 36529, 36541, 36551, 36559, 36563, 36571, 36583, 36587,
+36599, 36607, 36629, 36637, 36643, 36653, 36671, 36677, 36683, 36691,
+36697, 36709, 36713, 36721, 36739, 36749, 36761, 36767, 36779, 36781,
+36787, 36791, 36793, 36809, 36821, 36833, 36847, 36857, 36871, 36877,
+36887, 36899, 36901, 36913, 36919, 36923, 36929, 36931, 36943, 36947,
+36973, 36979, 36997, 37003, 37013, 37019, 37021, 37039, 37049, 37057,
+37061, 37087, 37097, 37117, 37123, 37139, 37159, 37171, 37181, 37189,
+37199, 37201, 37217, 37223, 37243, 37253, 37273, 37277, 37307, 37309,
+37313, 37321, 37337, 37339, 37357, 37361, 37363, 37369, 37379, 37397,
+37409, 37423, 37441, 37447, 37463, 37483, 37489, 37493, 37501, 37507,
+37511, 37517, 37529, 37537, 37547, 37549, 37561, 37567, 37571, 37573,
+37579, 37589, 37591, 37607, 37619, 37633, 37643, 37649, 37657, 37663,
+37691, 37693, 37699, 37717, 37747, 37781, 37783, 37799, 37811, 37813,
+37831, 37847, 37853, 37861, 37871, 37879, 37889, 37897, 37907, 37951,
+37957, 37963, 37967, 37987, 37991, 37993, 37997, 38011, 38039, 38047,
+38053, 38069, 38083, 38113, 38119, 38149, 38153, 38167, 38177, 38183,
+38189, 38197, 38201, 38219, 38231, 38237, 38239, 38261, 38273, 38281,
+38287, 38299, 38303, 38317, 38321, 38327, 38329, 38333, 38351, 38371,
+38377, 38393, 38431, 38447, 38449, 38453, 38459, 38461, 38501, 38543,
+38557, 38561, 38567, 38569, 38593, 38603, 38609, 38611, 38629, 38639,
+38651, 38653, 38669, 38671, 38677, 38693, 38699, 38707, 38711, 38713,
+38723, 38729, 38737, 38747, 38749, 38767, 38783, 38791, 38803, 38821,
+38833, 38839, 38851, 38861, 38867, 38873, 38891, 38903, 38917, 38921,
+38923, 38933, 38953, 38959, 38971, 38977, 38993, 39019, 39023, 39041,
+39043, 39047, 39079, 39089, 39097, 39103, 39107, 39113, 39119, 39133,
+39139, 39157, 39161, 39163, 39181, 39191, 39199, 39209, 39217, 39227,
+39229, 39233, 39239, 39241, 39251, 39293, 39301, 39313, 39317, 39323,
+39341, 39343, 39359, 39367, 39371, 39373, 39383, 39397, 39409, 39419,
+39439, 39443, 39451, 39461, 39499, 39503, 39509, 39511, 39521, 39541,
+39551, 39563, 39569, 39581, 39607, 39619, 39623, 39631, 39659, 39667,
+39671, 39679, 39703, 39709, 39719, 39727, 39733, 39749, 39761, 39769,
+39779, 39791, 39799, 39821, 39827, 39829, 39839, 39841, 39847, 39857,
+39863, 39869, 39877, 39883, 39887, 39901, 39929, 39937, 39953, 39971,
+39979, 39983, 39989, 40009, 40013, 40031, 40037, 40039, 40063, 40087,
+40093, 40099, 40111, 40123, 40127, 40129, 40151, 40153, 40163, 40169,
+40177, 40189, 40193, 40213, 40231, 40237, 40241, 40253, 40277, 40283,
+40289, 40343, 40351, 40357, 40361, 40387, 40423, 40427, 40429, 40433,
+40459, 40471, 40483, 40487, 40493, 40499, 40507, 40519, 40529, 40531,
+40543, 40559, 40577, 40583, 40591, 40597, 40609, 40627, 40637, 40639,
+40693, 40697, 40699, 40709, 40739, 40751, 40759, 40763, 40771, 40787,
+40801, 40813, 40819, 40823, 40829, 40841, 40847, 40849, 40853, 40867,
+40879, 40883, 40897, 40903, 40927, 40933, 40939, 40949, 40961, 40973,
+40993, 41011, 41017, 41023, 41039, 41047, 41051, 41057, 41077, 41081,
+41113, 41117, 41131, 41141, 41143, 41149, 41161, 41177, 41179, 41183,
+41189, 41201, 41203, 41213, 41221, 41227, 41231, 41233, 41243, 41257,
+41263, 41269, 41281, 41299, 41333, 41341, 41351, 41357, 41381, 41387,
+41389, 41399, 41411, 41413, 41443, 41453, 41467, 41479, 41491, 41507,
+41513, 41519, 41521, 41539, 41543, 41549, 41579, 41593, 41597, 41603,
+41609, 41611, 41617, 41621, 41627, 41641, 41647, 41651, 41659, 41669,
+41681, 41687, 41719, 41729, 41737, 41759, 41761, 41771, 41777, 41801,
+41809, 41813, 41843, 41849, 41851, 41863, 41879, 41887, 41893, 41897,
+41903, 41911, 41927, 41941, 41947, 41953, 41957, 41959, 41969, 41981,
+41983, 41999, 42013, 42017, 42019, 42023, 42043, 42061, 42071, 42073,
+42083, 42089, 42101, 42131, 42139, 42157, 42169, 42179, 42181, 42187,
+42193, 42197, 42209, 42221, 42223, 42227, 42239, 42257, 42281, 42283,
+42293, 42299, 42307, 42323, 42331, 42337, 42349, 42359, 42373, 42379,
+42391, 42397, 42403, 42407, 42409, 42433, 42437, 42443, 42451, 42457,
+42461, 42463, 42467, 42473, 42487, 42491, 42499, 42509, 42533, 42557,
+42569, 42571, 42577, 42589, 42611, 42641, 42643, 42649, 42667, 42677,
+42683, 42689, 42697, 42701, 42703, 42709, 42719, 42727, 42737, 42743,
+42751, 42767, 42773, 42787, 42793, 42797, 42821, 42829, 42839, 42841,
+42853, 42859, 42863, 42899, 42901, 42923, 42929, 42937, 42943, 42953,
+42961, 42967, 42979, 42989, 43003, 43013, 43019, 43037, 43049, 43051,
+43063, 43067, 43093, 43103, 43117, 43133, 43151, 43159, 43177, 43189,
+43201, 43207, 43223, 43237, 43261, 43271, 43283, 43291, 43313, 43319,
+43321, 43331, 43391, 43397, 43399, 43403, 43411, 43427, 43441, 43451,
+43457, 43481, 43487, 43499, 43517, 43541, 43543, 43573, 43577, 43579,
+43591, 43597, 43607, 43609, 43613, 43627, 43633, 43649, 43651, 43661,
+43669, 43691, 43711, 43717, 43721, 43753, 43759, 43777, 43781, 43783,
+43787, 43789, 43793, 43801, 43853, 43867, 43889, 43891, 43913, 43933,
+43943, 43951, 43961, 43963, 43969, 43973, 43987, 43991, 43997, 44017,
+44021, 44027, 44029, 44041, 44053, 44059, 44071, 44087, 44089, 44101,
+44111, 44119, 44123, 44129, 44131, 44159, 44171, 44179, 44189, 44201,
+44203, 44207, 44221, 44249, 44257, 44263, 44267, 44269, 44273, 44279,
+44281, 44293, 44351, 44357, 44371, 44381, 44383, 44389, 44417, 44449,
+44453, 44483, 44491, 44497, 44501, 44507, 44519, 44531, 44533, 44537,
+44543, 44549, 44563, 44579, 44587, 44617, 44621, 44623, 44633, 44641,
+44647, 44651, 44657, 44683, 44687, 44699, 44701, 44711, 44729, 44741,
+44753, 44771, 44773, 44777, 44789, 44797, 44809, 44819, 44839, 44843,
+44851, 44867, 44879, 44887, 44893, 44909, 44917, 44927, 44939, 44953,
+44959, 44963, 44971, 44983, 44987, 45007, 45013, 45053, 45061, 45077,
+45083, 45119, 45121, 45127, 45131, 45137, 45139, 45161, 45179, 45181,
+45191, 45197, 45233, 45247, 45259, 45263, 45281, 45289, 45293, 45307,
+45317, 45319, 45329, 45337, 45341, 45343, 45361, 45377, 45389, 45403,
+45413, 45427, 45433, 45439, 45481, 45491, 45497, 45503, 45523, 45533,
+45541, 45553, 45557, 45569, 45587, 45589, 45599, 45613, 45631, 45641,
+45659, 45667, 45673, 45677, 45691, 45697, 45707, 45737, 45751, 45757,
+45763, 45767, 45779, 45817, 45821, 45823, 45827, 45833, 45841, 45853,
+45863, 45869, 45887, 45893, 45943, 45949, 45953, 45959, 45971, 45979,
+45989, 46021, 46027, 46049, 46051, 46061, 46073, 46091, 46093, 46099,
+46103, 46133, 46141, 46147, 46153, 46171, 46181, 46183, 46187, 46199,
+46219, 46229, 46237, 46261, 46271, 46273, 46279, 46301, 46307, 46309,
+46327, 46337, 46349, 46351, 46381, 46399, 46411, 46439, 46441, 46447,
+46451, 46457, 46471, 46477, 46489, 46499, 46507, 46511, 46523, 46549,
+46559, 46567, 46573, 46589, 46591, 46601, 46619, 46633, 46639, 46643,
+46649, 46663, 46679, 46681, 46687, 46691, 46703, 46723, 46727, 46747,
+46751, 46757, 46769, 46771, 46807, 46811, 46817, 46819, 46829, 46831,
+46853, 46861, 46867, 46877, 46889, 46901, 46919, 46933, 46957, 46993,
+46997, 47017, 47041, 47051, 47057, 47059, 47087, 47093, 47111, 47119,
+47123, 47129, 47137, 47143, 47147, 47149, 47161, 47189, 47207, 47221,
+47237, 47251, 47269, 47279, 47287, 47293, 47297, 47303, 47309, 47317,
+47339, 47351, 47353, 47363, 47381, 47387, 47389, 47407, 47417, 47419,
+47431, 47441, 47459, 47491, 47497, 47501, 47507, 47513, 47521, 47527,
+47533, 47543, 47563, 47569, 47581, 47591, 47599, 47609, 47623, 47629,
+47639, 47653, 47657, 47659, 47681, 47699, 47701, 47711, 47713, 47717,
+47737, 47741, 47743, 47777, 47779, 47791, 47797, 47807, 47809, 47819,
+47837, 47843, 47857, 47869, 47881, 47903, 47911, 47917, 47933, 47939,
+47947, 47951, 47963, 47969, 47977, 47981, 48017, 48023, 48029, 48049,
+48073, 48079, 48091, 48109, 48119, 48121, 48131, 48157, 48163, 48179,
+48187, 48193, 48197, 48221, 48239, 48247, 48259, 48271, 48281, 48299,
+48311, 48313, 48337, 48341, 48353, 48371, 48383, 48397, 48407, 48409,
+48413, 48437, 48449, 48463, 48473, 48479, 48481, 48487, 48491, 48497,
+48523, 48527, 48533, 48539, 48541, 48563, 48571, 48589, 48593, 48611,
+48619, 48623, 48647, 48649, 48661, 48673, 48677, 48679, 48731, 48733,
+48751, 48757, 48761, 48767, 48779, 48781, 48787, 48799, 48809, 48817,
+48821, 48823, 48847, 48857, 48859, 48869, 48871, 48883, 48889, 48907,
+48947, 48953, 48973, 48989, 48991, 49003, 49009, 49019, 49031, 49033,
+49037, 49043, 49057, 49069, 49081, 49103, 49109, 49117, 49121, 49123,
+49139, 49157, 49169, 49171, 49177, 49193, 49199, 49201, 49207, 49211,
+49223, 49253, 49261, 49277, 49279, 49297, 49307, 49331, 49333, 49339,
+49363, 49367, 49369, 49391, 49393, 49409, 49411, 49417, 49429, 49433,
+49451, 49459, 49463, 49477, 49481, 49499, 49523, 49529, 49531, 49537,
+49547, 49549, 49559, 49597, 49603, 49613, 49627, 49633, 49639, 49663,
+49667, 49669, 49681, 49697, 49711, 49727, 49739, 49741, 49747, 49757,
+49783, 49787, 49789, 49801, 49807, 49811, 49823, 49831, 49843, 49853,
+49871, 49877, 49891, 49919, 49921, 49927, 49937, 49939, 49943, 49957,
+49991, 49993, 49999, 50021, 50023, 50033, 50047, 50051, 50053, 50069,
+50077, 50087, 50093, 50101, 50111, 50119, 50123, 50129, 50131, 50147,
+50153, 50159, 50177, 50207, 50221, 50227, 50231, 50261, 50263, 50273,
+50287, 50291, 50311, 50321, 50329, 50333, 50341, 50359, 50363, 50377,
+50383, 50387, 50411, 50417, 50423, 50441, 50459, 50461, 50497, 50503,
+50513, 50527, 50539, 50543, 50549, 50551, 50581, 50587, 50591, 50593,
+50599, 50627, 50647, 50651, 50671, 50683, 50707, 50723, 50741, 50753,
+50767, 50773, 50777, 50789, 50821, 50833, 50839, 50849, 50857, 50867,
+50873, 50891, 50893, 50909, 50923, 50929, 50951, 50957, 50969, 50971,
+50989, 50993, 51001, 51031, 51043, 51047, 51059, 51061, 51071, 51109,
+51131, 51133, 51137, 51151, 51157, 51169, 51193, 51197, 51199, 51203,
+51217, 51229, 51239, 51241, 51257, 51263, 51283, 51287, 51307, 51329,
+51341, 51343, 51347, 51349, 51361, 51383, 51407, 51413, 51419, 51421,
+51427, 51431, 51437, 51439, 51449, 51461, 51473, 51479, 51481, 51487,
+51503, 51511, 51517, 51521, 51539, 51551, 51563, 51577, 51581, 51593,
+51599, 51607, 51613, 51631, 51637, 51647, 51659, 51673, 51679, 51683,
+51691, 51713, 51719, 51721, 51749, 51767, 51769, 51787, 51797, 51803,
+51817, 51827, 51829, 51839, 51853, 51859, 51869, 51871, 51893, 51899,
+51907, 51913, 51929, 51941, 51949, 51971, 51973, 51977, 51991, 52009,
+52021, 52027, 52051, 52057, 52067, 52069, 52081, 52103, 52121, 52127,
+52147, 52153, 52163, 52177, 52181, 52183, 52189, 52201, 52223, 52237,
+52249, 52253, 52259, 52267, 52289, 52291, 52301, 52313, 52321, 52361,
+52363, 52369, 52379, 52387, 52391, 52433, 52453, 52457, 52489, 52501,
+52511, 52517, 52529, 52541, 52543, 52553, 52561, 52567, 52571, 52579,
+52583, 52609, 52627, 52631, 52639, 52667, 52673, 52691, 52697, 52709,
+52711, 52721, 52727, 52733, 52747, 52757, 52769, 52783, 52807, 52813,
+52817, 52837, 52859, 52861, 52879, 52883, 52889, 52901, 52903, 52919,
+52937, 52951, 52957, 52963, 52967, 52973, 52981, 52999, 53003, 53017,
+53047, 53051, 53069, 53077, 53087, 53089, 53093, 53101, 53113, 53117,
+53129, 53147, 53149, 53161, 53171, 53173, 53189, 53197, 53201, 53231,
+53233, 53239, 53267, 53269, 53279, 53281, 53299, 53309, 53323, 53327,
+53353, 53359, 53377, 53381, 53401, 53407, 53411, 53419, 53437, 53441,
+53453, 53479, 53503, 53507, 53527, 53549, 53551, 53569, 53591, 53593,
+53597, 53609, 53611, 53617, 53623, 53629, 53633, 53639, 53653, 53657,
+53681, 53693, 53699, 53717, 53719, 53731, 53759, 53773, 53777, 53783,
+53791, 53813, 53819, 53831, 53849, 53857, 53861, 53881, 53887, 53891,
+53897, 53899, 53917, 53923, 53927, 53939, 53951, 53959, 53987, 53993,
+54001, 54011, 54013, 54037, 54049, 54059, 54083, 54091, 54101, 54121,
+54133, 54139, 54151, 54163, 54167, 54181, 54193, 54217, 54251, 54269,
+54277, 54287, 54293, 54311, 54319, 54323, 54331, 54347, 54361, 54367,
+54371, 54377, 54401, 54403, 54409, 54413, 54419, 54421, 54437, 54443,
+54449, 54469, 54493, 54497, 54499, 54503, 54517, 54521, 54539, 54541,
+54547, 54559, 54563, 54577, 54581, 54583, 54601, 54617, 54623, 54629,
+54631, 54647, 54667, 54673, 54679, 54709, 54713, 54721, 54727, 54751,
+54767, 54773, 54779, 54787, 54799, 54829, 54833, 54851, 54869, 54877,
+54881, 54907, 54917, 54919, 54941, 54949, 54959, 54973, 54979, 54983,
+55001, 55009, 55021, 55049, 55051, 55057, 55061, 55073, 55079, 55103,
+55109, 55117, 55127, 55147, 55163, 55171, 55201, 55207, 55213, 55217,
+55219, 55229, 55243, 55249, 55259, 55291, 55313, 55331, 55333, 55337,
+55339, 55343, 55351, 55373, 55381, 55399, 55411, 55439, 55441, 55457,
+55469, 55487, 55501, 55511, 55529, 55541, 55547, 55579, 55589, 55603,
+55609, 55619, 55621, 55631, 55633, 55639, 55661, 55663, 55667, 55673,
+55681, 55691, 55697, 55711, 55717, 55721, 55733, 55763, 55787, 55793,
+55799, 55807, 55813, 55817, 55819, 55823, 55829, 55837, 55843, 55849,
+55871, 55889, 55897, 55901, 55903, 55921, 55927, 55931, 55933, 55949,
+55967, 55987, 55997, 56003, 56009, 56039, 56041, 56053, 56081, 56087,
+56093, 56099, 56101, 56113, 56123, 56131, 56149, 56167, 56171, 56179,
+56197, 56207, 56209, 56237, 56239, 56249, 56263, 56267, 56269, 56299,
+56311, 56333, 56359, 56369, 56377, 56383, 56393, 56401, 56417, 56431,
+56437, 56443, 56453, 56467, 56473, 56477, 56479, 56489, 56501, 56503,
+56509, 56519, 56527, 56531, 56533, 56543, 56569, 56591, 56597, 56599,
+56611, 56629, 56633, 56659, 56663, 56671, 56681, 56687, 56701, 56711,
+56713, 56731, 56737, 56747, 56767, 56773, 56779, 56783, 56807, 56809,
+56813, 56821, 56827, 56843, 56857, 56873, 56891, 56893, 56897, 56909,
+56911, 56921, 56923, 56929, 56941, 56951, 56957, 56963, 56983, 56989,
+56993, 56999, 57037, 57041, 57047, 57059, 57073, 57077, 57089, 57097,
+57107, 57119, 57131, 57139, 57143, 57149, 57163, 57173, 57179, 57191,
+57193, 57203, 57221, 57223, 57241, 57251, 57259, 57269, 57271, 57283,
+57287, 57301, 57329, 57331, 57347, 57349, 57367, 57373, 57383, 57389,
+57397, 57413, 57427, 57457, 57467, 57487, 57493, 57503, 57527, 57529,
+57557, 57559, 57571, 57587, 57593, 57601, 57637, 57641, 57649, 57653,
+57667, 57679, 57689, 57697, 57709, 57713, 57719, 57727, 57731, 57737,
+57751, 57773, 57781, 57787, 57791, 57793, 57803, 57809, 57829, 57839,
+57847, 57853, 57859, 57881, 57899, 57901, 57917, 57923, 57943, 57947,
+57973, 57977, 57991, 58013, 58027, 58031, 58043, 58049, 58057, 58061,
+58067, 58073, 58099, 58109, 58111, 58129, 58147, 58151, 58153, 58169,
+58171, 58189, 58193, 58199, 58207, 58211, 58217, 58229, 58231, 58237,
+58243, 58271, 58309, 58313, 58321, 58337, 58363, 58367, 58369, 58379,
+58391, 58393, 58403, 58411, 58417, 58427, 58439, 58441, 58451, 58453,
+58477, 58481, 58511, 58537, 58543, 58549, 58567, 58573, 58579, 58601,
+58603, 58613, 58631, 58657, 58661, 58679, 58687, 58693, 58699, 58711,
+58727, 58733, 58741, 58757, 58763, 58771, 58787, 58789, 58831, 58889,
+58897, 58901, 58907, 58909, 58913, 58921, 58937, 58943, 58963, 58967,
+58979, 58991, 58997, 59009, 59011, 59021, 59023, 59029, 59051, 59053,
+59063, 59069, 59077, 59083, 59093, 59107, 59113, 59119, 59123, 59141,
+59149, 59159, 59167, 59183, 59197, 59207, 59209, 59219, 59221, 59233,
+59239, 59243, 59263, 59273, 59281, 59333, 59341, 59351, 59357, 59359,
+59369, 59377, 59387, 59393, 59399, 59407, 59417, 59419, 59441, 59443,
+59447, 59453, 59467, 59471, 59473, 59497, 59509, 59513, 59539, 59557,
+59561, 59567, 59581, 59611, 59617, 59621, 59627, 59629, 59651, 59659,
+59663, 59669, 59671, 59693, 59699, 59707, 59723, 59729, 59743, 59747,
+59753, 59771, 59779, 59791, 59797, 59809, 59833, 59863, 59879, 59887,
+59921, 59929, 59951, 59957, 59971, 59981, 59999, 60013, 60017, 60029,
+60037, 60041, 60077, 60083, 60089, 60091, 60101, 60103, 60107, 60127,
+60133, 60139, 60149, 60161, 60167, 60169, 60209, 60217, 60223, 60251,
+60257, 60259, 60271, 60289, 60293, 60317, 60331, 60337, 60343, 60353,
+60373, 60383, 60397, 60413, 60427, 60443, 60449, 60457, 60493, 60497,
+60509, 60521, 60527, 60539, 60589, 60601, 60607, 60611, 60617, 60623,
+60631, 60637, 60647, 60649, 60659, 60661, 60679, 60689, 60703, 60719,
+60727, 60733, 60737, 60757, 60761, 60763, 60773, 60779, 60793, 60811,
+60821, 60859, 60869, 60887, 60889, 60899, 60901, 60913, 60917, 60919,
+60923, 60937, 60943, 60953, 60961, 61001, 61007, 61027, 61031, 61043,
+61051, 61057, 61091, 61099, 61121, 61129, 61141, 61151, 61153, 61169,
+61211, 61223, 61231, 61253, 61261, 61283, 61291, 61297, 61331, 61333,
+61339, 61343, 61357, 61363, 61379, 61381, 61403, 61409, 61417, 61441,
+61463, 61469, 61471, 61483, 61487, 61493, 61507, 61511, 61519, 61543,
+61547, 61553, 61559, 61561, 61583, 61603, 61609, 61613, 61627, 61631,
+61637, 61643, 61651, 61657, 61667, 61673, 61681, 61687, 61703, 61717,
+61723, 61729, 61751, 61757, 61781, 61813, 61819, 61837, 61843, 61861,
+61871, 61879, 61909, 61927, 61933, 61949, 61961, 61967, 61979, 61981,
+61987, 61991, 62003, 62011, 62017, 62039, 62047, 62053, 62057, 62071,
+62081, 62099, 62119, 62129, 62131, 62137, 62141, 62143, 62171, 62189,
+62191, 62201, 62207, 62213, 62219, 62233, 62273, 62297, 62299, 62303,
+62311, 62323, 62327, 62347, 62351, 62383, 62401, 62417, 62423, 62459,
+62467, 62473, 62477, 62483, 62497, 62501, 62507, 62533, 62539, 62549,
+62563, 62581, 62591, 62597, 62603, 62617, 62627, 62633, 62639, 62653,
+62659, 62683, 62687, 62701, 62723, 62731, 62743, 62753, 62761, 62773,
+62791, 62801, 62819, 62827, 62851, 62861, 62869, 62873, 62897, 62903,
+62921, 62927, 62929, 62939, 62969, 62971, 62981, 62983, 62987, 62989,
+63029, 63031, 63059, 63067, 63073, 63079, 63097, 63103, 63113, 63127,
+63131, 63149, 63179, 63197, 63199, 63211, 63241, 63247, 63277, 63281,
+63299, 63311, 63313, 63317, 63331, 63337, 63347, 63353, 63361, 63367,
+63377, 63389, 63391, 63397, 63409, 63419, 63421, 63439, 63443, 63463,
+63467, 63473, 63487, 63493, 63499, 63521, 63527, 63533, 63541, 63559,
+63577, 63587, 63589, 63599, 63601, 63607, 63611, 63617, 63629, 63647,
+63649, 63659, 63667, 63671, 63689, 63691, 63697, 63703, 63709, 63719,
+63727, 63737, 63743, 63761, 63773, 63781, 63793, 63799, 63803, 63809,
+63823, 63839, 63841, 63853, 63857, 63863, 63901, 63907, 63913, 63929,
+63949, 63977, 63997, 64007, 64013, 64019, 64033, 64037, 64063, 64067,
+64081, 64091, 64109, 64123, 64151, 64153, 64157, 64171, 64187, 64189,
+64217, 64223, 64231, 64237, 64271, 64279, 64283, 64301, 64303, 64319,
+64327, 64333, 64373, 64381, 64399, 64403, 64433, 64439, 64451, 64453,
+64483, 64489, 64499, 64513, 64553, 64567, 64577, 64579, 64591, 64601,
+64609, 64613, 64621, 64627, 64633, 64661, 64663, 64667, 64679, 64693,
+64709, 64717, 64747, 64763, 64781, 64783, 64793, 64811, 64817, 64849,
+64853, 64871, 64877, 64879, 64891, 64901, 64919, 64921, 64927, 64937,
+64951, 64969, 64997, 65003, 65011, 65027, 65029, 65033, 65053, 65063,
+65071, 65089, 65099, 65101, 65111, 65119, 65123, 65129, 65141, 65147,
+65167, 65171, 65173, 65179, 65183, 65203, 65213, 65239, 65257, 65267,
+65269, 65287, 65293, 65309, 65323, 65327, 65353, 65357, 65371, 65381,
+65393, 65407, 65413, 65419, 65423, 65437, 65447, 65449, 65479, 65497,
65519, 65521
} ;
+
+} // namespace Givaro
diff --git a/src/kernel/zpz/givprimes16.h b/src/kernel/zpz/givprimes16.h
index 73b934a..02ef0b2 100644
--- a/src/kernel/zpz/givprimes16.h
+++ b/src/kernel/zpz/givprimes16.h
@@ -1,34 +1,41 @@
-#ifndef _GIV_PRIMES16_H_
-#define _GIV_PRIMES16_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givprimes16.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// Time-stamp: <02 Oct 07 16:43:17 Jean-Guillaume.Dumas at imag.fr>
// ==========================================================================
-// Description:
-// - set of primes less than 2^16
-#include <stddef.h>
+/*! @file zpz/givprimes16.h
+ * @ingroup zpz
+ * @brief set of primes less than 2^16
+ */
+
+#ifndef __GIVARO_primes16_H
+#define __GIVARO_primes16_H
+#include <stddef.h>
+namespace Givaro {
// --------------------------------------------- class Primes16
class Primes16 {
public:
// -- Returns the number of primes of this ctxt
-static size_t count() { return _size; }
+static size_t count() { return _size; }
-static size_t ith(size_t i) {
+static size_t ith(size_t i) {
// JGD 02.10.2007 : dependent of system/givconfig.h
// GIVARO_ASSERT( (i>=0)&&(i<(int)_size), "[Primes16::ith] index out of bounds");
- return _primes[i];
-}
+ return _primes[i];
+}
private:
static const size_t _size;
static const size_t _primes[];
};
+} // namespace Givaro
-
-#endif
+#endif // __GIVARO_primes16_H
diff --git a/src/kernel/zpz/givrns.h b/src/kernel/zpz/givrns.h
index c703fe5..4c59152 100644
--- a/src/kernel/zpz/givrns.h
+++ b/src/kernel/zpz/givrns.h
@@ -1,83 +1,101 @@
-#ifndef _ARITHMODU_H
-#define _ARITHMODU_H
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givrns.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givrns.h,v 1.3 2005/06/14 14:53:14 pernet Exp $
+// $Id: givrns.h,v 1.5 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
-// Modular arithmetic for GIVARO. Here is defined arithmetic functions
-// on rns representation and interface between RNS and Integer,
-// all is done via the Chinese Remainder Algorithm.
+
+/*! @file zpz/givrns.h
+ * @ingroup zpz
+ * @brief Modular arithmetic for GIVARO.
+ * Here is defined arithmetic functions
+ * on rns representation and interface between RNS and Integer,
+ * all is done via the Chinese Remainder Algorithm.
+ */
+
+#ifndef __GIVARO_arithmodu_H
+#define __GIVARO_arithmodu_H
#include "givaro/givconfig.h"
#include "givaro/giverror.h"
+#include "givaro/givarray0.h"
+
+namespace Givaro {
+
+ /*! @brief class RNSsystem.
+ * Structure which manages list of domains in order to convert integer
+ * to/from RNS number system using a mixed radix form. This class is
+ * parameterized by the type of \c RING and of \c Domain.
+ * The ring should have:
+ * - Ring( Modulo ) and Domain.init(Ring) conversions
+ * - operator *= (Ring&, const Modulo&)
+ * - operator += (Ring&, const Modulo&)
+ * .
+ */
+
+ template<class RING, class Domain>
+ class RNSsystem {
+ typedef RNSsystem<RING, Domain> Self_t;
+ public:
+ typedef RING ring;
+ typedef typename Domain::Element modulo;
+ typedef Array0<modulo> array;
+ typedef Array0<Domain> domains;
+
+ // Default Cstor, Dstor/Cstor of recopy:
+ RNSsystem() ;
+ ~RNSsystem() ;
+ RNSsystem(const Self_t& R);
+
+ // -- Cstor with given primes
+ RNSsystem( const domains& primes );
+
+ // -- Computation of a mixed-radix representation of the residus.
+ void RnsToMixedRadix(array& mixrad, const array& residu) ;
+
+ // -- Convert a mixed radix representation to an Integer
+ RING& MixedRadixToRing( RING& res, const array& mixrad ) const;
- // --------------------------------------------- class RNSsystem
- // Structure which manages list of domains in order to
- // convert integer to/from RNS number system using
- // a mixed radix form.
- // This class is parameterized by the type of Ring and of Domain
- // Ring should have:
- // - Ring( Modulo ) and Domain.init(Ring) conversions
- // - operator *= (Ring&, const Modulo&)
- // - operator += (Ring&, const Modulo&)
-
-template<class RING, class Domain>
-class RNSsystem {
- typedef RNSsystem<RING, Domain> Self_t;
-public:
- typedef RING ring;
- typedef typename Domain::Element modulo;
- typedef Array0<modulo> array;
- typedef Array0<Domain> domains;
-
- // Default Cstor, Dstor/Cstor of recopy:
- RNSsystem() ;
- ~RNSsystem();
- RNSsystem(const Self_t& R);
-
- // -- Cstor with given primes
- RNSsystem( const domains& primes );
-
- // -- Computation of a mixed-radix representation of the residus.
- void RnsToMixedRadix(array& mixrad, const array& residu) const;
-
- // -- Convert a mixed radix representation to an Integer
- void MixedRadixToRing( RING& res, const array& mixrad ) const;
-
- // -- Convert a Ring Element to a its RNS representation
- // with the "this" rns system.
- void RingToRns( array& rns, const RING& a ) const;
-
- // -- Convert a RNS representation to a RING Element
- void RnsToRing( RING& a, const array& rns ) const;
-
- // ------------- Access methods
-
- // -- Returns the number of primes of this ctxt
- int size() const { return _primes.size(); }
-
- // -- Returns a array to the begin of the array of primes
- const domains& Primes() const;
- // -- Returns the ith primes of the rns system
- const Domain ith(const size_t i) const;
-
- // -- Returns an array of the reciprocal ck = (\prod_{j=0..k-1)p_j)^(-1) [pk]
- const array& Reciprocals() const;
- const modulo reciprocal(const size_t i) const;
-
-protected:
- // -------------- Compute some fields of the structure :
- void ComputeCk();
-
- domains _primes; // - array of the primes
- array _ck; // - reciprocals, _ck[0] = 1, same size as _primes
-};
+ // -- Convert a Ring Element to a its RNS representation
+ // with the "this" rns system.
+ void RingToRns( array& rns, const RING& a ) const;
+
+ // -- Convert a RNS representation to a RING Element
+ RING& RnsToRing( RING& a, const array& rns ) ;
+
+ // ------------- Access methods
+
+ // -- Returns the number of primes of this ctxt
+ int size() const { return _primes.size(); }
+
+ // -- Returns a array to the begin of the array of primes
+ const domains& Primes() const;
+ // -- Returns the ith primes of the rns system
+ const Domain ith(const size_t i) const;
+
+ //! -- Returns an array of the reciprocal \f$ck = \left(\prod_{j=0..k-1}p_j\right)^{-1} \mod pk\f$
+ const array& Reciprocals() const;
+ const modulo reciprocal(const size_t i) const;
+
+ // -- Cstor with given primes
+ void setPrimes( const domains& primes );
+ protected:
+ // -------------- Compute some fields of the structure :
+ void ComputeCk();
+
+ domains _primes; // - array of the primes
+ array _ck; // - reciprocals, _ck[0] = 1, same size as _primes
+ };
+
+} // namespace Givaro
#include "givaro/givrnscstor.inl"
#include "givaro/givrnsconvert.inl"
-#endif
+#endif // __GIVARO_arithmodu_H
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/zpz/givrnsconvert.inl b/src/kernel/zpz/givrnsconvert.inl
index 8ccf1ee..738d393 100644
--- a/src/kernel/zpz/givrnsconvert.inl
+++ b/src/kernel/zpz/givrnsconvert.inl
@@ -1,67 +1,81 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givrnsconvert.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givrnsconvert.inl,v 1.3 2005/04/28 16:38:14 jgdumas Exp $
+// $Id: givrnsconvert.inl,v 1.5 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#ifndef __GIVARO_rns_convert_INL
+#define __GIVARO_rns_convert_INL
+
+namespace Givaro {
+
// -- Computation of a mixed-radix representation of the residu.
template<class RING, class Domain>
void RNSsystem<RING,Domain>::RnsToMixedRadix
- (RNSsystem<RING,Domain>::array& mixrad, const RNSsystem<RING,Domain>::array& residu) const
+ (RNSsystem<RING,Domain>::array& mixrad, const RNSsystem<RING,Domain>::array& residu)
{
- long j;
- size_t i=0,size = _primes.size();
- if (mixrad.size() < size) mixrad.reallocate( size );
-
- // -- Computation of Ck
+ int j;
+ int i=0,Size = (int)_primes.size();
+ if ((int)mixrad.size() < Size) mixrad.reallocate( Size );
+
+ // -- Computation of Ck
if (_ck.size()==0) ((RNSsystem*)this)->ComputeCk();
- // -- size-1 steps
+ // -- Size-1 steps
modulo t2, t3, t4, tmp;
_primes[0].assign(mixrad[0],residu[0]);
//_primes[0].write(std::cout << "mixrad0 = ", mixrad[0]) << std::endl;
- for (i=1; i < size; ++i)
+ for (i=1; i < (int)Size; ++i)
{ // - computes pp_i = r_0 + r_1*p_0 + ... + r_{i-1} \prod_{j<i-2} p_j [p_i]
// Horner scheme
-
+
_primes[i].init(tmp, _primes[i-1].convert(t4, mixrad[i-1]) );
//_primes[i].write(std::cout << "mod " << _primes[i].characteristic() << ":: ", tmp) << std::endl;
for (j= i-2; j>=0; --j) {
//_primes[j].write(_primes[i].write(std::cout << "mod " << _primes[i].characteristic() << ":: ", tmp) << " * " << _primes[j].characteristic() << " + ", mixrad[j]) <<" =";
-
+
_primes[i].init(t3, _primes[j].convert(t4, mixrad[j]));
_primes[i].init(t4, _primes[j].characteristic());
_primes[i].axpy(t2, tmp, t4, t3);
_primes[i].assign(tmp, t2);
-//_primes[i].write(std::cout << " ", tmp) << std::endl;
+//_primes[i].write(std::cout << " ", tmp) << std::endl;
}
//_primes[i].write(std::cout << "\nmod" << _primes[i].characteristic() << ", sumprod = ", tmp) << std::endl;
// - m_i = (r_i - pp_i)*ck_i, ck is reciprocals
_primes[i].sub(t2, residu[i], tmp);
_primes[i].assign(tmp, t2);
//_primes[i].write(std::cout << "mod " << _primes[i].characteristic() << ", sum - sumprod = ", tmp) << std::endl;
-
+
_primes[i].mul(mixrad[i], tmp, _ck[i]);
//_primes[i].write(std::cout << "mod " << _primes[i].characteristic() << ", mixrad = ", mixrad[i]) << std::endl;
}
}
-
+
// -- Convert a mixed radix representation to an Integer
template<class RING, class Domain>
-void RNSsystem<RING,Domain>::MixedRadixToRing( RING& res, const RNSsystem<RING,Domain>::array& mixrad ) const
+RING& RNSsystem<RING,Domain>::MixedRadixToRing( RING& res, const RNSsystem<RING,Domain>::array& mixrad ) const
{
- size_t size = _primes.size();
- if (size != mixrad.size())
+ size_t Size = _primes.size();
+ if (!Size)
+ GivError("_primes is empty");
+ if (Size != mixrad.size())
throw GivError("[RNSsystem::MixedRadixToRing]: bad size of input array");
- _primes[size-1].convert(res,mixrad[size-1]);
+ _primes[int(Size-1)].convert(res,mixrad[int(Size-1)]);
RING tmp;
- for (int i=size-2; i>=0; --i) {
+ if( Size == 1 )
+ return res;
+
+ for (int i=int(Size-1); i--; ) {
res *= _primes[i].characteristic();
res += _primes[i].convert(tmp, mixrad[i]);
}
+ return res;
}
@@ -69,24 +83,27 @@ void RNSsystem<RING,Domain>::MixedRadixToRing( RING& res, const RNSsystem<RING,D
template<class RING, class Domain>
void RNSsystem<RING,Domain>::RingToRns( RNSsystem<RING,Domain>::array& rns , const RING& a) const
{
- size_t size = _primes.size();
- if (rns.size() != size) rns.reallocate(size);
- // -- may be faster using the recursive
+ int Size = (int) _primes.size();
+ if ((int)rns.size() != Size) rns.reallocate(Size);
+ // -- may be faster using the recursive
// tree algorithm a mod p_1...p_k/2, and a mod p_k/2+1...p_k
- for (size_t i=0; i<size; i++)
+ for (int i=0; i<Size; i++)
_primes[i].init(rns[i], a);
}
// Convert to an Integer:
template<class RING, class Domain>
-void RNSsystem<RING,Domain>::RnsToRing( RING& I, const RNSsystem<RING,Domain>::array& rns) const
+RING& RNSsystem<RING,Domain>::RnsToRing( RING& I, const RNSsystem<RING,Domain>::array& rns)
{
// - Computation of a mixed radix representation of this
typename RNSsystem<RING,Domain>::array mixrad(_primes.size());
RnsToMixedRadix( mixrad , rns );
// - Convert mixrad to an integer
- MixedRadixToRing( I, mixrad ) ;
- return;
+ return MixedRadixToRing( I, mixrad ) ;
}
+} // namespace Givaro
+
+#endif // __GIVARO_rns_convert_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/zpz/givrnscstor.inl b/src/kernel/zpz/givrnscstor.inl
index 66f2e2b..8160713 100644
--- a/src/kernel/zpz/givrnscstor.inl
+++ b/src/kernel/zpz/givrnscstor.inl
@@ -1,86 +1,106 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givrnscstor.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gaut%ier
-// $Id: givrnscstor.inl,v 1.2 2004/10/12 14:36:46 jgdumas Exp $
+// $Id: givrnscstor.inl,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
-// -- free memory allocated in array !
-template<class RING, class Domain>
-RNSsystem<RING,Domain>::~RNSsystem()
-{}
-
-template<class RING, class Domain>
-RNSsystem<RING,Domain>::RNSsystem ()
- : _primes(0), _ck(0)
-{}
-
-template<class RING, class Domain>
-RNSsystem<RING,Domain>::RNSsystem (const RNSsystem<RING,Domain>& R)
- : _primes(R._primes, givWithCopy()),
- _ck(R._ck, givWithCopy())
-{}
-
-
- // -- Array of primes are given
-template<class RING, class Domain>
-RNSsystem<RING,Domain>::RNSsystem( const RNSsystem<RING,Domain>::domains& inprimes)
- : _primes(inprimes, givWithCopy()),
- _ck(0)
-{
- GIVARO_ASSERT( inprimes.size()>0, "[RNSsystem<RING,Domain>::RNSsystem] bad size of array");
-}
-
- // -- Computes Ck , Ck = (\prod_{i=0}^{k-1} primes[i])^(-1) % primes[k],
- // for k=1..(_sz-1)
-template<class RING, class Domain>
-void RNSsystem<RING,Domain>::ComputeCk()
-{
- if (_ck.size() !=0) return; // -- already computed
-
- // - reallocation of a new array :
- size_t size = _primes.size();
- _ck.reallocate(size);
-// _ck[0] = Neutral::zero; // -- undefined and never used
-
- for (size_t k=1; k < size; ++k)
- {
- modulo prod, tmp;
- _primes[k].init(prod, _primes[0].characteristic());
- for (size_t i= 1; i < k; ++i)
- _primes[k].mulin(prod, _primes[k].init(tmp,_primes[i].characteristic()));
- _primes[k].inv(_ck[k], prod);
- }
-}
-
-
-template<class RING, class Domain>
-const typename RNSsystem<RING,Domain>::domains& RNSsystem<RING,Domain>::Primes() const
-{
- return _primes;
-}
-
-
-template<class RING, class Domain>
-const Domain RNSsystem<RING,Domain>::ith(const size_t i) const
-{
- return _primes[i];
-}
-
-
-template<class RING, class Domain>
-const typename RNSsystem<RING,Domain>::array& RNSsystem<RING,Domain>::Reciprocals() const
-{
- if (_ck.size() ==0) ((RNSsystem<RING,Domain>*)this)->ComputeCk();
- return _ck;
-}
-
-
-template<class RING, class Domain>
-const typename RNSsystem<RING,Domain>::modulo RNSsystem<RING,Domain>::reciprocal(const size_t i) const
-{
- if (_ck.size() ==0) ((RNSsystem<RING,Domain>*)this)->ComputeCk();
- return _ck[i];
-}
+#ifndef __GIVARO_rns_cstor_INL
+#define __GIVARO_rns_cstor_INL
+
+namespace Givaro {
+
+ // -- free memory allocated in array !
+ template<class RING, class Domain>
+ RNSsystem<RING,Domain>::~RNSsystem()
+ {
+ }
+
+ template<class RING, class Domain>
+ RNSsystem<RING,Domain>::RNSsystem ()
+ : _primes(0), _ck(0)
+ {}
+
+ template<class RING, class Domain>
+ RNSsystem<RING,Domain>::RNSsystem (const RNSsystem<RING,Domain>& R)
+ : _primes(R._primes, givWithCopy()),
+ _ck(R._ck, givWithCopy())
+ {}
+
+ template<class RING, class Domain>
+ void RNSsystem<RING,Domain>::setPrimes (const RNSsystem<RING,Domain>::domains& inprimes) {
+ _primes.allocate(0);
+ _primes.copy( inprimes );
+ _ck.reallocate(0);
+ }
+
+ // -- Array of primes are given
+ template<class RING, class Domain>
+ RNSsystem<RING,Domain>::RNSsystem( const RNSsystem<RING,Domain>::domains& inprimes)
+ : _primes(inprimes, givWithCopy()),
+ _ck(0)
+ {
+ GIVARO_ASSERT( inprimes.size()>0, "[RNSsystem<RING,Domain>::RNSsystem] bad size of array");
+ }
+
+ // -- Computes Ck , Ck = (\prod_{i=0}^{k-1} primes[i])^(-1) % primes[k],
+ // for k=1..(_sz-1)
+ template<class RING, class Domain>
+ void RNSsystem<RING,Domain>::ComputeCk()
+ {
+ if (_ck.size() !=0) return; // -- already computed
+
+ // - reallocation of a new array :
+ int Size = (int) _primes.size();
+ _ck.reallocate(Size);
+ // _ck[0] = Neutral::zero; // -- undefined and never used
+
+ for (int k=1; k < Size; ++k)
+ {
+ modulo prod, tmp;
+ _primes[k].init(prod, _primes[0].characteristic());
+ for (int i= 1; i < k; ++i)
+ _primes[k].mulin(prod, _primes[k].init(tmp,_primes[i].characteristic()));
+ _primes[k].inv(_ck[k], prod);
+ }
+ }
+
+
+ template<class RING, class Domain>
+ const typename RNSsystem<RING,Domain>::domains& RNSsystem<RING,Domain>::Primes() const
+ {
+ return _primes;
+ }
+
+
+ template<class RING, class Domain>
+ const Domain RNSsystem<RING,Domain>::ith(const size_t i) const
+ {
+ return _primes[i];
+ }
+
+
+ template<class RING, class Domain>
+ const typename RNSsystem<RING,Domain>::array& RNSsystem<RING,Domain>::Reciprocals() const
+ {
+ if (_ck.size() ==0) ((RNSsystem<RING,Domain>*)this)->ComputeCk();
+ return _ck;
+ }
+
+
+ template<class RING, class Domain>
+ const typename RNSsystem<RING,Domain>::modulo RNSsystem<RING,Domain>::reciprocal(const size_t i) const
+ {
+ if (_ck.size() ==0) ((RNSsystem<RING,Domain>*)this)->ComputeCk();
+ return _ck[i];
+ }
+
+} // namespace Givaro
+
+#endif // __GIVARO_rns_cstor_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/zpz/givrnsfixed.h b/src/kernel/zpz/givrnsfixed.h
new file mode 100644
index 0000000..cef1cd9
--- /dev/null
+++ b/src/kernel/zpz/givrnsfixed.h
@@ -0,0 +1,73 @@
+// Copyright(c)'1994-2011 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <01 Apr 11 15:43:07 Jean-Guillaume.Dumas at imag.fr>
+// ==========================================================================
+
+/*! @file zpz/givrnsfixed.h
+ * @ingroup zpz
+ * @brief Chinese Remainder Algorithm.
+ */
+
+#ifndef __GIVARO_arithmodu_fixedprimes_H
+#define __GIVARO_arithmodu_fixedprimes_H
+
+#include "givaro/givrns.h"
+#include "givaro/givrandom.h"
+#include "givaro/givintprime.h"
+#include "givaro/givzpzInt.h"
+#include <vector>
+
+namespace Givaro {
+
+
+ /*! @brief NO DOC
+ */
+template<class Ints>
+class RNSsystemFixed {
+ typedef RNSsystemFixed<Ints> Self_t;
+ typedef RNSsystem<Ints, ZpzDom<Ints> > RNS_t;
+public:
+ typedef std::vector<Ints> array;
+ typedef std::vector<array> tree;
+
+ // Default Cstor, Dstor/Cstor of recopy:
+ RNSsystemFixed() ;
+ ~RNSsystemFixed();
+ RNSsystemFixed(const Self_t& R);
+
+ // -- Cstor with given primes
+ RNSsystemFixed( const array& primes );
+
+ // -- Convert a RNS representation to a Ints Element
+ template<class smallIntVector>
+ Ints& RnsToRing( Ints& a, const smallIntVector& rns ) ;
+
+ // ------------- Access methods
+
+ // -- Returns the number of primes of this ctxt
+ int size() const { return _primes.size(); }
+
+ // -- Returns a array to the beginning of the array of primes
+ const tree& Primes() const;
+ // -- Returns the ith primes of the rns system
+ const Ints ith(const size_t i) const;
+
+
+protected:
+ template<class smallIntVector>
+ Ints& RnsToRingLeft( Ints& I, const smallIntVector& residues, const int level, const int col ) ;
+ template<class smallIntVector>
+ Ints& RnsToRingRight( Ints& I, const smallIntVector& residues, const int level, const int col ) ;
+
+ tree _primes; // - array of the primes and reciprocals
+ RNS_t _RNS; // - unbalanced recovery
+};
+
+} // namespace Givaro
+
+#include "givaro/givrnsfixed.inl"
+
+#endif
diff --git a/src/kernel/zpz/givrnsfixed.inl b/src/kernel/zpz/givrnsfixed.inl
new file mode 100644
index 0000000..1337cc4
--- /dev/null
+++ b/src/kernel/zpz/givrnsfixed.inl
@@ -0,0 +1,182 @@
+// Copyright(c)'1994-2011 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <08 Mar 11 16:23:50 Jean-Guillaume.Dumas at imag.fr>
+// ==========================================================================
+// Description:
+// Chinese Remainder Algorithm.
+#ifndef __GIVARO_arithmodu_fixedprimes_INL
+#define __GIVARO_arithmodu_fixedprimes_INL
+
+#include "givaro/givpower.h"
+
+namespace Givaro {
+
+ template<class Ints>
+ template<class smallIntVector>
+ Ints& RNSsystemFixed<Ints>::RnsToRingLeft( Ints& I, const smallIntVector& residues, const int level, const int col )
+{
+ if (level) {
+ int lowercol=col<<1, lowercolnext=lowercol+1;
+ int lowerlevel=level-1;
+ Ints u0;
+ RnsToRingLeft(u0, residues, lowerlevel, lowercol);
+ RnsToRingRight(I, residues, lowerlevel, lowercolnext);
+
+ I -= u0; // u1-u0
+ I *= _primes[lowerlevel][lowercolnext]; // (u1-u0) * (p0(p0^{-1} mod p1))
+ I += u0; // (u1-u0)*M01+u0
+ return Integer::modin(I, _primes[level][col]);// (u1-u0)*M01 +u0 mod p0p1, between 0 and p0p1-1
+ }
+ else {
+ return I=residues[col];
+ }
+ }
+
+ template<class Ints>
+ template<class smallIntVector>
+ Ints& RNSsystemFixed<Ints>::RnsToRingRight( Ints& I, const smallIntVector& residues, const int level, const int col )
+ {
+ if (level) {
+ int lowercol=col<<1, lowercolnext=lowercol+1;
+ int lowerlevel=level-1;
+ Ints u0;
+ RnsToRingLeft(u0, residues, lowerlevel, lowercol);
+ RnsToRingRight(I, residues, lowerlevel, lowercolnext);
+
+ I -= u0; // u1-u0
+ I *= _primes[lowerlevel][lowercolnext]; // (u1-u0) * (p0(p0^{-1} mod p1))
+ return I += u0; // (u1-u0)*M01+u0
+ } else {
+ return I=residues[col];
+ }
+ }
+
+
+
+ // Convert to an Ints:
+ template<class Ints>
+ template<class smallIntVector>
+ Ints& RNSsystemFixed<Ints>::RnsToRing( Ints& I, const smallIntVector& rns)
+ {
+ int ir = (int)_RNS.Primes().size();
+ typename RNS_t::array Reds( ir );
+ for(int i = (int)_primes.size(); i-- ;) {
+ int is = (int)_primes[i].size();
+ if (is & 1) {
+ RnsToRingLeft(Reds[--ir], rns, i, --is);
+ }
+ }
+
+ return _RNS.RnsToRing( I, Reds);
+ }
+
+
+ // -- free memory allocated in array !
+ template<class Ints>
+ RNSsystemFixed<Ints>::~RNSsystemFixed()
+ {}
+
+ template<class Ints>
+ RNSsystemFixed<Ints>::RNSsystemFixed () :
+ _primes(0)
+ {}
+
+ template<class Ints>
+ RNSsystemFixed<Ints>::RNSsystemFixed (const RNSsystemFixed<Ints>& R) :
+ _primes(R._primes, givWithCopy())
+ {}
+
+
+ // -- Array of primes are given
+ template<class Ints>
+ RNSsystemFixed<Ints>::RNSsystemFixed( const RNSsystemFixed<Ints>::array& inprimes) : _primes(0)
+ {
+ GIVARO_ASSERT( inprimes.size()>0, "[RNSsystemFixed<Ints>::RNSsystemFixed] bad size of array");
+ _primes.reserve( GIVINTLOG(inprimes.size()) );
+ _primes.resize(1);
+
+ for(typename array::const_iterator pit = inprimes.begin(); pit != inprimes.end(); ++pit) {
+ _primes.front().push_back( *pit );
+ for(int i = 1; i< (int)_primes.size(); ++i) {
+ int s = (int)_primes[i-1].size();
+ if (s & 1) break;
+ else {
+ Ints& p0(_primes[i-1][s-2]), & p1(_primes[i-1][s-1]);
+ Ints prod(p0*p1);
+ inv(p1, p0, p1) *= p0;
+ _primes[i].push_back( prod );
+ }
+ }
+
+ int lastp = int(_primes.size()-1);
+
+ if (! (_primes.back().size() & 1)) {
+
+ // std::cout << '[';
+ // for(int j=0; j<_primes.back().size(); ++j)
+ // std::cout << ' ' << _primes.back()[j];
+ // std::cout << ']' << std::endl;
+
+
+
+ array newlevel;
+
+ int s = (int)_primes.back().size();
+
+ Ints& p0(_primes[lastp][s-2]), & p1(_primes[lastp][s-1]);
+ newlevel.push_back( p0*p1 );
+
+ inv(p1, p0, p1) *= p0;
+ _primes.push_back( newlevel );
+ }
+
+ // std::cout << std::endl << "----------------" << std::endl;
+ // std::cout << '[';
+ // for(int i=0; i<_primes.size(); ++i) {
+ // std::cout << '[';
+ // for(int j=0; j<_primes[i].size(); ++j)
+ // std::cout << ' ' << _primes[i][j];
+ // std::cout << ']' << std::endl;
+ // }
+ // std::cout << ']' << std::endl;
+ // std::cout << "----------------" << std::endl;
+
+
+
+ }
+
+ int numodd=0;
+ for(int i = (int)_primes.size(); i-- ; )
+ if (_primes[i].size() & 1) ++numodd;
+
+
+ typename RNS_t::domains Mods(numodd);
+ for(int i = (int)_primes.size(); i-- ; ) {
+ if (_primes[i].size() & 1)
+ Mods[--numodd] = _primes[i].back();
+ }
+ _RNS.setPrimes( Mods );
+ }
+
+
+ template<class Ints>
+ const typename RNSsystemFixed<Ints>::tree& RNSsystemFixed<Ints>::Primes() const
+ {
+ return _primes;
+ }
+
+
+ template<class Ints>
+ const Ints RNSsystemFixed<Ints>::ith(const size_t i) const
+ {
+ return _primes.front()[i];
+ }
+
+} // namespace Givaro
+
+#endif
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/src/kernel/zpz/givtablelimits.C b/src/kernel/zpz/givtablelimits.C
index 3f10687..8e1849e 100644
--- a/src/kernel/zpz/givtablelimits.C
+++ b/src/kernel/zpz/givtablelimits.C
@@ -1,9 +1,11 @@
// ==========================================================================
// file: givadicqfq.C
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Time-stamp: <11 Jun 07 18:20:54 Jean-Guillaume.Dumas at imag.fr>
-// (c) Givaro Team
-// date: 2007
-// version:
// author: Jean-Guillaume.Dumas
// Description:
// t-adic max sizes for BLAS based linear algebra over extension fields
@@ -14,6 +16,7 @@
// ==========================================================================
#include "givaro/givtablelimits.h"
+namespace Givaro {
const size_t AdicSize::n_max_53[][_GIVARO_FF_MAXEXPONENT_] = {
/* 2 */ { 104028, 517, 47, 11, 4, 2, 1},
@@ -538,4 +541,4 @@ const size_t AdicSize::qadic_64[][_GIVARO_FF_MAXEXPONENT_] = {
/* 1129 */ { 2544769}
};
-
+} // namespace Givaro
diff --git a/src/kernel/zpz/givtablelimits.h b/src/kernel/zpz/givtablelimits.h
index 55878f9..e1e1733 100644
--- a/src/kernel/zpz/givtablelimits.h
+++ b/src/kernel/zpz/givtablelimits.h
@@ -1,20 +1,28 @@
-#ifndef __GIVARO_TABLESIZE_MAX__
-#define __GIVARO_TABLESIZE_MAX__
// ==========================================================================
-// file: givadicqfq.h
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// file: givadicqfq.h
// Time-stamp: <11 Jun 07 19:18:31 Jean-Guillaume.Dumas at imag.fr>
-// (c) Givaro Team
// date: 2007
-// version:
+// version:
// author: Jean-Guillaume.Dumas
-// Description:
-// Zech extension fitting a small enough memory space
-// t-adic max sizes for BLAS based linear algebra over extension fields
-// see:
-// [Dumas, Gautier, Pernet 2002] Finite field linear algebra subroutines.
-// ISSAC'02: Proceedings of the 2002 International Symposium on Symbolic
-// and Algebraic Computation, Lille, France pp 63--74.
-// ==========================================================================
+
+/*! @file zpz/givtablelimits.h
+ * @ingroup zpz
+ * @brief Zech extension.
+ * Zech extension fitting a small enough memory space
+ * t-adic max sizes for BLAS based linear algebra over extension fields
+ * @bib
+ * - [Dumas, Gautier, Pernet 2002] Finite field linear algebra subroutines.
+ * ISSAC'02: Proceedings of the 2002 International Symposium on Symbolic
+ * and Algebraic Computation, Lille, France pp 63--74.
+ */
+
+#ifndef __GIVARO_tablesize_MAX_H
+#define __GIVARO_tablesize_MAX_H
#ifndef FF_TABLE_MAX
@@ -35,31 +43,33 @@
#include <vector>
#include "givaro/givprimes16.h"
-#include <math.h>
+#include <cmath>
#include <stddef.h>
- // --------------------------------------------- class
+namespace Givaro {
+
+ // --------------------------------------------- class
class AdicSize {
public:
-
+
static size_t nmax53(const unsigned long P, const unsigned long e) {
size_t i = 0;
while (Primes16::ith(i) < P) ++i;
return n_max_53[i][e-2];
- }
-
+ }
+
static size_t qmax53(const unsigned long P, const unsigned long e) {
size_t i = 0;
while (Primes16::ith(i) < P) ++i;
return qadic_53[i][e-2];
}
-
+
static size_t nmax64(const unsigned long P, const unsigned long e) {
size_t i = 0;
while (Primes16::ith(i) < P) ++i;
return n_max_64[i][e-2];
}
-
+
size_t qmax64(const unsigned long P, const unsigned long e) {
size_t i = 0;
while (Primes16::ith(i) < P) ++i;
@@ -72,14 +82,14 @@ public:
tmp *= double(e);
tmp *= double(nm);
size_t k = ilogb(tmp);
- return ( (53/(2*e-1))>k ? ++k : 0);
+ return ( (53/(2*e-1))>k ? ++k : 0);
}
-
+
static size_t twopmax53(const unsigned long P, const unsigned long e) {
size_t k = 53/(2*e-1);
- return ( pow(2.0,double(k))>double(e*(P-1)*(P-1)) ? k: 0);
+ return ( std::pow((double)2.0,double(k))>double(e*(P-1)*(P-1)) ? k: 0);
}
-
+
private:
static const size_t n_max_53[][_GIVARO_FF_MAXEXPONENT_];
static const size_t n_max_64[][_GIVARO_FF_MAXEXPONENT_];
@@ -87,8 +97,6 @@ private:
static const size_t qadic_64[][_GIVARO_FF_MAXEXPONENT_];
};
+} // namespace Givaro
-
-
-
-#endif
+#endif // __GIVARO_tablesize_MAX_H
diff --git a/src/kernel/zpz/givzpz.h b/src/kernel/zpz/givzpz.h
index 9a40512..0f18bb8 100644
--- a/src/kernel/zpz/givzpz.h
+++ b/src/kernel/zpz/givzpz.h
@@ -1,35 +1,39 @@
-#ifndef _GIVARO_ZPZ_H_
-#define _GIVARO_ZPZ_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz.h,v 1.4 2004/10/11 15:15:14 jgdumas Exp $
+// $Id: givzpz.h,v 1.8 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description:
-// Family of arithmetics over Zpz
+
+/*!@file zpz/givzpz.h
+ * @ingroup zpz
+ * @brief Family of arithmetics over Zpz (\f$\mathbf{Z}/p\mathbf{Z}\f$).
+ */
+
+#ifndef __GIVARO_zpz_H
+#define __GIVARO_zpz_H
// ==========================================================================
-// --
+// --
// ==========================================================================
#include <givaro/givconfig.h>
-template<class TAG> class ZpzDom;
+namespace Givaro {
+ template<class TAG> class ZpzDom;
+}
-// -- Tag for arithmetic:
-struct Std16 { typedef int16 type;}; // -- standard arithmetic over 16bits representations.
-struct Std32 {typedef int32 type;}; // -- standard arithmetic over 32bits representations.
-struct Unsigned32 {typedef uint32 type;}; // -- standard arithmetic over 32bits representations.
-
-struct Log16 { typedef int16 type;}; // -- log arithmetic over 16bits representations.
+#include "givaro/givzpztypes.h"
#include "givaro/givzpz16std.h"
#include "givaro/givzpz16table1.h"
+
#include "givaro/givzpz32std.h"
#include "givaro/givzpz32uns.h"
-
#ifndef __USE_Givaro_SIXTYFOUR__
#ifdef __USE_64_bits__
#define __USE_Givaro_SIXTYFOUR__ 1
@@ -41,13 +45,10 @@ struct Log16 { typedef int16 type;}; // -- log arithmetic over 16bits representa
#endif
#ifndef __DONOTUSE_Givaro_SIXTYFOUR__
-#ifndef __USE_GMPPLUSPLUS_SIXTYFOUR__
-#define __USE_GMPPLUSPLUS_SIXTYFOUR__ 1
-#endif
-struct Std64 { typedef int64 type;}; // -- standard arithmetic over 64bits representations.
#include "givaro/givzpz64std.h"
#endif
#include "givaro/givzpzInt.h"
-#endif
+#endif // __GIVARO_zpz_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz16std.C b/src/kernel/zpz/givzpz16std.C
index 8a45db1..de5e403 100644
--- a/src/kernel/zpz/givzpz16std.C
+++ b/src/kernel/zpz/givzpz16std.C
@@ -1,60 +1,76 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz16std.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz16std.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givzpz16std.C,v 1.4 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
// Description:
#include <iostream>
#include "givaro/givzpz16std.h"
- // Returns d, and u and v such that u a + v b = d;
-// JGD 04.11.1999
-// const int32 ZpzDom<Std16>::gcdext
-// ( int32& u, int32& v, const int32 a, const int32 b )
-int32& ZpzDom<Std16>::gcdext
- ( int32& d, int32& u, int32& v, const int32 a, const int32 b ) const
-{
- register long u1,u2,u3;
- register long v1,v2,v3;
- u1 = 1; u2 = 0; u3 = a;
- v1 = 0; v2 = 1; v3 = b;
- while (v3 != 0)
- {
- register long q , t1, t2 ,t3;
- q = u3 / v3;
- t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
- u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
- }
- u = u1;
- v = u2;
- return d=u3;
-}
-
-int32& ZpzDom<Std16>::invext
- ( int32& u, const int32 a, const int32 b ) const
-{
- register long u3;
- register long v1,v3;
- u = 1; u3 = a;
- v1 = 0; v3 = b;
- while (v3 != 0)
- {
- register long q, t1, t3;
- q = u3 / v3;
- t1 = u - q * v1; t3 = u3 - q * v3;
- u = v1; u3 = v3; v1 = t1; v3 = t3;
- }
- return (u3<0?u=-u:u);
-}
-
-void ZpzDom<Std16>::Init()
-{
-}
-
-void ZpzDom<Std16>::End()
-{
-}
+namespace Givaro {
+ // Returns d, and u and v such that u a + v b = d;
+ // JGD 04.11.1999
+ // const int32_t ZpzDom<Std16>::gcdext
+ // ( int32_t& u, int32_t& v, const int32_t a, const int32_t b )
+ int32_t& ZpzDom<Std16>::gcdext
+ ( int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const
+ {
+ long u1,u2,u3;
+ long v1,v2,v3;
+ u1 = 1; u2 = 0; u3 = a;
+ v1 = 0; v2 = 1; v3 = b;
+ while (v3 != 0)
+ {
+ long q , t1, t2 ,t3;
+ q = u3 / v3;
+ t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
+ u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
+ }
+ u = int32_t(u1);
+ v = int32_t(u2);
+ return d=int32_t(u3);
+ }
+
+ int32_t& ZpzDom<Std16>::invext
+ ( int32_t& u, const int32_t a, const int32_t b ) const
+ {
+ long u3;
+ long v1,v3;
+ u = 1; u3 = a;
+ v1 = 0; v3 = b;
+ while (v3 != 0)
+ {
+ long q, t1, t3;
+
+ q = u3 / v3;
+
+ t1 = u - q * v1;
+ t3 = u3 - q * v3;
+
+ u = int32_t(v1);
+
+ u3 = v3;
+ v1 = t1;
+ v3 = t3;
+ }
+ return (u3<0?u=-u:u);
+ }
+
+ void ZpzDom<Std16>::Init()
+ {
+ }
+
+ void ZpzDom<Std16>::End()
+ {
+ }
+
+} // namespace Givaro
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz16std.h b/src/kernel/zpz/givzpz16std.h
index b254688..e1d9b12 100644
--- a/src/kernel/zpz/givzpz16std.h
+++ b/src/kernel/zpz/givzpz16std.h
@@ -1,245 +1,245 @@
-#ifndef _GIVARO_ZPZ16STD_H_
-#define _GIVARO_ZPZ16STD_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz16std.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz16std.h,v 1.9 2006-07-21 08:03:26 jgdumas Exp $
+// $Id: givzpz16std.h,v 1.16 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
//
// Modified by Pascal Giorgi on 2002/02/13 (pascal.giorgi at ens-lyon.fr)
-//
-// Description:
-// Arithmetic on Z/pZ, with p a prime number less than 2^16
-// Modulo typedef is a signed long number. In case it was modified
-// then bezout algorithm must be changed (coefficient can be negative).
-
-
-/* Thierry -> JG: Constantes necessaires:
- (typedef) uint16 : type des int sur 16bits non signe
- (typedef) uint32 : type des int sur 16bits non signe
- (typedef) int16 : type des int sur 16bits signe
- (typedef) int32 : type des int sur 16bits signe
- (#define) GIVARO_MAXUINT16: 2^16 -1
- (#define) GIVARO_MAXUINT32: 2^32 -1
- (#define) GIVARO_MAXULONG: val max en unsigned long
-*/
-/*
+/*! @file zpz/givzpz16std.h
+ * @ingroup zpz
+ * @brief Arithmetic on Z/pZ, with p a prime number less than 2^14.
+ * Modulo typedef is a signed long number. In case it was modified
+ * then Bézout algorithm must be changed (coefficient can be negative).
+ */
+#ifndef __GIVARO_zpz16std_H
+#define __GIVARO_zpz16std_H
+
+
+#if 0 /* Thierry -> JG: Constantes necessaires: */
+(typedef) uint16_t : type des int sur 16bits non signe
+(typedef) uint32_t : type des int sur 16bits non signe
+(typedef) int16_t : type des int sur 16bits signe
+(typedef) int32_t : type des int sur 16bits signe
+(#define) GIVARO_MAXUINT16: 2^16 -1
+(#define) GIVARO_MAXUINT32: 2^32 -1
+(#define) GIVARO_MAXULONG: val max en unsigned long
+#endif
+#if 0
#define GIVARO_BITS_PER_LONGINT 32
#define GIVARO_BITS_PER_INT 32
#define GIVARO_BITS_PER_SHORTINT 16
#define GIVARO_BITS_PER_CHAR 16
-typedef char int8;
-typedef short int16;
-typedef int int32;
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint32;
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
#define GIVARO_MAXUINT8 255U // 2^8-1
#define GIVARO_MAXUINT16 65535U // 2^16-1
#define GIVARO_MAXUINT32 4294967295U // 2^32-1
#define GIVARO_MAXULONG 4294967295U // 2^32-1
-*/
+#endif
#include "givaro/givbasictype.h"
-/*
- Classes d'erreurs:
+/*
+ Classes d'erreurs:
GivError::throw_error + des classes d'exception dont les cstos prennent des chaines:
- * GivMathDivZero( " ... " )
- * GivBadFormat( " ... " )
-*/
+ * GivMathDivZero( " ... " )
+ * GivBadFormat( " ... " )
+ */
#include "givaro/giverror.h"
-#include "givaro/givzpz.h"
+// #include "givaro/givzpz16std.h"
+#include "givaro/givzpz32std.h"
#include "givaro/giv_randiter.h"
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// - The representation of an integer a in Zpz is the value a % p
-// ==========================================================================
+namespace Givaro {
+/*! @brief This class implement the standard arithmetic with Modulo Elements.
+ * - The representation of an integer a in Zpz is the value a % p
+ * .
+ */
template<>
class ZpzDom<Std16> {
public:
- // ----- Exported Types and constantes
- typedef uint16 Residu_t; // - type to store residue
- enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
- // ----- Representation of Element of the domain ZpzDom
- typedef int16 Rep;
- typedef int16 Element;
-
- // ----- Representation of vector of the Element
- typedef Rep* Array;
- typedef const Rep* constArray;
-
- // ----- Constantes
- const Rep zero;
- const Rep one;
-
- // ----- Constructor
- ZpzDom() : zero(0), one(1), _p(0) {}
- ZpzDom( Residu_t p ) : zero(0), one(1), _p(p) {}
- ZpzDom( const ZpzDom<Std16>& F) : zero(0), one(1), _p(F._p) {}
-
-
- int operator==( const ZpzDom<Std16>& BC) const { return _p == BC._p;}
- int operator!=( const ZpzDom<Std16>& BC) const { return _p != BC._p;}
-
- ZpzDom<Std16>& operator=( const ZpzDom<Std16>& F) { this->_p = F._p; return *this;}
-
- // ----- Access to the modulus
- Residu_t residu() const;
- Residu_t size() const { return _p; }
- Residu_t characteristic() const { return _p; }
- Integer& characteristic( Integer& p) const { return p=_p; }
- Rep access( const Rep a ) const { return a; }
-
- // ----- Convert from Element to int
- int16& convert( int16& x , const Rep a) const { return x=(int16)(a);}
- uint16& convert( uint16& x , const Rep a) const { return x=(uint16)(a);}
- unsigned long& convert( unsigned long& x , const Rep a) const { return x=(unsigned long)(a);}
- double& convert( double& x , const Rep a) const { return x=(double)(a);}
- int& convert( int& x , const Rep a) const { return x=int(a);}
- Integer& convert(Integer& i, const Rep a) const {
- unsigned long ur;
- return i = (Integer)convert(ur, a);
- }
-
-
-
- // ----- Access to the modulus
- Rep& init( Rep& a ) const;
- void init( const size_t, Array a, constArray b ) const;
- Rep& init( Rep& a, const long i) const ;
- Rep& init( Rep& a, const unsigned long i) const ;
- Rep& init( Rep& a, const int i) const ;
- Rep& init( Rep& a, const unsigned int i) const ;
- Rep& init( Rep& a, const double i) const ;
- Rep& init( Rep& a, const float i) const ;
- Rep& init( Rep& a, const Integer& i) const ;
-
- // ----- Misc methods
- int areEqual( const Rep, const Rep) const;
- int areNEqual( const Rep, const Rep) const;
- int isZero( const Rep a ) const;
- int isnzero( const Rep a ) const;
- int isOne ( const Rep a ) const;
- size_t length ( const Rep a ) const;
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- Rep& mul (Rep& r, const Rep a, const Rep b) const;
- Rep& div (Rep& r, const Rep a, const Rep b) const;
- Rep& add (Rep& r, const Rep a, const Rep b) const;
- Rep& sub (Rep& r, const Rep a, const Rep b) const;
- Rep& neg (Rep& r, const Rep a) const;
- Rep& inv (Rep& r, const Rep a) const;
-
- Rep& mulin (Rep& r, const Rep a) const;
- Rep& divin (Rep& r, const Rep a) const;
- Rep& addin (Rep& r, const Rep a) const;
- Rep& subin (Rep& r, const Rep a) const;
- Rep& negin (Rep& r) const;
- Rep& invin (Rep& r) const;
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- void mul (const size_t sz, Array r, constArray a, constArray b) const;
- void mul (const size_t sz, Array r, constArray a, Rep b) const;
-
- void div (const size_t sz, Array r, constArray a, constArray b) const;
- void div (const size_t sz, Array r, constArray a, Rep b) const;
-
- void add (const size_t sz, Array r, constArray a, constArray b) const;
- void add (const size_t sz, Array r, constArray a, Rep b) const;
-
- void sub (const size_t sz, Array r, constArray a, constArray b) const;
- void sub (const size_t sz, Array r, constArray a, Rep b) const;
-
- void neg (const size_t sz, Array r, constArray a) const;
- void inv (const size_t sz, Array r, constArray a) const;
-
- // -- axpy: r <- a * x + y mod p
- Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axpyin: r <- r + a * x mod p
- Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
- void axpyin
- (const size_t sz, Array r, constArray a, constArray x) const;
-
- // -- amxy: r <- c - a * b mod p
- Rep& amxy (Rep& r, const Rep a, const Rep b, const Rep c) const;
-
- // -- axmy: r <- a * x - y mod p
- Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axmyin: r <- r - a * x mod p
- Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
- void axmyin
- (const size_t sz, Array r, constArray a, constArray x) const;
-
- // -- Misc: r <- a mod p
- void assign ( const size_t sz, Array r, constArray a ) const;
-/* JGD 26.10.99
- void assign ( Rep& r, const Rep a) const;
- void assign ( Rep& r, const long a ) const;
- void assign ( Rep& r, const unsigned long a ) const;
- void assign ( Rep& r, const int a ) const;
- void assign ( Rep& r, const unsigned int a ) const;
-*/
- Rep& assign ( Rep& r, const Rep a) const;
- Rep& assign ( Rep& r, const long a ) const;
- Rep& assign ( Rep& r, const unsigned long a ) const;
- Rep& assign ( Rep& r, const int a ) const;
- Rep& assign ( Rep& r, const unsigned int a ) const;
- // ----- random generators
- template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r, long s) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
-
- typedef GIV_randIter< ZpzDom<Std16>, Rep > randIter;
-
- // <- \sum_i a[i], return 1 if a.size() ==0,
- void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
-
- // <- \prod_i a[i], return 1 if a.size() ==0,
- void reducemul ( Rep& r, const size_t sz, constArray a ) const;
-
- // <- \sum_i a[i] * b[i]
- void dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
- void dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
-
- // ----- a -> r: uint16 to double
- void i2d ( const size_t sz, double* r, constArray a ) const;
-
- // ----- a -> r % p: double to uint16 % p
- void d2i ( const size_t sz, Array r, const double* a ) const;
-
- // --- IO methods
- std::istream& read ( std::istream& s );
- std::ostream& write( std::ostream& s ) const;
- std::istream& read ( std::istream& s, Rep& a ) const;
- std::ostream& write( std::ostream& s, const Rep a ) const;
+ // ----- Exported Types and constantes
+ typedef uint16_t Residu_t; // - type to store residue
+ enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
+ // ----- Representation of Element of the domain ZpzDom
+ typedef int16_t Rep;
+ typedef int16_t Element;
+
+ // ----- Representation of vector of the Element
+ typedef Rep* Array;
+ typedef const Rep* constArray;
+
+ // ----- Constantes
+ const Rep zero;
+ const Rep one;
+
+ // ----- Constructor
+ ZpzDom() : zero(0), one(1), _p(0) {}
+ ZpzDom( Residu_t p ) : zero(0), one(1), _p(p) {}
+ ZpzDom( const ZpzDom<Std16>& F) : zero(0), one(1), _p(F._p) {}
+
+
+ int operator==( const ZpzDom<Std16>& BC) const { return _p == BC._p;}
+ int operator!=( const ZpzDom<Std16>& BC) const { return _p != BC._p;}
+
+ ZpzDom<Std16>& operator=( const ZpzDom<Std16>& F) { this->_p = F._p; return *this;}
+
+ // ----- Access to the modulus
+ Residu_t residu() const;
+ Residu_t size() const { return _p; }
+ Residu_t characteristic() const { return _p; }
+ Integer& characteristic( Integer& p) const { return p=_p; }
+ Rep access( const Rep a ) const { return a; }
+
+ // ----- Convert from Element to int
+ int16_t& convert( int16_t& x , const Rep a) const { return x=(int16_t)(a);}
+ uint16_t& convert( uint16_t& x , const Rep a) const { return x=(uint16_t)(a);}
+ unsigned long& convert( unsigned long& x , const Rep a) const { return x=(unsigned long)(a);}
+ double& convert( double& x , const Rep a) const { return x=(double)(a);}
+ int& convert( int& x , const Rep a) const { return x=int(a);}
+ Integer& convert(Integer& i, const Rep a) const {
+ unsigned long ur;
+ return i = (Integer)convert(ur, a);
+ }
+
+
+
+ // ----- Access to the modulus
+ Rep& init( Rep& a ) const;
+ void init( const size_t, Array a, constArray b ) const;
+ Rep& init( Rep& a, const long i) const ;
+ Rep& init( Rep& a, const unsigned long i) const ;
+ Rep& init( Rep& a, const int i) const ;
+ Rep& init( Rep& a, const unsigned int i) const ;
+ Rep& init( Rep& a, const double i) const ;
+ Rep& init( Rep& a, const float i) const ;
+ Rep& init( Rep& a, const Integer& i) const ;
+
+ // ----- Misc methods
+ int areEqual( const Rep, const Rep) const;
+ int areNEqual( const Rep, const Rep) const;
+ int isZero( const Rep a ) const;
+ int isnzero( const Rep a ) const;
+ int isOne ( const Rep a ) const;
+ size_t length ( const Rep a ) const;
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ Rep& mul (Rep& r, const Rep a, const Rep b) const;
+ Rep& div (Rep& r, const Rep a, const Rep b) const;
+ Rep& add (Rep& r, const Rep a, const Rep b) const;
+ Rep& sub (Rep& r, const Rep a, const Rep b) const;
+ Rep& neg (Rep& r, const Rep a) const;
+ Rep& inv (Rep& r, const Rep a) const;
+
+ Rep& mulin (Rep& r, const Rep a) const;
+ Rep& divin (Rep& r, const Rep a) const;
+ Rep& addin (Rep& r, const Rep a) const;
+ Rep& subin (Rep& r, const Rep a) const;
+ Rep& negin (Rep& r) const;
+ Rep& invin (Rep& r) const;
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ void mul (const size_t sz, Array r, constArray a, constArray b) const;
+ void mul (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void div (const size_t sz, Array r, constArray a, constArray b) const;
+ void div (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void add (const size_t sz, Array r, constArray a, constArray b) const;
+ void add (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void sub (const size_t sz, Array r, constArray a, constArray b) const;
+ void sub (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void neg (const size_t sz, Array r, constArray a) const;
+ void inv (const size_t sz, Array r, constArray a) const;
+
+ // -- axpy: r <- a * x + y mod p
+ Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axpy
+ (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axpyin: r <- r + a * x mod p
+ Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
+ void axpyin
+ (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpyin: r <- r - a * x mod p
+ Rep& maxpyin (Rep& r, const Rep a, const Rep b) const;
+ void maxpyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- axmy: r <- a * x - y mod p
+ Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axmy
+ (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axmyin: r <- a * x - r mod p
+ Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
+ // void axmyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- Misc: r <- a mod p
+ void assign ( const size_t sz, Array r, constArray a ) const;
+ Rep& assign ( Rep& r, const Rep a) const;
+
+ // ----- random generators
+ template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r, long s) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
+
+ typedef GIV_randIter< ZpzDom<Std16>, Rep > randIter;
+
+ // <- \sum_i a[i], return 1 if a.size() ==0,
+ void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+
+ // <- \prod_i a[i], return 1 if a.size() ==0,
+ void reducemul ( Rep& r, const size_t sz, constArray a ) const;
+
+ // <- \sum_i a[i] * b[i]
+ void dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+ void dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
+
+ // ----- a -> r: uint16_t to double
+ void i2d ( const size_t sz, double* r, constArray a ) const;
+
+ // ----- a -> r % p: double to uint16_t % p
+ void d2i ( const size_t sz, Array r, const double* a ) const;
+
+ // --- IO methods
+ std::istream& read ( std::istream& s );
+ std::ostream& write( std::ostream& s ) const;
+ std::istream& read ( std::istream& s, Rep& a ) const;
+ std::ostream& write( std::ostream& s, const Rep a ) const;
protected:
- // -- based for modular inverse, d = a*u + b*v
-// static const int32 gcdext ( int32& u, int32& v, const int32 a, const int32 b );
- int32& gcdext (int32& d, int32& u, int32& v, const int32 a, const int32 b ) const;
- int32& invext (int32& u, const int32 a, const int32 b ) const;
+ // -- based for modular inverse, d = a*u + b*v
+ // static const int32_t gcdext ( int32_t& u, int32_t& v, const int32_t a, const int32_t b );
+ int32_t& gcdext (int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const;
+ int32_t& invext (int32_t& u, const int32_t a, const int32_t b ) const;
protected:
- // -- data representation of the domain:
- Residu_t _p;
+ // -- data representation of the domain:
+ Residu_t _p;
- static void Init();
- static void End();
+ static void Init();
+ static void End();
};
+} // namespace Givaro
#include "givaro/givzpz16std.inl"
-#endif
+#endif // __GIVARO_zpz16std_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz16std.inl b/src/kernel/zpz/givzpz16std.inl
index 77e4ab0..290751f 100644
--- a/src/kernel/zpz/givzpz16std.inl
+++ b/src/kernel/zpz/givzpz16std.inl
@@ -1,577 +1,580 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz16std.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz16std.inl,v 1.9 2008-04-22 16:55:57 jgdumas Exp $
+// $Id: givzpz16std.inl,v 1.18 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
// Description:
// ---------
// -- normalized operations
// ---------
-
-
-// r = a*b
-#define __GIVARO_ZPZ16_N_MUL(r,p,a,b) { r = (a*b); r= (r>=p ? r % (uint16)p : r); }
-// r *= a
-#define __GIVARO_ZPZ16_N_MULIN(r,p,a) { r *= a; r= (r<p ? r : r % (uint16)p);}
+#ifndef __GIVARO_zpz16std_INL
+#define __GIVARO_zpz16std_INL
// r = a - b
//#define __GIVARO_ZPZ16_N_SUB(r,p,a,b) { r = (a-b); r= (r < 0 ? r+p : r);}
-#define __GIVARO_ZPZ16_N_SUB(r,p,a,b) ( r = a>=b? a-b: (p-b)+a )
+#define __GIVARO_ZPZ16_N_SUB(r,p,a,b) ( r = Rep(a>=b? a-b: (p-b)+a) )
// r -= a
-#define __GIVARO_ZPZ16_N_SUBIN(r,p,a) { r -= a; r= (r < 0 ? r+p : r);}
+#define __GIVARO_ZPZ16_N_SUBIN(r,p,a) { r = Rep(r-a); r= Rep(r < 0 ? r+p : r);}
// r = a+b
-#define __GIVARO_ZPZ16_N_ADD(r,p,a,b) { r = (a+b); r= (r < p ? r : r-p);}
+#define __GIVARO_ZPZ16_N_ADD(r,p,a,b) { r = Rep(a+b); r= Rep(r < p ? r : r-p);}
// r += a
-#define __GIVARO_ZPZ16_N_ADDIN(r,p,a) { r += a; r= (r < p ? r : r-p);}
-
-// r <- a*b+c % p
-#define __GIVARO_ZPZ16_N_MULADD(r,p,a,b,c) \
-{ r = (a*b+c); r= (r<p ? r : r % (uint16)p); }
-
-#define __GIVARO_ZPZ16_N_MULADDIN(r,p,a,b) \
-{ r += (a*b); r= (r<p ? r : r % (uint16)p);}
-
-// // a*b-c
-#define __GIVARO_ZPZ16_N_MULSUB(r,p,a,b,c) \
-{ r = (a*b-c); r= (r<p ? (r>0? r : r% (uint16)p) : r % (uint16)p); }
-// a*b-c
-#define __GIVARO_ZPZ16_N_SUBMULIN(r,p,a,b) \
-{ r -= (a*b); if (r<0) { r+=p; r = (r<0 ? r % (uint16)p : r); } }
-
-
-
-
-#define __GIVARO_ZPZ16_N_NEG(r,p,a) { r = (a == 0 ? 0 : p-a); }
-#define __GIVARO_ZPZ16_N_NEGIN(r,p) { r = (r == 0 ? 0 : p-r); }
-
-
-inline ZpzDom<Std16>::Residu_t ZpzDom<Std16>::residu( ) const
-{ return _p; }
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::mul (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_N_MUL(tmp,(int32)_p,(int32)a,(int32)b);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::neg (Rep& r, const Rep a) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_N_NEG(tmp,(int32)_p,(int32)a);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::inv (Rep& r, const Rep a) const
-{
- register int32 u;
- ZpzDom<Std16>::invext(u, a, _p);
-// if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::inv)" << std::endl;
- return r = (u<0)?(ZpzDom<Std16>::Rep)(u+_p):(ZpzDom<Std16>::Rep)u;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::div (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp;
- register int16 ib;
- inv(ib, b);
- __GIVARO_ZPZ16_N_MUL(tmp,(int32)_p,(int32)a,(int32)ib);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::sub (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_ZPZ16_N_SUB(r,(int32)_p,(int32)a,(int32)b);
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::add (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_N_ADD(tmp,(int32)_p,(int32)a,(int32)b);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-
- // -- inline array operations between ZpzDom<Std16>::Rep
-inline void ZpzDom<Std16>::mul (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_MUL(tmp, (int32)_p,(int32)a[i], (int32)b[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::mul (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_MUL(tmp, (int32)_p, (int32)a[i], (int32)b);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::div (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- div( r[i], a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Std16>::div (const size_t sz, Array r, constArray a, Rep b) const
-{
- ZpzDom<Std16>::Rep ib;
- inv(ib, b);
- mul(sz, r, a, ib);
-}
-
-inline void ZpzDom<Std16>::add (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_ADD(tmp, (int32)_p, (int32)a[i], (int32)b[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::add (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_ADD(tmp, (int32)_p, (int32)a[i], (int32)b);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::sub (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_SUB(tmp, (int32)_p, (int32)a[i], (int32)b[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::sub (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_SUB(tmp, (int32)_p, (int32)a[i], (int32)b);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::neg (const size_t sz, Array r, constArray a) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_NEG(tmp, (int32)_p, (int32)a[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::mulin (Rep& r, const Rep a) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ16_N_MULIN(tmp,(int32)_p, (int32)a);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::divin (Rep& r, const Rep a) const
-{
- ZpzDom<Std16>::Rep ia;
- inv(ia, a);
- return mulin(r, ia);
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::addin (Rep& r, const Rep a) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ16_N_ADDIN(tmp,(int32)_p, (int32)a);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::subin (Rep& r, const Rep a) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ16_N_SUBIN(tmp,(int32)_p, (int32)a);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::negin (Rep& r) const
-{
- __GIVARO_ZPZ16_N_NEGIN(r,(int32)_p);
- return r;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::invin (Rep& r) const
-{
- register int32 u;
- ZpzDom<Std16>::invext(u, r, _p);
-// if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::inv)" << std::endl;
- return r = (u<0)?(ZpzDom<Std16>::Rep)(u+_p):(ZpzDom<Std16>::Rep)u;
-}
-
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axpy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_N_MULADD(tmp, (int32)_p, (int32)a, (int32)b, (int32)c);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axpyin
- (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ16_N_MULADDIN(tmp, (int32)_p, (int32)a, (int32)b);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-
-inline void ZpzDom<Std16>::axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_MULADD(tmp, (int32)_p, (int32)a[i], (int32)x[i], (int32)y[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std16>::axpyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp = (int32)r[i];
- __GIVARO_ZPZ16_N_MULADDIN(tmp, (int32)_p, (int32)a[i], (int32)x[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::amxy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_N_MUL(tmp, (int32)_p, (int32)a, (int32)b);
- __GIVARO_ZPZ16_N_SUB(r, (int32)_p, (int32)c, tmp);
- return r;
-}
-
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axmy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_N_MULSUB(tmp, (int32)_p, (int32)a, (int32)b, (int32)c);
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-// r -= a*b
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axmyin
- (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ16_N_SUBMULIN(tmp, (int32)_p, (int32)a, (int32)b );
- return r = (ZpzDom<Std16>::Rep)tmp;
-}
-
-
-inline void ZpzDom<Std16>::axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ16_N_MULSUB(tmp, (int32)_p, (int32)a[i], (int32)x[i], (int32)y[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
-// r -= a*b
-inline void ZpzDom<Std16>::axmyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp = (int32)r[i];
- __GIVARO_ZPZ16_N_SUBMULIN(tmp, (int32)_p, (int32)a[i], (int32)x[i]);
- r[i] = (ZpzDom<Std16>::Rep)tmp;
- }
-}
-
- // ------------------------- Miscellaneous functions
-
-inline int ZpzDom<Std16>::areEqual(const Rep a, const Rep b) const
-{ return a == b; }
-
-inline int ZpzDom<Std16>::areNEqual(const Rep a, const Rep b) const
-{ return a != b; }
-
-inline int ZpzDom<Std16>::isZero(const Rep a) const
-{ return a == ZpzDom<Std16>::zero; }
-
-inline int ZpzDom<Std16>::isnzero(const Rep a) const
-{ return a != ZpzDom<Std16>::zero; }
-
-inline int ZpzDom<Std16>::isOne(const Rep a) const
-{ return a == ZpzDom<Std16>::one; }
-
-
-
-inline size_t ZpzDom<Std16>::length(const Rep a) const
-{ return ZpzDom<Std16>::size_rep;}
-
-// ---------
-// -- misc operations
-// ---------
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r, const unsigned long a ) const
-{ return r = (Rep)( a >= (unsigned long)_p ? a % (unsigned long)_p : a);
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r, const long a ) const
-{
- int sign; long ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % (uint16)_p : ua;
- if (r && (sign ==-1)) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r, const Integer& residu ) const
-{
- int16 tr;
- if (residu <0) {
- // -a = b [p]
- // a = p-b [p]
- if ( residu <= (Integer)(-_p) ) tr = int16( (-residu) % (uint16)_p) ;
- else tr = int16(-residu);
- if (tr)
- return r = (uint16)_p - (uint16)tr;
- else
- return r = zero;
- } else {
- if (residu >= (Integer)_p ) tr = int16(residu % _p) ;
- else tr = int16(residu);
- return r = (Rep)tr;
- }
-}
-
-
-
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const int i) const { return init(a,(long)i); }
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const double i) const { return init(a,(long)i); }
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const float i) const { return init(a,(double)i); }
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const unsigned int i) const { return init(a,(unsigned long)i); }
-
-
-inline void ZpzDom<Std16>::assign
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- if (a[i] <ZpzDom<Std16>::zero) {
- r[i] = a[i] + _p;
- if (r[i] <ZpzDom<Std16>::zero) r[i] = r[i] % (uint16)_p;
- }
- else if (a[i] >_p) {
- r[i] = a[i] - _p;
- if (r[i] >=_p) r[i] = r[i] % (uint16)_p;
- }
- else r[i] = a[i];
- }
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::assign ( Rep& r, const long a ) const
-{ return init(r, a);
-}
-
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::assign ( Rep& r, const int a ) const
-{ return ZpzDom<Std16>::assign( r, (long)a); }
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::assign ( Rep& r, const unsigned long a ) const
-{ return init(r,a); }
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::assign
- ( Rep& r, const unsigned int a ) const
-{ return init(r, (unsigned long)a); }
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::assign
- ( Rep& r, const Rep a ) const
-{ return assign(r, (long)a); }
-
-template< class RandIter >
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::random(RandIter& g, Rep& a) const {
- return init(a, g());
-}
-
-template< class RandIter >
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::random(RandIter& g, Rep& a, const Rep& b) const {
- return init(a, g());
-}
-
-template< class RandIter >
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::random(RandIter& g, Rep& a, long b) const {
- return init(a, g() %(uint16) b);
-}
-
-template< class RandIter >
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::nonzerorandom(RandIter& g, Rep& a) const {
- while (isZero(init(a, g()))) {};
- return a;
-}
-
-template< class RandIter >
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const {
- while (isZero(init(a, g()))) {};
- return a;
-}
-
-template< class RandIter >
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::nonzerorandom(RandIter& g, Rep& a, long b) const {
- while (isZero(init(a, g() %(uint16) b))) {};
- return a;
-}
-
-inline void ZpzDom<Std16>::init
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i)
- r[i] = a[i];
-}
-
-inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r ) const
-{ return r = zero; }
-
-inline void ZpzDom<Std16>::dotprod
- ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
-{
- unsigned int stride = 1;
- if ((unsigned long)bound < GIVARO_MAXUINT16)
- stride = GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound);
- unsigned long dot = zero;
- if ((sz <10) && (sz <stride)) {
- for( register int i= sz-1; i>=0; --i)
- dot += a[i] * b[i];
- if (dot > _p) r = (Rep)(dot % (uint16)_p);
- else r = (Rep)dot;
- return;
- }
- unsigned int i_begin=0;
- stride &= ~0x1;
- if (stride ==0) {
- for( register int i= sz-1; i>0; --i) {
- dot += a[i] * b[i];
- if (dot>_p) dot %= _p;
- }
- r = (Rep)dot;
- return;
- }
- do {
- size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
- if ((min_sz & 0x1) !=0)
- { min_sz--; i_begin++; dot += a++[min_sz] * b++[min_sz]; }
- if (min_sz > 1)
- for( register size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
- {
- dot += a[0] * b[0];
- dot += a[1] * b[1];
- }
- if (dot>_p) dot %= (uint16)_p;
- i_begin += min_sz;
- } while (i_begin <sz);
- r = (Rep)dot;
-}
-
-inline void ZpzDom<Std16>::dotprod
- ( Rep& r, const size_t sz, constArray a, constArray b ) const
-{
- return ZpzDom<Std16>::dotprod(r, _p, sz, a, b);
-}
-
-
- // a -> r: int16 to double
-inline void
- ZpzDom<Std16>::i2d ( const size_t sz, double* r, constArray a ) const
-{
- for (size_t i=0; i<sz; ++i) r[i] = a[i];
-}
-
- // a -> r: double to int16
-inline void
- ZpzDom<Std16>::d2i ( const size_t sz, Array r, const double* a ) const
-{
- union d_2_l {
- double d;
- int32 r[2];
- };
-// static const double offset = 4503599627370496.0; // 2^52
- double offset = 4503599627370496.0; // 2^52
- for (size_t i=0; i<sz; ++i)
- {
- register d_2_l tmp;
- // - normalization: put fractional part at the end of the representation
- tmp.d = a[i] + offset;
- r[i] = tmp.r[1];
- if (r[i] <_p) r[i] %= _p;
- }
- // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
- // r[i] = (r[i] <_p ? r[i] : r[i]%_p);
- // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]%_p);
-}
-
-
-
- // -- Input: (z, <_p>)
-inline std::istream& ZpzDom<Std16>::read (std::istream& s)
-{
- char ch;
- s >> std::ws >> ch;
- if (ch != '(')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: syntax error: no '('"));
- std::cerr << "GivBadFormat(ZpzDom<Std16>::read: syntax error: no '('))" << std::endl;
-
- s >> std::ws >> ch;
- if (ch != 'z')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: bad domain object"));
- std::cerr << "GivBadFormat(ZpzDom<Std16>::read: bad domain object))" << std::endl;
-
- s >> std::ws >> ch;
- if (ch != ',')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: syntax error: no ','"));
- std::cerr << "GivBadFormat(ZpzDom<Std16>::read: syntax error: no ',')) " << std::endl;
-
- s >> std::ws >> _p;
-
- s >> std::ws >> ch;
- if (ch != ')')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: syntax error: no ')'"));
- std::cerr << "GivBadFormat(ZpzDom<Std16>::read: syntax error: no ')')) " << std::endl;
-
- return s;
-}
-
-inline std::ostream& ZpzDom<Std16>::write (std::ostream& s ) const
-{
- return s << "Std16 Givaro Z/pZ modulo " << residu();
-}
-
-inline std::istream& ZpzDom<Std16>::read (std::istream& s, Rep& a) const
-{
- s >> a;
- init(a, a);
- return s;
-}
-
-inline std::ostream& ZpzDom<Std16>::write (std::ostream& s, const Rep a) const
-{
- return s << a;
-}
+#define __GIVARO_ZPZ16_N_ADDIN(r,p,a) { r = Rep(r+a); r= Rep(r < p ? r : r-p);}
+
+#define __GIVARO_ZPZ16_N_NEG(r,p,a) ( r = Rep(a == 0 ? 0 : p-a) )
+#define __GIVARO_ZPZ16_N_NEGIN(r,p) ( r = Rep(r == 0 ? 0 : p-r) )
+
+
+namespace Givaro {
+
+
+ inline ZpzDom<Std16>::Residu_t ZpzDom<Std16>::residu( ) const
+ {
+ return _p;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::mul (Rep& r, const Rep a, const Rep b) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp,(int32_t)_p,(int32_t)a,(int32_t)b);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::neg (Rep& r, const Rep a) const
+ {
+ return __GIVARO_ZPZ16_N_NEG(r,_p,a);
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::inv (Rep& r, const Rep a) const
+ {
+ int32_t u;
+ ZpzDom<Std16>::invext(u, a, _p);
+ // if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::inv)" << std::endl;
+ return r = (u<0)?(ZpzDom<Std16>::Rep)(u+_p):(ZpzDom<Std16>::Rep)u;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::div (Rep& r, const Rep a, const Rep b) const
+ {
+ int32_t tmp;
+ Rep ib;
+ inv(ib, b);
+ __GIVARO_ZPZ32_N_MUL(tmp,(int32_t)_p,(int32_t)a,(int32_t)ib);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::sub (Rep& r, const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ16_N_SUB(r,_p,a,b);
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::add (Rep& r, const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ16_N_ADD(r,_p,a,b);
+ return r;
+ }
+
+
+ // -- inline array operations between ZpzDom<Std16>::Rep
+ inline void ZpzDom<Std16>::mul (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp, (int32_t)_p,(int32_t)a[i], (int32_t)b[i]);
+ r[i] = (ZpzDom<Std16>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std16>::mul (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)b);
+ r[i] = (ZpzDom<Std16>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std16>::div (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ div( r[i], a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Std16>::div (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ ZpzDom<Std16>::Rep ib;
+ inv(ib, b);
+ mul(sz, r, a, ib);
+ }
+
+ inline void ZpzDom<Std16>::add (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; )
+ __GIVARO_ZPZ16_N_ADD(r[i], _p, a[i], b[i]);
+ }
+
+ inline void ZpzDom<Std16>::add (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; )
+ __GIVARO_ZPZ16_N_ADD(r[i], _p, a[i], b);
+ }
+
+ inline void ZpzDom<Std16>::sub (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; )
+ __GIVARO_ZPZ16_N_SUB(r[i], _p, a[i], b[i]);
+ }
+
+ inline void ZpzDom<Std16>::sub (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; )
+ __GIVARO_ZPZ16_N_SUB(r[i], _p, a[i], b);
+ }
+
+ inline void ZpzDom<Std16>::neg (const size_t sz, Array r, constArray a) const
+ {
+ for ( size_t i=sz ; --i ; )
+ __GIVARO_ZPZ16_N_NEG(r[i], _p, a[i]);
+ }
+
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::mulin (Rep& r, const Rep a) const
+ {
+ int32_t tmp = (int32_t)r;
+ __GIVARO_ZPZ32_N_MULIN(tmp,(int32_t)_p, (int32_t)a);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::divin (Rep& r, const Rep a) const
+ {
+ ZpzDom<Std16>::Rep ia;
+ inv(ia, a);
+ return mulin(r, ia);
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::addin (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_N_ADDIN(r,_p, a);
+ return r;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::subin (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_N_SUBIN(r,_p,a);
+ return r;
+ }
+
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::negin (Rep& r) const
+ {
+ return __GIVARO_ZPZ16_N_NEGIN(r,_p);
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::invin (Rep& r) const
+ {
+ int32_t u;
+ ZpzDom<Std16>::invext(u, r, _p);
+ // if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::inv)" << std::endl;
+ return r = (u<0)?(ZpzDom<Std16>::Rep)(u+_p):(ZpzDom<Std16>::Rep)u;
+ }
+
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axpy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULADD(tmp, (int32_t)_p, (int32_t)a, (int32_t)b, (int32_t)c);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axpyin
+ (Rep& r, const Rep a, const Rep b) const
+ {
+ int32_t tmp = (int32_t)r;
+ __GIVARO_ZPZ32_N_MULADDIN(tmp, (int32_t)_p, (int32_t)a, (int32_t)b);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+
+ inline void ZpzDom<Std16>::axpy
+ (const size_t sz, Array r, constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULADD(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i], (int32_t)y[i]);
+ r[i] = (ZpzDom<Std16>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std16>::axpyin
+ (const size_t sz, Array r, constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp = (int32_t)r[i];
+ __GIVARO_ZPZ32_N_MULADDIN(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i]);
+ r[i] = (ZpzDom<Std16>::Rep)tmp;
+ }
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::maxpy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp, (int32_t)_p, (int32_t)a, (int32_t)b);
+ return __GIVARO_ZPZ16_N_SUB(r, _p, c, (Rep)tmp);
+ }
+
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axmy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULSUB(tmp, (int32_t)_p, (int32_t)a, (int32_t)b, (int32_t)c);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+ // r -= a*b
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::maxpyin
+ (Rep& r, const Rep a, const Rep b) const
+ {
+ int32_t tmp = (int32_t)r;
+ __GIVARO_ZPZ32_N_SUBMULIN(tmp, (int32_t)_p, (int32_t)a, (int32_t)b );
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ // int32_t tmp = (int32_t)r;
+ // __GIVARO_ZPZ16_N_SUBMULIN(tmp, (int32_t)_p, (int32_t)a, (int32_t)b );
+ // return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+ // r = a*b - r
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::axmyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ int32_t tmp = (int32_t)r;
+ __GIVARO_ZPZ32_N_MULSUB(tmp, (int32_t)_p, (int32_t)a, (int32_t)b , tmp);
+ return r = (ZpzDom<Std16>::Rep)tmp;
+ }
+
+
+ inline void ZpzDom<Std16>::axmy (const size_t sz, Array r,
+ constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULSUB(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i], (int32_t)y[i]);
+ r[i] = (ZpzDom<Std16>::Rep)tmp;
+ }
+ }
+
+ // r -= a*b
+ inline void ZpzDom<Std16>::maxpyin (const size_t sz, Array r,
+ constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp = (int32_t)r[i];
+ __GIVARO_ZPZ32_N_SUBMULIN(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i]);
+ r[i] = (ZpzDom<Std16>::Rep)tmp;
+ }
+ }
+
+ // ------------------------- Miscellaneous functions
+
+ inline int ZpzDom<Std16>::areEqual(const Rep a, const Rep b) const
+ {
+ return a == b;
+ }
+
+ inline int ZpzDom<Std16>::areNEqual(const Rep a, const Rep b) const
+ {
+ return a != b;
+ }
+
+ inline int ZpzDom<Std16>::isZero(const Rep a) const
+ {
+ return a == ZpzDom<Std16>::zero;
+ }
+
+ inline int ZpzDom<Std16>::isnzero(const Rep a) const
+ {
+ return a != ZpzDom<Std16>::zero;
+ }
+
+ inline int ZpzDom<Std16>::isOne(const Rep a) const
+ {
+ return a == ZpzDom<Std16>::one;
+ }
+
+
+
+ inline size_t ZpzDom<Std16>::length(const Rep ) const
+ {
+ return ZpzDom<Std16>::size_rep;
+ }
+
+ // ---------
+ // -- misc operations
+ // ---------
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r, const unsigned long a ) const
+ {
+ return r = (Rep)( a >= (unsigned long)_p ? a % (unsigned long)_p : a);
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r, const long a ) const
+ {
+ int sign; long ua;
+ if (a <0) {
+ sign =-1;
+ ua = -a;
+ }
+ else {
+ ua = a;
+ sign =1;
+ }
+ r = Rep( (ua >=_p) ? ua % (uint16_t)_p : ua );
+ if (r && (sign ==-1))
+ r = (Rep)(_p - r);
+ return r;
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r, const Integer& Residu ) const
+ {
+ Rep tr;
+ if (Residu <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ if ( Residu <= (Integer)(-_p) ) tr = Rep( (-Residu) % (uint16_t)_p) ;
+ else tr = Rep(-Residu);
+ if (tr)
+ return r = Rep((uint16_t)_p - (uint16_t)tr);
+ else
+ return r = zero;
+ }
+ else {
+ if (Residu >= (Integer)_p ) tr = Rep(Residu % _p) ;
+ else tr = Rep(Residu);
+ return r = (Rep)tr;
+ }
+ }
+
+
+
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const int i) const
+ {
+ return init(a,(long)i);
+ }
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const double i) const
+ {
+ return init(a,(long)i);
+ }
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const float i) const
+ {
+ return init(a,(double)i);
+ }
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init( Rep& a, const unsigned int i) const
+ {
+ return init(a,(unsigned long)i);
+ }
+
+
+ inline void ZpzDom<Std16>::assign
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; )
+ r[i] = a[i];
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::assign ( Rep& r, const Rep a ) const
+ { return r=a;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::random(RandIter& g, Rep& a) const
+ {
+ return init(a, g());
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::random(RandIter& g, Rep& a, const Rep& b) const
+ {
+ return init(a, g());
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::random(RandIter& g, Rep& a, long b) const
+ {
+ return init(a, g() %(uint16_t) b);
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::nonzerorandom(RandIter& g, Rep& a) const
+ {
+ while (isZero(init(a, g()))) {};
+ return a;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const
+ {
+ while (isZero(init(a, g()))) {};
+ return a;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::nonzerorandom(RandIter& g, Rep& a, long b) const
+ {
+ while (isZero(init(a, g() %(uint16_t) b))) {};
+ return a;
+ }
+
+ inline void ZpzDom<Std16>::init
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; )
+ r[i] = a[i];
+ }
+
+ inline ZpzDom<Std16>::Rep& ZpzDom<Std16>::init ( Rep& r ) const
+ {
+ return r = zero;
+ }
+
+ inline void ZpzDom<Std16>::dotprod
+ ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
+ {
+ unsigned int stride = 1;
+ if ((unsigned long)bound < GIVARO_MAXUINT16)
+ stride = (unsigned int) (GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound));
+ unsigned long dot = zero;
+ if ((sz <10) && (sz <stride)) {
+ for( size_t i= sz; i--; )
+ dot += a[i] * b[i];
+ if (dot > _p) r = (Rep)(dot % (uint16_t)_p);
+ else r = (Rep)dot;
+ return;
+ }
+ unsigned int i_begin=0;
+ stride &= ~0x1;
+ if (stride ==0) {
+ for( size_t i = sz; i--; ) {
+ dot += a[i] * b[i];
+ if (dot>_p) dot %= _p;
+ }
+ r = (Rep)dot;
+ return;
+ }
+ do {
+ size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
+ if ((min_sz & 0x1) !=0) {
+ min_sz--;
+ i_begin++;
+ dot += a++[min_sz] * b++[min_sz];
+ }
+ if (min_sz > 1)
+ for( size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
+ {
+ dot += a[0] * b[0];
+ dot += a[1] * b[1];
+ }
+ if (dot>_p) dot %= (uint16_t)_p;
+ i_begin += (unsigned int) min_sz;
+ } while (i_begin <sz);
+ r = (Rep)dot;
+ }
+
+ inline void ZpzDom<Std16>::dotprod
+ ( Rep& r, const size_t sz, constArray a, constArray b ) const
+ {
+ return ZpzDom<Std16>::dotprod(r, _p, sz, a, b);
+ }
+
+
+ // a -> r: int16_t to double
+ inline void
+ ZpzDom<Std16>::i2d ( const size_t sz, double* r, constArray a ) const
+ {
+ for (size_t i=0; i<sz; ++i) r[i] = a[i];
+ }
+
+ // a -> r: double to int16_t
+ inline void
+ ZpzDom<Std16>::d2i ( const size_t sz, Array r, const double* a ) const
+ {
+ union d_2_l {
+ double d;
+ int32_t r[2];
+ };
+ // static const double offset = 4503599627370496.0; // 2^52
+ double offset = 4503599627370496.0; // 2^52
+ for (size_t i=0; i<sz; ++i)
+ {
+ d_2_l tmp;
+ // - normalization: put fractional part at the end of the representation
+ tmp.d = a[i] + offset;
+ r[i] = (Rep) tmp.r[1];
+ if (r[i] <_p)
+ r[i] = Rep(r[i]%_p);
+ }
+ // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
+ // r[i] = (r[i] <_p ? r[i] : r[i]%_p);
+ // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]%_p);
+ }
+
+
+
+ // -- Input: (z, <_p>)
+ inline std::istream& ZpzDom<Std16>::read (std::istream& s)
+ {
+ char ch;
+ s >> std::ws >> ch;
+ if (ch != '(')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: syntax error: no '('"));
+ std::cerr << "GivBadFormat(ZpzDom<Std16>::read: syntax error: no '('))" << std::endl;
+
+ s >> std::ws >> ch;
+ if (ch != 'z')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: bad domain object"));
+ std::cerr << "GivBadFormat(ZpzDom<Std16>::read: bad domain object))" << std::endl;
+
+ s >> std::ws >> ch;
+ if (ch != ',')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: syntax error: no ','"));
+ std::cerr << "GivBadFormat(ZpzDom<Std16>::read: syntax error: no ',')) " << std::endl;
+
+ s >> std::ws >> _p;
+
+ s >> std::ws >> ch;
+ if (ch != ')')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std16>::read: syntax error: no ')'"));
+ std::cerr << "GivBadFormat(ZpzDom<Std16>::read: syntax error: no ')')) " << std::endl;
+
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Std16>::write (std::ostream& s ) const
+ {
+ return s << "Std16 Givaro Z/pZ modulo " << residu();
+ }
+
+ inline std::istream& ZpzDom<Std16>::read (std::istream& s, Rep& a) const
+ {
+ s >> a;
+ init(a, a);
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Std16>::write (std::ostream& s, const Rep a) const
+ {
+ return s << a;
+ }
+
+} // namespace Givaro
+
+#endif // __GIVARO_zpz16std_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz16table1.C b/src/kernel/zpz/givzpz16table1.C
index 79c48eb..673e088 100644
--- a/src/kernel/zpz/givzpz16table1.C
+++ b/src/kernel/zpz/givzpz16table1.C
@@ -1,139 +1,151 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz16table1.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: J.G. Dumas
-// $Id: givzpz16table1.C,v 1.4 2008-03-13 01:58:41 pernet Exp $
+// $Id: givzpz16table1.C,v 1.8 2011-02-04 14:11:46 jgdumas Exp $
// ==========================================================================
// Description:
#include <iostream>
#include "givaro/givzpz16table1.h"
+namespace Givaro {
-ZpzDom<Log16>::ZpzDom( Residu_t p )
- : zero(2*(p-1)), one(0), _p(p)
+ZpzDom<Log16>::ZpzDom( Residu_t p ) :
+ zero(Rep(2*(p-1))), one(0), _p(p)
{
- int32 i,j;
-
- // tab value: Domain -> Rep, or something very similar
- _tab_value2rep = new Power_t[_p];
- // tab power: Rep -> Domain
- _tab_rep2value = new Residu_t[_p];
-
- _tab_rep2value[0] = 1;
- _tab_value2rep[1] = 0;
-
- _pmone = _p -1;
-
- int not_found = 1;
- Residu_t accu = 1;
- Residu_t seed =2;
-
- // -- Find a generator of the multiplicative group
- while (_p > 2 && not_found == 1)
- {
- for(i=1; i<_p; i++)
- {
- accu = (accu * seed) % _p;
-//cout << i << " :: " << accu << endl;
- _tab_rep2value[i] = accu;
- if (accu == 1) break;
- _tab_value2rep[accu] = i;
- }
- if (accu != 1){
- std::cerr << "attempted to build Log16 field with non-prime base "<<_p<<", halting\n";
- exit(1);
- };
- if (i ==_p-1) not_found = 0;
- else {
- do { seed = rand() % _p; } while ((seed ==0) && (seed !=1));
-// if (seed < 0) seed += _p;
- }
- }
- // -- Set the zero at position 2 * _p - 2 in table
- _tab_value2rep[0] = 2*_pmone;
-
-//cout << "Generateur: " << seed << endl;
-/*cout << "Table: Value -> Rep" << endl;
-for(i=0; i<_p; i++) {
- cout << i << " -> " << _tab_value2rep[i] << endl;
-}
-cout << "\nTable: Rep -> Value" << endl;
-for(i=0; i<_p; i++) {
- cout << i << " -> " << _tab_rep2value[i] << endl;
-}
-*/
- // -- Table for multiplication
- _tab_mul = new Power_t[4*_p];
- for(j=0; j<_pmone; j++) _tab_mul[j] = j;
- for(j=_pmone; j< (int32)2*_pmone; j++) _tab_mul[j] = j-_pmone;
- for(j=2*_pmone; j<= (int32)4*_pmone; j++) _tab_mul[j] = 2*_pmone;
-
- // -- Table for division and neg:
- _tab_div = &_tab_mul[_pmone];
- _tab_neg = &_tab_mul[_pmone/2];
-
- // -- Table for 1+value
- Power_t* tab_pone = new Power_t[4*_p];
- _tab_addone = &tab_pone[(int32)(2*_pmone)];
-
-/* Pascal Giorgi 24/04/02
- Error between _tab_rep2value and _tab_value2rep
-
- for(j=0; j<_pmone; j++)
- _tab_addone[j] = _tab_rep2value[ 1 + _tab_value2rep[j] ];
- for(j=1-_pmone; j<0; j++)
- _tab_addone[j] = _tab_rep2value[ 1 + _tab_value2rep[j + _pmone] ];
-
- corrected by inversing the array
-*/
- for(j=0; j<_pmone; j++){
- if (_tab_rep2value[j] < _pmone)
- _tab_addone[j] = _tab_value2rep[ 1 + _tab_rep2value[j] ];
- else
- _tab_addone[j] = _tab_value2rep[0];
- }
- for(j=1-_pmone; j<0; j++){
- if (_tab_rep2value[j+_pmone] < _pmone)
- _tab_addone[j] = _tab_value2rep[ 1 + _tab_rep2value[j + _pmone] ];
- else
- _tab_addone[j] = _tab_value2rep[0];
-
- }
- for(j=_pmone; j<=(int32)2*_pmone; j++)
- _tab_addone[j] = 0;
- for(j=(int32)-2*_pmone; j<(int32)(1-_pmone); j++)
- _tab_addone[j] = j;
-
- _tab_addone[_pmone / 2] = 2*_pmone;
- _tab_addone[-_pmone / 2] = 2*_pmone;
-
-
- // -- Table for 1-value
- Power_t* tab_mone = new Power_t[(int32)4*_p];
- _tab_subone = &tab_mone[(int32)2*_pmone];
-
- for(j=_pmone; j<=(int32)2*_pmone; j++)
- _tab_subone[j] = 0;
- for(j=-2*_pmone; j<(int32)(1-3*_pmone/2); j++)
- _tab_subone[j] = j+_pmone/2;
- for(j=-3*_pmone/2; j<(1-_pmone); j++)
- _tab_subone[j] = j-_pmone/2;
- for(j=1-_pmone; j<(1-_pmone/2); j++)
- _tab_subone[j] = _tab_addone[j + _pmone/2 + _pmone];
- for(j=_pmone/2; j<_pmone; j++)
- _tab_subone[j] = _tab_addone[j - _pmone/2];
- for(j=-_pmone/2; j<_pmone/2; j++)
- _tab_subone[j] = _tab_addone[j+_pmone/2];
-
- numRefs = new int;
- (*numRefs) = 1;
-#ifdef REFC_DEBUG
- std::cout << *(numRefs) << " Arefs, p="<<_p<<" \n";
+ int32_t i,j;
+
+ // tab value: Domain -> Rep, or something very similar
+ _tab_value2rep = new Power_t[_p];
+ // tab power: Rep -> Domain
+ _tab_rep2value = new Residu_t[_p];
+
+ _tab_rep2value[0] = 1;
+ _tab_value2rep[1] = 0;
+
+ _pmone = Rep(_p -1);
+ int32_t fourp = ((int32_t)p) << 2, fourpmone= ((int32_t)_pmone)<<2;
+
+ int not_found = 1;
+ Residu_t accu = 1;
+ Residu_t seed =2;
+
+ // -- Find a generator of the multiplicative group
+ while (_p > 2 && not_found == 1)
+ {
+ for(i=1; i<_p; i++)
+ {
+ accu = Rep((accu * seed) % _p);
+ //cout << i << " :: " << accu << endl;
+ _tab_rep2value[i] = accu;
+ if (accu == 1)
+ break;
+ _tab_value2rep[accu] = Rep(i);
+ }
+ if (accu != 1){
+ std::cerr << "attempted to build Log16 field with non-prime base "<<_p<<", halting\n";
+ return;
+ }
+ if (i ==_p-1) not_found = 0;
+ else {
+ do {
+ seed = Rep(rand() % _p);
+ } while ((seed ==0) && (seed !=1));
+ // if (seed < 0) seed += _p;
+ }
+ }
+ // -- Set the zero at position 2 * _p - 2 in table
+ _tab_value2rep[0] = zero;
+
+ //cout << "Generateur: " << seed << endl;
+ /*cout << "Table: Value -> Rep" << endl;
+ for(i=0; i<_p; i++) {
+ cout << i << " -> " << _tab_value2rep[i] << endl;
+ }
+ cout << "\nTable: Rep -> Value" << endl;
+ for(i=0; i<_p; i++) {
+ cout << i << " -> " << _tab_rep2value[i] << endl;
+ }
+ */
+ // -- Table for multiplication
+ _tab_mul = new Power_t[fourp];
+ for(j=0; j<_pmone; j++)
+ _tab_mul[j] = (Rep)j;
+ for(j=_pmone; j< (int32_t)zero; j++)
+ _tab_mul[j] = Rep(j-_pmone);
+ for(j=zero; j<= fourpmone; j++)
+ _tab_mul[j] = zero;
+
+ // -- Table for division and neg:
+ _tab_div = &_tab_mul[_pmone];
+ _tab_neg = &_tab_mul[_pmone/2];
+
+ // -- Table for 1+value
+ _tab_pone = new Power_t[fourp];
+ _tab_addone = &_tab_pone[(int32_t)(zero)];
+
+ /* Pascal Giorgi 24/04/02
+ Error between _tab_rep2value and _tab_value2rep
+
+ for(j=0; j<_pmone; j++)
+ _tab_addone[j] = _tab_rep2value[ 1 + _tab_value2rep[j] ];
+ for(j=1-_pmone; j<0; j++)
+ _tab_addone[j] = _tab_rep2value[ 1 + _tab_value2rep[j + _pmone] ];
+
+ corrected by inversing the array
+ */
+ for(j=0; j<_pmone; j++){
+ if (_tab_rep2value[j] < _pmone)
+ _tab_addone[j] = _tab_value2rep[ 1 + _tab_rep2value[j] ];
+ else
+ _tab_addone[j] = _tab_value2rep[0];
+ }
+ for(j=1-_pmone; j<0; j++){
+ if (_tab_rep2value[j+_pmone] < _pmone)
+ _tab_addone[j] = _tab_value2rep[ 1 + _tab_rep2value[j + _pmone] ];
+ else
+ _tab_addone[j] = _tab_value2rep[0];
+
+ }
+ for(j=_pmone; j<=(int32_t)zero; j++)
+ _tab_addone[j] = 0;
+ for(j=(int32_t)-zero; j<(int32_t)(1-_pmone); j++)
+ _tab_addone[j] = (Rep)j;
+
+ _tab_addone[_pmone / 2] = zero;
+ _tab_addone[-_pmone / 2] = zero;
+
+
+ // -- Table for 1-value
+ _tab_mone = new Power_t[fourp];
+ _tab_subone = &_tab_mone[(int32_t)zero];
+
+ for(j=_pmone; j<=(int32_t)zero; j++)
+ _tab_subone[j] = 0;
+ for(j=-zero; j<(int32_t)(1-3*_pmone/2); j++)
+ _tab_subone[j] = Rep(j+_pmone/2);
+ for(j=-3*_pmone/2; j<(1-_pmone); j++)
+ _tab_subone[j] = Rep(j-_pmone/2);
+ for(j=1-_pmone; j<(1-_pmone/2); j++)
+ _tab_subone[j] = _tab_addone[j + _pmone/2 + _pmone];
+ for(j=_pmone/2; j<_pmone; j++)
+ _tab_subone[j] = _tab_addone[j - _pmone/2];
+
+ for(j=-_pmone/2; j<_pmone/2; j++)
+ _tab_subone[j] = _tab_addone[j+_pmone/2];
+
+ numRefs = new int;
+ (*numRefs) = 1;
+#ifdef GIVARO_DEBUG
+ std::cout << *(numRefs) << " Arefs, p="<<_p<<" \n";
#endif
- // -- temporary
+ // -- temporary
}
ZpzDom<Log16>::ZpzDom(const ZpzDom<Log16>& F)
@@ -146,11 +158,13 @@ ZpzDom<Log16>::ZpzDom(const ZpzDom<Log16>& F)
_tab_mul = F._tab_mul;
_tab_div = F._tab_div;
_tab_neg = F._tab_neg;
+ _tab_mone = F._tab_mone;
+ _tab_pone = F._tab_pone;
_tab_addone = F._tab_addone;
_tab_subone = F._tab_subone;
numRefs = F.numRefs;
(*numRefs)++;
-#ifdef REFC_DEBUG
+#ifdef GIVARO_DEBUG
std::cout << *(numRefs) << " Brefs, p="<<_p<<" \n";
#endif
}
@@ -160,18 +174,21 @@ ZpzDom<Log16>& ZpzDom<Log16>::operator=( const ZpzDom<Log16>& F)
{
if (this->numRefs) {
(*(this->numRefs))--;
-#ifdef REFC_DEBUG
+#ifdef GIVARO_DEBUG
std::cout << *(this->numRefs) << " Crefs, p="<<this->_p<<" \n";
#endif
if ((*(this->numRefs))==0) {
-#ifdef REFC_DEBUG
+#ifdef GIVARO_DEBUG
+ std::cout << "zero : " << zero << std::endl;
std::cout << "Ddestroying, p="<<residu()<<"\n";
#endif
delete [] _tab_value2rep;
delete [] _tab_rep2value;
delete [] _tab_mul;
- delete [] (&_tab_addone[-2*_pmone]);
- delete [] (&_tab_subone[-2*_pmone]);
+ delete [] _tab_mone;
+ delete [] _tab_pone;
+// delete [] (&_tab_addone[-zero]);
+// delete [] (&_tab_subone[-zero]);
delete numRefs;
}
}
@@ -183,11 +200,13 @@ ZpzDom<Log16>& ZpzDom<Log16>::operator=( const ZpzDom<Log16>& F)
this->_tab_mul = F._tab_mul;
this->_tab_div = F._tab_div;
this->_tab_neg = F._tab_neg;
+ this->_tab_mone = F._tab_mone;
+ this->_tab_pone = F._tab_pone;
this->_tab_addone = F._tab_addone;
this->_tab_subone = F._tab_subone;
this->numRefs = F.numRefs;
(*(this->numRefs))++;
-#ifdef REFC_DEBUG
+#ifdef GIVARO_DEBUG
std::cout << *(this->numRefs) << " Erefs, p = "<<this->_p<<"\n";
#endif
@@ -195,27 +214,33 @@ ZpzDom<Log16>& ZpzDom<Log16>::operator=( const ZpzDom<Log16>& F)
}
-ZpzDom<Log16>::~ZpzDom()
+ZpzDom<Log16>::~ZpzDom()
{
(*numRefs)--;
if (*numRefs == 0) {
-#ifdef REFC_DEBUG
+#ifdef GIVARO_DEBUG
+ std::cout << "zero : " << zero << std::endl;
std::cout << "Fdestroying, p="<<residu()<<"\n";
#endif
delete [] _tab_value2rep;
delete [] _tab_rep2value;
delete [] _tab_mul;
- delete [] (&_tab_addone[-2*_pmone]);
- delete [] (&_tab_subone[-2*_pmone]);
+ delete [] _tab_mone;
+ delete [] _tab_pone;
+// delete [] (&_tab_addone[-(int32_t)zero]);
+// delete [] (&_tab_subone[-(int32_t)zero]);
delete numRefs;
}
}
-void ZpzDom<Log16>::Init()
+void ZpzDom<Log16>::Init()
{
-}
+}
void ZpzDom<Log16>::End()
{
}
+} // namespace Givaro
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz16table1.h b/src/kernel/zpz/givzpz16table1.h
index 34fa2aa..1ceeda5 100644
--- a/src/kernel/zpz/givzpz16table1.h
+++ b/src/kernel/zpz/givzpz16table1.h
@@ -1,52 +1,60 @@
-#ifndef _GIVARO_ZPZ16LOG_H_
-#define _GIVARO_ZPZ16LOG_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz16table1.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: J.G. Dumas
-// $Id: givzpz16table1.h,v 1.8 2005/07/12 12:54:37 jgdumas Exp $
+// $Id: givzpz16table1.h,v 1.17 2011-02-04 14:11:46 jgdumas Exp $
// ==========================================================================
//
// Modified by Pascal Giorgi on 2002/02/13 (pascal.giorgi at ens-lyon.fr)
-//
-// Description:
-// Arithmetic on Z/pZ, with tabulation of operations.
+
+/*! @file zpz/givzpz16table1.h
+ * @ingroup zpz
+ * @brief Arithmetic on Z/pZ, with tabulation of operations.
+ */
+
+#ifndef __GIVARO_zpz16log_H
+#define __GIVARO_zpz16log_H
#include "givaro/givbasictype.h"
#include "givaro/giverror.h"
#include "givaro/givarray0.h"
-#include "givaro/givzpz.h"
+#include "givaro/givzpztypes.h"
#include "givaro/giv_randiter.h"
+namespace Givaro {
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// - The representation of an integer a in Zpz is the value a % p
-// ==========================================================================
+/*! @brief This class implement the standard arithmetic with Modulo Elements.
+ * - The representation of an integer a in Zpz is the value a % p
+ * - p max is 16381
+ * .
+ */
template<>
class ZpzDom<Log16> {
public:
// ----- Exported Types and constantes
- typedef uint16 Residu_t; // - type to store residue
+ typedef uint16_t Residu_t; // - type to store residue
enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
// ----- Representation of Element of the domain ZpzDom:
- typedef int16 Power_t;
+ typedef int16_t Power_t;
typedef Power_t Rep;
- typedef int16 Element;
+ typedef int16_t Element;
// ----- Representation of vector of the Element
typedef Residu_t* Array;
typedef const Residu_t* constArray;
- // ----- Constantes
- const Rep zero;
- const Rep one;
+ // ----- Constantes
+ const Residu_t zero;
+ const Residu_t one;
// ----- Constructor /destor
- ZpzDom( Residu_t p = 2);
+ ZpzDom( Residu_t p = 2 );
ZpzDom( const ZpzDom<Log16>& F);
~ZpzDom();
@@ -55,33 +63,33 @@ public:
ZpzDom<Log16>& operator=( const ZpzDom<Log16>& F);
- // ----- Access to the modulus
+ // ----- Access to the modulus
Residu_t residu() const;
Residu_t characteristic() const { return _p;}
Integer& characteristic( Integer& p) const { return p=_p;}
Residu_t size() const { return _p;}
// ----- Convert from Element to int
- int16& convert( int16& x , const Rep a) const {
- return x = ((a >= _p)?0:_tab_rep2value[a]);
+ int16_t& convert( int16_t& x , const Rep a) const {
+ return x = Rep((a >= _p)?0:_tab_rep2value[a]);
}
- uint16& convert( uint16& x , const Rep a) const {
- return x = ((a >= _p)?0:_tab_rep2value[a]);
+ uint16_t& convert( uint16_t& x , const Rep a) const {
+ return x = Rep((a >= _p)?0:_tab_rep2value[a]);
}
- unsigned long & convert( unsigned long& x , const Rep a) const {
+ unsigned long & convert( unsigned long& x , const Rep a) const {
return x = ((a >= _p)?0:_tab_rep2value[a]);
}
-
- double& convert( double& x , const Rep a) const {
+
+ double& convert( double& x , const Rep a) const {
return x = (double)((a >= _p)?0:_tab_rep2value[a]);
}
- long& convert( long& x , const Rep a) const {
+ long& convert( long& x , const Rep a) const {
return x = (long)((a >= _p)?0:_tab_rep2value[a]);
}
Integer& convert(Integer& i, const Rep a) const {
return i = (Integer)((a >= _p)?0:_tab_rep2value[a]);
- }
-
+ }
+
// initialized by a degree of the generator.
@@ -95,11 +103,11 @@ public:
Rep& init( Rep& a, const float i) const;
// Specials
- Rep& init( Rep& a, const int16 i) const ;
- Rep& init( Rep& r, const uint16 a) const;
+ Rep& init( Rep& a, const int16_t i) const ;
+ Rep& init( Rep& r, const uint16_t a) const;
- // -- Assignment : r = a
- Rep& assign (Rep& r, const Rep a) const;
+ // -- Assignment : r = a
+ Rep& assign (Rep& r, const Rep a) const;
void assign ( const size_t sz, Array r, constArray a ) const;
// ----- Misc methods
@@ -112,7 +120,7 @@ public:
// ----- Equality between two Elements
int areEqual( const Element& a, const Element& b) const {return a==b;}
-
+
// ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
Rep& mul (Rep& r, const Rep a, const Rep b) const;
@@ -149,36 +157,41 @@ public:
// -- axpy: r <- a * x + y mod p
Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
Rep& axpyin (Rep& r, const Rep a, const Rep b) const;
- void axpy
+ void axpy
(const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- void axpyin
+ void axpyin
(const size_t sz, Array r, constArray a, constArray x) const;
// -- axmy: r <- a * x - y mod p
- void axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axmyin (Rep& r, const Rep a, const Rep b) const;
- void axmy
+ Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axmy
(const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- void axmyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ // -- axmyin: r <- a * b - r mod p
+ Rep& axmyin (Rep& r, const Rep a, const Rep b) const;
+ // void axmyin (const size_t sz, Array r, constArray a, constArray x) const;
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpyin: r <- r - a * b mod p
+ Rep& maxpyin (Rep& r, const Rep a, const Rep b) const;
+ void maxpyin (const size_t sz, Array r, constArray a, constArray x) const;
// <- \sum_i a[i], return 1 if a.size() ==0,
- void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
// <- \prod_i a[i], return 1 if a.size() ==0,
- void reducemul ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
- // <- \sum_i a[i] * b[i]
- void dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
- void dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
+ // <- \sum_i a[i] * b[i]
+ Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+ Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
- // ----- a -> r: uint16 to double
- void i2d ( const size_t sz, double* r, constArray a ) const;
+ // ----- a -> r: uint16_t to double
+ void i2d ( const size_t sz, double* r, constArray a ) const;
- // ----- a -> r % p: double to uint16 % p
- void d2i ( const size_t sz, Array r, const double* a ) const;
+ // ----- a -> r % p: double to uint16_t % p
+ void d2i ( const size_t sz, Array r, const double* a ) const;
// ----- random generators
template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
@@ -199,7 +212,7 @@ public:
protected:
// -- based for modular inverse, d = a*u + b*v
- static const int32 gcdext ( int32& u, int32& v, const int32 a, const int32 b );
+ static int32_t gcdext ( int32_t& u, int32_t& v, const int32_t a, const int32_t b );
protected:
// -- data representation of the domain:
@@ -212,14 +225,17 @@ protected:
Power_t* _tab_neg; // table for neg
Power_t* _tab_addone; // table for ei+1
Power_t* _tab_subone; // table for -(ei+1)
+ Power_t* _tab_mone; // table for ei+1
+ Power_t* _tab_pone; // table for -(ei+1)
int* numRefs;
static void Init();
static void End();
-
+
};
+} // namespace Givaro
#include "givaro/givzpz16table1.inl"
-#endif
+#endif // __GIVARO_zpz16log_H
diff --git a/src/kernel/zpz/givzpz16table1.inl b/src/kernel/zpz/givzpz16table1.inl
index d4506ed..8db94de 100644
--- a/src/kernel/zpz/givzpz16table1.inl
+++ b/src/kernel/zpz/givzpz16table1.inl
@@ -1,10 +1,13 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz16table1.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: J.G. Dumas$
// Modified by Pascal Giorgi 2002/04/24
-// $Id: givzpz16table1.inl,v 1.6 2008-04-22 16:55:57 jgdumas Exp $
+// $Id: givzpz16table1.inl,v 1.13 2011-02-04 14:11:46 jgdumas Exp $
// ==========================================================================
// Description:
@@ -12,503 +15,577 @@
// -- normalized operations
// ---------
-#define __GIVARO_ZPZ16_LOG_MUL(r,p,a,b) \
- {(r)= _tab_mul[(a) + (b)]; }
-#define __GIVARO_ZPZ16_LOG_DIV(r,p,a,b) \
- {(r)= _tab_div[(a) - (b)]; }
-#define __GIVARO_ZPZ16_LOG_INV(r,p,b) \
- {(r)= _tab_div[ - (b)]; }
-#define __GIVARO_ZPZ16_LOG_SUB(r,p,a,b) \
- {(r)= _tab_mul[(a) + _tab_subone[(b) - (a)] ]; }
-#define __GIVARO_ZPZ16_LOG_ADD(r,p,a,b) \
- {(r)= _tab_mul[(a) + _tab_addone[(b) - (a)] ];}
-#define __GIVARO_ZPZ16_LOG_NEG(r,p,a) \
- { r = _tab_neg[(a)];}
+#ifndef __GIVARO_zpz16_table1_INL
+#define __GIVARO_zpz16_table1_INL
+
+#define __GIVARO_ZPZ16_LOG_MUL(r,p,a,b) ( (r)= _tab_mul[(a) + (b)] )
+#define __GIVARO_ZPZ16_LOG_DIV(r,p,a,b) ( (r)= _tab_div[(a) - (b)] )
+#define __GIVARO_ZPZ16_LOG_INV(r,p,b) ( (r)= _tab_div[ - (b)] )
+#define __GIVARO_ZPZ16_LOG_SUB(r,p,a,b) ( (r)= _tab_mul[(a) + _tab_subone[(b) - (a)] ] )
+#define __GIVARO_ZPZ16_LOG_ADD(r,p,a,b) ( (r)= _tab_mul[(a) + _tab_addone[(b) - (a)] ] )
+#define __GIVARO_ZPZ16_LOG_NEG(r,p,a) ( (r)= _tab_neg[(a)] )
/* Pascal Giorgi
Changing the order of parameters.
-*/
+ */
#define __GIVARO_ZPZ16_LOG_MULADD(r,p,a,b,c) \
- { __GIVARO_ZPZ16_LOG_MUL(r, p, a, b); __GIVARO_ZPZ16_LOG_ADD(r, p, r, c); }
-#define __GIVARO_ZPZ16_LOG_MULSUB(r,p,a,b,c) \
- { __GIVARO_ZPZ16_LOG_MUL(r, p, a, b); __GIVARO_ZPZ16_LOG_SUB(r, p, r, c); }
-
-
-
-inline ZpzDom<Log16>::Residu_t ZpzDom<Log16>::residu( ) const
-{ return _p; }
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::mul (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp;
- __GIVARO_ZPZ16_LOG_MUL(tmp,(int32)_p,(int32)a,(int32)b);
- return r= (ZpzDom<Log16>::Rep)tmp;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::div (Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_ZPZ16_LOG_DIV(r,_p,a,b);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::sub (Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_ZPZ16_LOG_SUB(r,_p,a,b);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::add (Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_ZPZ16_LOG_ADD(r,_p,a,b);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::neg (Rep& r, const Rep a) const
-{
- __GIVARO_ZPZ16_LOG_NEG(r,_p,a);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::inv (Rep& r, const Rep a) const
-{
- __GIVARO_ZPZ16_LOG_INV(r,_p,a);
- // GivError::throw_error( GivMathDivZero("Zpz::inv"));
- return r;
-}
-
-
-template< class RandIter >
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::random(RandIter& g, Rep& a) const {
- return init(a, g());
-}
-
-template< class RandIter >
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::random(RandIter& g, Rep& a, const Rep& b) const {
- return init(a, g());
-}
-
-template< class RandIter >
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::random(RandIter& g, Rep& a, long b) const {
- return init(a, g() %(uint16) b);
-}
-
-template< class RandIter >
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::nonzerorandom(RandIter& g, Rep& a) const {
- while (iszero(init(a, g()))) {};
- return a;
-}
-
-template< class RandIter >
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const {
- while (iszero(init(a, g()))) {};
- return a;
-}
-
-template< class RandIter >
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::nonzerorandom(RandIter& g, Rep& a, long b) const {
- while (iszero(init(a, g() %(uint16) b))) {};
- return a;
-}
-
-
-
- // -- inline array operations between ZpzDom<Log16>::Rep
-inline void ZpzDom<Log16>::mul (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_MUL(r[i], _p,a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Log16>::mul (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_MUL(r[i], _p, a[i], b);
- }
-}
-
-inline void ZpzDom<Log16>::div (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_DIV( r[i], _p, a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Log16>::div (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_DIV( r[i], _p, a[i], b);
- }
-}
-
-inline void ZpzDom<Log16>::add (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_ADD(r[i], _p, a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Log16>::add (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_ADD(r[i], _p, a[i], b);
- }
-}
-
-inline void ZpzDom<Log16>::sub (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_SUB(r[i], _p, a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Log16>::sub (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_SUB(r[i], _p, a[i], b);
- }
-}
-
-inline void ZpzDom<Log16>::neg (const size_t sz, Array r, constArray a) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_NEG(r[i], _p, a[i]);
- }
-}
-
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::mulin (Rep& r, const Rep a) const
-{
- __GIVARO_ZPZ16_LOG_MUL(r,_p, r,a);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::divin (Rep& r, const Rep a) const
-{
- ZpzDom<Log16>::Rep ia;
- inv(ia, a);
- mulin(r, ia);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::addin (Rep& r, const Rep a) const
-{
- __GIVARO_ZPZ16_LOG_ADD(r, _p, r,a);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::subin (Rep& r, const Rep a) const
-{
- __GIVARO_ZPZ16_LOG_SUB(r,_p, r,a);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::negin (Rep& r) const
-{
- __GIVARO_ZPZ16_LOG_NEG(r,_p,r);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::invin (Rep& r) const
-{
- __GIVARO_ZPZ16_LOG_INV(r,_p,r);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::axpy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- __GIVARO_ZPZ16_LOG_MULADD(r, _p, a, b, c);
- return r;
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::axpyin
- (Rep& r, const Rep a, const Rep b) const
-{
- //__GIVARO_ZPZ16_LOG_MULADD(r, _p, a, b, r);
- // Pascal giorgi
- // non consistant because don't perform an axpyin
- // due to the name of parameter
- // the operation performed is 2*a*b
-
- return axpy(r,a,b,r);
-}
-
-
-inline void ZpzDom<Log16>::axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_MULADD(r[i], _p, a[i], x[i], y[i]);
- }
-}
-
-inline void ZpzDom<Log16>::axpyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_MULADD(r[i], _p, a[i], x[i], r[i]);
- }
-}
-
-
-inline void ZpzDom<Log16>::axmy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- __GIVARO_ZPZ16_LOG_MULSUB(r,_p,a,b,c);
-}
-
-inline void ZpzDom<Log16>::axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_MULSUB(r[i], _p, a[i], x[i], y[i]);
- }
-}
-
-inline void ZpzDom<Log16>::axmyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZ16_LOG_MULSUB(r[i], _p, a[i], x[i], r[i]);
- __GIVARO_ZPZ16_LOG_NEG(r[i], _p, r[i]);
- }
-}
-
- // ------------------------- Miscellaneous functions
-
-inline int ZpzDom<Log16>::iszero(const Rep a) const
-{ return a >= _p; }
-
-inline int ZpzDom<Log16>::isone(const Rep a) const
-{ return a == ZpzDom<Log16>::one; }
-
-inline size_t ZpzDom<Log16>::length(const Rep a) const
-{ return ZpzDom<Log16>::size_rep;}
-
-inline int ZpzDom<Log16>::isZero( const Rep a ) const {return iszero(a);}
-inline int ZpzDom<Log16>::isOne ( const Rep a ) const {return isone(a);}
-
+{ __GIVARO_ZPZ16_LOG_MUL(r, p, a, b); __GIVARO_ZPZ16_LOG_ADD(r, p, r, c); }
-// ---------
-// -- misc operations
-// ---------
-/*
-inline void ZpzDom<Log16>::assign
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- if (a[i] <ZpzDom<Log16>::zero) {
- r[i] = a[i] + _p;
- if (r[i] <ZpzDom<Log16>::zero) r[i] = r[i] % _p;
- }
- else if (a[i] >_p) {
- r[i] = a[i] - _p;
- if (r[i] >_p) r[i] = r[i] % _p;
- }
- else r[i] = a[i];
- }
-}
-*/
-
-inline void ZpzDom<Log16>::assign ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i)
- r[i] = a[i];
-}
-
-
-
-// initialized by a degree of the generator.
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r ) const
-{ return r = zero; }
-
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::assign ( Rep& r, const Rep a ) const
-{ return r = a; }
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const long a ) const
-{
- int sign; unsigned long ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = (ua >_p) ? ua % _p : ua;
- if (sign ==-1) r = _p - r;
- return r = _tab_value2rep[r];
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const int a ) const
-{ return ZpzDom<Log16>::init( r, (long)a); }
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const unsigned long a ) const
-{ r = (a >_p) ? a % _p : a; return r= _tab_value2rep[r];}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const unsigned int a ) const
-{ r = (a >_p) ? a % _p : a; return r= _tab_value2rep[r];}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const uint16 a ) const
-{ r = (a >_p) ? a % _p : a; return r= _tab_value2rep[r];}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const int16 a ) const
-{ return ZpzDom<Log16>::init( r, (long)a); }
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init( Rep& a, const double i) const {
- return init(a,(long)i);
-}
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init( Rep& a, const float i) const {
- return init(a,(double)i);
-}
-
-inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const Integer& residu ) const
-{
- int16 tr;
- if (residu <0) {
- // -a = b [p]
- // a = p-b [p]
- if ( residu <= (Integer)(-_p) ) tr = int16( (-residu) % _p) ;
- else tr = int16(-residu);
- if (tr)
- return r = _tab_value2rep[ _p - (uint16)tr ];
- else
- return r = zero;
- } else {
- if (residu >= (Integer)_p ) tr = int16(residu % _p) ;
- else tr = int16(residu);
- return r = _tab_value2rep[tr];
- }
-}
-
-
-
-inline void ZpzDom<Log16>::dotprod
- ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
-{
- unsigned int stride = 1;
- if ((unsigned long)bound < GIVARO_MAXUINT16)
- stride = GIVARO_MAXUINT32/((unsigned long)bound * (unsigned long)bound);
- uint32 dot = zero;
- if ((sz <10) && (sz <stride)) {
- for( register int i= sz-1; i>=0; --i)
- dot += _tab_rep2value[a[i]] * _tab_rep2value[b[i]];
- if (dot > _p) r = _tab_value2rep[(Rep)(dot % _p)];
- else r = _tab_value2rep[dot];
- return;
- }
- unsigned int i_begin=0;
- stride &= ~0x1;
- if (stride ==0) {
- for( register int i= sz-1; i>0; --i) {
- dot += _tab_rep2value[a[i]] * _tab_rep2value[b[i]];
- if (dot>_p) dot %= _p;
- }
- r = _tab_value2rep[dot];
- return;
- }
- do {
- size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
- if ( (min_sz & 0x1) !=0) {
- min_sz--; i_begin++;
- dot += _tab_rep2value[a++[min_sz]] * _tab_rep2value[b++[min_sz]];
- }
- if (min_sz > 1)
- for( register size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
- {
- dot += _tab_rep2value[a[0]] * _tab_rep2value[b[0]];
- dot += _tab_rep2value[a[1]] * _tab_rep2value[b[1]];
- }
- if (dot>_p) dot %= _p;
- i_begin += min_sz;
- } while (i_begin <sz);
- r = _tab_value2rep[dot];
-}
-
-inline void ZpzDom<Log16>::dotprod
- ( Rep& r, const size_t sz, constArray a, constArray b ) const
-{
- return ZpzDom<Log16>::dotprod(r, _p, sz, a, b);
-}
-
-
- // a -> r: int16 to double
-inline void
- ZpzDom<Log16>::i2d ( const size_t sz, double* r, constArray a ) const
-{
- for (size_t i=0; i<sz; ++i) r[i] = _tab_rep2value[a[i]];
-}
-
- // a -> r: double to int16
-inline void
- ZpzDom<Log16>::d2i ( const size_t sz, Array r, const double* a ) const
-{
- union d_2_l {
- double d;
- int32 r[2];
- };
- static const double offset = 4503599627370496.0; // 2^52
- register size_t i=sz-1;
-label1:
- {
- register d_2_l tmp;
- // - normalization: put fractional part at the end of the representation
- tmp.d = a[i] + offset;
- r[i--] = _tab_value2rep[(tmp.r[1] >_p ? tmp.r[1] : tmp.r[1] % _p)];
- }
- if (i >0) goto label1;
- //for (size_t i=sz-1; i>=0; --i)
-}
-
-
- // -- Input: (z, <_p>)
-inline std::istream& ZpzDom<Log16>::read (std::istream& s)
-{
- char ch;
- s >> std::ws >> ch;
-// if (ch != '(')
-// GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: syntax error: no '('"));
- if (ch != '(')
- std::cerr << "ZpzDom<Log16>::read: syntax error: no '('" << std::endl;
-
- s >> std::ws >> ch;
-// if (ch != 'z')
-// GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: bad domain object"));
- if (ch != 'z')
- std::cerr << "ZpzDom<Log16>::read: bad domain object" << std::endl ;
-
- s >> std::ws >> ch;
-// if (ch != ',')
-// GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: syntax error: no ','"));
- if (ch != ',')
- std::cerr << "ZpzDom<Log16>::read: syntax error: no ','" << std::endl;
-
-
- s >> std::ws >> _p;
-
- s >> std::ws >> ch;
-// if (ch != ')')
-// GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: syntax error: no ')'"));
- if (ch != ')')
- std::cerr << "ZpzDom<Log16>::read: syntax error: no ')'" << std::endl;
-
- return s;
-}
-
-inline std::ostream& ZpzDom<Log16>::write (std::ostream& s ) const
-{
- return s << "Log16 Givaro Z/pZ modulo " << residu();
-}
-
-inline std::istream& ZpzDom<Log16>::read (std::istream& s, Rep& a) const
-{
- int tmp; //dpritcha
- s >> tmp;
- tmp %= _p;
- if (tmp < 0) tmp += _p;
- a = _tab_value2rep[tmp];
- return s;
-}
-
-inline std::ostream& ZpzDom<Log16>::write (std::ostream& s, const Rep a) const
-{
- if (a >= _p) return s << '0';
- return s << _tab_rep2value[a]; //dpritcha
-}
+// a*b-c
+#define __GIVARO_ZPZ16_LOG_MULSUB(r,p,a,b,c) \
+{ __GIVARO_ZPZ16_LOG_MUL(r, p, a, b); __GIVARO_ZPZ16_LOG_SUB(r, p, r, c); }
+
+namespace Givaro {
+
+ inline ZpzDom<Log16>::Residu_t ZpzDom<Log16>::residu( ) const
+ {
+ return _p;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::mul (Rep& r, const Rep a, const Rep b) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ16_LOG_MUL(tmp,(int32_t)_p,(int32_t)a,(int32_t)b);
+ return r= (ZpzDom<Log16>::Rep)tmp;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::div (Rep& r, const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ16_LOG_DIV(r,_p,a,b);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::sub (Rep& r, const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ16_LOG_SUB(r,_p,a,b);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::add (Rep& r, const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ16_LOG_ADD(r,_p,a,b);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::neg (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_LOG_NEG(r,_p,a);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::inv (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_LOG_INV(r,_p,a);
+ // GivError::throw_error( GivMathDivZero("Zpz::inv"));
+ return r;
+ }
+
+
+ template< class RandIter >
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::random(RandIter& g, Rep& a) const
+ {
+ return init(a, g());
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::random(RandIter& g, Rep& a, const Rep& b) const
+ {
+ return init(a, g());
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::random(RandIter& g, Rep& a, long b) const
+ {
+ return init(a, g() %(uint16_t) b);
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::nonzerorandom(RandIter& g, Rep& a) const
+ {
+ while (iszero(init(a, g()))) {};
+ return a;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const
+ {
+ while (iszero(init(a, g()))) {};
+ return a;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::nonzerorandom(RandIter& g, Rep& a, long b) const
+ {
+ while (iszero(init(a, g() %(uint16_t) b))) {};
+ return a;
+ }
+
+
+
+ // -- inline array operations between ZpzDom<Log16>::Rep
+ inline void ZpzDom<Log16>::mul (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_MUL(r[i], _p,a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Log16>::mul (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_MUL(r[i], _p, a[i], b);
+ }
+ }
+
+ inline void ZpzDom<Log16>::div (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_DIV( r[i], _p, a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Log16>::div (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_DIV( r[i], _p, a[i], b);
+ }
+ }
+
+ inline void ZpzDom<Log16>::add (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_ADD(r[i], _p, a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Log16>::add (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_ADD(r[i], _p, a[i], b);
+ }
+ }
+
+ inline void ZpzDom<Log16>::sub (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_SUB(r[i], _p, a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Log16>::sub (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_SUB(r[i], _p, a[i], b);
+ }
+ }
+
+ inline void ZpzDom<Log16>::neg (const size_t sz, Array r, constArray a) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_NEG(r[i], _p, a[i]);
+ }
+ }
+
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::mulin (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_LOG_MUL(r,_p, r,a);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::divin (Rep& r, const Rep a) const
+ {
+ ZpzDom<Log16>::Rep ia;
+ inv(ia, a);
+ mulin(r, ia);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::addin (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_LOG_ADD(r, _p, r,a);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::subin (Rep& r, const Rep a) const
+ {
+ __GIVARO_ZPZ16_LOG_SUB(r,_p, r,a);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::negin (Rep& r) const
+ {
+ __GIVARO_ZPZ16_LOG_NEG(r,_p,r);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::invin (Rep& r) const
+ {
+ __GIVARO_ZPZ16_LOG_INV(r,_p,r);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::axpy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+ {
+ __GIVARO_ZPZ16_LOG_MULADD(r, _p, a, b, c);
+ return r;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::axpyin
+ (Rep& r, const Rep a, const Rep b) const
+ {
+ return axpy(r,a,b,r);
+ }
+
+
+ inline void ZpzDom<Log16>::axpy
+ (const size_t sz, Array r, constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_MULADD(r[i], _p, a[i], x[i], y[i]);
+ }
+ }
+
+ inline void ZpzDom<Log16>::axpyin
+ (const size_t sz, Array r, constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_MULADD(r[i], _p, a[i], x[i], r[i]);
+ }
+ }
+
+ // r <- a*b-c
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::axmy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+ {
+ __GIVARO_ZPZ16_LOG_MULSUB(r,_p,a,b,c);
+ return r;
+ }
+
+ // r <- r-a*b
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::maxpyin
+ (Rep& r, const Rep a, const Rep b) const
+ {
+ Rep t; __GIVARO_ZPZ16_LOG_MUL(t,_p,a,b);
+ return this->subin(r,t);
+ }
+
+ // r <- c-a*b
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::maxpy
+ (Rep& r, const Rep a, const Rep b, const Rep c) const
+ {
+ Rep t; __GIVARO_ZPZ16_LOG_MUL(t,_p,a,b);
+ return this->sub(r,c,t);
+ }
+
+
+ // r <- a*b-r
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::axmyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ Rep t; __GIVARO_ZPZ16_LOG_MUL(t,_p,a,b);
+ return sub(r,t,r);
+ }
+
+ inline void ZpzDom<Log16>::axmy
+ (const size_t sz, Array r, constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_MULSUB(r[i], _p, a[i], x[i], y[i]);
+ }
+ }
+
+ inline void ZpzDom<Log16>::maxpyin (const size_t sz, Array r,
+ constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZ16_LOG_MULSUB(r[i], _p, a[i], x[i], r[i]);
+ __GIVARO_ZPZ16_LOG_NEG(r[i], _p, r[i]);
+ }
+ }
+
+ // ------------------------- Miscellaneous functions
+
+ inline int ZpzDom<Log16>::iszero(const Rep a) const
+ {
+ return a >= _p;
+ }
+
+ inline int ZpzDom<Log16>::isone(const Rep a) const
+ {
+ return a == ZpzDom<Log16>::one;
+ }
+
+ inline size_t ZpzDom<Log16>::length(const Rep ) const
+ {
+ return ZpzDom<Log16>::size_rep;
+ }
+
+ inline int ZpzDom<Log16>::isZero( const Rep a ) const
+ {
+ return iszero(a);
+ }
+ inline int ZpzDom<Log16>::isOne ( const Rep a ) const
+ {
+ return isone(a);
+ }
+
+
+ // ---------
+ // -- misc operations
+ // ---------
+#if 0
+ inline void ZpzDom<Log16>::assign
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ if (a[i] <ZpzDom<Log16>::zero) {
+ r[i] = a[i] + _p;
+ if (r[i] <ZpzDom<Log16>::zero) r[i] = r[i] % _p;
+ }
+ else if (a[i] >_p) {
+ r[i] = a[i] - _p;
+ if (r[i] >_p) r[i] = r[i] % _p;
+ }
+ else r[i] = a[i];
+ }
+ }
+#endif
+
+ inline void ZpzDom<Log16>::assign ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; )
+ r[i] = a[i];
+ }
+
+
+
+ // initialized by a degree of the generator.
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r ) const
+ {
+ return r = zero;
+ }
+
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::assign ( Rep& r, const Rep a ) const
+ {
+ return r = a;
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const long a ) const
+ {
+ int sign; unsigned long ua;
+ if (a <0) {
+ sign =-1;
+ ua = -a;
+ }
+ else {
+ ua = a;
+ sign =1;
+ }
+ r = Rep( (ua >_p) ? ua % _p : ua );
+ if (sign ==-1)
+ r = Rep(_p - r);
+ return r = _tab_value2rep[r];
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const int a ) const
+ {
+ return ZpzDom<Log16>::init( r, (long)a);
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const unsigned long a ) const
+ {
+ r = Rep((a >_p) ? a % _p : a);
+ return r= _tab_value2rep[r];
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const unsigned int a ) const
+ {
+ r = Rep((a >_p) ? a % _p : a);
+ return r= _tab_value2rep[r];
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const uint16_t a ) const
+ {
+ r = Rep((a >_p) ? a % _p : a);
+ return r= _tab_value2rep[r];
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const int16_t a ) const
+ {
+ return ZpzDom<Log16>::init( r, (long)a);
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init( Rep& a, const double i) const
+ {
+ return init(a,(long)i);
+ }
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init( Rep& a, const float i) const
+ {
+ return init(a,(double)i);
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::init ( Rep& r, const Integer& Residu ) const
+ {
+ int16_t tr;
+ if (Residu <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ if ( Residu <= (Integer)(-_p) ) tr = int16_t( (-Residu) % _p) ;
+ else tr = int16_t(-Residu);
+ if (tr)
+ return r = _tab_value2rep[ _p - (uint16_t)tr ];
+ else
+ return r = zero;
+ } else {
+ if (Residu >= (Integer)_p ) tr = int16_t(Residu % _p) ;
+ else tr = int16_t(Residu);
+ return r = _tab_value2rep[tr];
+ }
+ }
+
+
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::dotprod
+ ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
+ {
+ unsigned int stride = 1;
+ if ((unsigned long)bound < GIVARO_MAXUINT16)
+ stride = (unsigned int) ( GIVARO_MAXUINT32/((unsigned long)bound * (unsigned long)bound) );
+ uint32_t dot = zero;
+ if ((sz <10) && (sz <stride)) {
+ for( size_t i= sz; i--; )
+ dot += _tab_rep2value[a[i]] * _tab_rep2value[b[i]];
+ if (dot > _p) return r = _tab_value2rep[(Rep)(dot % _p)];
+ else return r = _tab_value2rep[dot];
+
+ }
+ unsigned int i_begin=0;
+ stride &= ~0x1;
+ if (stride ==0) {
+ for( size_t i= sz-1; i>0; --i) {
+ dot += _tab_rep2value[a[i]] * _tab_rep2value[b[i]];
+ if (dot>_p) dot %= _p;
+ }
+ return r = _tab_value2rep[dot];
+
+ }
+ do {
+ size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
+ if ( (min_sz & 0x1) !=0) {
+ min_sz--; i_begin++;
+ dot += _tab_rep2value[a++[min_sz]] * _tab_rep2value[b++[min_sz]];
+ }
+ if (min_sz > 1)
+ for( size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
+ {
+ dot += _tab_rep2value[a[0]] * _tab_rep2value[b[0]];
+ dot += _tab_rep2value[a[1]] * _tab_rep2value[b[1]];
+ }
+ if (dot>_p) dot %= _p;
+ i_begin += (unsigned int) min_sz;
+ } while (i_begin <sz);
+ return r = _tab_value2rep[dot];
+ }
+
+ inline ZpzDom<Log16>::Rep& ZpzDom<Log16>::dotprod
+ ( Rep& r, const size_t sz, constArray a, constArray b ) const
+ {
+ return ZpzDom<Log16>::dotprod(r, _p, sz, a, b);
+ }
+
+
+ // a -> r: int16_t to double
+ inline void
+ ZpzDom<Log16>::i2d ( const size_t sz, double* r, constArray a ) const
+ {
+ for (size_t i=0; i<sz; ++i) r[i] = _tab_rep2value[a[i]];
+ }
+
+ // a -> r: double to int16_t
+ inline void
+ ZpzDom<Log16>::d2i ( const size_t sz, Array r, const double* a ) const
+ {
+ union d_2_l {
+ double d;
+ int32_t r[2];
+ };
+ static const double offset = 4503599627370496.0; // 2^52
+ size_t i=sz-1;
+ //warning todo while
+ //do
+label1:
+ {
+ d_2_l tmp;
+ // - normalization: put fractional part at the end of the representation
+ tmp.d = a[i] + offset;
+ r[i--] = _tab_value2rep[(tmp.r[1] >_p ? tmp.r[1] : tmp.r[1] % _p)];
+ }
+ // while (i!=0)
+ if (i >0) goto label1;
+ //for (size_t i=sz-1; i>=0; --i)
+ }
+
+
+ // -- Input: (z, <_p>)
+ inline std::istream& ZpzDom<Log16>::read (std::istream& s)
+ {
+ char ch;
+ s >> std::ws >> ch;
+ // if (ch != '(')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: syntax error: no '('"));
+ if (ch != '(')
+ std::cerr << "ZpzDom<Log16>::read: syntax error: no '('" << std::endl;
+
+ s >> std::ws >> ch;
+ // if (ch != 'z')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: bad domain object"));
+ if (ch != 'z')
+ std::cerr << "ZpzDom<Log16>::read: bad domain object" << std::endl ;
+
+ s >> std::ws >> ch;
+ // if (ch != ',')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: syntax error: no ','"));
+ if (ch != ',')
+ std::cerr << "ZpzDom<Log16>::read: syntax error: no ','" << std::endl;
+
+
+ s >> std::ws >> _p;
+
+ s >> std::ws >> ch;
+ // if (ch != ')')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Log16>::read: syntax error: no ')'"));
+ if (ch != ')')
+ std::cerr << "ZpzDom<Log16>::read: syntax error: no ')'" << std::endl;
+
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Log16>::write (std::ostream& s ) const
+ {
+ return s << "Log16 Givaro Z/pZ modulo " << residu();
+ }
+
+ inline std::istream& ZpzDom<Log16>::read (std::istream& s, Rep& a) const
+ {
+ int tmp; //dpritcha
+ s >> tmp;
+ tmp %= _p;
+ if (tmp < 0) tmp += _p;
+ a = _tab_value2rep[tmp];
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Log16>::write (std::ostream& s, const Rep a) const
+ {
+ if (a >= _p) return s << '0';
+ return s << _tab_rep2value[a]; //dpritcha
+ }
+
+} // namespace Givaro
+
+#endif // __GIVARO_zpz16_table1_INL
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz32std.C b/src/kernel/zpz/givzpz32std.C
index b44140e..d1444a6 100644
--- a/src/kernel/zpz/givzpz32std.C
+++ b/src/kernel/zpz/givzpz32std.C
@@ -1,58 +1,66 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz32std.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz32std.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givzpz32std.C,v 1.4 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
// Description:
#include <iostream>
#include "givaro/givzpz32std.h"
+namespace Givaro {
+
// Returns d, and u and v such that u a + v b = d;
// JGD 04.11.1999
-// const int32 ZpzDom<Std32>::gcdext
-// ( int32& u, int32& v, const int32 a, const int32 b )
-int32& ZpzDom<Std32>::gcdext
- ( int32& d, int32& u, int32& v, const int32 a, const int32 b ) const
+// const int32_t ZpzDom<Std32>::gcdext
+// ( int32_t& u, int32_t& v, const int32_t a, const int32_t b )
+int32_t& ZpzDom<Std32>::gcdext
+ ( int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const
{
- register long u1,u2,u3;
- register long v1,v2,v3;
+ long u1,u2,u3;
+ long v1,v2,v3;
u1 = 1; u2 = 0; u3 = a;
v1 = 0; v2 = 1; v3 = b;
while (v3 != 0)
{
- register long q , t1, t2 ,t3;
+ long q , t1, t2 ,t3;
q = u3 / v3;
t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
}
- u = u1;
- v = u2;
- return d=u3;
+ u = int32_t(u1);
+ v = int32_t(u2);
+ return d=int32_t(u3);
// return u3;
-}
+}
-int32& ZpzDom<Std32>::invext
- ( int32& u, const int32 a, const int32 b ) const
+int32_t& ZpzDom<Std32>::invext
+ ( int32_t& u, const int32_t a, const int32_t b ) const
{
- register long u3;
- register long v1,v3;
- u = 1; u3 = a;
- v1 = 0; v3 = b;
- while (v3 != 0)
- {
- register long q, t1, t3;
- q = u3 / v3;
- t1 = u - q * v1; t3 = u3 - q * v3;
- u = v1; u3 = v3; v1 = t1; v3 = t3;
- }
- return (u3<0?u=-u:u);
-}
-
-
-void ZpzDom<Std32>::Init()
+ long u3;
+ long v1,v3;
+ u = 1; u3 = a;
+ v1 = 0; v3 = b;
+ while (v3 != 0)
+ {
+ long q, t1, t3;
+ q = u3 / v3;
+ t1 = u - q * v1; t3 = u3 - q * v3;
+ u = int32_t(v1);
+ u3 = v3;
+ v1 = t1;
+ v3 = t3;
+ }
+ return (u3<0?u=-u:u);
+}
+
+
+void ZpzDom<Std32>::Init()
{
}
@@ -60,3 +68,4 @@ void ZpzDom<Std32>::End()
{
}
+} // namespace Givaro
diff --git a/src/kernel/zpz/givzpz32std.h b/src/kernel/zpz/givzpz32std.h
index a224417..c079b21 100644
--- a/src/kernel/zpz/givzpz32std.h
+++ b/src/kernel/zpz/givzpz32std.h
@@ -1,51 +1,60 @@
-#ifndef _GIVARO_ZPZ32STD_H_
-#define _GIVARO_ZPZ32STD_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz32std.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz32std.h,v 1.11 2008-06-23 13:03:42 jgdumas Exp $
+// $Id: givzpz32std.h,v 1.22 2011-02-04 14:11:46 jgdumas Exp $
// ==========================================================================
//
// Modified by Pascal Giorgi on 2002/02/13 (pascal.giorgi at ens-lyon.fr)
-//
-// Description:
-// Arithmetic on Z/pZ, with p a prime number less than 2^32
-// Modulo typedef is a signed long number. In case it was modified
-// then bezout algorithm must be changed (coefficient can be negative).
+
+/*! @file zpz/givzps32std.h
+ * @ingroup zpz
+ * @brief Arithmetic on Z/pZ, with p a prime number less than 2^32.
+ * Modulo typedef is a signed long number. In case it was modified
+ * then Bézout algorithm must be changed (coefficient can be negative).
+ */
+
+#ifndef __GIVARO_zpz32std_H
+#define __GIVARO_zpz32std_H
+
#include "givaro/givbasictype.h"
#include "givaro/giverror.h"
-#include "givaro/givzpz.h"
+#include "givaro/givzpztypes.h"
#include "givaro/giv_randiter.h"
#include <math.h>
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// - The representation of an integer a in Zpz is the value a % p
-// ==========================================================================
+namespace Givaro {
+/*! @brief This class implement the standard arithmetic with Modulo Elements.
+ * - The representation of an integer a in Zpz is the value a % p
+ * - p max is 46337
+ * .
+ */
template<>
class ZpzDom<Std32> {
public:
// ----- Exported Types and constantes
- typedef uint32 Residu_t; // - type to store residue
+ typedef uint32_t Residu_t; // - type to store residue
enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
// ----- Representation of Element of the domain ZpzDom
- typedef int32 Rep;
- typedef int32 Element;
+ typedef int32_t Rep;
+ typedef int32_t Element;
// ----- Representation of vector of the Element
typedef Rep* Array;
typedef const Rep* constArray;
- // ----- Constantes
+ // ----- Constantes
const Rep zero;
const Rep one;
- // ----- Constructor
+ // ----- Constructor
ZpzDom()
: zero(0), one(1), _p(0), _dp(0.0) {}
@@ -60,14 +69,14 @@ public:
int operator==( const ZpzDom<Std32>& BC) const { return _p == BC._p;}
int operator!=( const ZpzDom<Std32>& BC) const { return _p != BC._p;}
-
- ZpzDom<Std32>& operator=( const ZpzDom<Std32>& F) {
- this->_p = F._p;
+
+ ZpzDom<Std32>& operator=( const ZpzDom<Std32>& F) {
+ this->_p = F._p;
this->_dp = F._dp;
return *this;
}
- // ----- Access to the modulus
+ // ----- Access to the modulus
Residu_t residu() const;
Residu_t size() const {return _p;}
Rep access( const Rep a ) const { return a; }
@@ -76,7 +85,7 @@ public:
Residu_t cardinality() const { return _p; }
- // ----- Access to the modulus
+ // ----- Access to the modulus
Rep& init( Rep& a ) const;
void init( const size_t, Array a, constArray b ) const;
Rep& init( Rep& r , const long a) const ;
@@ -94,8 +103,8 @@ public:
double& convert(double& r, const Rep a ) const { return r = (double)a ;}
long int& convert(long int& r, const Rep a) const { return r = (long int)a;}
unsigned long int& convert(unsigned long int& r, const Rep a) const { return r = (unsigned long int)a;}
- int32& convert(int32& r, const Rep a ) const { return r = (int32)a ;}
- uint32& convert(uint32& r, const Rep a ) const { return r = (uint32)a ;}
+ int32_t& convert(int32_t& r, const Rep a ) const { return r = (int32_t)a ;}
+ uint32_t& convert(uint32_t& r, const Rep a ) const { return r = (uint32_t)a ;}
Integer& convert(Integer& i, const Rep a) const {
unsigned long ur;
return i = (Integer)convert(ur, a);
@@ -142,41 +151,27 @@ public:
// -- axpy: r <- a * x + y mod p
Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ void axpy (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
// -- axpyin: r <- r + a * x mod p
Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
- void axpyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ void axpyin (const size_t sz, Array r, constArray a, constArray x) const;
- // -- amxy: r <- c - a * b mod p
- Rep& amxy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpyin: r <- r - a * b mod p
+ Rep& maxpyin(Rep& r, const Rep a, const Rep b) const;
+ void maxpyin (const size_t sz, Array r, constArray a, constArray x) const;
// -- axmy: r <- a * x - y mod p
Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axmyin: r <- r - a * x mod p
+ void axmy (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axmyin: r <- a * x - r mod p
Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
- void axmyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ // void axmyin (const size_t sz, Array r, constArray a, constArray x) const;
// -- Misc: r <- a mod p
void assign ( const size_t sz, Array r, constArray a ) const;
-/* JGD 26.10.99
- void assign ( Rep& r, const Rep a) const;
- void assign ( Rep& r, const long a ) const;
- void assign ( Rep& r, const unsigned long a ) const;
- void assign ( Rep& r, const int a ) const;
- void assign ( Rep& r, const unsigned int a ) const;
-*/
- // Rep& assign ( Rep& r, const Rep a) const;
- Rep& assign ( Rep& r, const int32 a) const;
- Rep& assign ( Rep& r, const uint32 a) const;
- Rep& assign ( Rep& r, const long a ) const;
- Rep& assign ( Rep& r, const unsigned long a ) const;
- Rep& assign ( Rep& r, const short a ) const;
- Rep& assign ( Rep& r, const unsigned short a ) const;
+ Rep& assign ( Rep& r, const Rep a) const;
// ----- random generators
// Rep& NONZEROGIVRANDOM(Rep&) const ;
// Rep& GIVRANDOM(Rep&) const ;
@@ -186,24 +181,24 @@ public:
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
-
+
typedef GIV_randIter< ZpzDom<Std32> , Rep > randIter;
// <- \sum_i a[i], return 1 if a.size() ==0,
- Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
// <- \prod_i a[i], return 1 if a.size() ==0,
- Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
- // <- \sum_i a[i] * b[i]
- Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
- Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
+ // <- \sum_i a[i] * b[i]
+ Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+ Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
- // ----- a -> r: uint32 to double
- void i2d ( const size_t sz, double* r, constArray a ) const;
+ // ----- a -> r: uint32_t to double
+ void i2d ( const size_t sz, double* r, constArray a ) const;
- // ----- a -> r % p: double to uint32 % p
- void d2i ( const size_t sz, Array r, const double* a ) const;
+ // ----- a -> r % p: double to uint32_t % p
+ void d2i ( const size_t sz, Array r, const double* a ) const;
// --- IO methods
std::istream& read ( std::istream& s );
@@ -213,9 +208,9 @@ public:
protected:
// -- based for modular inverse, d = a*u + b*v
-// static const int32 gcdext ( int32& u, int32& v, const int32 a, const int32 b );
- int32& gcdext (int32& d, int32& u, int32& v, const int32 a, const int32 b ) const;
- int32& invext (int32& u, const int32 a, const int32 b ) const;
+// static const int32_t gcdext ( int32_t& u, int32_t& v, const int32_t a, const int32_t b );
+ int32_t& gcdext (int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const;
+ int32_t& invext (int32_t& u, const int32_t a, const int32_t b ) const;
protected:
// -- data representation of the domain:
@@ -226,7 +221,11 @@ protected:
static void End();
};
+} // namespace Givaro
+
#include "givaro/givzpz32std.inl"
-#endif
+#endif // __GIVARO_zpz32std_H
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz32std.inl b/src/kernel/zpz/givzpz32std.inl
index db90763..fc821f6 100644
--- a/src/kernel/zpz/givzpz32std.inl
+++ b/src/kernel/zpz/givzpz32std.inl
@@ -1,21 +1,27 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz32std.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz32std.inl,v 1.11 2008-09-18 08:12:55 jgdumas Exp $
+// $Id: givzpz32std.inl,v 1.20 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
+
+#ifndef __GIVARO_zpz32std_INL
+#define __GIVARO_zpz32std_INL
+
+
// Description:
// ---------
// -- normalized operations
// ---------
-
-
// r = a*b
-#define __GIVARO_ZPZ32_N_MUL(r,p,a,b) ( r = (uint32)(a*b) % (uint32)p )
+#define __GIVARO_ZPZ32_N_MUL(r,p,a,b) ( r = (uint32_t)(a*b) % (uint32_t)p )
// r *= a
-#define __GIVARO_ZPZ32_N_MULIN(r,p,a) ( r = (uint32)(r*a) % (uint32)p )
+#define __GIVARO_ZPZ32_N_MULIN(r,p,a) ( r = (uint32_t)(r*a) % (uint32_t)p )
// r = a - b
//#define __GIVARO_ZPZ32_N_SUB(r,p,a,b) ( r = (a>b)? a-b: (p-b)+a )
@@ -29,547 +35,553 @@
#define __GIVARO_ZPZ32_N_ADDIN(r,p,a) { r += a; r= (r < p ? r : r-p); }
// r <- a*b+c % p
-#define __GIVARO_ZPZ32_N_MULADD(r,p,a,b,c) ( r = (uint32)(a*b+c) % (uint32)p )
-
-#define __GIVARO_ZPZ32_N_MULADDIN(r,p,a,b) ( r = (uint32)(a*b+r) % (uint32)p )
+#define __GIVARO_ZPZ32_N_MULADD(r,p,a,b,c) ( r = (uint32_t)(a*b+c) % (uint32_t)p )
-// a*b-c
-#define __GIVARO_ZPZ32_N_MULSUB(r,p,a,b,c) \
-{ r = (a*b+p-c); r= (r<p ? r : (uint32)r % (uint32)p); }
-// a*b-c
-#define __GIVARO_ZPZ32_N_SUBMULIN(r,p,a,b) \
-{ r -= (a*b); if (r<0) { r+=p; r = (r<0 ? r % (uint32)p : r); } }
+#define __GIVARO_ZPZ32_N_MULADDIN(r,p,a,b) ( r = (uint32_t)(a*b+r) % (uint32_t)p )
#define __GIVARO_ZPZ32_N_NEG(r,p,a) ( r = (a == 0 ? 0 : p-a) )
#define __GIVARO_ZPZ32_N_NEGIN(r,p) ( r = (r == 0 ? 0 : p-r) )
-
-inline ZpzDom<Std32>::Residu_t ZpzDom<Std32>::residu( ) const
-{ return _p; }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::mul (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_ZPZ32_N_MUL(r,(int32)_p,(int32)a,(int32)b);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::sub (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_ZPZ32_N_SUB(r,_p,a,b);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::add (Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_ZPZ32_N_ADD(r,(int32)_p,(int32)a,(int32)b);
- return r;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::neg (Rep& r, const Rep a) const
-{
- return __GIVARO_ZPZ32_N_NEG(r,(int32)_p,(int32)a);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::inv (Rep& r, const Rep a) const
-{
- register int32 u;
- ZpzDom<Std32>::invext(u, a, _p);
-// if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::inv)" << std::endl;
- return r = (u<0)?(ZpzDom<Std32>::Rep)u + _p:(ZpzDom<Std32>::Rep)u;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::div (Rep& r, const Rep a, const Rep b) const
-{
- return mulin( inv(r,b), a );
-}
-
- // -- inline array operations between ZpzDom<Std32>::Rep
-inline void ZpzDom<Std32>::mul (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_MUL(tmp, (int32)_p,(int32)a[i], (int32)b[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::mul (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_MUL(tmp, (int32)_p, (int32)a[i], (int32)b);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::div (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- div( r[i], a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Std32>::div (const size_t sz, Array r, constArray a, Rep b) const
-{
- ZpzDom<Std32>::Rep ib;
- inv(ib, b);
- mul(sz, r, a, ib);
-}
-
-inline void ZpzDom<Std32>::add (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_ADD(tmp, (int32)_p, (int32)a[i], (int32)b[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::add (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_ADD(tmp, (int32)_p, (int32)a[i], (int32)b);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::sub (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_SUB(tmp, (int32)_p, (int32)a[i], (int32)b[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::sub (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_SUB(tmp, (int32)_p, (int32)a[i], (int32)b);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::neg (const size_t sz, Array r, constArray a) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_NEG(tmp, (int32)_p, (int32)a[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::mulin (Rep& r, const Rep a) const
-{
- return __GIVARO_ZPZ32_N_MULIN(r,(int32)_p, (int32)a);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::divin (Rep& r, const Rep a) const
-{
- ZpzDom<Std32>::Rep ia;
- inv(ia, a);
- return mulin(r, ia);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::addin (Rep& r, const Rep a) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ32_N_ADDIN(tmp,(int32)_p, (int32)a);
- return r = (ZpzDom<Std32>::Rep)tmp;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::subin (Rep& r, const Rep a) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ32_N_SUBIN(tmp,(int32)_p, (int32)a);
- return r = (ZpzDom<Std32>::Rep)tmp;
-}
-
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::negin (Rep& r) const
-{
- return __GIVARO_ZPZ32_N_NEGIN(r,(int32)_p);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::invin (Rep& r) const
-{
- register int32 u;
- ZpzDom<Std32>::invext(u, r, _p);
-// if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::invin)" << std::endl;
- return r = (u<0)?(ZpzDom<Std32>::Rep)u + _p:(ZpzDom<Std32>::Rep)u;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axpy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- return __GIVARO_ZPZ32_N_MULADD(r, (int32)_p, (int32)a, (int32)b, (int32)c);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axpyin
- (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_ZPZ32_N_MULADDIN(r, (int32)_p, (int32)a, (int32)b);
-}
-
-
-inline void ZpzDom<Std32>::axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_MULADD(tmp, (int32)_p, (int32)a[i], (int32)x[i], (int32)y[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Std32>::axpyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp = (int32)r[i];
- __GIVARO_ZPZ32_N_MULADDIN(tmp, (int32)_p, (int32)a[i], (int32)x[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
- // -- amxy: r <- c - a * b mod p
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::amxy (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register int32 tmp;
- __GIVARO_ZPZ32_N_MUL(tmp, (int32)_p, (int32)a, (int32)b);
- __GIVARO_ZPZ32_N_SUB(r, (int32)_p, (int32)c, tmp);
- return r;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axmy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register int32 tmp;
- __GIVARO_ZPZ32_N_MULSUB(tmp, (int32)_p, (int32)a, (int32)b, (int32)c);
- return r = (ZpzDom<Std32>::Rep)tmp;
-}
-
-// r -= a*b
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axmyin
- (Rep& r, const Rep a, const Rep b) const
-{
- register int32 tmp = (int32)r;
- __GIVARO_ZPZ32_N_SUBMULIN(tmp, (int32)_p, (int32)a, (int32)b );
- return r = (ZpzDom<Std32>::Rep)tmp;
-}
-
-
-inline void ZpzDom<Std32>::axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp;
- __GIVARO_ZPZ32_N_MULSUB(tmp, (int32)_p, (int32)a[i], (int32)x[i], (int32)y[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
-// r -= a*b
-inline void ZpzDom<Std32>::axmyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register int32 tmp = (int32)r[i];
- __GIVARO_ZPZ32_N_SUBMULIN(tmp, (int32)_p, (int32)a[i], (int32)x[i]);
- r[i] = (ZpzDom<Std32>::Rep)tmp;
- }
-}
-
- // ------------------------- Miscellaneous functions
-
-inline int ZpzDom<Std32>::isZero(const Rep a) const
-{ return a == ZpzDom<Std32>::zero; }
-
-inline int ZpzDom<Std32>::isOne(const Rep a) const
-{ return a == ZpzDom<Std32>::one; }
-
-
-
-inline size_t ZpzDom<Std32>::length(const Rep a) const
-{ return ZpzDom<Std32>::size_rep;}
-
-// ---------
-// -- misc operations
-// ---------
-
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const double a ) const
-{
- int sign; double ua;
- if (a < 0.0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- if ( ua > Signed_Trait<uint32>::max()){
-// ua -= (double)floor(ua * _invdp)*_dp;
- ua = fmod(ua,_dp);
- r = (Rep) ua;
- } else
- r = (ua >=_p) ? (uint32) ua % (uint32)_p : (uint32) ua;
- if (r && (sign ==-1)) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const float a ) const {
- return init(r, (double)a);
-}
-
-
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const unsigned long a ) const
-{ return r = (Rep)( a >= (unsigned long)_p ? a % (unsigned long)_p : a);
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const long a ) const
-{
- int sign; unsigned long ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % (uint32)_p : ua;
- if (r && (sign ==-1)) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const Integer& residu ) const
-{
- long tr;
- if (residu <0) {
- // -a = b [p]
- // a = p-b [p]
- if ( residu <= (Integer)(-_p) ) tr = long( (-residu) % _p) ;
- else tr = long(-residu);
- if (tr)
- return r = _p - (unsigned long)tr;
- else
- return r = zero;
- } else {
- if (residu >= (Integer)_p ) tr = long(residu % _p) ;
- else tr = long(residu);
- return r = tr;
- }
-}
-
-
-
-
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init( Rep& a, const int i) const { return init(a,(long)i); }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init( Rep& a, const unsigned int i) const { return init(a,(unsigned long)i); }
-
-
-inline void ZpzDom<Std32>::assign
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- if (a[i] <ZpzDom<Std32>::zero) {
- r[i] = a[i] + _p;
- if (r[i] <ZpzDom<Std32>::zero) r[i] = r[i] % _p;
- }
- else if ((uint32)a[i] >_p) {
- r[i] = a[i] - _p;
- if ((uint32)r[i] >=_p) r[i] = r[i] % _p;
- }
- else r[i] = a[i];
- }
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign ( Rep& r, const long a ) const
-{
- int sign; uint32 ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % _p : ua;
- if (sign ==-1) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign ( Rep& r, const short a ) const
-{ return ZpzDom<Std32>::assign( r, (long)a); }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign ( Rep& r, const unsigned long a ) const
-{ return r = (a >=_p) ? a % _p : a; }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign
- ( Rep& r, const unsigned short a ) const
-{ return r = (a >=_p) ? a % _p : a; }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign
- ( Rep& r, const int32 a ) const
-{ return assign(r, (long)a); }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign
- ( Rep& r, const uint32 a ) const
-{ return assign(r, (unsigned long)a); }
-
-
-inline void ZpzDom<Std32>::init
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i)
- r[i] = a[i];
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r ) const
-{ return r = zero; }
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::dotprod
- ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
-{
- unsigned int stride = 1;
- if ((unsigned long)bound < GIVARO_MAXUINT32)
-// stride = GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound);
- stride = GIVARO_MAXULONG/((unsigned long)bound) / ((unsigned long)bound);
- unsigned long dot = zero;
- if ((sz <10) && (sz <stride)) {
- for( register int i= sz-1; i>=0; --i)
- dot += a[i] * b[i];
- if (dot > _p) return r = (Rep)(dot % (int32)_p);
- else return r = (Rep)dot;
- }
- size_t i_begin=0;
- stride &= ~0x1;
- if (stride ==0) {
- for( register int i= sz-1; i>0; --i) {
- dot += a[i] * b[i];
- if (dot>_p) dot %= _p;
- }
- return r = (Rep)dot;
- }
- do {
- size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
- if ((min_sz & 0x1) !=0)
- { min_sz--; i_begin++; dot += a++[min_sz] * b++[min_sz]; }
- if (min_sz > 1)
- for( register size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
- {
- dot += a[0] * b[0];
- dot += a[1] * b[1];
- }
- if (dot>_p) dot %= _p;
- i_begin += min_sz;
- } while (i_begin <sz);
- return r = (Rep)dot;
-}
-
-template< class RandIter >
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::random(RandIter& g, Rep& a) const {
- return init(a, g());
-}
-
-template< class RandIter >
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::random(RandIter& g, Rep& a, const Rep& b) const {
- return init(a, g());
-}
-template< class RandIter >
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::random(RandIter& g, Rep& a, long b) const {
- return init(a, g() %(uint32) b);
-
-}
-
-template< class RandIter >
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::nonzerorandom(RandIter& g, Rep& a) const {
- while (isZero(init(a, g()))) {};
+// a*b-c
+#define __GIVARO_ZPZ32_N_MULSUB(r,p,a,b,c) ( r = (uint32_t)(a*b+p-c) % (uint32_t)p )
+
+// r-a*b
+#define __GIVARO_ZPZ32_N_SUBMULIN(r,p,a,b) { \
+ __GIVARO_ZPZ32_N_MULSUB(r,p,a,b,r); __GIVARO_ZPZ32_N_NEGIN(r,p); }
+
+namespace Givaro {
+
+ inline ZpzDom<Std32>::Residu_t ZpzDom<Std32>::residu( ) const
+ {
+ return _p;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::mul (Rep& r, const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ32_N_MUL(r,(int32_t)_p,(int32_t)a,(int32_t)b);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::sub (Rep& r, const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ32_N_SUB(r,_p,a,b);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::add (Rep& r, const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ32_N_ADD(r,(int32_t)_p,(int32_t)a,(int32_t)b);
+ return r;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::neg (Rep& r, const Rep a) const
+ {
+ return __GIVARO_ZPZ32_N_NEG(r,(int32_t)_p,(int32_t)a);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::inv (Rep& r, const Rep a) const
+ {
+ int32_t u;
+ ZpzDom<Std32>::invext(u, a, _p);
+ // if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::inv)" << std::endl;
+ return r = (u<0)?(ZpzDom<Std32>::Rep)u + _p:(ZpzDom<Std32>::Rep)u;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::div (Rep& r, const Rep a, const Rep b) const
+ {
+ return mulin( inv(r,b), a );
+ }
+
+ // -- inline array operations between ZpzDom<Std32>::Rep
+ inline void ZpzDom<Std32>::mul (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp, (int32_t)_p,(int32_t)a[i], (int32_t)b[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::mul (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)b);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::div (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ div( r[i], a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Std32>::div (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ ZpzDom<Std32>::Rep ib;
+ inv(ib, b);
+ mul(sz, r, a, ib);
+ }
+
+ inline void ZpzDom<Std32>::add (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_ADD(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)b[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::add (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_ADD(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)b);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::sub (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_SUB(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)b[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::sub (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_SUB(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)b);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::neg (const size_t sz, Array r, constArray a) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_NEG(tmp, (int32_t)_p, (int32_t)a[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::mulin (Rep& r, const Rep a) const
+ {
+ return __GIVARO_ZPZ32_N_MULIN(r,(int32_t)_p, (int32_t)a);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::divin (Rep& r, const Rep a) const
+ {
+ ZpzDom<Std32>::Rep ia;
+ inv(ia, a);
+ return mulin(r, ia);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::addin (Rep& r, const Rep a) const
+ {
+ int32_t tmp = (int32_t)r;
+ __GIVARO_ZPZ32_N_ADDIN(tmp,(int32_t)_p, (int32_t)a);
+ return r = (ZpzDom<Std32>::Rep)tmp;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::subin (Rep& r, const Rep a) const
+ {
+ int32_t tmp = (int32_t)r;
+ __GIVARO_ZPZ32_N_SUBIN(tmp,(int32_t)_p, (int32_t)a);
+ return r = (ZpzDom<Std32>::Rep)tmp;
+ }
+
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::negin (Rep& r) const
+ {
+ return __GIVARO_ZPZ32_N_NEGIN(r,(int32_t)_p);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::invin (Rep& r) const
+ {
+ int32_t u;
+ ZpzDom<Std32>::invext(u, r, _p);
+ // if ((d != 1) && (d != -1)) std::cerr << "GivMathDivZero(Zpz::invin)" << std::endl;
+ return r = (u<0)?(ZpzDom<Std32>::Rep)u + _p:(ZpzDom<Std32>::Rep)u;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axpy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+ {
+ return __GIVARO_ZPZ32_N_MULADD(r, (int32_t)_p, (int32_t)a, (int32_t)b, (int32_t)c);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axpyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ32_N_MULADDIN(r, (int32_t)_p, (int32_t)a, (int32_t)b);
+ }
+
+
+ inline void ZpzDom<Std32>::axpy (const size_t sz,
+ Array r, constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULADD(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i], (int32_t)y[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Std32>::axpyin (const size_t sz,
+ Array r, constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp = (int32_t)r[i];
+ __GIVARO_ZPZ32_N_MULADDIN(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ // -- maxpy: r <- c - a * b mod p
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::maxpy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MUL(tmp, (int32_t)_p, (int32_t)a, (int32_t)b);
+ __GIVARO_ZPZ32_N_SUB(r, (int32_t)_p, (int32_t)c, tmp);
+ return r;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axmy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+ {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULSUB(tmp, (int32_t)_p, (int32_t)a, (int32_t)b, (int32_t)c);
+ return r = (ZpzDom<Std32>::Rep)tmp;
+ }
+
+ // r -= a*b
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::maxpyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ32_N_SUBMULIN(r, (int32_t)_p, (int32_t)a, (int32_t)b );
+ return r;
+ // int32_t tmp = (int32_t)r;
+ // __GIVARO_ZPZ32_N_SUBMULIN(tmp, (int32_t)_p, (int32_t)a, (int32_t)b );
+ // return r = (ZpzDom<Std32>::Rep)tmp;
+ }
+
+ // r = a*b - r
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::axmyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ32_N_MULSUB(r, (int32_t)_p, (int32_t)a, (int32_t)b, r );
+ }
+
+ inline void ZpzDom<Std32>::axmy (const size_t sz,
+ Array r, constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz; i--; ) {
+ int32_t tmp;
+ __GIVARO_ZPZ32_N_MULSUB(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i], (int32_t)y[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ // r = r - a*b
+ inline void ZpzDom<Std32>::maxpyin (const size_t sz,
+ Array r, constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ int32_t tmp = (int32_t)r[i];
+ __GIVARO_ZPZ32_N_SUBMULIN(tmp, (int32_t)_p, (int32_t)a[i], (int32_t)x[i]);
+ r[i] = (ZpzDom<Std32>::Rep)tmp;
+ }
+ }
+
+ // ------------------------- Miscellaneous functions
+
+ inline int ZpzDom<Std32>::isZero(const Rep a) const
+ {
+ return a == ZpzDom<Std32>::zero;
+ }
+
+ inline int ZpzDom<Std32>::isOne(const Rep a) const
+ {
+ return a == ZpzDom<Std32>::one;
+ }
+
+
+
+ inline size_t ZpzDom<Std32>::length(const Rep ) const
+ {
+ return ZpzDom<Std32>::size_rep;
+ }
+
+ // ---------
+ // -- misc operations
+ // ---------
+
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const double a ) const
+ {
+ int sign; double ua;
+ if (a < 0.0) { sign =-1; ua = -a;}
+ else { ua = a; sign =1; }
+ if ( ua > Signed_Trait<uint32_t>::max()){
+ // ua -= (double)floor(ua * _invdp)*_dp;
+ ua = fmod(ua,_dp);
+ r = (Rep) ua;
+ } else
+ r = (ua >=_p) ? (uint32_t) ua % (uint32_t)_p : (uint32_t) ua;
+ if (r && (sign ==-1)) r = _p - r;
+ return r;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const float a ) const
+ {
+ return init(r, (double)a);
+ }
+
+
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const unsigned long a ) const
+ { return r = (Rep)( a >= (unsigned long)_p ? a % (unsigned long)_p : a);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const long a ) const
+ {
+ int sign; unsigned long ua;
+ if (a <0) { sign =-1; ua = -a;}
+ else { ua = a; sign =1; }
+ r = Rep((ua >=_p) ? ua % (uint32_t)_p : ua);
+ if (r && (sign ==-1)) r = _p - r;
+ return r;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r, const Integer& Residu ) const
+ {
+ long tr;
+ if (Residu <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ if ( Residu <= (Integer)(-_p) ) tr = long( (-Residu) % _p) ;
+ else tr = long(-Residu);
+ if (tr)
+ return r = Rep(_p - (unsigned long)tr);
+ else
+ return r = zero;
+ } else {
+ if (Residu >= (Integer)_p ) tr = long(Residu % _p) ;
+ else tr = long(Residu);
+ return r = Rep(tr);
+ }
+ }
+
+
+
+
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init( Rep& a, const int i) const
+ {
+ return init(a,(long)i);
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init( Rep& a, const unsigned int i) const
+ {
+ return init(a,(unsigned long)i);
+ }
+
+
+ inline void ZpzDom<Std32>::assign
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; )
+ r[i] = a[i];
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::assign ( Rep& r, const Rep a ) const
+ {
+ return r=a;
+ }
+
+ inline void ZpzDom<Std32>::init
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; )
+ r[i] = a[i];
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::init ( Rep& r ) const
+ {
+ return r = zero;
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::dotprod
+ ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
+ {
+ unsigned int stride = 1;
+ if ((unsigned long)bound < GIVARO_MAXUINT32)
+ // stride = GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound);
+ // hopefully stride is not unsigned long !?!
+ stride = (unsigned int) (GIVARO_MAXULONG/((unsigned long)bound) / ((unsigned long)bound));
+ unsigned long dot = zero;
+ if ((sz <10) && (sz <stride)) {
+ for( size_t i= sz; i--; )
+ dot += a[i] * b[i];
+ if (dot > _p) return r = (Rep)(dot % (int32_t)_p);
+ else return r = (Rep)dot;
+ }
+ size_t i_begin=0;
+ stride &= ~0x1;
+ if (stride ==0) {
+ for( size_t i= sz; --i; ) {
+ dot += a[i] * b[i];
+ if (dot>_p) dot %= _p;
+ }
+ return r = (Rep)dot;
+ }
+ do {
+ size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
+ if ((min_sz & 0x1) !=0)
+ { min_sz--; i_begin++; dot += a++[min_sz] * b++[min_sz]; }
+ if (min_sz > 1)
+ for( size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
+ {
+ dot += a[0] * b[0];
+ dot += a[1] * b[1];
+ }
+ if (dot>_p) dot %= _p;
+ i_begin += min_sz;
+ } while (i_begin <sz);
+ return r = (Rep)dot;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::random(RandIter& g, Rep& a) const
+ {
+ return init(a, g());
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::random(RandIter& g, Rep& a, const Rep& b) const
+ {
+ return init(a, g());
+ }
+ template< class RandIter >
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::random(RandIter& g, Rep& a, long b) const
+ {
+ return init(a, g() %(uint32_t) b);
+
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::nonzerorandom(RandIter& g, Rep& a) const
+ {
+ while (isZero(init(a, g()))) {};
return a;
-}
+ }
-template< class RandIter >
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const {
- while (isZero(init(a, g()))) {};
+ template< class RandIter >
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const
+ {
+ while (isZero(init(a, g()))) {};
return a;
-}
+ }
-template< class RandIter >
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::nonzerorandom(RandIter& g, Rep& a, long b) const {
- while (isZero(init(a, g() %(uint32) b))) {};
+ template< class RandIter >
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::nonzerorandom(RandIter& g, Rep& a, long b) const
+ {
+ while (isZero(init(a, g() %(uint32_t) b))) {};
return a;
-}
-
-inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::dotprod
- ( Rep& r, const size_t sz, constArray a, constArray b ) const
-{
- return ZpzDom<Std32>::dotprod(r, _p, sz, a, b);
-}
-
-
- // a -> r: int32 to double
-inline void
- ZpzDom<Std32>::i2d ( const size_t sz, double* r, constArray a ) const
-{
- for (size_t i=0; i<sz; ++i) r[i] = a[i];
-}
-
- // a -> r: double to int32
-inline void
- ZpzDom<Std32>::d2i ( const size_t sz, Array r, const double* a ) const
-{
- union d_2_l {
- double d;
- int32 r[2];
- };
-// static const double offset = 4503599627370496.0; // 2^52
- double offset = 4503599627370496.0; // 2^52
- for (size_t i=0; i<sz; ++i)
- {
- register d_2_l tmp;
- // - normalization: put fractional part at the end of the representation
- tmp.d = a[i] + offset;
- r[i] = tmp.r[1];
- if (r[i] <(int32)_p) r[i] %= _p;
- }
- // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
- // r[i] = (r[i] <_p ? r[i] : r[i]%_p);
- // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]%_p);
-}
-
-
-
- // -- Input: (z, <_p>)
-inline std::istream& ZpzDom<Std32>::read (std::istream& s)
-{
- char ch;
- s >> std::ws >> ch;
- if (ch != '(')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: syntax error: no '('"));
- std::cerr << "GivBadFormat(ZpzDom<Std32>::read: syntax error: no '('))" << std::endl;
-
- s >> std::ws >> ch;
- if (ch != 'z')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: bad domain object"));
- std::cerr << "GivBadFormat(ZpzDom<Std32>::read: bad domain object))" << std::endl;
-
- s >> std::ws >> ch;
- if (ch != ',')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: syntax error: no ','"));
- std::cerr << "GivBadFormat(ZpzDom<Std32>::read: syntax error: no ',')) " << std::endl;
-
- s >> std::ws >> _p;
-
- s >> std::ws >> ch;
- if (ch != ')')
-// GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: syntax error: no ')'"));
- std::cerr << "GivBadFormat(ZpzDom<Std32>::read: syntax error: no ')')) " << std::endl;
-
- return s;
-}
-
-inline std::ostream& ZpzDom<Std32>::write (std::ostream& s ) const
-{
- return s << "Std32 Givaro Z/pZ modulo " << residu();
-}
-
-inline std::istream& ZpzDom<Std32>::read (std::istream& s, Rep& a) const
-{
- s >> a;
- init(a, a);
- return s;
-}
-
-inline std::ostream& ZpzDom<Std32>::write (std::ostream& s, const Rep a) const
-{
- return s << a;
-}
+ }
+
+ inline ZpzDom<Std32>::Rep& ZpzDom<Std32>::dotprod
+ ( Rep& r, const size_t sz, constArray a, constArray b ) const
+ {
+ return ZpzDom<Std32>::dotprod(r, _p, sz, a, b);
+ }
+
+
+ // a -> r: int32_t to double
+ inline void
+ ZpzDom<Std32>::i2d ( const size_t sz, double* r, constArray a ) const
+ {
+ for (size_t i=0; i<sz; ++i) r[i] = a[i];
+ }
+
+ // a -> r: double to int32_t
+ inline void
+ ZpzDom<Std32>::d2i ( const size_t sz, Array r, const double* a ) const
+ {
+ union d_2_l {
+ double d;
+ int32_t r[2];
+ };
+ // static const double offset = 4503599627370496.0; // 2^52
+ double offset = 4503599627370496.0; // 2^52
+ for (size_t i=0; i<sz; ++i)
+ {
+ d_2_l tmp;
+ // - normalization: put fractional part at the end of the representation
+ tmp.d = a[i] + offset;
+ r[i] = tmp.r[1];
+ if (r[i] <(int32_t)_p) r[i] %= _p;
+ }
+ // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
+ // r[i] = (r[i] <_p ? r[i] : r[i]%_p);
+ // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]%_p);
+ }
+
+
+
+ // -- Input: (z, <_p>)
+ inline std::istream& ZpzDom<Std32>::read (std::istream& s)
+ {
+ char ch;
+ s >> std::ws >> ch;
+ if (ch != '(')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: syntax error: no '('"));
+ std::cerr << "GivBadFormat(ZpzDom<Std32>::read: syntax error: no '('))" << std::endl;
+
+ s >> std::ws >> ch;
+ if (ch != 'z')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: bad domain object"));
+ std::cerr << "GivBadFormat(ZpzDom<Std32>::read: bad domain object))" << std::endl;
+
+ s >> std::ws >> ch;
+ if (ch != ',')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: syntax error: no ','"));
+ std::cerr << "GivBadFormat(ZpzDom<Std32>::read: syntax error: no ',')) " << std::endl;
+
+ s >> std::ws >> _p;
+
+ s >> std::ws >> ch;
+ if (ch != ')')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Std32>::read: syntax error: no ')'"));
+ std::cerr << "GivBadFormat(ZpzDom<Std32>::read: syntax error: no ')')) " << std::endl;
+
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Std32>::write (std::ostream& s ) const
+ {
+ return s << "Std32 Givaro Z/pZ modulo " << residu();
+ }
+
+ inline std::istream& ZpzDom<Std32>::read (std::istream& s, Rep& a) const
+ {
+ s >> a;
+ init(a, a);
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Std32>::write (std::ostream& s, const Rep a) const
+ {
+ return s << a;
+ }
+
+} // namespace Givaro
+
+#endif // __GIVARO_zpz32std_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz32uns.C b/src/kernel/zpz/givzpz32uns.C
index ad1dce7..cc2eb5a 100644
--- a/src/kernel/zpz/givzpz32uns.C
+++ b/src/kernel/zpz/givzpz32uns.C
@@ -1,63 +1,71 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz32uns.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz32uns.C,v 1.2 2004/10/11 12:29:50 jgdumas Exp $
+// $Id: givzpz32uns.C,v 1.5 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
// Description:
#include <iostream>
#include "givaro/givzpz32uns.h"
- // Returns d, and u and v such that u a + v b = d;
-// JGD 04.11.1999
-// const int32 ZpzDom<Unsigned32>::gcdext
-// ( int32& u, int32& v, const int32 a, const int32 b )
-int32& ZpzDom<Unsigned32>::gcdext
- ( int32& d, int32& u, int32& v, const int32 a, const int32 b ) const
-{
- register long u1,u2,u3;
- register long v1,v2,v3;
- u1 = 1; u2 = 0; u3 = a;
- v1 = 0; v2 = 1; v3 = b;
- while (v3 != 0)
- {
- register long q , t1, t2 ,t3;
- q = u3 / v3;
- t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
- u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
- }
- u = u1;
- v = u2;
- return d=u3;
-// return u3;
-}
-
-uint32& ZpzDom<Unsigned32>::invext
- ( uint32& u, const uint32 a, const uint32 b ) const
-{
- register long u1,u3;
- register long v1,v3;
- u1 = 1; u3 = a;
- v1 = 0; v3 = b;
- while (v3 != 0)
- {
- register long q, t1, t3;
- q = u3 / v3;
- t1 = u1 - q * v1; t3 = u3 - q * v3;
- u1 = v1; u3 = v3; v1 = t1; v3 = t3;
- }
- v1=(u3<0?-u1:u1);
- return u=(v1<0?b+v1:v1);
-}
-
-
-void ZpzDom<Unsigned32>::Init()
-{
-}
-
-void ZpzDom<Unsigned32>::End()
-{
-}
+namespace Givaro {
+ // Returns d, and u and v such that u a + v b = d;
+ // JGD 04.11.1999
+ // const int32_t ZpzDom<Unsigned32>::gcdext
+ // ( int32_t& u, int32_t& v, const int32_t a, const int32_t b )
+ int32_t& ZpzDom<Unsigned32>::gcdext
+ ( int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const
+ {
+ long u1,u2,u3;
+ long v1,v2,v3;
+ u1 = 1; u2 = 0; u3 = a;
+ v1 = 0; v2 = 1; v3 = b;
+ while (v3 != 0)
+ {
+ long q , t1, t2 ,t3;
+ q = u3 / v3;
+ t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
+ u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
+ }
+ u = int32_t(u1);
+ v = int32_t(u2);
+ return d= int32_t(u3);
+ // return u3;
+ }
+
+ uint32_t& ZpzDom<Unsigned32>::invext
+ ( uint32_t& u, const uint32_t a, const uint32_t b ) const
+ {
+ long u1,u3;
+ long v1,v3;
+ u1 = 1; u3 = a;
+ v1 = 0; v3 = b;
+ while (v3 != 0)
+ {
+ long q, t1, t3;
+ q = u3 / v3;
+ t1 = u1 - q * v1; t3 = u3 - q * v3;
+ u1 = v1; u3 = v3; v1 = t1; v3 = t3;
+ }
+ v1=(u3<0?-u1:u1);
+ return u=uint32_t(v1<0?b+v1:v1);
+ }
+
+
+ void ZpzDom<Unsigned32>::Init()
+ {
+ }
+
+ void ZpzDom<Unsigned32>::End()
+ {
+ }
+
+} // namespace Givaro
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz32uns.h b/src/kernel/zpz/givzpz32uns.h
index 5aceab5..41cba3f 100644
--- a/src/kernel/zpz/givzpz32uns.h
+++ b/src/kernel/zpz/givzpz32uns.h
@@ -1,31 +1,38 @@
-#ifndef _GIVARO_ZPZ32UNSIGNED_H_
-#define _GIVARO_ZPZ32UNSIGNED_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz32uns.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz32uns.h,v 1.7 2008-04-22 15:57:14 jgdumas Exp $
+// $Id: givzpz32uns.h,v 1.13 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
//
// Modified by Pascal Giorgi on 2002/02/13 (pascal.giorgi at ens-lyon.fr)
-//
-// Description:
-// Arithmetic on Z/pZ, with p a prime number less than 2^32
-// Modulo typedef is a signed long number. In case it was modified
-// then bezout algorithm must be changed (coefficient can be negative).
+
+/*! @file zpz/givzpz32uns.h
+ * @ingroup zpz
+ * @brief Arithmetic on Z/pZ, with p a prime number less than 2^32.
+ * Modulo typedef is a signed long number. In case it was modified
+ * then Bézout algorithm must be changed (coefficient can be negative).
+ */
+#ifndef __GIVARO_zpz32unsigned_H
+#define __GIVARO_zpz32unsigned_H
#include "givaro/givbasictype.h"
#include "givaro/giverror.h"
-#include "givaro/givzpz.h"
+#include "givaro/givzpztypes.h"
#include "givaro/giv_randiter.h"
#include <math.h>
+namespace Givaro {
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// - The representation of an integer a in Zpz is the value a % p
-// ==========================================================================
+
+/*! @brief This class implement the standard arithmetic with Modulo Elements.
+ * - The representation of an integer a in Zpz is the value a % p
+ * .
+ */
template<>
class ZpzDom<Unsigned32> {
@@ -41,25 +48,25 @@ public:
typedef Rep* Array;
typedef const Rep* constArray;
- // ----- Constantes
+ // ----- Constantes
const Rep zero;
const Rep one;
- // ----- Constructor
+ // ----- Constructor
ZpzDom();
ZpzDom( Residu_t p );
ZpzDom( const ZpzDom<Unsigned32>& F);
int operator==( const ZpzDom<Unsigned32>& BC) const { return _p == BC._p;}
int operator!=( const ZpzDom<Unsigned32>& BC) const { return _p != BC._p;}
-
- ZpzDom<Unsigned32>& operator=( const ZpzDom<Unsigned32>& F) {
- this->_p = F._p;
+
+ ZpzDom<Unsigned32>& operator=( const ZpzDom<Unsigned32>& F) {
+ this->_p = F._p;
this->_dp = F._dp;
return *this;
}
- // ----- Access to the modulus
+ // ----- Access to the modulus
Residu_t residu() const;
Residu_t size() const {return _p;}
Rep access( const Rep a ) const { return a; }
@@ -68,7 +75,7 @@ public:
Residu_t cardinality() const { return _p; }
- // ----- Access to the modulus
+ // ----- Access to the modulus
Rep& init( Rep& a ) const;
void init( const size_t, Array a, constArray b ) const;
Rep& init( Rep& r , const long a) const ;
@@ -86,12 +93,12 @@ public:
double& convert(double& r, const Rep a ) const { return r = (double)a ;}
long int& convert(long int& r, const Rep a) const { return r = (long int)a;}
unsigned long int& convert(unsigned long int& r, const Rep a) const { return r = (unsigned long int)a;}
- int32& convert(int32& r, const Rep a) const { return r = (int32)a;}
- uint32& convert(uint32& r, const Rep a) const { return r = (uint32)a;}
+ int32_t& convert(int32_t& r, const Rep a) const { return r = (int32_t)a;}
+ uint32_t& convert(uint32_t& r, const Rep a) const { return r = (uint32_t)a;}
Integer& convert(Integer& i, const Rep a) const {
unsigned long ur;
return i = (Integer)convert(ur, a);
- }
+ }
// ----- Misc methods
int isZero( const Rep a ) const;
@@ -134,31 +141,33 @@ public:
// -- axpy: r <- a * x + y mod p
Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ void axpy (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
// -- axpyin: r <- r + a * x mod p
Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
- void axpyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ void axpyin (const size_t sz, Array r, constArray a, constArray x) const;
// -- axmy: r <- a * x - y mod p
Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axmyin: r <- r - a * x mod p
+ void axmy (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axmyin: r <- a * x -r mod p
Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
- void axmyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ // void axmyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpyin: r <- r - a * b mod p
+ Rep& maxpyin(Rep& r, const Rep a, const Rep b) const;
+ void maxpyin (const size_t sz, Array r, constArray a, constArray x) const;
// -- Misc: r <- a mod p
void assign ( const size_t sz, Array r, constArray a ) const;
-/* JGD 26.10.99
+#if 0 /* JGD 26.10.99 */
void assign ( Rep& r, const Rep a) const;
void assign ( Rep& r, const long a ) const;
void assign ( Rep& r, const unsigned long a ) const;
void assign ( Rep& r, const int a ) const;
void assign ( Rep& r, const unsigned int a ) const;
-*/
+#endif
Rep& assign ( Rep& r, const Rep a) const;
Rep& assign ( Rep& r, const long a ) const;
Rep& assign ( Rep& r, const unsigned long a ) const;
@@ -173,24 +182,24 @@ public:
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
-
+
typedef GIV_randIter< ZpzDom<Unsigned32> , Rep > randIter;
// <- \sum_i a[i], return 1 if a.size() ==0,
- Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
// <- \prod_i a[i], return 1 if a.size() ==0,
- Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
- // <- \sum_i a[i] * b[i]
- Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
- Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
+ // <- \sum_i a[i] * b[i]
+ Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+ Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
- // ----- a -> r: uint32 to double
- void i2d ( const size_t sz, double* r, constArray a ) const;
+ // ----- a -> r: uint32_t to double
+ void i2d ( const size_t sz, double* r, constArray a ) const;
- // ----- a -> r % p: double to uint32 % p
- void d2i ( const size_t sz, Array r, const double* a ) const;
+ // ----- a -> r % p: double to uint32_t % p
+ void d2i ( const size_t sz, Array r, const double* a ) const;
// --- IO methods
std::istream& read ( std::istream& s );
@@ -200,9 +209,9 @@ public:
protected:
// -- based for modular inverse, d = a*u + b*v
-// static const int32 gcdext ( int32& u, int32& v, const int32 a, const int32 b );
- int32& gcdext (int32& d, int32& u, int32& v, const int32 a, const int32 b ) const;
- uint32& invext (uint32& u, const uint32 a, const uint32 b ) const;
+// static const int32_t gcdext ( int32_t& u, int32_t& v, const int32_t a, const int32_t b );
+ int32_t& gcdext (int32_t& d, int32_t& u, int32_t& v, const int32_t a, const int32_t b ) const;
+ uint32_t& invext (uint32_t& u, const uint32_t a, const uint32_t b ) const;
protected:
// -- data representation of the domain:
@@ -213,7 +222,10 @@ protected:
static void End();
};
+} // namespace Givaro
+
#include "givaro/givzpz32uns.inl"
-#endif
+#endif // __GIVARO_zpz32unsigned_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz32uns.inl b/src/kernel/zpz/givzpz32uns.inl
index 9170401..22be6c0 100644
--- a/src/kernel/zpz/givzpz32uns.inl
+++ b/src/kernel/zpz/givzpz32uns.inl
@@ -1,10 +1,17 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz32uns.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz32uns.inl,v 1.9 2008-09-18 08:12:55 jgdumas Exp $
+// $Id: givzpz32uns.inl,v 1.15 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
+
+#ifndef __GIVARO_zpz32_uns_INL
+#define __GIVARO_zpz32_uns_INL
+
// Description:
// ---------
@@ -35,549 +42,631 @@
#define __GIVARO_ZPZ32_Uns_MULADDIN(r,p,a,b) \
{ r += a*b; r= (r < p ? r : r % p); }
+#define __GIVARO_ZPZ32_Uns_NEG(r,p,a) ( r = (a == 0 ? 0 : p-a) )
+#define __GIVARO_ZPZ32_Uns_NEGIN(r,p) ( r = (r == 0 ? 0 : p-r) )
+
// a*b-c
#define __GIVARO_ZPZ32_Uns_MULSUB(r,p,a,b,c) \
{ r = (a*b+p-c); r= (r<p ? r : r % p); }
// a*b-c
#define __GIVARO_ZPZ32_Uns_SUBMULIN(r,p,a,b) \
-{ r = (a*b+p-r); r= (r<p ? r : r % p); }
-
-#define __GIVARO_ZPZ32_Uns_NEG(r,p,a) ( r = (a == 0 ? 0 : p-a) )
-#define __GIVARO_ZPZ32_Uns_NEGIN(r,p) ( r = (r == 0 ? 0 : p-r) )
-
-
-inline ZpzDom<Unsigned32>::ZpzDom( )
- : zero(0), one(1), _p(0), _dp(0.0)
-{}
-
-inline ZpzDom<Unsigned32>::ZpzDom( Residu_t p )
- : zero(0), one(1), _p(p), _dp((double)p)
-
-{}
-
-inline ZpzDom<Unsigned32>::Residu_t ZpzDom<Unsigned32>::residu( ) const
-{ return _p; }
-
-inline ZpzDom<Unsigned32>::ZpzDom(const ZpzDom<Unsigned32>& F)
- : zero(0), one(1), _p(F._p), _dp(F._dp)
- { }
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::mul (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_ZPZ32_Uns_MUL(r,_p,a,b);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::sub (Rep& r, const Rep a, const Rep b) const
-{
- return __GIVARO_ZPZ32_Uns_SUB(r,_p,a,b);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::add (Rep& r, const Rep a, const Rep b) const
-{
- __GIVARO_ZPZ32_Uns_ADD(r,_p,a,b);
- return r;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::neg (Rep& r, const Rep a) const
-{
- return __GIVARO_ZPZ32_Uns_NEG(r,_p,a);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::inv (Rep& r,
-const Rep a) const
-{
- return ZpzDom<Unsigned32>::invext(r, a, _p);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::div (Rep& r, const Rep a, const Rep b) const
-{
- /*
- register uint32 tmp;
- register uint32 ib;
- inv(ib, b);
- __GIVARO_ZPZ32_Uns_MUL(tmp,_p,a,ib);
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
- */
- return mulin( inv(r, b), a );
-}
-
- // -- inline array operations between ZpzDom<Unsigned32>::Rep
-inline void ZpzDom<Unsigned32>::mul (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_MUL(tmp, _p,a[i], b[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::mul (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_MUL(tmp, _p, a[i], b);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::div (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- div( r[i], a[i], b[i]);
- }
-}
-
-inline void ZpzDom<Unsigned32>::div (const size_t sz, Array r, constArray a, Rep b) const
-{
- ZpzDom<Unsigned32>::Rep ib;
- inv(ib, b);
- mul(sz, r, a, ib);
-}
-
-inline void ZpzDom<Unsigned32>::add (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_ADD(tmp, _p, a[i], b[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::add (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_ADD(tmp, _p, a[i], b);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::sub (const size_t sz, Array r, constArray a, constArray b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_SUB(tmp, _p, a[i], b[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::sub (const size_t sz, Array r, constArray a, Rep b) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_SUB(tmp, _p, a[i], b);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::neg (const size_t sz, Array r, constArray a) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_NEG(tmp, _p, a[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::mulin (Rep& r, const Rep a) const
-{
- return __GIVARO_ZPZ32_Uns_MULIN(r,_p, a);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::divin (Rep& r, const Rep a) const
-{
- ZpzDom<Unsigned32>::Rep ia;
- inv(ia, a);
- return mulin(r, ia);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::addin (Rep& r, const Rep a) const
-{
- register uint32 tmp = r;
- __GIVARO_ZPZ32_Uns_ADDIN(tmp,_p, a);
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::subin (Rep& r, const Rep a) const
-{
- register uint32 tmp = r;
- __GIVARO_ZPZ32_Uns_SUBIN(tmp,_p, a);
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
-}
-
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::negin (Rep& r) const
-{
- return __GIVARO_ZPZ32_Uns_NEGIN(r,_p);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::invin (Rep& r) const
-{
- return ZpzDom<Unsigned32>::invext(r, r, _p);
-}
-
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axpy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_MULADD(tmp, _p, a, b, c);
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axpyin
- (Rep& r, const Rep a, const Rep b) const
-{
- register uint32 tmp = r;
- __GIVARO_ZPZ32_Uns_MULADDIN(tmp, _p, a, b);
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
-}
-
-
-inline void ZpzDom<Unsigned32>::axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_MULADD(tmp, _p, a[i], x[i], y[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline void ZpzDom<Unsigned32>::axpyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp = r[i];
- __GIVARO_ZPZ32_Uns_MULADDIN(tmp, _p, a[i], x[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axmy
- (Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_MULSUB(tmp, _p, a, b, c);
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
-}
-
-// r -= a*b
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axmyin
- (Rep& r, const Rep a, const Rep b) const
-{
- register uint32 tmp = r;
- __GIVARO_ZPZ32_Uns_SUBMULIN(tmp, _p, a, b );
- return r = (ZpzDom<Unsigned32>::Rep)tmp;
-}
-
-
-inline void ZpzDom<Unsigned32>::axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp;
- __GIVARO_ZPZ32_Uns_MULSUB(tmp, _p, a[i], x[i], y[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
-// r -= a*b
-inline void ZpzDom<Unsigned32>::axmyin
- (const size_t sz, Array r, constArray a, constArray x) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- register uint32 tmp = r[i];
- __GIVARO_ZPZ32_Uns_SUBMULIN(tmp, _p, a[i], x[i]);
- r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
- }
-}
-
- // ------------------------- Miscellaneous functions
-
-inline int ZpzDom<Unsigned32>::isZero(const Rep a) const
-{ return a == ZpzDom<Unsigned32>::zero; }
-
-inline int ZpzDom<Unsigned32>::isOne(const Rep a) const
-{ return a == ZpzDom<Unsigned32>::one; }
-
-
-inline size_t ZpzDom<Unsigned32>::length(const Rep a) const
-{ return ZpzDom<Unsigned32>::size_rep;}
-
-// ---------
-// -- misc operations
-// ---------
-
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const double a ) const
-{
- int sign; double ua;
- if (a < 0.0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- if ( ua > Signed_Trait<uint32>::max()){
-// ua -= (double)floor(ua * _invdp)*_dp;
- ua = fmod(ua,_dp);
- r = (Rep) ua;
- } else
- r = (ua >=_p) ? (uint32) ua % _p : (uint32) ua;
- if (r && (sign ==-1)) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const float a ) const {
- return init(r, (double)a);
-}
-
-
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const unsigned long a ) const
-{ return r = (Rep)( a >= (unsigned long)_p ? a % (unsigned long)_p : a);
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const long a ) const
-{
- int sign; unsigned long ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % _p : ua;
- if (r && (sign ==-1)) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const Integer& residu ) const
-{
- long tr;
- if (residu <0) {
- // -a = b [p]
- // a = p-b [p]
- if ( residu <= (Integer)(-_p) ) tr = long( (-residu) % _p) ;
- else tr = long(-residu);
- if (tr)
- return r = _p - (unsigned long)tr;
- else
- return r = zero;
- } else {
- if (residu >= (Integer)_p ) tr = long(residu % _p) ;
- else tr = long(residu);
- return r = tr;
- }
-}
-
-
-
-
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init( Rep& a, const int i) const { return init(a,(long)i); }
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init( Rep& a, const unsigned int i) const { return init(a,(unsigned long)i); }
-
-
-inline void ZpzDom<Unsigned32>::assign
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i) {
- if (a[i] <ZpzDom<Unsigned32>::zero) {
- r[i] = a[i] + _p;
- if (r[i] <ZpzDom<Unsigned32>::zero) r[i] = r[i] % _p;
- }
- else if ((uint32)a[i] >_p) {
- r[i] = a[i] - _p;
- if ((uint32)r[i] >=_p) r[i] = r[i] % _p;
- }
- else r[i] = a[i];
- }
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign ( Rep& r, const long a ) const
-{
- int sign; uint32 ua;
- if (a <0) { sign =-1; ua = -a;}
- else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % _p : ua;
- if (sign ==-1) r = _p - r;
- return r;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign ( Rep& r, const short a ) const
-{ return ZpzDom<Unsigned32>::assign( r, (long)a); }
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign ( Rep& r, const unsigned long a ) const
-{ return r = (a >=_p) ? a % _p : a; }
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign
- ( Rep& r, const unsigned short a ) const
-{ return r = (a >=_p) ? a % _p : a; }
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign
- ( Rep& r, const Rep a ) const
-{ return assign(r, (long)a); }
-
-
-inline void ZpzDom<Unsigned32>::init
- ( const size_t sz, Array r, constArray a ) const
-{
- for (register size_t i=sz-1; i!=0; --i)
- r[i] = a[i];
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r ) const
-{ return r = zero; }
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::dotprod
- ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
-{
- unsigned int stride = 1;
- if ((unsigned long)bound < GIVARO_MAXUINT32)
-// stride = GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound);
- stride = GIVARO_MAXULONG/((unsigned long)bound) / ((unsigned long)bound);
- unsigned long dot = zero;
- if ((sz <10) && (sz <stride)) {
- for( register int i= sz-1; i>=0; --i)
- dot += a[i] * b[i];
- if (dot > _p) return r = (Rep)(dot % _p);
- else return r = (Rep)dot;
- }
- size_t i_begin=0;
- stride &= ~0x1;
- if (stride ==0) {
- for( register int i= sz-1; i>0; --i) {
- dot += a[i] * b[i];
- if (dot>_p) dot %= _p;
- }
- return r = (Rep)dot;
- }
- do {
- size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
- if ((min_sz & 0x1) !=0)
- { min_sz--; i_begin++; dot += a++[min_sz] * b++[min_sz]; }
- if (min_sz > 1)
- for( register size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
- {
- dot += a[0] * b[0];
- dot += a[1] * b[1];
- }
- if (dot>_p) dot %= _p;
- i_begin += min_sz;
- } while (i_begin <sz);
- return r = (Rep)dot;
-}
-
-template< class RandIter >
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::random(RandIter& g, Rep& a) const {
- return init(a, g());
-}
-
-template< class RandIter >
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::random(RandIter& g, Rep& a, const Rep& b) const {
- return init(a, g());
-}
-template< class RandIter >
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::random(RandIter& g, Rep& a, long b) const {
- return init(a, g() %(uint32) b);
-
-}
-
-template< class RandIter >
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::nonzerorandom(RandIter& g, Rep& a) const {
- while (isZero(init(a, g()))) {};
+{ r = (a*b+p-r); r= (r<p ? r : r % p); __GIVARO_ZPZ32_Uns_NEGIN(r,p); }
+
+namespace Givaro {
+
+ inline ZpzDom<Unsigned32>::ZpzDom( )
+ : zero(0), one(1), _p(0), _dp(0.0)
+ {}
+
+ inline ZpzDom<Unsigned32>::ZpzDom( Residu_t p )
+ : zero(0), one(1), _p(p), _dp((double)p)
+
+ {}
+
+ inline ZpzDom<Unsigned32>::Residu_t ZpzDom<Unsigned32>::residu( ) const
+ {
+ return _p;
+ }
+
+ inline ZpzDom<Unsigned32>::ZpzDom(const ZpzDom<Unsigned32>& F)
+ : zero(0), one(1), _p(F._p), _dp(F._dp)
+ { }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::mul (Rep& r, const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ32_Uns_MUL(r,_p,a,b);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::sub (Rep& r, const Rep a, const Rep b) const
+ {
+ return __GIVARO_ZPZ32_Uns_SUB(r,_p,a,b);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::add (Rep& r, const Rep a, const Rep b) const
+ {
+ __GIVARO_ZPZ32_Uns_ADD(r,_p,a,b);
+ return r;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::neg (Rep& r, const Rep a) const
+ {
+ return __GIVARO_ZPZ32_Uns_NEG(r,_p,a);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::inv (Rep& r,
+ const Rep a) const
+ {
+ return ZpzDom<Unsigned32>::invext(r, a, _p);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::div (Rep& r, const Rep a, const Rep b) const
+ {
+ /*
+ uint32_t tmp;
+ uint32_t ib;
+ inv(ib, b);
+ __GIVARO_ZPZ32_Uns_MUL(tmp,_p,a,ib);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ */
+ return mulin( inv(r, b), a );
+ }
+
+ // -- inline array operations between ZpzDom<Unsigned32>::Rep
+ inline void ZpzDom<Unsigned32>::mul (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_MUL(tmp, _p,a[i], b[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::mul (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_MUL(tmp, _p, a[i], b);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::div (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ div( r[i], a[i], b[i]);
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::div (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ ZpzDom<Unsigned32>::Rep ib;
+ inv(ib, b);
+ mul(sz, r, a, ib);
+ }
+
+ inline void ZpzDom<Unsigned32>::add (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_ADD(tmp, _p, a[i], b[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::add (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_ADD(tmp, _p, a[i], b);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::sub (const size_t sz, Array r, constArray a, constArray b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_SUB(tmp, _p, a[i], b[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::sub (const size_t sz, Array r, constArray a, Rep b) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_SUB(tmp, _p, a[i], b);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::neg (const size_t sz, Array r, constArray a) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_NEG(tmp, _p, a[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::mulin (Rep& r, const Rep a) const
+ {
+ return __GIVARO_ZPZ32_Uns_MULIN(r,_p, a);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::divin (Rep& r, const Rep a) const
+ {
+ ZpzDom<Unsigned32>::Rep ia;
+ inv(ia, a);
+ return mulin(r, ia);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::addin (Rep& r, const Rep a) const
+ {
+ uint32_t tmp = r;
+ __GIVARO_ZPZ32_Uns_ADDIN(tmp,_p, a);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::subin (Rep& r, const Rep a) const
+ {
+ uint32_t tmp = r;
+ __GIVARO_ZPZ32_Uns_SUBIN(tmp,_p, a);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::negin (Rep& r) const
+ {
+ return __GIVARO_ZPZ32_Uns_NEGIN(r,_p);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::invin (Rep& r) const
+ {
+ return ZpzDom<Unsigned32>::invext(r, r, _p);
+ }
+
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axpy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+ {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_MULADD(tmp, _p, a, b, c);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axpyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ uint32_t tmp = r;
+ __GIVARO_ZPZ32_Uns_MULADDIN(tmp, _p, a, b);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+
+ inline void ZpzDom<Unsigned32>::axpy (const size_t sz, Array r,
+ constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_MULADD(tmp, _p, a[i], x[i], y[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline void ZpzDom<Unsigned32>::axpyin (const size_t sz, Array r,
+ constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp = r[i];
+ __GIVARO_ZPZ32_Uns_MULADDIN(tmp, _p, a[i], x[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axmy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+ {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_MULSUB(tmp, _p, a, b, c);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+ // r = c-a*b
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::maxpy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+ {
+ uint32_t tmp=c;
+ __GIVARO_ZPZ32_Uns_SUBMULIN(tmp, _p, a, b);
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+ // r -= a*b
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::maxpyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ uint32_t tmp = r;
+ __GIVARO_ZPZ32_Uns_SUBMULIN(tmp, _p, a, b );
+ return r = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+
+ // r = a*b - r
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::axmyin (Rep& r,
+ const Rep a, const Rep b) const
+ {
+ maxpyin(r,a,b);
+ return negin(r);
+ }
+
+
+ inline void ZpzDom<Unsigned32>::axmy (const size_t sz, Array r,
+ constArray a, constArray x, constArray y) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp;
+ __GIVARO_ZPZ32_Uns_MULSUB(tmp, _p, a[i], x[i], y[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ // r -= a*b
+ inline void ZpzDom<Unsigned32>::maxpyin (const size_t sz, Array r,
+ constArray a, constArray x) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ uint32_t tmp = r[i];
+ __GIVARO_ZPZ32_Uns_SUBMULIN(tmp, _p, a[i], x[i]);
+ r[i] = (ZpzDom<Unsigned32>::Rep)tmp;
+ }
+ }
+
+ // ------------------------- Miscellaneous functions
+
+ inline int ZpzDom<Unsigned32>::isZero(const Rep a) const
+ {
+ return a == ZpzDom<Unsigned32>::zero;
+ }
+
+ inline int ZpzDom<Unsigned32>::isOne(const Rep a) const
+ {
+ return a == ZpzDom<Unsigned32>::one;
+ }
+
+
+ inline size_t ZpzDom<Unsigned32>::length(const Rep ) const
+ {
+ return ZpzDom<Unsigned32>::size_rep;
+ }
+
+ // ---------
+ // -- misc operations
+ // ---------
+
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const double a ) const
+ {
+ int sign; double ua;
+ if (a < 0.0) { sign =-1; ua = -a;}
+ else { ua = a; sign =1; }
+ if ( ua > Signed_Trait<uint32_t>::max()){
+ // ua -= (double)floor(ua * _invdp)*_dp;
+ ua = fmod(ua,_dp);
+ r = (Rep) ua;
+ } else
+ r = (ua >=_p) ? (uint32_t) ua % _p : (uint32_t) ua;
+ if (r && (sign ==-1)) r = _p - r;
+ return r;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const float a ) const
+ {
+ return init(r, (double)a);
+ }
+
+
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const unsigned long a ) const
+ {
+ return r = (Rep)( a >= (unsigned long)_p ? a % (unsigned long)_p : a);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const long a ) const
+ {
+ int sign;
+ unsigned long ua;
+ if (a <0) {
+ sign =-1;
+ ua = -a;
+ }
+ else {
+ ua = a;
+ sign =1;
+ }
+ r = Rep( (ua >=_p) ? ua % _p : ua );
+ if (r && (sign ==-1))
+ r = _p - r;
+ return r;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r, const Integer& Residu ) const
+ {
+ long tr;
+ if (Residu <0) {
+ // -a = b [p]
+ // a = p-b [p]
+ if ( Residu <= (Integer)(-_p) )
+ tr = long( (-Residu) % _p) ;
+ else
+ tr = long(-Residu);
+ if (tr)
+ return r = Rep( _p - (unsigned long)tr );
+ else
+ return r = zero;
+ } else {
+ if (Residu >= (Integer)_p )
+ tr = long(Residu % _p) ;
+ else
+ tr = long(Residu);
+ return r = Rep(tr);
+ }
+ }
+
+
+
+
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init( Rep& a, const int i) const
+ {
+ return init(a,(long)i);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init( Rep& a, const unsigned int i) const
+ {
+ return init(a,(unsigned long)i);
+ }
+
+
+ inline void ZpzDom<Unsigned32>::assign
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; ) {
+ if (a[i] <ZpzDom<Unsigned32>::zero) {
+ r[i] = a[i] + _p;
+ if (r[i] <ZpzDom<Unsigned32>::zero) r[i] = r[i] % _p;
+ }
+ else if ((uint32_t)a[i] >_p) {
+ r[i] = a[i] - _p;
+ if ((uint32_t)r[i] >=_p) r[i] = r[i] % _p;
+ }
+ else r[i] = a[i];
+ }
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign ( Rep& r, const long a ) const
+ {
+ int sign;
+ uint32_t ua;
+ if (a <0) {
+ sign =-1;
+ ua = (uint32_t) -a;
+ }
+ else {
+ ua = uint32_t(a);
+ sign = 1;
+ }
+ r = Rep( (ua >=_p) ? (ua % _p) : ua );
+ if (sign ==-1)
+ r = _p - r;
+ return r;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign ( Rep& r, const short a ) const
+ {
+ return ZpzDom<Unsigned32>::assign( r, (long)a);
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign ( Rep& r, const unsigned long a ) const
+ {
+ return r = Rep( (a >=_p) ? (a % _p) : a );
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign
+ ( Rep& r, const unsigned short a ) const
+ {
+ return r = Rep( (a >=_p) ? (a % _p) : a );
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::assign
+ ( Rep& r, const Rep a ) const
+ {
+ return assign(r, (long)a);
+ }
+
+
+ inline void ZpzDom<Unsigned32>::init
+ ( const size_t sz, Array r, constArray a ) const
+ {
+ for ( size_t i=sz ; --i ; )
+ r[i] = a[i];
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::init ( Rep& r ) const
+ {
+ return r = zero;
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::dotprod
+ ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
+ {
+ unsigned int stride = 1;
+ if ((unsigned long)bound < GIVARO_MAXUINT32)
+ // stride = GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound);
+ stride = (unsigned int) ( GIVARO_MAXULONG/((unsigned long)bound) / ((unsigned long)bound) );
+ unsigned long dot = zero;
+ if ((sz <10) && (sz <stride)) {
+ for( size_t i= sz; i--; )
+ dot += a[i] * b[i];
+ if (dot > _p)
+ return r = (Rep)(dot % _p);
+ else
+ return r = (Rep)dot;
+ }
+ size_t i_begin=0;
+ stride &= ~0x1;
+ if (stride ==0) {
+ for( size_t i= sz; --i; ) {
+ dot += a[i] * b[i];
+ if (dot>_p) dot %= _p;
+ }
+ return r = (Rep)dot;
+ }
+ do {
+ size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
+ if ((min_sz & 0x1) !=0) {
+ min_sz--;
+ i_begin++;
+ dot += a++[min_sz] * b++[min_sz];
+ }
+ if (min_sz > 1)
+ for( size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
+ {
+ dot += a[0] * b[0];
+ dot += a[1] * b[1];
+ }
+ if (dot>_p)
+ dot %= _p;
+ i_begin += min_sz;
+ } while (i_begin <sz);
+ return r = (Rep)dot;
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::random(RandIter& g, Rep& a) const
+ {
+ return init(a, g());
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::random(RandIter& g, Rep& a, const Rep& b) const
+ {
+ return init(a, g());
+ }
+ template< class RandIter >
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::random(RandIter& g, Rep& a, long b) const
+ {
+ return init(a, g() %(uint32_t) b);
+
+ }
+
+ template< class RandIter >
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::nonzerorandom(RandIter& g, Rep& a) const
+ {
+ while (isZero(init(a, g()))) {};
return a;
-}
+ }
-template< class RandIter >
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const {
- while (isZero(init(a, g()))) {};
+ template< class RandIter >
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::nonzerorandom(RandIter& g, Rep& a, const Rep& b) const
+ {
+ while (isZero(init(a, g()))) {};
return a;
-}
+ }
-template< class RandIter >
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::nonzerorandom(RandIter& g, Rep& a, long b) const {
- while (isZero(init(a, g() %(uint32) b))) {};
+ template< class RandIter >
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::nonzerorandom(RandIter& g, Rep& a, long b) const
+ {
+ while (isZero(init(a, g() %(uint32_t) b))) {};
return a;
-}
-
-inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::dotprod
- ( Rep& r, const size_t sz, constArray a, constArray b ) const
-{
- return ZpzDom<Unsigned32>::dotprod(r, _p, sz, a, b);
-}
-
-
- // a -> r: uint32 to double
-inline void
- ZpzDom<Unsigned32>::i2d ( const size_t sz, double* r, constArray a ) const
-{
- for (size_t i=0; i<sz; ++i) r[i] = a[i];
-}
-
- // a -> r: double to uint32
-inline void
- ZpzDom<Unsigned32>::d2i ( const size_t sz, Array r, const double* a ) const
-{
- union d_2_l {
- double d;
- uint32 r[2];
- };
-// static const double offset = 4503599627370496.0; // 2^52
- double offset = 4503599627370496.0; // 2^52
- for (size_t i=0; i<sz; ++i)
- {
- register d_2_l tmp;
- // - normalization: put fractional part at the end of the representation
- tmp.d = a[i] + offset;
- r[i] = tmp.r[1];
- if (r[i] <_p) r[i] %= _p;
- }
- // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
- // r[i] = (r[i] <_p ? r[i] : r[i]%_p);
- // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]%_p);
-}
-
-
-
- // -- Input: (z, <_p>)
-inline std::istream& ZpzDom<Unsigned32>::read (std::istream& s)
-{
- char ch;
- s >> std::ws >> ch;
- if (ch != '(')
-// GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: syntax error: no '('"));
- std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: syntax error: no '('))" << std::endl;
-
- s >> std::ws >> ch;
- if (ch != 'z')
-// GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: bad domain object"));
- std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: bad domain object))" << std::endl;
-
- s >> std::ws >> ch;
- if (ch != ',')
-// GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: syntax error: no ','"));
- std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: syntax error: no ',')) " << std::endl;
-
- s >> std::ws >> _p;
-
- s >> std::ws >> ch;
- if (ch != ')')
-// GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: syntax error: no ')'"));
- std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: syntax error: no ')')) " << std::endl;
-
- return s;
-}
-
-inline std::ostream& ZpzDom<Unsigned32>::write (std::ostream& s ) const
-{
- return s << "Uns32 Givaro Z/pZ modulo " << residu();
-}
-
-inline std::istream& ZpzDom<Unsigned32>::read (std::istream& s, Rep& a) const
-{
- s >> a;
- init(a, a);
- return s;
-}
-
-inline std::ostream& ZpzDom<Unsigned32>::write (std::ostream& s, const Rep a) const
-{
- return s << a;
-}
+ }
+
+ inline ZpzDom<Unsigned32>::Rep& ZpzDom<Unsigned32>::dotprod
+ ( Rep& r, const size_t sz, constArray a, constArray b ) const
+ {
+ return ZpzDom<Unsigned32>::dotprod(r, _p, sz, a, b);
+ }
+
+
+ // a -> r: uint32_t to double
+ inline void
+ ZpzDom<Unsigned32>::i2d ( const size_t sz, double* r, constArray a ) const
+ {
+ for (size_t i=0; i<sz; ++i) r[i] = a[i];
+ }
+
+ // a -> r: double to uint32_t
+ inline void
+ ZpzDom<Unsigned32>::d2i ( const size_t sz, Array r, const double* a ) const
+ {
+ union d_2_l {
+ double d;
+ uint32_t r[2];
+ };
+ // static const double offset = 4503599627370496.0; // 2^52
+ double offset = 4503599627370496.0; // 2^52
+ for (size_t i=0; i<sz; ++i)
+ {
+ d_2_l tmp;
+ // - normalization: put fractional part at the end of the representation
+ tmp.d = a[i] + offset;
+ r[i] = tmp.r[1];
+ if (r[i] <_p) r[i] %= _p;
+ }
+ // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
+ // r[i] = (r[i] <_p ? r[i] : r[i]%_p);
+ // r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]%_p);
+ }
+
+
+
+ // -- Input: (z, <_p>)
+ inline std::istream& ZpzDom<Unsigned32>::read (std::istream& s)
+ {
+ char ch;
+ s >> std::ws >> ch;
+ if (ch != '(')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: syntax error: no '('"));
+ std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: syntax error: no '('))" << std::endl;
+
+ s >> std::ws >> ch;
+ if (ch != 'z')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: bad domain object"));
+ std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: bad domain object))" << std::endl;
+
+ s >> std::ws >> ch;
+ if (ch != ',')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: syntax error: no ','"));
+ std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: syntax error: no ',')) " << std::endl;
+
+ s >> std::ws >> _p;
+
+ s >> std::ws >> ch;
+ if (ch != ')')
+ // GivError::throw_error( GivBadFormat("ZpzDom<Unsigned32>::read: syntax error: no ')'"));
+ std::cerr << "GivBadFormat(ZpzDom<Unsigned32>::read: syntax error: no ')')) " << std::endl;
+
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Unsigned32>::write (std::ostream& s ) const
+ {
+ return s << "Uns32 Givaro Z/pZ modulo " << residu();
+ }
+
+ inline std::istream& ZpzDom<Unsigned32>::read (std::istream& s, Rep& a) const
+ {
+ s >> a;
+ init(a, a);
+ return s;
+ }
+
+ inline std::ostream& ZpzDom<Unsigned32>::write (std::ostream& s, const Rep a) const
+ {
+ return s << a;
+ }
+
+} // namespace Givaro
+
+#endif // __GIVARO_zpz32_uns_INL
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz64std.C b/src/kernel/zpz/givzpz64std.C
index a37fdd8..18d85d3 100644
--- a/src/kernel/zpz/givzpz64std.C
+++ b/src/kernel/zpz/givzpz64std.C
@@ -1,61 +1,67 @@
-#include <givaro/givconfig.h>
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz64std.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz64std.C,v 1.3 2004/10/11 13:54:38 jgdumas Exp $
+// $Id: givzpz64std.C,v 1.6 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
-// Description:
+#include <givaro/givconfig.h>
#include <iostream>
#include "givaro/givzpz64std.h"
+namespace Givaro {
+
// Returns d, and u and v such that u a + v b = d;
// JGD 04.11.1999
-// const int64 ZpzDom<Std64>::gcdext
-// ( int64& u, int64& v, const int64 a, const int64 b )
-int64& ZpzDom<Std64>::gcdext
- ( int64& d, int64& u, int64& v, const int64 a, const int64 b ) const
+// const int64_t ZpzDom<Std64>::gcdext
+// ( int64_t& u, int64_t& v, const int64_t a, const int64_t b )
+int64_t& ZpzDom<Std64>::gcdext
+ ( int64_t& d, int64_t& u, int64_t& v, const int64_t a, const int64_t b ) const
{
- register int64 u1,u2,u3;
- register int64 v1,v2,v3;
+ int64_t u1,u2,u3;
+ int64_t v1,v2,v3;
u1 = 1; u2 = 0; u3 = a;
v1 = 0; v2 = 1; v3 = b;
while (v3 != 0)
{
- register int64 q , t1, t2 ,t3;
+ int64_t q , t1, t2 ,t3;
q = u3 / v3;
t1 = u1 - q * v1; t2 = u2 - q * v2; t3 = u3 - q * v3;
u1 = v1; u2 = v2; u3 = v3; v1 = t1; v2 = t2; v3 = t3;
}
- u = u1;
+ u = u1;
v = u2;
return d=u3;
// return u3;
-}
+}
-int64& ZpzDom<Std64>::invext
- ( int64& u, const int64 a, const int64 b ) const
+int64_t& ZpzDom<Std64>::invext
+ ( int64_t& u, const int64_t a, const int64_t b ) const
{
- register int64 u3;
- register int64 v1,v3;
+ int64_t u3;
+ int64_t v1,v3;
u = 1; u3 = a;
v1 = 0; v3 = b;
while (v3 != 0)
{
- register int64 q , t1, t3;
+ int64_t q , t1, t3;
q = u3 / v3;
t1 = u - q * v1; t3 = u3 - q * v3;
u = v1; u3 = v3; v1 = t1; v3 = t3;
}
- return (u3<0?u=-u:u);
-}
+ return (u3<0?u=-u:u);
+}
-void ZpzDom<Std64>::Init()
+void ZpzDom<Std64>::Init()
{
-}
+}
void ZpzDom<Std64>::End()
{
}
+
+ } // namespace Givaro
diff --git a/src/kernel/zpz/givzpz64std.h b/src/kernel/zpz/givzpz64std.h
index 23927b7..53fa401 100644
--- a/src/kernel/zpz/givzpz64std.h
+++ b/src/kernel/zpz/givzpz64std.h
@@ -1,202 +1,220 @@
-#ifndef _GIVARO_ZPZ64STD_H_
-#define _GIVARO_ZPZ64STD_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz64std.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz64std.h,v 1.11 2006-07-21 08:03:26 jgdumas Exp $
+// $Id: givzpz64std.h,v 1.21 2011-02-04 14:11:46 jgdumas Exp $
// ==========================================================================
-// Description:
-// Arithmetic on Z/pZ, with p a prime number less than 2^64
-// Modulo typedef is a signed long number. In case it was modified
-// then bezout algorithm must be changed (coefficient can be negative).
+
+/*! @file zpz/givzpz64std.h
+ * @ingroup zpz
+ * @brief Description.
+ * Arithmetic on Z/pZ, with p a prime number less than 2^64
+ * Modulo typedef is a signed long number. In case it was modified
+ * then Bézout algorithm must be changed (coefficient can be negative).
+ */
+
+#ifndef __GIVARO_zpz64std_H
+#define __GIVARO_zpz64std_H
+
#include "givaro/givinteger.h"
#include "givaro/giverror.h"
-#include "givaro/givzpz.h"
+#include "givaro/givzpztypes.h"
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// - The representation of an integer a in Zpz is the value a % p
-// ==========================================================================
+
+namespace Givaro {
+
+/*! @brief This class implement the standard arithmetic with Modulo Elements.
+ * - The representation of an integer a in Zpz is the value a % p
+ * - p max is 2147483647
+ * .
+ */
template<>
-class ZpzDom<Std64> {
- typedef ZpzDom<Std64> Self_t;
-
+class ZpzDom<Std64>
+{
+ typedef ZpzDom<Std64> Self_t;
+
public:
- // ----- Exported Types and constantes
- typedef uint64 Residu_t; // - type to store residue
- enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
- // ----- Representation of Element of the domain ZpzDom
- typedef int64 Rep;
- typedef int64 Element;
-
-
- // ----- Representation of vector of the Element
- typedef Rep* Array;
- typedef const Rep* constArray;
-
- // ----- Constantes
- const Rep zero;
- const Rep one;
-
- // ----- Constructor
- ZpzDom() : zero(0), one(1), _p(0) {}
- ZpzDom( Residu_t p, unsigned long e = 1) : zero(0), one(1), _p(p) {}
-
-
- Self_t& operator= (const Self_t& D) {
- this->_p = D._p;
- return *this;
- }
-
- int operator==( const Self_t& BC) const { return _p == BC._p;}
- int operator!=( const Self_t& BC) const { return _p != BC._p;}
-
-
-
-
- // ----- Access to the modulus
- Residu_t residu() const;
- Residu_t size() const { return _p; }
- Residu_t characteristic() const { return _p; }
- Integer& characteristic(Integer& p) const { return p=_p; }
- Residu_t cardinality() const { return _p; }
- Rep access( const Rep a ) const { return a; }
-
-
- // ----- Access to the modulus
- Rep& init( Rep& a ) const;
- void init( const size_t, Array a, constArray b ) const;
- Rep& init( Rep& a, const long i) const ;
- Rep& init( Rep& a, const unsigned long i) const ;
- Rep& init( Rep& a, const long long i) const ;
- Rep& init( Rep& a, const unsigned long long i) const ;
- Rep& init( Rep& a, const int i) const ;
- Rep& init( Rep& a, const unsigned int i) const ;
- Rep& init( Rep& a, const double i) const ;
- Rep& init( Rep& a, const float i) const ;
- Rep& init( Rep& a, const Integer& i) const ;
-
- // ----- Misc methods
- int areEqual( const Rep, const Rep) const;
- int areNEqual( const Rep, const Rep) const;
- int isZero( const Rep a ) const;
- int isnzero( const Rep a ) const;
- int isOne ( const Rep a ) const;
- size_t length ( const Rep a ) const;
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- Rep& mul (Rep& r, const Rep a, const Rep b) const;
- Rep& inv (Rep& r, const Rep a) const;
- Rep& div (Rep& r, const Rep a, const Rep b) const;
- Rep& add (Rep& r, const Rep a, const Rep b) const;
- Rep& sub (Rep& r, const Rep a, const Rep b) const;
- Rep& neg (Rep& r, const Rep a) const;
-
- Rep& mulin (Rep& r, const Rep a) const;
- Rep& divin (Rep& r, const Rep a) const;
- Rep& addin (Rep& r, const Rep a) const;
- Rep& subin (Rep& r, const Rep a) const;
- Rep& negin (Rep& r) const;
- Rep& invin (Rep& r) const;
-
- // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
- void mul (const size_t sz, Array r, constArray a, constArray b) const;
- void mul (const size_t sz, Array r, constArray a, Rep b) const;
-
- void div (const size_t sz, Array r, constArray a, constArray b) const;
- void div (const size_t sz, Array r, constArray a, Rep b) const;
-
- void add (const size_t sz, Array r, constArray a, constArray b) const;
- void add (const size_t sz, Array r, constArray a, Rep b) const;
-
- void sub (const size_t sz, Array r, constArray a, constArray b) const;
- void sub (const size_t sz, Array r, constArray a, Rep b) const;
-
- void neg (const size_t sz, Array r, constArray a) const;
- void inv (const size_t sz, Array r, constArray a) const;
-
- // -- axpy: r <- a * x + y mod p
- Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axpyin: r <- r + a * x mod p
- Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
- void axpyin
- (const size_t sz, Array r, constArray a, constArray x) const;
-
- // -- amxy: r <- c - a * b mod p
- Rep& amxy (Rep& r, const Rep a, const Rep b, const Rep c) const;
-
- // -- axmy: r <- a * x - y mod p
- Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
- void axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axmyin: r <- r - a * x mod p
- Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
- void axmyin
- (const size_t sz, Array r, constArray a, constArray x) const;
-
- // -- Misc: r <- a mod p
- void assign ( const size_t sz, Array r, constArray a ) const;
- Rep& assign ( Rep& r, const Rep a) const;
-/*
- Rep& assign ( Rep& r, const long a ) const;
- Rep& assign ( Rep& r, const unsigned long a ) const;
- Rep& assign ( Rep& r, const int a ) const;
- Rep& assign ( Rep& r, const unsigned int a ) const;
-*/
- // ----- random generators
-// Rep& NONZEROGIVRANDOM(Rep&) const ;
-// Rep& GIVRANDOM(Rep&) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r, long s) const ;
- template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
-
-
- // <- \sum_i a[i], return 1 if a.size() ==0,
- void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
-
- // <- \prod_i a[i], return 1 if a.size() ==0,
- void reducemul ( Rep& r, const size_t sz, constArray a ) const;
-
- // <- \sum_i a[i] * b[i]
- void dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
- void dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
-
- // ----- a -> r: uint64 to double
- void i2d ( const size_t sz, double* r, constArray a ) const;
-
- // ----- a -> r % p: double to uint64 % p
- void d2i ( const size_t sz, Array r, const double* a ) const;
-
- // --- IO methods
- std::istream& read ( std::istream& s );
- std::ostream& write( std::ostream& s ) const;
- std::istream& read ( std::istream& s, Rep& a ) const;
- std::ostream& write( std::ostream& s, const Rep a ) const;
- template <class XXX> XXX& convert( XXX& s, const Rep a ) const;
- Integer& write(Integer&, const Rep a ) const;
+ // ----- Exported Types and constantes
+ typedef uint64_t Residu_t; // - type to store residue
+ enum { size_rep = sizeof(Residu_t) }; // - size of the storage type
+ // ----- Representation of Element of the domain ZpzDom
+ typedef int64_t Rep;
+ typedef int64_t Element;
+
+
+ // ----- Representation of vector of the Element
+ typedef Rep* Array;
+ typedef const Rep* constArray;
+
+ // ----- Constantes
+ const Rep zero;
+ const Rep one;
+
+ // ----- Constructor
+ ZpzDom() : zero(0), one(1), _p(0) {}
+ ZpzDom( Residu_t p, unsigned long = 1) : zero(0), one(1), _p(p) {}
+
+
+ Self_t& operator= (const Self_t& D) {
+ this->_p = D._p;
+ return *this;
+ }
+
+ int operator==( const Self_t& BC) const { return _p == BC._p;}
+ int operator!=( const Self_t& BC) const { return _p != BC._p;}
+
+
+
+
+ // ----- Access to the modulus
+ Residu_t residu() const;
+ Residu_t size() const { return _p; }
+ Residu_t characteristic() const { return _p; }
+ Integer& characteristic(Integer& p) const { return p=_p; }
+ Residu_t cardinality() const { return _p; }
+ Rep access( const Rep a ) const { return a; }
+
+
+ // ----- Initialisation
+ Rep& init( Rep& a ) const;
+ void init( const size_t, Array a, constArray b ) const;
+ Rep& init( Rep& a, const long i) const ;
+ Rep& init( Rep& a, const unsigned long i) const ;
+ Rep& init( Rep& a, const long long i) const ;
+ Rep& init( Rep& a, const unsigned long long i) const ;
+ Rep& init( Rep& a, const int i) const ;
+ Rep& init( Rep& a, const unsigned int i) const ;
+ Rep& init( Rep& a, const double i) const ;
+ Rep& init( Rep& a, const float i) const ;
+ Rep& init( Rep& a, const Integer& i) const ;
+
+ // ----- Misc methods
+ int areEqual( const Rep, const Rep) const;
+ int areNEqual( const Rep, const Rep) const;
+ int isZero( const Rep a ) const;
+ int isnzero( const Rep a ) const;
+ int isOne ( const Rep a ) const;
+ size_t length ( const Rep a ) const;
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ Rep& mul (Rep& r, const Rep a, const Rep b) const;
+ Rep& inv (Rep& r, const Rep a) const;
+ Rep& div (Rep& r, const Rep a, const Rep b) const;
+ Rep& add (Rep& r, const Rep a, const Rep b) const;
+ Rep& sub (Rep& r, const Rep a, const Rep b) const;
+ Rep& neg (Rep& r, const Rep a) const;
+
+ Rep& mulin (Rep& r, const Rep a) const;
+ Rep& divin (Rep& r, const Rep a) const;
+ Rep& addin (Rep& r, const Rep a) const;
+ Rep& subin (Rep& r, const Rep a) const;
+ Rep& negin (Rep& r) const;
+ Rep& invin (Rep& r) const;
+
+ // ----- Operations with reduction: r <- a op b mod p, r <- op a mod p
+ void mul (const size_t sz, Array r, constArray a, constArray b) const;
+ void mul (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void div (const size_t sz, Array r, constArray a, constArray b) const;
+ void div (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void add (const size_t sz, Array r, constArray a, constArray b) const;
+ void add (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void sub (const size_t sz, Array r, constArray a, constArray b) const;
+ void sub (const size_t sz, Array r, constArray a, Rep b) const;
+
+ void neg (const size_t sz, Array r, constArray a) const;
+ void inv (const size_t sz, Array r, constArray a) const;
+
+ // -- axpy: r <- a * x + y mod p
+ Rep& axpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axpy
+ (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axpyin: r <- r + a * x mod p
+ Rep& axpyin(Rep& r, const Rep a, const Rep b) const;
+ void axpyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- axmy: r <- a * x - y mod p
+ Rep& axmy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ void axmy
+ (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axmyin: r <- a * x - r mod p
+ Rep& axmyin(Rep& r, const Rep a, const Rep b) const;
+ // void axmyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep a, const Rep b, const Rep c) const;
+ // -- maxpyin: r <- r - a * b mod p
+ Rep& maxpyin(Rep& r, const Rep a, const Rep b) const;
+ void maxpyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- Misc: r <- a mod p
+ void assign ( const size_t sz, Array r, constArray a ) const;
+ Rep& assign ( Rep& r, const Rep a) const;
+ /*
+ Rep& assign ( Rep& r, const long a ) const;
+ Rep& assign ( Rep& r, const unsigned long a ) const;
+ Rep& assign ( Rep& r, const int a ) const;
+ Rep& assign ( Rep& r, const unsigned int a ) const;
+ */
+ // ----- random generators
+ // Rep& NONZEROGIVRANDOM(Rep&) const ;
+ // Rep& GIVRANDOM(Rep&) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r, long s) const ;
+ template< class RandIter > Rep& random(RandIter&, Rep& r, const Rep& b) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
+
+
+ // <- \sum_i a[i], return 1 if a.size() ==0,
+ void reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+
+ // <- \prod_i a[i], return 1 if a.size() ==0,
+ void reducemul ( Rep& r, const size_t sz, constArray a ) const;
+
+ // <- \sum_i a[i] * b[i]
+ void dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+ void dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
+
+ // ----- a -> r: uint64_t to double
+ void i2d ( const size_t sz, double* r, constArray a ) const;
+
+ // ----- a -> r % p: double to uint64_t % p
+ void d2i ( const size_t sz, Array r, const double* a ) const;
+
+ // --- IO methods
+ std::istream& read ( std::istream& s );
+ std::ostream& write( std::ostream& s ) const;
+ std::istream& read ( std::istream& s, Rep& a ) const;
+ std::ostream& write( std::ostream& s, const Rep a ) const;
+ template <class XXX> XXX& convert( XXX& s, const Rep a ) const;
+ Integer& write(Integer&, const Rep a ) const;
protected:
- // -- based for modular inverse, d = a*u + b*v
-// static const int64 gcdext ( int64& u, int64& v, const int64 a, const int64 b );
- int64& gcdext (int64& d, int64& u, int64& v, const int64 a, const int64 b ) const;
- int64& invext (int64& u, const int64 a, const int64 b ) const;
+ // -- based for modular inverse, d = a*u + b*v
+ // static const int64_t gcdext ( int64_t& u, int64_t& v, const int64_t a, const int64_t b );
+ int64_t& gcdext (int64_t& d, int64_t& u, int64_t& v, const int64_t a, const int64_t b ) const;
+ int64_t& invext (int64_t& u, const int64_t a, const int64_t b ) const;
protected:
- // -- data representation of the domain:
- Residu_t _p;
+ // -- data representation of the domain:
+ Residu_t _p;
- static void Init();
- static void End();
+ static void Init();
+ static void End();
};
+} // namespace Givaro
#include "givaro/givzpz64std.inl"
-#endif
+#endif // __GIVARO_zpz64std_H
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpz64std.inl b/src/kernel/zpz/givzpz64std.inl
index 0f2927f..044b8a6 100644
--- a/src/kernel/zpz/givzpz64std.inl
+++ b/src/kernel/zpz/givzpz64std.inl
@@ -1,22 +1,30 @@
-#include <givaro/givconfig.h>
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpz64std.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givzpz64std.inl,v 1.10 2008-04-22 16:55:57 jgdumas Exp $
+// $Id: givzpz64std.inl,v 1.19 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_zpz64std_INL
+#define __GIVARO_zpz64std_INL
+
// Description:
// ---------
// -- normalized operations
// ---------
+#include <givaro/givconfig.h>
+
+#ifndef __DONOTUSE_Givaro_SIXTYFOUR__
// r = a*b
-#define __GIVARO_ZPZ64_N_MUL(r,p,a,b) { r = (a*b); r= (r>=p ? r % (uint64)p : r); }
+#define __GIVARO_ZPZ64_N_MUL(r,p,a,b) ( r = (uint64_t)(a*b) % (uint64_t)p )
// r *= a
-#define __GIVARO_ZPZ64_N_MULIN(r,p,a) { r *= a; r= (r<p ? r : r % (uint64)p);}
+#define __GIVARO_ZPZ64_N_MULIN(r,p,a) ( r = (uint64_t)(r*a) % (uint64_t)p )
// r = a - b
#define __GIVARO_ZPZ64_N_SUB(r,p,a,b) { r = (a-b); r= (r < 0 ? r+p : r);}
@@ -29,98 +37,94 @@
#define __GIVARO_ZPZ64_N_ADDIN(r,p,a) { r += a; r= (r < p ? r : r-p);}
// r <- a*b+c % p
-#define __GIVARO_ZPZ64_N_MULADD(r,p,a,b,c) \
-{ r = (a*b+c); r= (r<p ? r : r % (uint64)p); }
-
-#define __GIVARO_ZPZ64_N_MULADDIN(r,p,a,b) \
-{ r += (a*b); r= (r<p ? r : r % (uint64)p);}
-
-// // a*b-c
-#define __GIVARO_ZPZ64_N_MULSUB(r,p,a,b,c) \
-{ r = (a*b-c); r= (r<p ? (r>0? r : r% (uint64)p) : r % (uint64)p); }
-// a*b-c
-#define __GIVARO_ZPZ64_N_SUBMULIN(r,p,a,b) \
-{ r -= (a*b); if (r<0) { r+=p; r = (r<0 ? r % (uint64)p : r); } }
-
-
+#define __GIVARO_ZPZ64_N_MULADD(r,p,a,b,c) ( r = (uint64_t)(a*b+c) % (uint64_t)p )
+#define __GIVARO_ZPZ64_N_MULADDIN(r,p,a,b) ( r = (uint64_t)(a*b+r) % (uint64_t)p )
#define __GIVARO_ZPZ64_N_NEG(r,p,a) { r = (a == 0 ? 0 : p-a); }
#define __GIVARO_ZPZ64_N_NEGIN(r,p) { r = (r == 0 ? 0 : p-r); }
+// a*b-c
+#define __GIVARO_ZPZ64_N_MULSUB(r,p,a,b,c) ( r = (uint64_t)(a*b+p-c) % (uint64_t)p )
+
+// r-a*b
+#define __GIVARO_ZPZ64_N_SUBMULIN(r,p,a,b) { \
+ __GIVARO_ZPZ64_N_MULSUB(r,p,a,b,r); __GIVARO_ZPZ64_N_NEGIN(r,p); }
+
+namespace Givaro {
inline ZpzDom<Std64>::Residu_t ZpzDom<Std64>::residu( ) const
{ return _p; }
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::mul (Rep& r, const Rep a, const Rep b) const
-{
- register int64 tmp;
- __GIVARO_ZPZ64_N_MUL(tmp,(int64)_p,(int64)a,(int64)b);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MUL(tmp,(int64_t)_p,(int64_t)a,(int64_t)b);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::neg (Rep& r, const Rep a) const
-{
- register int64 tmp;
- __GIVARO_ZPZ64_N_NEG(tmp,(int64)_p,(int64)a);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_NEG(tmp,(int64_t)_p,(int64_t)a);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::inv (Rep& r, const Rep a) const
-{
-// register int64 d, u, v;
- register int64 u;
+{
+// int64_t d, u, v;
+ int64_t u;
ZpzDom<Std64>::invext(u, a, _p);
- return r = (u<0)?(ZpzDom<Std64>::Rep)(u+_p):(ZpzDom<Std64>::Rep)u;
+ return r = (u<0)?(ZpzDom<Std64>::Rep)(u+_p):(ZpzDom<Std64>::Rep)u;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::div (Rep& r, const Rep a, const Rep b) const
-{
- register int64 tmp;
- register int64 ib;
+{
+ int64_t tmp;
+ int64_t ib;
inv(ib, b);
- __GIVARO_ZPZ64_N_MUL(tmp,(int64)_p,(int64)a,(int64)ib);
- return r = (ZpzDom<Std64>::Rep)tmp;
+ __GIVARO_ZPZ64_N_MUL(tmp,(int64_t)_p,(int64_t)a,(int64_t)ib);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::sub (Rep& r, const Rep a, const Rep b) const
-{
- register int64 tmp;
- __GIVARO_ZPZ64_N_SUB(tmp,(int64)_p,(int64)a,(int64)b);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_SUB(tmp,(int64_t)_p,(int64_t)a,(int64_t)b);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::add (Rep& r, const Rep a, const Rep b) const
-{
- register int64 tmp;
- __GIVARO_ZPZ64_N_ADD(tmp,(int64)_p,(int64)a,(int64)b);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_ADD(tmp,(int64_t)_p,(int64_t)a,(int64_t)b);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
// -- inline array operations between ZpzDom<Std64>::Rep
inline void ZpzDom<Std64>::mul (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_MUL(tmp, (int64)_p,(int64)a[i], (int64)b[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MUL(tmp, (int64_t)_p,(int64_t)a[i], (int64_t)b[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline void ZpzDom<Std64>::mul (const size_t sz, Array r, constArray a, Rep b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_MUL(tmp, (int64)_p, (int64)a[i], (int64)b);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MUL(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)b);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline void ZpzDom<Std64>::div (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- div( r[i], a[i], b[i]);
- }
+ for ( size_t i = sz; --i; ) {
+ div( r[i], a[i], b[i]);
+ }
}
inline void ZpzDom<Std64>::div (const size_t sz, Array r, constArray a, Rep b) const
@@ -132,176 +136,193 @@ inline void ZpzDom<Std64>::div (const size_t sz, Array r, constArray a, Rep b) c
inline void ZpzDom<Std64>::add (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_ADD(tmp, (int64)_p, (int64)a[i], (int64)b[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_ADD(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)b[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline void ZpzDom<Std64>::add (const size_t sz, Array r, constArray a, Rep b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_ADD(tmp, (int64)_p, (int64)a[i], (int64)b);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_ADD(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)b);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline void ZpzDom<Std64>::sub (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_SUB(tmp, (int64)_p, (int64)a[i], (int64)b[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_SUB(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)b[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline void ZpzDom<Std64>::sub (const size_t sz, Array r, constArray a, Rep b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_SUB(tmp, (int64)_p, (int64)a[i], (int64)b);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_SUB(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)b);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline void ZpzDom<Std64>::neg (const size_t sz, Array r, constArray a) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_NEG(tmp, (int64)_p, (int64)a[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_NEG(tmp, (int64_t)_p, (int64_t)a[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::mulin (Rep& r, const Rep a) const
-{
- register int64 tmp = (int64)r;
- __GIVARO_ZPZ64_N_MULIN(tmp,(int64)_p, (int64)a);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp = (int64_t)r;
+ __GIVARO_ZPZ64_N_MULIN(tmp,(int64_t)_p, (int64_t)a);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::divin (Rep& r, const Rep a) const
-{
+{
ZpzDom<Std64>::Rep ia;
inv(ia, a);
return mulin(r, ia);
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::addin (Rep& r, const Rep a) const
-{
- register int64 tmp = (int64)r;
- __GIVARO_ZPZ64_N_ADDIN(tmp,(int64)_p, (int64)a);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp = (int64_t)r;
+ __GIVARO_ZPZ64_N_ADDIN(tmp,(int64_t)_p, (int64_t)a);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::subin (Rep& r, const Rep a) const
-{
- register int64 tmp = (int64)r;
- __GIVARO_ZPZ64_N_SUBIN(tmp,(int64)_p, (int64)a);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp = (int64_t)r;
+ __GIVARO_ZPZ64_N_SUBIN(tmp,(int64_t)_p, (int64_t)a);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::negin (Rep& r) const
-{
- __GIVARO_ZPZ64_N_NEGIN(r,(int64)_p);
- return r;
+{
+ __GIVARO_ZPZ64_N_NEGIN(r,(int64_t)_p);
+ return r;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::invin (Rep& r) const
-{
- register int64 u;
+{
+ int64_t u;
ZpzDom<Std64>::invext(u, r, _p);
- return r = (u<0)?(ZpzDom<Std64>::Rep)(u+_p):(ZpzDom<Std64>::Rep)u;
+ return r = (u<0)?(ZpzDom<Std64>::Rep)(u+_p):(ZpzDom<Std64>::Rep)u;
}
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axpy
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axpy
(Rep& r, const Rep a, const Rep b, const Rep c) const
-{
- register int64 tmp;
- __GIVARO_ZPZ64_N_MULADD(tmp, (int64)_p, (int64)a, (int64)b, (int64)c);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MULADD(tmp, (int64_t)_p, (int64_t)a, (int64_t)b, (int64_t)c);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axpyin
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axpyin
(Rep& r, const Rep a, const Rep b) const
-{
- register int64 tmp = (int64)r;
- __GIVARO_ZPZ64_N_MULADDIN(tmp, (int64)_p, (int64)a, (int64)b);
- return r = (ZpzDom<Std64>::Rep)tmp;
+{
+ int64_t tmp = (int64_t)r;
+ __GIVARO_ZPZ64_N_MULADDIN(tmp, (int64_t)_p, (int64_t)a, (int64_t)b);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
-inline void ZpzDom<Std64>::axpy
+inline void ZpzDom<Std64>::axpy
(const size_t sz, Array r, constArray a, constArray x, constArray y) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_MULADD(tmp, (int64)_p, (int64)a[i], (int64)x[i], (int64)y[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MULADD(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)x[i], (int64_t)y[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
-inline void ZpzDom<Std64>::axpyin
+inline void ZpzDom<Std64>::axpyin
(const size_t sz, Array r, constArray a, constArray x) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp = (int64)r[i];
- __GIVARO_ZPZ64_N_MULADDIN(tmp, (int64)_p, (int64)a[i], (int64)x[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp = (int64_t)r[i];
+ __GIVARO_ZPZ64_N_MULADDIN(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)x[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::amxy
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axmy
(Rep& r, const Rep a, const Rep b, const Rep c) const
{
- register int64 tmp;
- __GIVARO_ZPZ64_N_MUL(tmp, (int64)_p, (int64)a, (int64)b);
- __GIVARO_ZPZ64_N_SUB(r, (int64)_p, (int64)c, tmp);
- return r;
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MULSUB(tmp, (int64_t)_p, (int64_t)a, (int64_t)b, (int64_t)c);
+ return r = (ZpzDom<Std64>::Rep)tmp;
}
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axmy
+// r = c - a*b
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::maxpy
(Rep& r, const Rep a, const Rep b, const Rep c) const
{
- register int64 tmp;
- __GIVARO_ZPZ64_N_MULSUB(tmp, (int64)_p, (int64)a, (int64)b, (int64)c);
+ int64_t tmp = (int64_t)c;
+ __GIVARO_ZPZ64_N_SUBMULIN(tmp, (int64_t)_p, (int64_t)a, (int64_t)b );
return r = (ZpzDom<Std64>::Rep)tmp;
}
+#if 0
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::maxpy (Rep& r,
+ const Rep a, const Rep b, const Rep c) const
+{
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MUL(tmp, (int64_t)_p, (int64_t)a, (int64_t)b);
+ __GIVARO_ZPZ64_N_SUB(r, (int64_t)_p, (int64_t)c, tmp);
+ return r;
+}
+#endif
+
// r -= a*b
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axmyin
- (Rep& r, const Rep a, const Rep b) const
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::maxpyin (Rep& r, const Rep a, const Rep b) const
{
- register int64 tmp = (int64)r;
- __GIVARO_ZPZ64_N_SUBMULIN(tmp, (int64)_p, (int64)a, (int64)b );
- return r = (ZpzDom<Std64>::Rep)tmp;
+ __GIVARO_ZPZ64_N_SUBMULIN(r, (int64_t)_p, (int64_t)a, (int64_t)b );
+ return r;
+// int64_t tmp = (int64_t)r;
+// __GIVARO_ZPZ64_N_SUBMULIN(tmp, (int64_t)_p, (int64_t)a, (int64_t)b );
+// return r = (ZpzDom<Std64>::Rep)tmp;
}
+// r = a*b - r
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::axmyin (Rep& r, const Rep a, const Rep b) const
+{
+ maxpyin(r,a,b);
+ return negin(r);
+}
-inline void ZpzDom<Std64>::axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
+
+inline void ZpzDom<Std64>::axmy (const size_t sz, Array r, constArray a, constArray x, constArray y) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp;
- __GIVARO_ZPZ64_N_MULSUB(tmp, (int64)_p, (int64)a[i], (int64)x[i], (int64)y[i]);
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp;
+ __GIVARO_ZPZ64_N_MULSUB(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)x[i], (int64_t)y[i]);
r[i] = (ZpzDom<Std64>::Rep)tmp;
}
}
-// r -= a*b
-inline void ZpzDom<Std64>::axmyin
- (const size_t sz, Array r, constArray a, constArray x) const
+// r = a*b - r
+inline void ZpzDom<Std64>::maxpyin (const size_t sz, Array r, constArray a, constArray x) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- register int64 tmp = (int64)r[i];
- __GIVARO_ZPZ64_N_SUBMULIN(tmp, (int64)_p, (int64)a[i], (int64)x[i]);
- r[i] = (ZpzDom<Std64>::Rep)tmp;
- }
+ for ( size_t i = sz; --i; ) {
+ int64_t tmp = (int64_t)r[i];
+ __GIVARO_ZPZ64_N_SUBMULIN(tmp, (int64_t)_p, (int64_t)a[i], (int64_t)x[i]);
+ r[i] = (ZpzDom<Std64>::Rep)tmp;
+ }
}
// ------------------------- Miscellaneous functions
@@ -322,7 +343,7 @@ inline int ZpzDom<Std64>::isOne(const Rep a) const
{ return a == ZpzDom<Std64>::one; }
-inline size_t ZpzDom<Std64>::length(const Rep a) const
+inline size_t ZpzDom<Std64>::length(const Rep ) const
{ return ZpzDom<Std64>::size_rep;}
@@ -330,53 +351,44 @@ inline size_t ZpzDom<Std64>::length(const Rep a) const
// -- misc operations
// ---------
-inline void ZpzDom<Std64>::assign
+inline void ZpzDom<Std64>::assign
( const size_t sz, Array r, constArray a ) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- if (a[i] <ZpzDom<Std64>::zero) {
- r[i] = a[i] + _p;
- if (r[i] <ZpzDom<Std64>::zero) r[i] = r[i] % (uint64)_p;
- }
- else if ((uint64)a[i] >_p) {
- r[i] = a[i] - _p;
- if ((uint64)r[i] >=_p) r[i] = r[i] % (uint64)_p;
- }
- else r[i] = a[i];
- }
+ for ( size_t i = sz; --i; )
+ r[i] = a[i];
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const unsigned long a ) const
-{ return r = (Rep)( a >= (uint64)_p ? a % (uint64)_p : a);
+{ return r = (Rep)( a >= (uint64_t)_p ? a % (uint64_t)_p : a);
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const long a ) const
{
- int64 sign; uint64 ua;
+ int64_t sign; uint64_t ua;
if (a <0) { sign =-1; ua = -a;}
else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % (uint64)_p : ua;
+ r = (ua >=_p) ? ua % (uint64_t)_p : ua;
if (r && (sign ==-1)) r = _p - r;
return r;
}
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const Integer& residu ) const
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const Integer& Residu ) const
{
- int64 tr;
- if (residu <0) {
+ int64_t tr;
+ if (Residu <0) {
// -a = b [p]
// a = p-b [p]
- if ( residu <= (Integer)(-_p) ) tr = int64( (-residu) % (Integer)_p) ;
- else tr = int64(-residu);
+ if ( (-Residu) >= (Integer)(_p) ) tr = int64_t( (-Residu) % (Integer)_p) ;
+ else tr = int64_t(-Residu);
if (tr)
- return r = (uint64)_p - (uint64)tr;
+ return r = (uint64_t)_p - (uint64_t)tr;
else
return r = zero;
} else {
- if (residu >= (Integer)_p ) tr = int64(residu % (Integer)_p) ;
- else tr = int64(residu);
+ if (Residu >= (Integer)_p ) tr = int64_t(Residu % (Integer)_p) ;
+ else tr = int64_t(Residu);
return r = tr;
}
}
@@ -389,32 +401,32 @@ inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init( Rep& a, const unsigned int i) c
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const unsigned long long a ) const
-{ return r = (Rep)( a >= (uint64)_p ? a % (uint64)_p : a);
+{ return r = (Rep)( a >= (uint64_t)_p ? a % (uint64_t)_p : a);
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const double a ) const
-{ return init(r, (int64)a);
+{ return init(r, (int64_t)a);
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const float a ) const
-{ return init(r, (double)a);
+{ return init(r, (double)a);
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r, const long long a ) const
{
- int sign; uint64 ua;
+ int sign; uint64_t ua;
if (a <0) { sign =-1; ua = -a;}
else { ua = a; sign =1; }
- r = (ua >=_p) ? ua % (uint64)_p : ua;
+ r = (ua >=_p) ? ua % (uint64_t)_p : ua;
if (r && (sign ==-1)) r = _p - r;
return r;
}
/*
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign ( Rep& r, const long a ) const
-{ return r = (Rep)a;
+{ return r = (Rep)a;
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign ( Rep& r, const int a ) const
@@ -423,12 +435,12 @@ inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign ( Rep& r, const int a ) const
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign ( Rep& r, const unsigned long a ) const
{ return r = (Rep)a; }
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign
( Rep& r, const unsigned int a ) const
{ return assign(r, (unsigned long)a); }
*/
-inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign
+inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::assign
( Rep& r, const Rep a ) const
{ return r = a; }
@@ -444,7 +456,7 @@ inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::random(RandIter& g, Rep& a, const Rep
template< class RandIter >
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::random(RandIter& g, Rep& a, long b) const {
- return init(a, g() %(uint64) b);
+ return init(a, g() %(uint64_t) b);
}
template< class RandIter >
@@ -461,38 +473,38 @@ inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::nonzerorandom(RandIter& g, Rep& a, co
template< class RandIter >
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::nonzerorandom(RandIter& g, Rep& a, long b) const {
- while (isZero(init(a, g() %(uint64) b))) {};
+ while (isZero(init(a, g() %(uint64_t) b))) {};
return a;
}
-inline void ZpzDom<Std64>::init
- ( const size_t sz, Array r, constArray a ) const
+inline void ZpzDom<Std64>::init ( const size_t sz, Array r, constArray a ) const
{
- for (register size_t i=sz-1; i!=0; --i)
- r[i] = a[i];
+ for ( size_t i = sz; --i; ) {
+ r[i] = a[i];
+ }
}
inline ZpzDom<Std64>::Rep& ZpzDom<Std64>::init ( Rep& r ) const
{ return r = zero; }
-inline void ZpzDom<Std64>::dotprod
+inline void ZpzDom<Std64>::dotprod
( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const
{
unsigned int stride = 1;
- if ((int64)bound < Signed_Trait<Rep>::max() )
- stride = GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound);
+ if ((int64_t)bound < Signed_Trait<Rep>::max() )
+ stride = (unsigned int) ( GIVARO_MAXULONG/((unsigned long)bound * (unsigned long)bound) );
unsigned long dot = zero;
if ((sz <10) && (sz <stride)) {
- for( register int i= sz-1; i>=0; --i)
- dot += a[i] * b[i];
- if (dot > _p) r = (Rep)(dot % (uint64)_p);
+ for( size_t i= sz; i--; )
+ dot += a[i] * b[i];
+ if (dot > _p) r = (Rep)(dot % (uint64_t)_p);
else r = (Rep)dot;
return;
}
unsigned int i_begin=0;
stride &= ~0x1;
if (stride ==0) {
- for( register int i= sz-1; i>0; --i) {
+ for( size_t i= sz; --i; ) {
dot += a[i] * b[i];
if (dot>_p) dot %= _p;
}
@@ -501,16 +513,16 @@ inline void ZpzDom<Std64>::dotprod
}
do {
size_t min_sz = ((sz-i_begin) < stride ? (sz-i_begin) : stride);
- if ((min_sz & 0x1) !=0)
+ if ((min_sz & 0x1) !=0)
{ min_sz--; i_begin++; dot += a++[min_sz] * b++[min_sz]; }
- if (min_sz > 1)
- for( register size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b )
+ if (min_sz > 1)
+ for( size_t i= min_sz; i>0; --i, --i, ++a, ++a, ++b, ++b ) //!@todo o_O
{
- dot += a[0] * b[0];
+ dot += a[0] * b[0];
dot += a[1] * b[1];
}
- if (dot>(uint64)_p) dot %= (uint64)_p;
- i_begin += min_sz;
+ if (dot>(uint64_t)_p) dot %= (uint64_t)_p;
+ i_begin += (unsigned int) min_sz;
} while (i_begin <sz);
r = (Rep)dot;
}
@@ -518,34 +530,36 @@ inline void ZpzDom<Std64>::dotprod
inline void ZpzDom<Std64>::dotprod
( Rep& r, const size_t sz, constArray a, constArray b ) const
{
- return ZpzDom<Std64>::dotprod(r, _p, sz, a, b);
+ ZpzDom<Std64>::dotprod(r, int(_p), sz, a, b);
}
- // a -> r: int64 to double
-inline void
+ // a -> r: int64_t to double
+inline void
ZpzDom<Std64>::i2d ( const size_t sz, double* r, constArray a ) const
{
- for (size_t i=0; i<sz; ++i) r[i] = a[i];
+ for (size_t i=0; i<sz; ++i) {
+ r[i] = (double) a[i];
+ }
}
- // a -> r: double to int64
-inline void
+ // a -> r: double to int64_t
+inline void
ZpzDom<Std64>::d2i ( const size_t sz, Array r, const double* a ) const
{
union d_2_l {
double d;
- int64 r[2];
+ int64_t r[2];
};
// static const double offset = 4503599627370496.0; // 2^52
double offset = 4503599627370496.0; // 2^52
for (size_t i=0; i<sz; ++i)
{
- register d_2_l tmp;
+ d_2_l tmp;
// - normalization: put fractional part at the end of the representation
- tmp.d = a[i] + offset;
+ tmp.d = a[i] + offset;
r[i] = tmp.r[1];
- if (r[i] <(int64)_p) r[i] %= _p;
+ if (r[i] <(int64_t)_p) r[i] %= _p;
}
// r[i] = (tmp.r[1] <_p ? tmp.r[1] : tmp.r[1]-_p);
// r[i] = (r[i] <_p ? r[i] : r[i]%_p);
@@ -554,9 +568,9 @@ inline void
// -- Input: (z, <_p>)
-inline std::istream& ZpzDom<Std64>::read (std::istream& s)
+inline std::istream& ZpzDom<Std64>::read (std::istream& s)
{
- char ch;
+ char ch;
s >> std::ws >> ch;
if (ch != '(')
// GivError::throw_error( GivBadFormat("ZpzDom<Std64>::read: syntax error: no '('"));
@@ -610,3 +624,10 @@ inline Integer& ZpzDom<Std64>::write (Integer& r, const Rep a) const
{
return r = Integer(a);
}
+
+#endif // __DONOTUSE_Givaro_SIXTYFOUR__
+
+} // namespace Givaro
+
+#endif // __GIVARO_zpz64std_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpzInt.C b/src/kernel/zpz/givzpzInt.C
index b3a70c9..9a7ded0 100644
--- a/src/kernel/zpz/givzpzInt.C
+++ b/src/kernel/zpz/givzpzInt.C
@@ -1,16 +1,21 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpzInt.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: JG Dumas
-// $Id: givzpzInt.C,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givzpzInt.C,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
#include <iostream>
#include "givaro/givzpzInt.h"
-void ZpzDom<Integer>::Init()
+namespace Givaro {
+
+void ZpzDom<Integer>::Init()
{
}
@@ -18,3 +23,7 @@ void ZpzDom<Integer>::End()
{
}
+
+
+} // namespace Givaro
+
diff --git a/src/kernel/zpz/givzpzInt.h b/src/kernel/zpz/givzpzInt.h
index c0c7125..d41ce81 100644
--- a/src/kernel/zpz/givzpzInt.h
+++ b/src/kernel/zpz/givzpzInt.h
@@ -1,26 +1,35 @@
-#ifndef _GIVARO_ZPZInteger_H_
-#define _GIVARO_ZPZInteger_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpzInt.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: JG Dumas
-// $Id: givzpzInt.h,v 1.6 2005/07/12 12:54:37 jgdumas Exp $
+// $Id: givzpzInt.h,v 1.11 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-//
-// Description:
-// Arithmetic on Z/pZ, with p a prime number in arbitrary precision
-#include "givbasictype.h"
-#include "giverror.h"
-#include "givzpz.h"
-#include "givinteger.h"
+/*! @file zpz/givzpzInt.h
+ * @ingroup zpz
+ * @brief Arithmetic on Z/pZ, with p a prime number in arbitrary precision.
+ */
+#ifndef __GIVARO_zpz_int_H
+#define __GIVARO_zpz_int_H
-// ==========================================================================
-// -- This class implement the standard arithmetic with Modulo Elements:
-// - The representation of an integer a in Zpz is the value a % p
-// ==========================================================================
+#include "givaro/givbasictype.h"
+#include "givaro/giverror.h"
+#include "givaro/givzpztypes.h"
+#include "givaro/givinteger.h"
+#include "givaro/giv_randiter.h"
+
+
+namespace Givaro {
+
+/*! @brief This class implement the standard arithmetic with Modulo Elements.
+ * - The representation of an integer a in Zpz is the value a % p
+ * .
+ */
template<>
class ZpzDom<Integer> {
@@ -36,11 +45,11 @@ public:
typedef Rep* Array;
typedef const Rep* constArray;
- // ----- Constantes
+ // ----- Constantes
const Rep zero;
const Rep one;
- // ----- Constructor
+ // ----- Constructor
ZpzDom() : zero(0), one(1), _p(0) {}
ZpzDom( Residu_t p ) : zero(0), one(1), _p(p) {}
ZpzDom( const ZpzDom<Integer>& F) : zero(0), one(1), _p(F._p) { }
@@ -48,13 +57,13 @@ public:
int operator==( const ZpzDom<Integer>& BC) const { return _p == BC._p;}
int operator!=( const ZpzDom<Integer>& BC) const { return _p != BC._p;}
-
- ZpzDom<Integer>& operator=( const ZpzDom<Integer>& F) {
- this->_p = F._p;
+
+ ZpzDom<Integer>& operator=( const ZpzDom<Integer>& F) {
+ this->_p = F._p;
return *this;
}
- // ----- Access to the modulus
+ // ----- Access to the modulus
Residu_t residu() const;
Residu_t size() const {return _p;}
Rep access( const Rep& a ) const { return a; }
@@ -63,7 +72,7 @@ public:
Residu_t cardinality() const { return _p; }
- // ----- Access to the modulus
+ // ----- Access to the modulus
Rep& init( Rep& a ) const;
void init( const size_t, Array a, constArray b ) const;
Rep& init( Rep& r , const long a) const ;
@@ -80,13 +89,11 @@ public:
float& convert(float& r, const Rep& a ) const { return r = (float)a ;}
double& convert(double& r, const Rep& a ) const { return r = (double)a ;}
long int& convert(long int& r, const Rep& a) const { return r = (long int)a;}
- unsigned long int& convert(unsigned long int& r, const Rep& a) const { return r = (unsigned long int)a;}
- Integer& convert(Integer& i, const Rep& a) const {
- unsigned long ur;
- return i = (Integer)convert(ur, a);
- }
-
-
+ unsigned long int& convert(unsigned long int& r, const Rep& a) const { return r = (unsigned long int)a;
+ }
+ Integer& convert(Integer& i, const Rep& a) const {
+ return i = a;
+ }
// ----- Misc methods
int isZero( const Rep& a ) const;
@@ -129,31 +136,33 @@ public:
// -- axpy: r <- a * x + y mod p
Rep& axpy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const;
- void axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ void axpy (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
// -- axpyin: r <- r + a * x mod p
Rep& axpyin(Rep& r, const Rep& a, const Rep& b) const;
- void axpyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ void axpyin (const size_t sz, Array r, constArray a, constArray x) const;
// -- axmy: r <- a * x - y mod p
Rep& axmy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const;
- void axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
- // -- axmyin: r <- r - a * x mod p
+ void axmy (const size_t sz, Array r, constArray a, constArray x, constArray c) const;
+ // -- axmyin: r <- a * x - r mod p
Rep& axmyin(Rep& r, const Rep& a, const Rep& b) const;
- void axmyin
- (const size_t sz, Array r, constArray a, constArray x) const;
+ // void axmyin (const size_t sz, Array r, constArray a, constArray x) const;
+
+ // -- maxpy: r <- c - a * b mod p
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const;
+ // -- maxpyin: r <- r - a * x mod p
+ Rep& maxpyin(Rep& r, const Rep& a, const Rep& b) const;
+ void maxpyin (const size_t sz, Array r, constArray a, constArray x) const;
// -- Misc: r <- a mod p
void assign ( const size_t sz, Array r, constArray a ) const;
-/* JGD 26.10.99
+#if 0 /* JGD 26.10.99 */
void assign ( Rep& r, const Rep& a) const;
void assign ( Rep& r, const long a ) const;
void assign ( Rep& r, const unsigned long a ) const;
void assign ( Rep& r, const int a ) const;
void assign ( Rep& r, const unsigned int a ) const;
-*/
+#endif
Rep& assign ( Rep& r, const Rep& a) const;
Rep& assign ( Rep& r, const long a ) const;
Rep& assign ( Rep& r, const unsigned long a ) const;
@@ -168,24 +177,24 @@ public:
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r) const ;
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, long s) const ;
template< class RandIter > Rep& nonzerorandom(RandIter&, Rep& r, const Rep& b) const ;
-
+
typedef GIV_randIter< ZpzDom<Integer> , Rep > randIter;
// <- \sum_i a[i], return 1 if a.size() ==0,
- Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reduceadd ( Rep& r, const size_t sz, constArray a ) const;
// <- \prod_i a[i], return 1 if a.size() ==0,
- Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
+ Rep& reducemul ( Rep& r, const size_t sz, constArray a ) const;
- // <- \sum_i a[i] * b[i]
-// Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
-// Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
+ // <- \sum_i a[i] * b[i]
+// Rep& dotprod ( Rep& r, const size_t sz, constArray a, constArray b ) const;
+// Rep& dotprod ( Rep& r, const int bound, const size_t sz, constArray a, constArray b ) const;
// ----- a -> r: Rep to double
- void i2d ( const size_t sz, double* r, constArray a ) const;
+ void i2d ( const size_t sz, double* r, constArray a ) const;
// ----- a -> r % p: double to Rep % p
- void d2i ( const size_t sz, Array r, const double* a ) const;
+ void d2i ( const size_t sz, Array r, const double* a ) const;
// --- IO methods
std::istream& read ( std::istream& s );
@@ -201,7 +210,9 @@ protected:
static void End();
};
+} // namespace Givaro
-#include "givzpzInt.inl"
+#include "givaro/givzpzInt.inl"
-#endif
+#endif // __GIVARO_zpz_int_H
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpzInt.inl b/src/kernel/zpz/givzpzInt.inl
index e37153f..abe107b 100644
--- a/src/kernel/zpz/givzpzInt.inl
+++ b/src/kernel/zpz/givzpzInt.inl
@@ -1,10 +1,15 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpzInt.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: JG Dumas
-// $Id: givzpzInt.inl,v 1.5 2008-09-18 08:12:55 jgdumas Exp $
+// $Id: givzpzInt.inl,v 1.11 2011-02-02 17:16:43 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_zpz_int_INL
+#define __GIVARO_zpz_int_INL
// Description:
// ---------
@@ -44,11 +49,12 @@
#define __GIVARO_ZPZInteger_N_MULSUB(r,p,a,b,c) { r = a; r*=b; r+=p; r-=c; if (r>=p) r %= p; }
// a*b-c
//#define __GIVARO_ZPZInteger_N_SUBMULIN(r,p,a,b) { r -= (a*b); if (r<0) { r+=p; r = (r<0 ? r % p : r); } }
-#define __GIVARO_ZPZInteger_N_SUBMULIN(r,p,a,b) { r -= (a*b); if (r<0) { r+=p; if (r<0 ) r %= p ; } }
+#define __GIVARO_ZPZInteger_N_SUBMULIN(r,p,a,b) { r -= (a*b); if (r<0) { r+=p; if (r<0 ) r %= p ; if (r<0 ) r += p ; } }
#define __GIVARO_ZPZInteger_N_NEG(r,p,a) { r = ( isZero(a) ? zero : p-a); }
#define __GIVARO_ZPZInteger_N_NEGIN(r,p) { r = ( isZero(r) ? zero : p-r); }
+namespace Givaro {
inline ZpzDom<Integer>::Residu_t ZpzDom<Integer>::residu( ) const
{ return _p; }
@@ -58,15 +64,15 @@ inline ZpzDom<Integer>::Residu_t ZpzDom<Integer>::residu( ) const
// ------------------------- Miscellaneous functions
inline int ZpzDom<Integer>::isZero(const Rep& a) const
-{ return ::isZero(a); }
+{ return ::Givaro::isZero(a); }
inline int ZpzDom<Integer>::isOne(const Rep& a) const
-{ return ::isOne(a); }
+{ return ::Givaro::isOne(a); }
inline size_t ZpzDom<Integer>::length(const Rep& a) const
-{ return ::length(a);}
+{ return ::Givaro::length(a);}
@@ -76,69 +82,69 @@ inline size_t ZpzDom<Integer>::length(const Rep& a) const
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::mul (Rep& r, const Rep& a, const Rep& b) const
-{
+{
__GIVARO_ZPZInteger_N_MUL(r,_p,a,b); return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::sub (Rep& r, const Rep& a, const Rep& b) const
-{
+{
__GIVARO_ZPZInteger_N_SUB(r,_p,a,b); return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::add (Rep& r, const Rep& a, const Rep& b) const
-{
+{
__GIVARO_ZPZInteger_N_ADD(r,_p,a,b); return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::neg (Rep& r, const Rep& a) const
-{
+{
__GIVARO_ZPZInteger_N_NEG(r,_p,a); return r;
-
+
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::negin (Rep& r) const
-{
- __GIVARO_ZPZInteger_N_NEGIN(r,_p);
+{
+ __GIVARO_ZPZInteger_N_NEGIN(r,_p);
return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::inv (Rep& r, const Rep& a) const
-{
-// Rep d, v;
+{
+// Rep d, v;
// d = gcd(a, _p, r, v);
-// if (d == -1) negin(r);
-// return r = (r<0)?r + _p:r;
+// if (d == -1) negin(r);
+// return r = (r<0)?r + _p:r;
// JGD 03.06.2003
- return ::inv(r,a,_p);
+ return ::Givaro::inv(r,a,_p);
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::div (Rep& r, const Rep& a, const Rep& b) const
-{
- Rep ib;
+{
+ Rep ib;
inv(ib, b);
- __GIVARO_ZPZInteger_N_MUL(r,_p,a,ib);
+ __GIVARO_ZPZInteger_N_MUL(r,_p,a,ib);
return r;
}
// -- inline array operations between ZpzDom<Integer>::Rep
inline void ZpzDom<Integer>::mul (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- __GIVARO_ZPZInteger_N_MUL(r[i], _p,a[i], b[i]);
+ for ( size_t i=sz ; --i ; ) {
+ __GIVARO_ZPZInteger_N_MUL(r[i], _p,a[i], b[i]);
}
}
inline void ZpzDom<Integer>::mul (const size_t sz, Array r, constArray a, const Rep& b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_MUL(r[i], _p, a[i], b);
}
}
inline void ZpzDom<Integer>::div (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
- div( r[i], a[i], b[i]);
+ for ( size_t i=sz ; --i ; ) {
+ div( r[i], a[i], b[i]);
}
}
@@ -151,141 +157,158 @@ inline void ZpzDom<Integer>::div (const size_t sz, Array r, constArray a, const
inline void ZpzDom<Integer>::add (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_ADD(r[i], _p, a[i], b[i]);
}
}
inline void ZpzDom<Integer>::add (const size_t sz, Array r, constArray a, const Rep& b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_ADD(r[i], _p, a[i], b);
}
}
inline void ZpzDom<Integer>::sub (const size_t sz, Array r, constArray a, constArray b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_SUB(r[i], _p, a[i], b[i]);
}
}
inline void ZpzDom<Integer>::sub (const size_t sz, Array r, constArray a, const Rep& b) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_SUB(r[i], _p, a[i], b);
}
}
inline void ZpzDom<Integer>::neg (const size_t sz, Array r, constArray a) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_NEG(r[i], _p, a[i]);
}
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::mulin (Rep& r, const Rep& a) const
-{
- __GIVARO_ZPZInteger_N_MULIN(r,_p, a);
+{
+ __GIVARO_ZPZInteger_N_MULIN(r,_p, a);
return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::divin (Rep& r, const Rep& a) const
-{
+{
ZpzDom<Integer>::Rep ia;
inv(ia, a);
return mulin(r, ia);
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::addin (Rep& r, const Rep& a) const
-{
- __GIVARO_ZPZInteger_N_ADDIN(r,_p, a);
+{
+ __GIVARO_ZPZInteger_N_ADDIN(r,_p, a);
return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::subin (Rep& r, const Rep& a) const
-{
- __GIVARO_ZPZInteger_N_SUBIN(r,_p, a);
+{
+ __GIVARO_ZPZInteger_N_SUBIN(r,_p, a);
return r;
}
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::invin (Rep& r) const
-{
-// Rep d, u, v;
+{
+// Rep d, u, v;
// d = gcd(r, _p, u, v);
-// if (d == -1) negin(u);
-// return r = (u<0)?u + _p:u;
+// if (d == -1) negin(u);
+// return r = (u<0)?u + _p:u;
// JGD 03.06.2003
Rep t = r;
- return ::inv(r,t,_p);
+ return ::Givaro::inv(r,t,_p);
}
-inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axpy
- (Rep& r, const Rep& a, const Rep& b, const Rep& c) const
-{
- __GIVARO_ZPZInteger_N_MULADD(r, _p, a, b, c);
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axpy (Rep& r,
+ const Rep& a, const Rep& b, const Rep& c) const
+{
+ __GIVARO_ZPZInteger_N_MULADD(r, _p, a, b, c);
return r;
}
-inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axpyin
- (Rep& r, const Rep& a, const Rep& b) const
-{
- Rep tmp = r;
- __GIVARO_ZPZInteger_N_MULADDIN(tmp, _p, a, b);
- return r = (ZpzDom<Integer>::Rep)tmp;
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axpyin (Rep& r,
+ const Rep& a, const Rep& b) const
+{
+ Rep tmp = r;
+ __GIVARO_ZPZInteger_N_MULADDIN(tmp, _p, a, b);
+ return r = (ZpzDom<Integer>::Rep)tmp;
}
-inline void ZpzDom<Integer>::axpy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
+inline void ZpzDom<Integer>::axpy (const size_t sz, Array r,
+ constArray a, constArray x, constArray y) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_MULADD(r[i], _p, a[i], x[i], y[i]);
}
}
-inline void ZpzDom<Integer>::axpyin
- (const size_t sz, Array r, constArray a, constArray x) const
+inline void ZpzDom<Integer>::axpyin (const size_t sz, Array r,
+ constArray a, constArray x) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
Rep tmp = r[i];
__GIVARO_ZPZInteger_N_MULADDIN(tmp, _p, a[i], x[i]);
r[i] = (ZpzDom<Integer>::Rep)tmp;
}
}
-inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axmy
- (Rep& r, const Rep& a, const Rep& b, const Rep& c) const
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axmy (Rep& r,
+ const Rep& a, const Rep& b, const Rep& c) const
{
__GIVARO_ZPZInteger_N_MULSUB(r, _p, a, b, c);
return r;
}
-// r -= a*b
-inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axmyin
- (Rep& r, const Rep& a, const Rep& b) const
+// r = c - a*b
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::maxpy (Rep& r,
+ const Rep& a, const Rep& b, const Rep& c) const
{
- Rep tmp = r;
+ Rep tmp = c;
__GIVARO_ZPZInteger_N_SUBMULIN(tmp, _p, a, b );
return r = (ZpzDom<Integer>::Rep)tmp;
}
+// r -= a*b
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::maxpyin (Rep& r,
+ const Rep& a, const Rep& b) const
+{
+ __GIVARO_ZPZInteger_N_SUBMULIN(r, _p, a, b );
+ return r;
+// Rep tmp = r;
+// __GIVARO_ZPZInteger_N_SUBMULIN(tmp, _p, a, b );
+// return r = (ZpzDom<Integer>::Rep)tmp;
+}
+// r = a*b - r
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::axmyin (Rep& r,
+ const Rep& a, const Rep& b) const
+{
+ maxpyin(r,a,b);
+ return negin(r);
+}
-inline void ZpzDom<Integer>::axmy
- (const size_t sz, Array r, constArray a, constArray x, constArray y) const
+inline void ZpzDom<Integer>::axmy (const size_t sz, Array r,
+ constArray a, constArray x, constArray y) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
__GIVARO_ZPZInteger_N_MULSUB(r[i], _p, a[i], x[i], y[i]);
}
}
// r -= a*b
-inline void ZpzDom<Integer>::axmyin
- (const size_t sz, Array r, constArray a, constArray x) const
+inline void ZpzDom<Integer>::maxpyin (const size_t sz, Array r,
+ constArray a, constArray x) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
Rep tmp = r[i];
__GIVARO_ZPZInteger_N_SUBMULIN(tmp, _p, a[i], x[i]);
r[i] = (ZpzDom<Integer>::Rep)tmp;
@@ -316,7 +339,7 @@ inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init ( Rep& r, const float a ) c
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init ( Rep& r, const unsigned long a ) const
-{
+{
r = Integer(a);
if ( r >= _p ) r %= _p;
return r ;
@@ -324,7 +347,7 @@ inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init ( Rep& r, const unsigned lo
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init ( Rep& r, const long a ) const
{
- int sign;
+ int sign;
if (a <0) { sign =-1; r = Integer(-a);}
else { r = Integer(a); sign =1; }
if (r >=_p) r %= _p;
@@ -334,7 +357,7 @@ inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init ( Rep& r, const long a ) co
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init ( Rep& r, const Integer& a ) const
{
- int sign;
+ int sign;
if (a <0) { sign =-1; r = Integer(-a);}
else { r = Integer(a); sign =1; }
if (r >=_p) r %= _p;
@@ -347,10 +370,10 @@ inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init( Rep& a, const int i) const {
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::init( Rep& a, const unsigned int i) const { return init(a,(unsigned long)i); }
-inline void ZpzDom<Integer>::assign
+inline void ZpzDom<Integer>::assign
( const size_t sz, Array r, constArray a ) const
{
- for (register size_t i=sz-1; i!=0; --i) {
+ for ( size_t i=sz ; --i ; ) {
if (a[i] <ZpzDom<Integer>::zero) {
r[i] = a[i] + _p;
if (r[i] <ZpzDom<Integer>::zero) r[i] %= _p;
@@ -374,19 +397,19 @@ inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::assign ( Rep& r, const short a )
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::assign ( Rep& r, const unsigned long a ) const
{ return r = Rep(a); }
-inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::assign
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::assign
( Rep& r, const unsigned short a ) const
{ return r = Rep(a); }
-inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::assign
+inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::assign
( Rep& r, const Rep& a ) const
{ return r=a; }
-inline void ZpzDom<Integer>::init
+inline void ZpzDom<Integer>::init
( const size_t sz, Array r, constArray a ) const
{
- for (register size_t i=sz-1; i!=0; --i)
+ for ( size_t i=sz ; --i ; )
r[i] = a[i];
}
@@ -408,7 +431,7 @@ template< class RandIter >
inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::random(RandIter& g, Rep& a, long b) const {
Integer::random(a,b);
return a %= _p;
-
+
}
template< class RandIter >
@@ -430,28 +453,28 @@ inline ZpzDom<Integer>::Rep& ZpzDom<Integer>::nonzerorandom(RandIter& g, Rep& a
}
- // a -> r: int32 to double
-inline void
+ // a -> r: int32_t to double
+inline void
ZpzDom<Integer>::i2d ( const size_t sz, double* r, constArray a ) const
{
for (size_t i=0; i<sz; ++i) r[i] = a[i];
}
- // a -> r: double to int32
-inline void
+ // a -> r: double to int32_t
+inline void
ZpzDom<Integer>::d2i ( const size_t sz, Array r, const double* a ) const
{
union d_2_l {
double d;
- int32 r[2];
+ int32_t r[2];
};
// static const double offset = 4503599627370496.0; // 2^52
double offset = 4503599627370496.0; // 2^52
for (size_t i=0; i<sz; ++i)
{
- register d_2_l tmp;
+ d_2_l tmp;
// - normalization: put fractional part at the end of the representation
- tmp.d = a[i] + offset;
+ tmp.d = a[i] + offset;
r[i] = tmp.r[1];
if (r[i] <_p) r[i] %= _p;
}
@@ -463,9 +486,9 @@ inline void
// -- Input: (z, <_p>)
-inline std::istream& ZpzDom<Integer>::read (std::istream& s)
+inline std::istream& ZpzDom<Integer>::read (std::istream& s)
{
- char ch;
+ char ch;
s >> std::ws >> ch;
if (ch != '(')
// GivError::throw_error( GivBadFormat("ZpzDom<Integer>::read: syntax error: no '('"));
@@ -507,3 +530,8 @@ inline std::ostream& ZpzDom<Integer>::write (std::ostream& s, const Rep& a) cons
{
return s << a;
}
+
+} // namespace Givaro
+
+#endif // __GIVARO_zpz_int_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/kernel/zpz/givzpztypes.h b/src/kernel/zpz/givzpztypes.h
new file mode 100644
index 0000000..35dbc7f
--- /dev/null
+++ b/src/kernel/zpz/givzpztypes.h
@@ -0,0 +1,42 @@
+// ==========================================================================
+// $Source: /var/lib/cvs/Givaro/src/kernel/zpz/givzpztypes.h,v $
+// Copyright(c)'1994-2011 by The Givaro group
+// Time-stamp: <02 Feb 11 14:36:21 Jean-Guillaume.Dumas at imag.fr> //
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Authors: JG Dumas
+// ==========================================================================
+
+/*! @file zpz/givzpztypes.h
+ * @ingroup zpz
+ * @brief Family of types for arithmetic over Zpz.
+ */
+
+#ifndef __GIVARO_zpztypes_H
+#define __GIVARO_zpztypes_H
+
+// ==========================================================================
+// --
+// ==========================================================================
+#include <givaro/givconfig.h>
+
+namespace Givaro {
+
+template<class TAG> class ZpzDom;
+
+// -- Tag for arithmetic:
+struct Std16 { typedef int16_t type;}; // -- standard arithmetic over 16bits representations.
+struct Std32 { typedef int32_t type;}; // -- standard arithmetic over 32bits representations.
+struct Unsigned32 {typedef uint32_t type;}; // -- standard arithmetic over 32bits representations.
+
+struct Log16 { typedef int16_t type;}; // -- log arithmetic over 16bits representations.
+
+#ifndef __DONOTUSE_Givaro_SIXTYFOUR__
+struct Std64 { typedef int64_t type;}; // -- standard arithmetic over 64bits representations.
+#endif
+
+}
+
+#endif // __GIVARO_zpztypes_H
diff --git a/src/library/Makefile.am b/src/library/Makefile.am
index 3ae6756..289b99c 100644
--- a/src/library/Makefile.am
+++ b/src/library/Makefile.am
@@ -1,4 +1,10 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+AM_CPPFLAGS=-I$(top_srcdir)
SUBDIRS=poly1 tools vector matrix
diff --git a/src/library/Makefile.in b/src/library/Makefile.in
index 9d86c97..8130201 100644
--- a/src/library/Makefile.in
+++ b/src/library/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -13,6 +14,12 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -36,12 +43,21 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -65,26 +81,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -94,40 +111,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -167,9 +194,10 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir)
SUBDIRS = poly1 tools vector matrix
all: all-recursive
@@ -178,14 +206,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/library/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/library/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/library/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/library/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -217,7 +245,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -242,7 +270,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -285,7 +313,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -426,6 +454,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -434,18 +464,28 @@ install-data-am:
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am:
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
diff --git a/src/library/matrix/Makefile.am b/src/library/matrix/Makefile.am
index b53adbc..e3ed054 100644
--- a/src/library/matrix/Makefile.am
+++ b/src/library/matrix/Makefile.am
@@ -1,15 +1,22 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/library/vector
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
- givmatdense.h \
- givmatrix.h \
- givmatsparse.h \
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/library/vector
+
+pkginclude_HEADERS= \
+ givmatdense.h \
+ givmatrix.h \
+ givmatsparse.h \
givmatstoragedense.h \
- givmatsparseops.inl \
+ givmatsparseops.inl \
givmatstoragesparse.h \
- givmatdenseops.inl \
+ givmatdenseops.inl \
givmatstorage.h
noinst_LTLIBRARIES=libgivmatrix.la
diff --git a/src/library/matrix/Makefile.in b/src/library/matrix/Makefile.in
index e29e600..b2d06dd 100644
--- a/src/library/matrix/Makefile.in
+++ b/src/library/matrix/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -50,8 +64,8 @@ libgivmatrix_la_LIBADD =
am_libgivmatrix_la_OBJECTS = givmatrix.lo
libgivmatrix_la_OBJECTS = $(am_libgivmatrix_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -83,26 +97,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -112,40 +127,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -185,18 +210,22 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/library/vector
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/library/vector
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
- givmatdense.h \
- givmatrix.h \
- givmatsparse.h \
+ givmatdense.h \
+ givmatrix.h \
+ givmatsparse.h \
givmatstoragedense.h \
- givmatsparseops.inl \
+ givmatsparseops.inl \
givmatstoragesparse.h \
- givmatdenseops.inl \
+ givmatdenseops.inl \
givmatstorage.h
noinst_LTLIBRARIES = libgivmatrix.la
@@ -209,14 +238,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/library/matrix/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/library/matrix/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/library/matrix/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/library/matrix/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -252,28 +281,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givmatrix.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -303,7 +318,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -408,7 +423,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -419,6 +433,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -427,22 +443,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/library/matrix/givmatdense.h b/src/library/matrix/givmatdense.h
index bde1cd5..886b9ca 100644
--- a/src/library/matrix/givmatdense.h
+++ b/src/library/matrix/givmatdense.h
@@ -1,19 +1,29 @@
-#ifndef _GIV_MATRIX_DENSE_H_
-#define _GIV_MATRIX_DENSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatdense.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatdense.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: givmatdense.h,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// of matrix by blocks.
+//
+
+#error "dead code"
+
+#ifndef _GIV_MATRIX_DENSE_H_
+#define _GIV_MATRIX_DENSE_H_
#include "givaro/givmatrix.h"
#include "givaro/givmatstoragedense.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// --
// -- Matrix class: dense matrix
// --
@@ -34,7 +44,7 @@ public:
// -- Self_t
typedef MatrixDom<Domain, Dense> Self_t;
- //-- Dstor:
+ //-- Dstor:
~MatrixDom() {}
//-- Default cstor:
@@ -54,13 +64,13 @@ public:
{ r.allocate(0); }
//-- access operators:
- Type_t& operator() (Rep& r, Indice_t i, Indice_t j) const
+ Type_t& operator() (Rep& r, Indice_t i, Indice_t j) const
{ return r(i,j); }
- const Type_t& operator() (const Rep& r, Indice_t i, Indice_t j) const
+ const Type_t& operator() (const Rep& r, Indice_t i, Indice_t j) const
{ return r(i,j); }
//-- Assignment operator: physical copy
- void assign (Rep& r, const Rep& a)
+ void assign (Rep& r, const Rep& a)
{ r.copy(a); }
// -- Comparaizon
@@ -84,14 +94,14 @@ public:
void neg ( Rep& res, const Rep& u ) const;
// --- Mul Vect:
- void mul ( typename VectorDom<Domain,Dense>::Rep& res, const Rep& M,
+ void mul ( typename VectorDom<Domain,Dense>::Rep& res, const Rep& M,
const VectorDom<Domain,Dense>& VD,
const typename VectorDom<Domain,Dense>::Rep& u ) const;
- void multrans ( typename VectorDom<Domain,Dense>::Rep& res, const Rep& M,
+ void multrans ( typename VectorDom<Domain,Dense>::Rep& res, const Rep& M,
const VectorDom<Domain,Dense>& VS,
const typename VectorDom<Domain,Dense>::Rep& u ) const;
- // -- axpy operations K-Space:
+ // -- axpy operations K-Space:
// r <- a*x+y
void axpy ( Rep& res, const Type_t& a, const Rep& x, const Rep& y )const;
// r <- r+a*x
@@ -101,10 +111,10 @@ public:
// r <- r-a*x
void axmyin( Rep& res, const Type_t& a, const Type_t& x ) const;
- // a*A*X + bY
- void axpy ( Rep& res, const Type_t& a, const Rep& A, const Rep& X,
+ // a*A*X + bY
+ void axpy ( Rep& res, const Type_t& a, const Rep& A, const Rep& X,
const Type_t& b, const Rep& Y ) const;
- // A*X + Y
+ // A*X + Y
void axpy ( Rep& res, const Rep& A, const Rep& X, const Rep& Y ) const;
// -- Element wise operation:
@@ -139,4 +149,6 @@ public:
ostream& write( ostream& s, const Rep& r ) const;
};
+} // Givaro
+
#endif
diff --git a/src/library/matrix/givmatdenseops.inl b/src/library/matrix/givmatdenseops.inl
index 834ec0d..b4fedd5 100644
--- a/src/library/matrix/givmatdenseops.inl
+++ b/src/library/matrix/givmatdenseops.inl
@@ -1,516 +1,526 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatdenseops.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatdenseops.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givmatdenseops.inl,v 1.3 2011-01-19 18:29:09 bboyer Exp $
// ==========================================================================
-template<class Domain>
+#error "this looks very much like dead code"
+
+namespace Givaro {
+#warning "this file will probably not compile"
+
+template<class Domain>
int MatrixDom<Domain,Dense>::areEqual ( const Rep& A, const Rep& B ) const
{
- if (ncol(A) != ncol(B)) return 0;
- if (nrow(A) != nrow(B)) return 0;
- return _supportdomain.areEqual(A,B);
+ if (ncol(A) != ncol(B)) return 0;
+ if (nrow(A) != nrow(B)) return 0;
+ return _supportdomain.areEqual(A,B);
}
template<class Domain>
int MatrixDom<Domain,Dense>::areNEqual ( const Rep& A, const Rep& B ) const
{
- return !areEqual(A,B);
+ return !areEqual(A,B);
}
template<class Domain>
int MatrixDom<Domain,Dense>::iszero ( const Rep& A ) const
{
- return _supportdoamin.iszero(A);
+ return _supportdoamin.iszero(A);
}
- // res <- A + B; aliases of operands are allowed
-template<class Domain>
+// res <- A + B; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::add( Rep& R, const Rep& A, const Rep& B) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)) && (ncol(A) == ncol(B)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)) && (nrow(A) == nrow(B)), "Bad size");
- _supportdomain.add(R,A,B);
+ GIVARO_ASSERT((ncol(R) == ncol(A)) && (ncol(A) == ncol(B)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)) && (nrow(A) == nrow(B)), "Bad size");
+ _supportdomain.add(R,A,B);
}
- // res <- res + A; aliases of operands are allowed
-template<class Domain>
+// res <- res + A; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::addin( Rep& R, const Rep& A ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- _supportdomain.addin(R,A);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ _supportdomain.addin(R,A);
}
- // res <- A + val; aliases of operands are allowed
-template<class Domain>
+// res <- A + val; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::add( Rep& R, const Rep& A, const Type_t& val ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- long i;
- size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
- for (i=min; --i>=0; ) _domain.add(R(i,i), A(i,i), val);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ long i;
+ size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
+ for (i=min; --i>=0; ) _domain.add(R(i,i), A(i,i), val);
}
- // res <- val + A; aliases of operands are allowed
-template<class Domain>
+// res <- val + A; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::add( Rep& R, const Type_t& val, const Rep& A) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- long i;
- size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
- for (i=min; --i>=0; ) _domain.add(R(i,i), A(i,i), val);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ long i;
+ size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
+ for (i=min; --i>=0; ) _domain.add(R(i,i), A(i,i), val);
}
- // res <- A - B; aliases of operands are allowed
-template<class Domain>
+// res <- A - B; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::sub( Rep& R, const Rep& A, const Rep& B) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)) && (ncol(A) == ncol(B)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)) && (nrow(A) == nrow(B)), "Bad size");
- _supportdomain.sub(R,A,B);
+ GIVARO_ASSERT((ncol(R) == ncol(A)) && (ncol(A) == ncol(B)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)) && (nrow(A) == nrow(B)), "Bad size");
+ _supportdomain.sub(R,A,B);
}
- // res <- res - A; aliases of operands are allowed
-template<class Domain>
+// res <- res - A; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::subin( Rep& R, const Rep& A ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- _supportdomain.subin(R,A);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ _supportdomain.subin(R,A);
}
- // res <- res - A; aliases of operands are allowed
-template<class Domain>
+// res <- res - A; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::sub( Rep& R, const Rep& A, const Type_t& val ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- long i;
- size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
- for (i=min; --i>=0; ) _domain.sub(R(i,i), A(i,i), val);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ long i;
+ size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
+ for (i=min; --i>=0; ) _domain.sub(R(i,i), A(i,i), val);
}
- // res <- res - A; aliases of operands are allowed
-template<class Domain>
+// res <- res - A; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::sub( Rep& R, const Type_t& val, const Rep& A) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- long i;
- size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
- for (i=min; --i>=0; ) _domain.sub(R(i,i), val, A(i,i));
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ long i;
+ size_t min = (ncol(R) < nrow(R) ? ncol(R) : nrow(R));
+ for (i=min; --i>=0; ) _domain.sub(R(i,i), val, A(i,i));
};
- // res <- - A; aliases of operands are allowed
-template<class Domain>
+// res <- - A; aliases of operands are allowed
+template<class Domain>
void MatrixDom<Domain,Dense>::neg( Rep& R, const Rep& A) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- _supportdomain.neg(R,A);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ _supportdomain.neg(R,A);
}
-template<class Domain>
+template<class Domain>
void MatrixDom<Domain,Dense>::negin( Rep& R ) const
{
- _supportdomain.negin(R);
+ _supportdomain.negin(R);
}
- // R <- A * B, R cannot be an alias for A or B
+// R <- A * B, R cannot be an alias for A or B
template<class Domain>
void MatrixDom<Domain,Dense>::mul( Rep& A, const Rep& B, const Rep& C) const
{
- GIVARO_ASSERT((ncol(A) == ncol(B)) && (ncol(B) == ncol(C)), "Bad size");
- GIVARO_ASSERT((nrow(A) == nrow(B)) && (nrow(B) == nrow(C)), "Bad size");
- Indice_t k, i, j;
- int startBi, startCj, startAi;
- Indice_t nrA = nrow(A);
- Indice_t ncA = ncol(A);
- Indice_t ncB = ncol(B);
-
- // -- the algorithm used the fact that matrices are stored by row
- Type_t tmp;
- for (i=0; i < nrA; ++i)
- {
- startAi = i*ncA;
- for (j=0; j < ncA; ++j, ++startAi)
- {
- startBi = i*ncB; startCj = j;
- _domain.assign(tmp, _domain.zero);
- for (k=0; k<ncB; ++k, ++startBi, startCj+=ncA) // ncA = ncC
- _domain.axpy(tmp, B[startBi], C[startCj], tmp);
- _domain.assign( A[startAi], tmp );
- }
- }
+ GIVARO_ASSERT((ncol(A) == ncol(B)) && (ncol(B) == ncol(C)), "Bad size");
+ GIVARO_ASSERT((nrow(A) == nrow(B)) && (nrow(B) == nrow(C)), "Bad size");
+ Indice_t k, i, j;
+ int startBi, startCj, startAi;
+ Indice_t nrA = nrow(A);
+ Indice_t ncA = ncol(A);
+ Indice_t ncB = ncol(B);
+
+ // -- the algorithm used the fact that matrices are stored by row
+ Type_t tmp;
+ for (i=0; i < nrA; ++i)
+ {
+ startAi = i*ncA;
+ for (j=0; j < ncA; ++j, ++startAi)
+ {
+ startBi = i*ncB; startCj = j;
+ _domain.assign(tmp, _domain.zero);
+ for (k=0; k<ncB; ++k, ++startBi, startCj+=ncA) // ncA = ncC
+ _domain.axpy(tmp, B[startBi], C[startCj], tmp);
+ _domain.assign( A[startAi], tmp );
+ }
+ }
}
template<class Domain>
void MatrixDom<Domain,Dense>::mulin
- ( Rep& R, const Type_t& val) const
+( Rep& R, const Type_t& val) const
{
- _supportdomain.mulin(R, val);
+ _supportdomain.mulin(R, val);
}
template<class Domain>
-void MatrixDom<Domain,Dense>::mul
- ( typename VectorDom<Domain,Dense>::Rep& res,
- const Rep& M,
- const VectorDom<Domain,Dense>& VD,
- const typename VectorDom<Domain,Dense>::Rep& u ) const
-{
- GIVARO_ASSERT( (nrow(M) == VD.dim(res)), "Bad size");
- GIVARO_ASSERT( (ncol(M) == VD.dim(u)), "Bad size");
- Indice_t k, i, j;
- int startMi;
- Indice_t nrM = nrow(M);
- Indice_t ncM = ncol(M);
-
- // -- the algorithm used the fact that matrices are stored by row
- for (i=0; i < nrM; ++i)
- {
- _domain.assign(res[i], _domain.zero);
- startMi = i*ncM;
- for (j=0; j < ncM; ++j, ++startMi)
- _domain.axpyin(res[i], M[startMi], u[j]);
- }
+void MatrixDom<Domain,Dense>::mul
+( typename VectorDom<Domain,Dense>::Rep& res,
+ const Rep& M,
+ const VectorDom<Domain,Dense>& VD,
+ const typename VectorDom<Domain,Dense>::Rep& u ) const
+{
+ GIVARO_ASSERT( (nrow(M) == VD.dim(res)), "Bad size");
+ GIVARO_ASSERT( (ncol(M) == VD.dim(u)), "Bad size");
+ Indice_t k, i, j;
+ int startMi;
+ Indice_t nrM = nrow(M);
+ Indice_t ncM = ncol(M);
+
+ // -- the algorithm used the fact that matrices are stored by row
+ for (i=0; i < nrM; ++i)
+ {
+ _domain.assign(res[i], _domain.zero);
+ startMi = i*ncM;
+ for (j=0; j < ncM; ++j, ++startMi)
+ _domain.axpyin(res[i], M[startMi], u[j]);
+ }
}
- // res <- tr(u) * tr(A)
+// res <- tr(u) * tr(A)
template<class Domain>
void MatrixDom<Domain,Dense>::multrans
- ( typename VectorDom<Domain,Dense>::Rep& res,
- const Rep& M,
- const VectorDom<Domain,Dense>& VD,
- const typename VectorDom<Domain,Dense>::Rep& u ) const
-{
- GIVARO_ASSERT( (nrow(M) == VD.dim(u)), "Bad size");
- GIVARO_ASSERT( (ncol(M) == VD.dim(res)), "Bad size");
- Indice_t k, i, j;
- int startMi;
- Indice_t nrM = nrow(M);
- Indice_t ncM = ncol(M);
-
- // -- the algorithm used the fact that matrices are stored by row
- for (j=0; j < ncM; ++j)
- _domain.assign(res[j], _domain.zero);
- for (i=0; i < nrM; ++i)
- {
- startMi = i*ncM;
- for (j=0; j < ncM; ++j, ++startMi)
- _domain.axpyin(res[j], u[i], M[startMi]);
- }
+( typename VectorDom<Domain,Dense>::Rep& res,
+ const Rep& M,
+ const VectorDom<Domain,Dense>& VD,
+ const typename VectorDom<Domain,Dense>::Rep& u ) const
+{
+ GIVARO_ASSERT( (nrow(M) == VD.dim(u)), "Bad size");
+ GIVARO_ASSERT( (ncol(M) == VD.dim(res)), "Bad size");
+ Indice_t k, i, j;
+ int startMi;
+ Indice_t nrM = nrow(M);
+ Indice_t ncM = ncol(M);
+
+ // -- the algorithm used the fact that matrices are stored by row
+ for (j=0; j < ncM; ++j)
+ _domain.assign(res[j], _domain.zero);
+ for (i=0; i < nrM; ++i)
+ {
+ startMi = i*ncM;
+ for (j=0; j < ncM; ++j, ++startMi)
+ _domain.axpyin(res[j], u[i], M[startMi]);
+ }
}
template<class Domain>
void MatrixDom<Domain,Dense>::mul
- ( Rep& R, const Type_t& val, const Rep& A) const
+( Rep& R, const Type_t& val, const Rep& A) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- _supportdomain.mul(R, val, A);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ _supportdomain.mul(R, val, A);
}
template<class Domain>
void MatrixDom<Domain,Dense>::mul
- ( Rep& R, const Rep& A, const Type_t& val) const
+( Rep& R, const Rep& A, const Type_t& val) const
{
- GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
- _supportdomain.mul(R, A, val);
+ GIVARO_ASSERT((ncol(R) == ncol(A)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(A)), "Bad size");
+ _supportdomain.mul(R, A, val);
}
- // r <- a*x+y
+// r <- a*x+y
template<class Domain>
-void MatrixDom<Domain,Dense>::axpy
- ( Rep& R, const Type_t& a, const Rep& X, const Rep& Y ) const
+void MatrixDom<Domain,Dense>::axpy
+( Rep& R, const Type_t& a, const Rep& X, const Rep& Y ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(X)) && (ncol(X) == ncol(Y)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(X)) && (nrow(X) == nrow(Y)), "Bad size");
- _supportdomain.axpy(R, a, X, Y);
+ GIVARO_ASSERT((ncol(R) == ncol(X)) && (ncol(X) == ncol(Y)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(X)) && (nrow(X) == nrow(Y)), "Bad size");
+ _supportdomain.axpy(R, a, X, Y);
}
- // r <- r+a*x
+// r <- r+a*x
template<class Domain>
void MatrixDom<Domain,Dense>::axpyin
- ( Rep& R, const Type_t& a, const Rep& X ) const
+( Rep& R, const Type_t& a, const Rep& X ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(X)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(X)), "Bad size");
- _supportdomain.axpyin(R, a, X);
+ GIVARO_ASSERT((ncol(R) == ncol(X)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(X)), "Bad size");
+ _supportdomain.axpyin(R, a, X);
}
- // r <- y-a*x
+// r <- a*x-y
template<class Domain>
-void MatrixDom<Domain,Dense>::axmy
- ( Rep& R, const Type_t& a, const Rep& X, const Rep& Y ) const
+void MatrixDom<Domain,Dense>::axmy ( Rep& R,
+ const Type_t& a, const Rep& X, const Rep& Y ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(X)) && (ncol(X) == ncol(Y)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(X)) && (nrow(X) == nrow(Y)), "Bad size");
- _supportdomain.axmy(R, a, X, Y);
+ GIVARO_ASSERT((ncol(R) == ncol(X)) && (ncol(X) == ncol(Y)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(X)) && (nrow(X) == nrow(Y)), "Bad size");
+ _supportdomain.axmy(R, a, X, Y);
}
- // r <- r-a*x
+// r <- a*x-r
template<class Domain>
-void MatrixDom<Domain,Dense>::axmyin
- ( Rep& R, const Type_t& a, const Type_t& X ) const
+void MatrixDom<Domain,Dense>::axmyin ( Rep& R,
+ const Type_t& a, const Type_t& X ) const
{
- GIVARO_ASSERT((ncol(R) == ncol(X)), "Bad size");
- GIVARO_ASSERT((nrow(R) == nrow(X)), "Bad size");
- _supportdomain.axmy(R, a, X);
+ GIVARO_ASSERT((ncol(R) == ncol(X)), "Bad size");
+ GIVARO_ASSERT((nrow(R) == nrow(X)), "Bad size");
+ _supportdomain.axmy(R, a, X);
}
- // -- axpy operations:
- // A*X + Y
+// -- axpy operations:
+// A*X + Y
template<class Domain>
-void MatrixDom<Domain,Dense>::axpy
- ( Rep& R, const Rep& A, const Rep& X, const Rep& Y ) const
-{
- int k, i, j;
- int startAi, startXj, startRi;
- int nrR = nrow(R);
- int ncR = ncol(R);
- int ncA = ncol(A);
-
- // -- the algorithm used the fact that matrices are stored by row
- Type_t tmp;
- for (i=0; i < nrR; ++i)
- {
- startRi = i*ncR;
- for (j=0; j < ncR; ++j, ++startRi)
- {
- startAi = i*ncA; startXj = j;
- _domain.assign(tmp, _domain.zero);
- for (k=0; k<ncA; ++k, ++startAi, startXj+=ncR) // ncR = ncX
- _domain.axpy(tmp, A[startAi], X[startXj], tmp);
- _domain.add( R[startRi], tmp, Y[startRi] );
- }
- }
+void MatrixDom<Domain,Dense>::axpy
+( Rep& R, const Rep& A, const Rep& X, const Rep& Y ) const
+{
+ int k, i, j;
+ int startAi, startXj, startRi;
+ int nrR = nrow(R);
+ int ncR = ncol(R);
+ int ncA = ncol(A);
+
+ // -- the algorithm used the fact that matrices are stored by row
+ Type_t tmp;
+ for (i=0; i < nrR; ++i)
+ {
+ startRi = i*ncR;
+ for (j=0; j < ncR; ++j, ++startRi)
+ {
+ startAi = i*ncA; startXj = j;
+ _domain.assign(tmp, _domain.zero);
+ for (k=0; k<ncA; ++k, ++startAi, startXj+=ncR) // ncR = ncX
+ _domain.axpy(tmp, A[startAi], X[startXj], tmp);
+ _domain.add( R[startRi], tmp, Y[startRi] );
+ }
+ }
}
- // a*A*X - b*Y
+// a*A*X - b*Y
template<class Domain>
-void MatrixDom<Domain,Dense>::axpy
- ( Rep& res, const Type_t& a, const Rep& A,
- const Rep& X, const Type_t& b, const Rep& Y ) const
-{
- Indice_t k, i, j;
- int startAi, startXj, startRi;
- Indice_t nrR = nrow(R);
- Indice_t ncR = ncol(R);
- Indice_t ncA = ncol(A);
-
- // -- the algorithm used the fact that matrices are stored by row
- Type_t tmp;
- for (i=0; i < nrR; ++i)
- {
- startRi = i*ncR;
- for (j=0; j < ncR; ++j, ++startRi)
- {
- startAi = i*ncA; startXj = j;
- _domain.assign(tmp, _domain.zero);
- for (k=0; k<ncA; ++k, ++startAi, startXj+=ncR) // ncR = ncX
- _domain.axpy(tmp, A[startAi], X[startXj], tmp);
- _domain.mul( tmp, a, tmp );
- _domain.axpy( R[startRi], b, Y[startRi], tmp);
- }
- }
+void MatrixDom<Domain,Dense>::axpy
+( Rep& res, const Type_t& a, const Rep& A,
+ const Rep& X, const Type_t& b, const Rep& Y ) const
+{
+ Indice_t k, i, j;
+ int startAi, startXj, startRi;
+ Indice_t nrR = nrow(R);
+ Indice_t ncR = ncol(R);
+ Indice_t ncA = ncol(A);
+
+ // -- the algorithm used the fact that matrices are stored by row
+ Type_t tmp;
+ for (i=0; i < nrR; ++i)
+ {
+ startRi = i*ncR;
+ for (j=0; j < ncR; ++j, ++startRi)
+ {
+ startAi = i*ncA; startXj = j;
+ _domain.assign(tmp, _domain.zero);
+ for (k=0; k<ncA; ++k, ++startAi, startXj+=ncR) // ncR = ncX
+ _domain.axpy(tmp, A[startAi], X[startXj], tmp);
+ _domain.mul( tmp, a, tmp );
+ _domain.axpy( R[startRi], b, Y[startRi], tmp);
+ }
+ }
}
- // Map: used for constant operation !, not that OP
+// Map: used for constant operation !, not that OP
template<class Domain>
template<class OP>
void MatrixDom<Domain,Dense>::map
- ( Rep& R, OP& op ) const
+( Rep& R, OP& op ) const
{
- Indice_t i;
- Indice_t max = _supportdomain.dim(R);
- for (i=max; --i>=0; ) op(R[i]);
+ Indice_t i;
+ Indice_t max = _supportdomain.dim(R);
+ for (i=max; --i>=0; ) op(R[i]);
}
template<class Domain>
template<class OP>
void MatrixDom<Domain,Dense>::map
- ( Rep& R, OP& op, const Rep& A ) const
+( Rep& R, OP& op, const Rep& A ) const
{
- Indice_t i;
- Indice_t max = _supportdomain.dim(R);
- for (i=max; --i>=0; ) op(R[i], A[i]);
+ Indice_t i;
+ Indice_t max = _supportdomain.dim(R);
+ for (i=max; --i>=0; ) op(R[i], A[i]);
}
template<class Domain>
template<class OP>
void MatrixDom<Domain,Dense>::map
- ( Rep& R, OP& op, const Rep& A, const Rep& B ) const
+( Rep& R, OP& op, const Rep& A, const Rep& B ) const
{
- Indice_t i;
- Indice_t max = _supportdomain.dim(R);
- for (i=max; --i>=0; ) op(R[i], A[i], B[i]);
+ Indice_t i;
+ Indice_t max = _supportdomain.dim(R);
+ for (i=max; --i>=0; ) op(R[i], A[i], B[i]);
}
template <class Domain>
inline ostream& MatrixDom<Domain,Dense>::write( ostream& sout ) const
{
- return _domain.write(sout << '(') << ",Dense)";
+ return _domain.write(sout << '(') << ",Dense)";
}
-// -- read the domain
+// -- read the domain
template<class Domain>
istream& MatrixDom<Domain,Dense>::read( istream& sin )
{
- char ch;
- sin >> std::ws >> ch;
- if (ch != '(')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '('"));
-
- // -- read subdomain:
- _domain.read(sin);
-
- // -- read ,
- sin >> std::ws >> ch;
- if (ch != ',')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
-
- // -- read dense:
- char name[6];
- sin >> std::ws; sin.read(name, 5); name[5] = (char)0;
- if (strcmp(name, "Dense") !=0)
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no 'Dense'"));
-
- // -- read )
- sin >> std::ws >> ch;
- if (ch != ')')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ')'"));
- return sin;
+ char ch;
+ sin >> std::ws >> ch;
+ if (ch != '(')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '('"));
+
+ // -- read subdomain:
+ _domain.read(sin);
+
+ // -- read ,
+ sin >> std::ws >> ch;
+ if (ch != ',')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
+
+ // -- read dense:
+ char name[6];
+ sin >> std::ws; sin.read(name, 5); name[5] = (char)0;
+ if (strcmp(name, "Dense") !=0)
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no 'Dense'"));
+
+ // -- read )
+ sin >> std::ws >> ch;
+ if (ch != ')')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ')'"));
+ return sin;
}
template <class Domain>
ostream& MatrixDom<Domain,Dense>::write( ostream& sout, const Rep& A) const
{
- int i,j;
- sout << '[' << nrow(A) << ',' << ncol(A) << ",[";
- for (i=0; i < nrow(A); i++)
- {
- sout << "[";
- for (j=0; j < ncol(A); j++)
- {
- _domain.write(sout,A(i,j));
- if (j < ncol(A) - 1) sout << ",";
- }
- if (i < nrow(A) - 1) sout << "]," << endl;
- else sout << "]";
- }
- return sout << "]]";
+ int i,j;
+ sout << '[' << nrow(A) << ',' << ncol(A) << ",[";
+ for (i=0; i < nrow(A); i++)
+ {
+ sout << "[";
+ for (j=0; j < ncol(A); j++)
+ {
+ _domain.write(sout,A(i,j));
+ if (j < ncol(A) - 1) sout << ",";
+ }
+ if (i < nrow(A) - 1) sout << "]," << endl;
+ else sout << "]";
+ }
+ return sout << "]]";
}
template <class Domain>
istream& MatrixDom<Domain,Dense>::read (istream& sin, Rep& R) const
{
- char ch;
- Indice_t i,j;
- long nr,nc;
-
- // -- read [
- sin >> std::ws >> ch;
- if (ch != '[') {
- cerr << "Read: " << ch << endl;
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '['"));
- }
-
- // -- read dimensions: nr , nc
- // -- read nrow
- sin >> std::ws >> nr;
- if (nr < 0)
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: bad row dimension"));
-
- // -- read ,
- sin >> std::ws >> ch;
- if (ch != ',')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
-
- // -- read ncol
- sin >> std::ws >> nc;
- if (nc < 0)
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: bad col dimension"));
-
- // -- read ,
- sin >> std::ws >> ch;
- if (ch != ',')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
-
- // -- read [
- sin >> std::ws >> ch;
- if (ch != '[')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '[' before entries"));
-
- // -- Read the matrix:
- R.reallocate( nr, nc );
- for (i=0; i<nr; ++i) {
- if (i != 0) {
- sin >> std::ws >> ch;
- if (ch != ',')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
- }
-
-cout << "Row: " << i << endl;
- // -- read [
- sin >> std::ws >> ch;
- if (ch != '[')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '['"));
-
- // read nc-1 times: val ,
- for (j=0; j< nc-1; ++j) {
-cout << "Read: i=" << i << ", j=" << j << endl;
- _domain.read(sin, R(i,j));
- // -- read [
- sin >> std::ws >> ch;
- if (ch != ',')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
- }
-
- // read 1 : val ]
-cout << "Read: i=" << i << ", j=" << j << endl;
- _domain.read(sin, R(i,j));
- sin >> std::ws >> ch;
- if (ch != ']')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ']'"));
- }
-
- // -- read ] ]
- sin >> std::ws >> ch;
- if (ch != ']')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ']'"));
- sin >> std::ws >> ch;
- if (ch != ']')
- GivError::throw_error(
- GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ']'"));
- return sin;
+ char ch;
+ Indice_t i,j;
+ long nr,nc;
+
+ // -- read [
+ sin >> std::ws >> ch;
+ if (ch != '[') {
+ cerr << "Read: " << ch << endl;
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '['"));
+ }
+
+ // -- read dimensions: nr , nc
+ // -- read nrow
+ sin >> std::ws >> nr;
+ if (nr < 0)
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: bad row dimension"));
+
+ // -- read ,
+ sin >> std::ws >> ch;
+ if (ch != ',')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
+
+ // -- read ncol
+ sin >> std::ws >> nc;
+ if (nc < 0)
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: bad col dimension"));
+
+ // -- read ,
+ sin >> std::ws >> ch;
+ if (ch != ',')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
+
+ // -- read [
+ sin >> std::ws >> ch;
+ if (ch != '[')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '[' before entries"));
+
+ // -- Read the matrix:
+ R.reallocate( nr, nc );
+ for (i=0; i<nr; ++i) {
+ if (i != 0) {
+ sin >> std::ws >> ch;
+ if (ch != ',')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
+ }
+
+ cout << "Row: " << i << endl;
+ // -- read [
+ sin >> std::ws >> ch;
+ if (ch != '[')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no '['"));
+
+ // read nc-1 times: val ,
+ for (j=0; j< nc-1; ++j) {
+ cout << "Read: i=" << i << ", j=" << j << endl;
+ _domain.read(sin, R(i,j));
+ // -- read [
+ sin >> std::ws >> ch;
+ if (ch != ',')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ','"));
+ }
+
+ // read 1 : val ]
+ cout << "Read: i=" << i << ", j=" << j << endl;
+ _domain.read(sin, R(i,j));
+ sin >> std::ws >> ch;
+ if (ch != ']')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ']'"));
+ }
+
+ // -- read ] ]
+ sin >> std::ws >> ch;
+ if (ch != ']')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ']'"));
+ sin >> std::ws >> ch;
+ if (ch != ']')
+ GivError::throw_error(
+ GivBadFormat("MatrixDom<Domain,Dense>::read: syntax error no ']'"));
+ return sin;
}
+} // Givaro
//#include "givaro/givmatdenseops.f.spe"
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/matrix/givmatrix.C b/src/library/matrix/givmatrix.C
index e69de29..249ae1e 100644
--- a/src/library/matrix/givmatrix.C
+++ b/src/library/matrix/givmatrix.C
@@ -0,0 +1,5 @@
+
+namespace Givaro {
+#warning "this file will probably not compile"
+
+} // Givaro
diff --git a/src/library/matrix/givmatrix.h b/src/library/matrix/givmatrix.h
index 8ddfa3e..9dedecb 100644
--- a/src/library/matrix/givmatrix.h
+++ b/src/library/matrix/givmatrix.h
@@ -1,18 +1,26 @@
-#ifndef _GIV_MATRIX_H_
-#define _GIV_MATRIX_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatrix.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatrix.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givmatrix.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#ifndef _GIV_MATRIX_H_
+#define _GIV_MATRIX_H_
+
+#error "dead code"
#include "givaro/giverror.h"
#include "givaro/givarray0.h"
#include "givaro/givelem.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// ==========================================================================
// --
@@ -25,6 +33,8 @@
template <class T, class StorageTag> class MatrixDom { };
+} // Givaro
+
#include "givaro/givvector.h"
#include "givaro/givmatstoragedense.h"
#include "givaro/givmatstoragesparse.h"
diff --git a/src/library/matrix/givmatsparse.h b/src/library/matrix/givmatsparse.h
index b2b70cf..7a3613e 100644
--- a/src/library/matrix/givmatsparse.h
+++ b/src/library/matrix/givmatsparse.h
@@ -1,24 +1,33 @@
-#ifndef _GIV_MATRIX_SPARSE_H_
-#define _GIV_MATRIX_SPARSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatsparse.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatsparse.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: givmatsparse.h,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// of matrix by blocks.
+#error "dead code"
+
+#ifndef _GIV_MATRIX_SPARSE_H_
+#define _GIV_MATRIX_SPARSE_H_
+
#include "givaro/givmatrix.h"
#include "givaro/givvector.h"
#include "givaro/givmatstoragesparse.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// --
// -- Matrix class: dense matrix
// --
template <class Domain>
-class MatrixDom<Domain, Sparse>
+class MatrixDom<Domain, Sparse>
{
Domain _domain;
@@ -35,7 +44,7 @@ public:
// -- Self_t
typedef MatrixDom<Domain, Sparse> Self_t;
- //-- Dstor:
+ //-- Dstor:
~MatrixDom() {}
//-- Default cstor:
@@ -57,7 +66,7 @@ public:
{ A.copy(B); }
//-- Assignment operator: physical copy
- void assign (Rep& r, const Rep& a) const
+ void assign (Rep& r, const Rep& a) const
{ r.copy(a); }
// -- Comparaizon
@@ -76,18 +85,18 @@ public:
void mul ( Rep& res, const Rep& u, const Type_t& v ) const;
// VD is the vector domain for res and u
- void mul ( VectorDom<Domain,Dense>::Rep& res,
+ void mul ( VectorDom<Domain,Dense>::Rep& res,
const Rep& M,
const VectorDom<Domain,Dense>& VD,
const VectorDom<Domain,Dense>::Rep& u ) const;
- void multrans ( typename VectorDom<Domain,Dense>::Rep& res,
+ void multrans ( typename VectorDom<Domain,Dense>::Rep& res,
const Rep& M,
const VectorDom<Domain,Dense>& VS,
const typename VectorDom<Domain,Dense>::Rep& u ) const;
void negin ( Rep& P ) const
- {
+ {
size_t sz = P._data.size();
for(size_t i=0; i<sz; ++i) _domain.negin(P._data[i]);
}
@@ -109,12 +118,14 @@ public:
ostream& write( ostream& s, const Rep& r ) const;
// -- Compression method to compact a dense matrix to a sparse
- // template<class StorageTag>,
+ // template<class StorageTag>,
void compact( Rep& Ms,
- const MatrixDom<Domain, Dense>& MD,
+ const MatrixDom<Domain, Dense>& MD,
const MatrixDom<Domain, Dense>::Rep& Md);
};
+} // Givaro
+
//#include "givaro/givmatsparseops.inl"
#endif
diff --git a/src/library/matrix/givmatsparseops.inl b/src/library/matrix/givmatsparseops.inl
index 02f0dac..52eb214 100644
--- a/src/library/matrix/givmatsparseops.inl
+++ b/src/library/matrix/givmatsparseops.inl
@@ -1,11 +1,19 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatsparseops.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatsparseops.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givmatsparseops.inl,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
+#error "this looks very much like dead code"
+
+namespace Givaro {
+#warning "this file will probably not compile"
+
// -- map of a unary operator, with operator()( Type_t& res )
// res and u could be aliases if OP permits it
template<class Domain>
@@ -35,7 +43,7 @@ inline void MatrixDom<Domain,Sparse>::
// -- Comparaizon
template<class Domain>
-inline int MatrixDom<Domain,Sparse>::areEqual
+inline int MatrixDom<Domain,Sparse>::areEqual
( const Rep& P, const Rep& Q) const
{
if (nrow(P) != nrow(Q)) return 0;
@@ -50,7 +58,7 @@ inline int MatrixDom<Domain,Sparse>::areEqual
}
template<class Domain>
-inline int MatrixDom<Domain,Sparse>::areNEqual
+inline int MatrixDom<Domain,Sparse>::areNEqual
( const Rep& P, const Rep& Q) const
{
return !areEqual(P,Q);
@@ -64,13 +72,13 @@ inline int MatrixDom<Domain,Sparse>::iszero ( const Rep& P ) const
return 1; } // -- row souhld be 0
size_t sz = P._data.size();
if (sz == 0) return 1;
- for(size_t i=0; i<sz; ++i)
+ for(size_t i=0; i<sz; ++i)
if (!_domain.iszero(P._data[i])) return 0;
return 1;
}
template<class Domain>
-inline void MatrixDom<Domain,Sparse>::mulin
+inline void MatrixDom<Domain,Sparse>::mulin
( Rep& res, const Type_t& u ) const
{
Curried2<MulOp<Domain> > op(_domain, u);
@@ -78,7 +86,7 @@ inline void MatrixDom<Domain,Sparse>::mulin
}
template<class Domain>
-inline void MatrixDom<Domain,Sparse>::mul
+inline void MatrixDom<Domain,Sparse>::mul
( Rep& res, const Type_t& u, const Rep& v ) const
{
Curried1<MulOp<Domain> > op(_domain, u);
@@ -86,7 +94,7 @@ inline void MatrixDom<Domain,Sparse>::mul
}
template<class Domain>
-inline void MatrixDom<Domain,Sparse>::mul
+inline void MatrixDom<Domain,Sparse>::mul
( Rep& res, const Rep& u, const Type_t& v ) const
{
Curried2<MulOp<Domain> > op(_domain, v);
@@ -107,29 +115,29 @@ inline void MatrixDom<Domain,Sparse>::neg ( Rep& R, const Rep& P ) const
}
// VD is the vector domain for res and u
-template<class Domain>
-inline void MatrixDom<Domain,Sparse>::mul
- ( VectorDom<Domain,Dense>::Rep& R,
+template<class Domain>
+inline void MatrixDom<Domain,Sparse>::mul
+ ( VectorDom<Domain,Dense>::Rep& R,
const Rep& M,
const VectorDom<Domain,Dense>& VD,
const VectorDom<Domain,Dense>::Rep& U ) const
{
Indice_t i,j;
- Indice_t irow, erow;
- for (i = nrow(M); --i>=0;)
+ Indice_t irow, erow;
+ for (i = nrow(M); --i>=0;)
{
// -- update the i-th row of R
_domain.assign(R[i], _domain.zero);
- irow = M._rows[i]; // - first index of the ith row
- erow = M._rows[i+1]; // - last index of the ith row
- for (; irow != erow; ++irow)
+ irow = M._rows[i]; // - first index of the ith row
+ erow = M._rows[i+1]; // - last index of the ith row
+ for (; irow != erow; ++irow)
_domain.axpyin(R[i], M._data[irow], U[M._index[irow]]);
}
}
template<class Domain>
-inline void MatrixDom<Domain,Sparse>::multrans
- ( typename VectorDom<Domain,Dense>::Rep& R,
+inline void MatrixDom<Domain,Sparse>::multrans
+ ( typename VectorDom<Domain,Dense>::Rep& R,
const Rep& M,
const VectorDom<Domain,Dense>& VS,
const typename VectorDom<Domain,Dense>::Rep& U ) const
@@ -174,7 +182,7 @@ void MatrixDom<Domain, Sparse>::compact
for (j=0; j<ncols; ++j)
{
_domain.assign(val, Md(i,j));
- if ( !_domain.iszero(val) )
+ if ( !_domain.iszero(val) )
{
Ms._data.reallocate(size+1);
Ms._index.reallocate(size+1);
@@ -198,7 +206,7 @@ inline ostream& MatrixDom<Domain,Sparse>::write( ostream& sout ) const
}
template <class Domain>
-inline istream& MatrixDom<Domain,Sparse>::read( istream& sin )
+inline istream& MatrixDom<Domain,Sparse>::read( istream& sin )
{
char ch;
sin >> std::ws >> ch;
@@ -218,7 +226,7 @@ inline istream& MatrixDom<Domain,Sparse>::read( istream& sin )
// -- read dense:
char name[7];
sin >> std::ws; sin.read(name, 6); name[6] = (char)0;
- if (strcmp(name, "Sparse") !=0)
+ if (strcmp(name, "Sparse") !=0)
GivError::throw_error(
GivBadFormat("MatrixDom<Domain,Sparse>::read: syntax error no 'Sparse'"));
@@ -287,5 +295,5 @@ istream& MatrixDom<Domain,Sparse>::read( istream& sin, Rep& R) const
return sin;
}
-
+} // Givaro
diff --git a/src/library/matrix/givmatstorage.h b/src/library/matrix/givmatstorage.h
index dea75e0..2d7ece5 100644
--- a/src/library/matrix/givmatstorage.h
+++ b/src/library/matrix/givmatstorage.h
@@ -1,23 +1,33 @@
-#ifndef _GIV_MATRIX_STORAGE_H_
-#define _GIV_MATRIX_STORAGE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatstorage.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatstorage.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givmatstorage.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+//
+#error "dead code"
+
+
+#ifndef _GIV_MATRIX_STORAGE_H_
+#define _GIV_MATRIX_STORAGE_H_
#include "givaro/givcategory.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// ==========================================================================
// --
// -- RetMatrixStorage<T, StorageTag>:
// -- return the storage type Storage_t associated with the
// -- StorageTag
// ==========================================================================
-template<class T, class StorageTag >
+template<class T, class StorageTag >
struct RetMatrixStorage {
typedef T Type_t;
typedef Undefined Storage_t;
@@ -30,12 +40,12 @@ struct RetMatrixStorage {
// -- return the storage type associated with a view of the storage
// -- associated with StorageTag.
// ==========================================================================
-template<class StorageTag, class ViewTag>
+template<class StorageTag, class ViewTag>
struct RetMatrix2Storage {
typedef Undefined Storage_t;
- typedef Undefined ViewTag_t;
+ typedef Undefined ViewTag_t;
};
-
+} // Givaro
#endif
diff --git a/src/library/matrix/givmatstoragedense.h b/src/library/matrix/givmatstoragedense.h
index 281a905..c7df04b 100644
--- a/src/library/matrix/givmatstoragedense.h
+++ b/src/library/matrix/givmatstoragedense.h
@@ -1,25 +1,35 @@
-#ifndef _GIV_MATRIX_STORAGE_DENSE_H_
-#define _GIV_MATRIX_STORAGE_DENSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatstoragedense.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatstoragedense.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givmatstoragedense.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+//
+#error "dead code"
+
+
+#ifndef _GIV_MATRIX_STORAGE_DENSE_H_
+#define _GIV_MATRIX_STORAGE_DENSE_H_
#include "givaro/givmatstorage.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// ==========================================================================
// --
// -- Specialization for dense representation, using Array0 of givaro
// --
// ==========================================================================
-template<class T>
+template<class T>
struct RetMatrixStorage<T,Dense> {
- typedef T Type_t;
+ typedef T Type_t;
typedef typename Array0<T>::Indice_t Indice_t;
// --
@@ -34,23 +44,23 @@ struct RetMatrixStorage<T,Dense> {
struct Storage_t : public Array0<T> {
Indice_t _nrow;
Indice_t _ncol;
- void allocate ( Indice_t nrow, Indice_t ncol)
- { Array0<T>::allocate( nrow*ncol );
+ void allocate ( Indice_t nrow, Indice_t ncol)
+ { Array0<T>::allocate( nrow*ncol );
_nrow = nrow; _ncol = ncol;
}
- Type_t& operator() (Indice_t i, Indice_t j)
- { return Array0<T>::operator[]( i*_ncol+j ); }
- const Type_t& operator() (Indice_t i, Indice_t j) const
- { return Array0<T>::operator[]( i*_ncol+j ); }
+ Type_t& operator() (Indice_t i, Indice_t j)
+ { return Array0<T>::operator[]( i*_ncol+j ); }
+ const Type_t& operator() (Indice_t i, Indice_t j) const
+ { return Array0<T>::operator[]( i*_ncol+j ); }
void reallocate( Indice_t nrow, Indice_t ncol)
- {
+ {
Storage_t tmp; tmp.allocate(nrow, ncol);
Indice_t i, mrow = (nrow < _nrow ? nrow : _nrow);
Indice_t j, mcol = (ncol < _ncol ? ncol : _ncol);
for (i=0; i<mrow; ++i)
for (j=0; j<mrow; ++j)
tmp(i,j) = (*this)(i,j);
- this->logcopy(tmp);
+ this->logcopy(tmp);
_nrow = nrow; _ncol = ncol;
};
Indice_t nrow() const { return _nrow; }
@@ -58,6 +68,8 @@ struct RetMatrixStorage<T,Dense> {
};
};
+} // givaro
+
#ifdef GIVARO_USE_SPECIALISED
#ifdef GIVARO_HAVE_LBLAS // -- specialization
// #include "givaro/givmatstoragedense.f.spe" // float
diff --git a/src/library/matrix/givmatstoragesparse.h b/src/library/matrix/givmatstoragesparse.h
index 74158c2..dec9e83 100644
--- a/src/library/matrix/givmatstoragesparse.h
+++ b/src/library/matrix/givmatstoragesparse.h
@@ -1,25 +1,35 @@
-#ifndef _GIV_MATRIX_STORAGE_SPARSE_H_
-#define _GIV_MATRIX_STORAGE_SPARSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/matrix/givmatstoragesparse.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givmatstoragesparse.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givmatstoragesparse.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+//
+#error "dead code"
+
+
+#ifndef _GIV_MATRIX_STORAGE_SPARSE_H_
+#define _GIV_MATRIX_STORAGE_SPARSE_H_
#include "givaro/givmatstorage.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// ==========================================================================
// --
// -- Specialization for sparse representation, using Array0 of givaro
// --
// ==========================================================================
-template<class T>
+template<class T>
struct RetMatrixStorage<T,Sparse> {
- typedef T Type_t;
+ typedef T Type_t;
typedef typename Array0<T>::Indice_t Indice_t;
// --
@@ -29,31 +39,31 @@ struct RetMatrixStorage<T,Sparse> {
typedef typename Array0<T>::constIterator_t constIterator_t;
// --
- // --
+ // --
// --
struct Storage_t {
Indice_t _nrow, _ncol; // - dimension of the block matrix
- Array0<Indice_t> _rows; // - rows[i] of the first entry of
+ Array0<Indice_t> _rows; // - rows[i] of the first entry of
// the i-th row in (_index,_data).
// rows a +1 entry
- Array0<Indice_t> _index; // - index of the first entry of
+ Array0<Indice_t> _index; // - index of the first entry of
Array0<T> _data; // - entries
//-- Store dimension but don't allocate
void allocate( size_t rsz, size_t csz )
- {
- _data.allocate(0);
- _index.allocate(0);
- _rows.allocate(rsz+1);
- _nrow = rsz; _ncol = csz;
+ {
+ _data.allocate(0);
+ _index.allocate(0);
+ _rows.allocate(rsz+1);
+ _nrow = rsz; _ncol = csz;
}
//-- Store dimension but don't allocate
void reallocate( size_t rsz, size_t csz )
{
- _data.reallocate(0);
- _index.reallocate(0);
- _rows.reallocate(rsz+1);
- _nrow = rsz; _ncol = csz;
+ _data.reallocate(0);
+ _index.reallocate(0);
+ _rows.reallocate(rsz+1);
+ _nrow = rsz; _ncol = csz;
}
Storage_t& copy (const Storage_t& V)
{
@@ -76,7 +86,7 @@ struct RetMatrixStorage<T,Sparse> {
Storage_t ( Indice_t nrow, Indice_t ncol )
: _nrow(nrow), _ncol(ncol), _rows(nrow+1), _index(0), _data( 0 ) {}
Storage_t ( const Storage_t& s )
- : _nrow(s._nrow), _ncol(s._ncol),
+ : _nrow(s._nrow), _ncol(s._ncol),
_rows ( s._rows, givWithCopy()),
_index( s._index, givWithCopy()),
_data ( s._data, givWithCopy() ) {}
@@ -85,5 +95,5 @@ struct RetMatrixStorage<T,Sparse> {
};
-
+} // Givaro
#endif
diff --git a/src/library/poly1/Makefile.am b/src/library/poly1/Makefile.am
index 83b6c11..211fd15 100644
--- a/src/library/poly1/Makefile.am
+++ b/src/library/poly1/Makefile.am
@@ -1,29 +1,42 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
- givindeter.h \
- givpoly1.h \
- givdegree.h \
- givinterp.h \
- givpoly1dense.h \
- givpoly1factor.h \
- givpoly1padic.h \
- givpoly1denseops.inl \
- givpoly1addsub.inl \
- givpoly1muldiv.inl \
- givpoly1axpy.inl \
- givpoly1gcd.inl \
- givpoly1kara.inl \
- givpoly1cstor.inl \
- givpoly1io.inl \
- givpoly1misc.inl \
- givpoly1sqrfree.inl \
- givpoly1cyclo.inl \
- givpoly1factor.inl \
- givpoly1proot.inl
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+
+pkginclude_HEADERS= \
+ givindeter.h \
+ givpoly1.h \
+ givdegree.h \
+ givinterp.h \
+ givinterpgeom.h \
+ givinterpgeom-multip.h \
+ givpoly1dense.h \
+ givpoly1factor.h \
+ givpoly1padic.h \
+ givpoly1denseops.inl \
+ givpoly1addsub.inl \
+ givpoly1muldiv.inl \
+ givpoly1axpy.inl \
+ givpoly1gcd.inl \
+ givpoly1kara.inl \
+ givpoly1cstor.inl \
+ givpoly1io.inl \
+ givpoly1misc.inl \
+ givpoly1sqrfree.inl \
+ givpoly1cyclo.inl \
+ givpoly1factor.inl \
+ givpoly1proot.inl \
+ givpoly1ratrecon.inl \
+ givpoly1crt.h \
+ givpoly1crtcstor.inl \
+ givpoly1crtconvert.inl
noinst_LTLIBRARIES=libgivpoly1.la
-libgivpoly1_la_SOURCES=givindeter.C
+libgivpoly1_la_SOURCES=givindeter.C givdegree.C
diff --git a/src/library/poly1/Makefile.in b/src/library/poly1/Makefile.in
index 3d8f45a..90ac063 100644
--- a/src/library/poly1/Makefile.in
+++ b/src/library/poly1/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -47,11 +61,11 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libgivpoly1_la_LIBADD =
-am_libgivpoly1_la_OBJECTS = givindeter.lo
+am_libgivpoly1_la_OBJECTS = givindeter.lo givdegree.lo
libgivpoly1_la_OBJECTS = $(am_libgivpoly1_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -83,26 +97,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -112,40 +127,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -185,34 +210,43 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
- givindeter.h \
- givpoly1.h \
- givdegree.h \
- givinterp.h \
- givpoly1dense.h \
- givpoly1factor.h \
- givpoly1padic.h \
- givpoly1denseops.inl \
- givpoly1addsub.inl \
- givpoly1muldiv.inl \
- givpoly1axpy.inl \
- givpoly1gcd.inl \
- givpoly1kara.inl \
- givpoly1cstor.inl \
- givpoly1io.inl \
- givpoly1misc.inl \
- givpoly1sqrfree.inl \
- givpoly1cyclo.inl \
- givpoly1factor.inl \
- givpoly1proot.inl
+ givindeter.h \
+ givpoly1.h \
+ givdegree.h \
+ givinterp.h \
+ givinterpgeom.h \
+ givinterpgeom-multip.h \
+ givpoly1dense.h \
+ givpoly1factor.h \
+ givpoly1padic.h \
+ givpoly1denseops.inl \
+ givpoly1addsub.inl \
+ givpoly1muldiv.inl \
+ givpoly1axpy.inl \
+ givpoly1gcd.inl \
+ givpoly1kara.inl \
+ givpoly1cstor.inl \
+ givpoly1io.inl \
+ givpoly1misc.inl \
+ givpoly1sqrfree.inl \
+ givpoly1cyclo.inl \
+ givpoly1factor.inl \
+ givpoly1proot.inl \
+ givpoly1ratrecon.inl \
+ givpoly1crt.h \
+ givpoly1crtcstor.inl \
+ givpoly1crtconvert.inl
noinst_LTLIBRARIES = libgivpoly1.la
-libgivpoly1_la_SOURCES = givindeter.C
+libgivpoly1_la_SOURCES = givindeter.C givdegree.C
all: all-am
.SUFFIXES:
@@ -221,14 +255,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/library/poly1/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/library/poly1/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/library/poly1/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/library/poly1/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -264,28 +298,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givindeter.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -315,7 +335,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -420,7 +440,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -431,6 +450,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -439,22 +460,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/library/poly1/givdegree.C b/src/library/poly1/givdegree.C
new file mode 100644
index 0000000..307e2c4
--- /dev/null
+++ b/src/library/poly1/givdegree.C
@@ -0,0 +1,4 @@
+#include <givaro/givdegree.h>
+namespace Givaro {
+const long Degree::deginfty = Degree::DEGPOLYZERO;
+} // Givaro
diff --git a/src/library/poly1/givdegree.h b/src/library/poly1/givdegree.h
index 2e7d705..063064b 100644
--- a/src/library/poly1/givdegree.h
+++ b/src/library/poly1/givdegree.h
@@ -1,34 +1,38 @@
-#ifndef _POLY1DEBGREE_H_
-#define _POLY1DEBGREE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givdegree.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givdegree.h,v 1.3 2008-07-02 12:53:02 jgdumas Exp $
+// $Id: givdegree.h,v 1.7 2011-02-02 16:23:56 bboyer Exp $
// Description: opaque class for Degree of polynomial. Degree of polynomial
// 0 is Degree::deginfty with value DEGPOLYZERO.
// ==========================================================================
+#ifndef __GIVARO_poly1degree_H
+#define __GIVARO_poly1degree_H
#include <iostream>
+namespace Givaro {
// -- Degree type for polynomials
-//
-class Degree {
+//
+class Degree {
public:
- typedef long value_type;
+ typedef long value_type;
enum { DEGPOLYZERO =-1};
- Degree(long a = DEGPOLYZERO): _deg(a) { }
-
+ Degree(long a = DEGPOLYZERO): _deg(a) { }
+
// JGD 03.06.2003
// Commented out because of ambiguous overload on the operators
// // -- cast --> long
-// operator long() { return _deg; }
-// operator int() { return _deg; }
+// operator long() { return _deg; }
+// operator int() { return _deg; }
// -- Degree of zero polynomial
- static const long deginfty = DEGPOLYZERO;
+ static const long deginfty;
// -- cvrt
long value() const { return _deg; }
@@ -38,11 +42,19 @@ public:
Degree operator-( const Degree& d) const { return Degree(_deg-d._deg); }
Degree operator*( const Degree& d) const { return Degree(_deg*d._deg); }
Degree operator/( const Degree& d) const { return Degree(_deg/d._deg); }
+ Degree& operator+=( const Degree& d) { _deg+=d._deg; return *this; }
+ Degree& operator-=( const Degree& d) { _deg-=d._deg; return *this; }
+ Degree& operator*=( const Degree& d) { _deg*=d._deg; return *this; }
+ Degree& operator/=( const Degree& d) { _deg/=d._deg; return *this; }
+ Degree operator<<( const int i) const { return Degree(_deg<<i); }
+ Degree operator>>( const int i) const { return Degree(_deg>>i); }
+ Degree& operator <<=( const int i) { _deg<<=i; return *this;}
+ Degree& operator >>=( const int i) { _deg>>=i; return *this;}
long operator++() { return ++_deg; }
long operator--() { return --_deg; }
long operator++(int) { return _deg++; }
long operator--(int) { return _deg--; }
-
+
// -- Comparizon:
int operator==( const Degree& d) const { return _deg == d._deg; }
int operator!=( const Degree& d) const { return _deg != d._deg; }
@@ -50,16 +62,23 @@ public:
int operator< ( const Degree& d) const { return _deg < d._deg; }
int operator>=( const Degree& d) const { return _deg >= d._deg; }
int operator> ( const Degree& d) const { return _deg > d._deg; }
-
+ int operator==( const long& d) const { return _deg == d; }
+ int operator!=( const long& d) const { return _deg != d; }
+ int operator<=( const long& d) const { return _deg <= d; }
+ int operator< ( const long& d) const { return _deg < d; }
+ int operator>=( const long& d) const { return _deg >= d; }
+ int operator> ( const long& d) const { return _deg > d; }
+
// -- methods
friend std::ostream& operator<< (std::ostream& o, const Degree& d) { return o << d._deg; }
friend std::istream& operator>> (std::istream& i, Degree& d) { return i >> d._deg; }
-
+
public:
long _deg;
};
inline long value(const Degree& d) { return d._deg; }
+} // Givaro
-#endif
+#endif // __GIVARO_poly1degree_H
diff --git a/src/library/poly1/givindeter.C b/src/library/poly1/givindeter.C
index bd48200..47184b8 100644
--- a/src/library/poly1/givindeter.C
+++ b/src/library/poly1/givindeter.C
@@ -1,9 +1,12 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givindeter.C,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givindeter.C,v 1.4 2008-07-01 15:40:33 jgdumas Exp $
+// $Id: givindeter.C,v 1.5 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
@@ -11,6 +14,7 @@
#include <string.h>
#include "givaro/givindeter.h"
+namespace Givaro {
Indeter& Indeter::operator=( const Indeter& s )
{
@@ -19,18 +23,19 @@ Indeter& Indeter::operator=( const Indeter& s )
}
int Indeter::compare(const Indeter& b) const
-{
- return name.compare(b.name);
+{
+ return name.compare(b.name);
}
-std::ostream& operator<< (std::ostream& o, const Indeter& X)
-{
-// return o << '[' << X.name.baseptr() << ']';
- return o << X.name ;
+std::ostream& operator<< (std::ostream& o, const Indeter& X)
+{
+// return o << '[' << X.name.baseptr() << ']';
+ return o << X.name ;
}
- std::istream& operator>> (std::istream& s_in, Indeter& X)
- {
+ std::istream& operator>> (std::istream& s_in, Indeter& X)
+ {
return s_in>>X.name;
}
+} // Givaro
diff --git a/src/library/poly1/givindeter.h b/src/library/poly1/givindeter.h
index d133a21..e915353 100644
--- a/src/library/poly1/givindeter.h
+++ b/src/library/poly1/givindeter.h
@@ -1,21 +1,26 @@
-#ifndef _INDETER_H_
-#define _INDETER_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givindeter.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givindeter.h,v 1.4 2008-04-08 11:43:11 jgdumas Exp $
+// $Id: givindeter.h,v 1.6 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
// - indeterminates for polynomial manipulation
+#ifndef __GIVARO_indeter_H
+#define __GIVARO_indeter_H
#include <iostream>
#include <string>
+namespace Givaro {
+
class Indeter {
public :
-
+
// -- Cstor: recopy the string
Indeter(const std::string & x="") : name(x){}
// -- Cstor: recopy the string
@@ -25,7 +30,7 @@ public :
// -- Dstor
~Indeter(){}
-
+
// -- assignement
Indeter& operator= (const Indeter& s);
@@ -36,7 +41,7 @@ public :
// for multivariate polynomials.
int compare(const Indeter& b) const;
- // -- methods
+ // -- methods
friend std::ostream& operator<< (std::ostream& o, const Indeter& X);
friend std::istream& operator>> (std::istream& o, Indeter& X);
@@ -45,22 +50,23 @@ protected:
};
// Inline members functions :
-inline int operator==(const Indeter& i1, const Indeter &i2)
+inline int operator==(const Indeter& i1, const Indeter &i2)
{ return i1.compare(i2) ==0; }
-inline int operator!=(const Indeter& i1, const Indeter &i2)
+inline int operator!=(const Indeter& i1, const Indeter &i2)
{ return i1.compare(i2) !=0; }
-inline int operator<= (const Indeter& i1, const Indeter &i2)
+inline int operator<= (const Indeter& i1, const Indeter &i2)
{ return i1.compare(i2) <=0; }
-inline int operator< (const Indeter& i1, const Indeter &i2)
+inline int operator< (const Indeter& i1, const Indeter &i2)
{ return i1.compare(i2) <0; }
-inline int operator>= (const Indeter& i1, const Indeter &i2)
+inline int operator>= (const Indeter& i1, const Indeter &i2)
{ return i1.compare(i2) >=0; }
inline int operator> (const Indeter& i1, const Indeter &i2)
{ return i1.compare(i2) >0; }
-#endif
+ } // Givaro
+#endif // __GIVARO_indeter_H
diff --git a/src/library/poly1/givinterp.h b/src/library/poly1/givinterp.h
index 6c57841..4423a44 100644
--- a/src/library/poly1/givinterp.h
+++ b/src/library/poly1/givinterp.h
@@ -1,24 +1,28 @@
-#ifndef _INTERPOLATION_H
-#define _INTERPOLATION_H
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givinterp.h,v $
-// Copyright(c)'2006 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: JG Dumas
-// $Id: givinterp.h,v 1.1 2006-06-26 16:31:03 jgdumas Exp $
+// $Id: givinterp.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#ifndef __GIVARO_interpolation_H
+#define __GIVARO_interpolation_H
#include "givaro/givconfig.h"
#include "givaro/giverror.h"
#include "givaro/givpoly1.h"
+namespace Givaro {
template<class Domain, bool REDUCE = true>
struct Interpolation : Poly1Dom<Domain,Dense> {
typedef std::vector< typename Domain::Element > Vect_t;
typedef typename Poly1Dom<Domain, Dense>::Element Element;
-
+
Interpolation (const Domain& d, const Indeter& X = Indeter() ) : Poly1Dom<Domain,Dense>(d,X), Pi(this->one) {}
@@ -38,12 +42,12 @@ struct Interpolation : Poly1Dom<Domain,Dense> {
this->_domain.init(tmp);
// Adds the last evaluation
for( typename Vect_t::reverse_iterator prev = DD.rbegin(), next = DD.rbegin(), point = Points.rbegin(); ++next != DD.rend(); ++prev, ++point)
- // [x_i, ..., x_{n+1}] = ([x_i, ..., x_n] - [x_{i+1}, ..., x_{n+1}])
+ // [x_i, ..., x_{n+1}] = ([x_i, ..., x_n] - [x_{i+1}, ..., x_{n+1}])
// / ( x_i - x_{n+1} )
this->_domain.divin(
this->_domain.subin(*next, *prev),
this->_domain.sub(tmp, *point, x)
- );
+ );
}
Points.push_back(x);
@@ -65,6 +69,6 @@ private:
Vect_t Points, DD;
};
+} // Givaro
-
-#endif
+#endif // __GIVARO_interpolation_H
diff --git a/src/library/poly1/givinterpgeom-multip.h b/src/library/poly1/givinterpgeom-multip.h
new file mode 100644
index 0000000..9a6356b
--- /dev/null
+++ b/src/library/poly1/givinterpgeom-multip.h
@@ -0,0 +1,194 @@
+// ==========================================================================
+// $Source: /var/lib/cvs/Givaro/src/library/poly1/givinterp.h,v $
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Authors: JG Dumas
+// $Id: givinterp.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
+// ==========================================================================
+// Description:
+// Interpolation at geometric points
+// see: Polynomial evaluation and interpolation on special sets of points,
+// A. Bostan and E. Schost, Journal of Complexity 21(4): 420-446, 2005.
+
+#ifndef __GIVARO_multiple_interpolation_at_geometric_points_H
+#define __GIVARO_multiple_interpolation_at_geometric_points_H
+
+#include "givaro/givconfig.h"
+#include "givaro/giverror.h"
+#include "givaro/givpoly1.h"
+#include <givaro/givtruncdomain.h>
+#include <vector>
+
+namespace Givaro {
+template<class Domain, bool REDUCE = true>
+struct NewtonInterpGeomMultip : TruncDom<Domain> {
+ typedef std::vector< typename Domain::Element > Vect_t;
+ typedef typename TruncDom<Domain>::Polynomial_t Polynomial;
+ typedef Polynomial Element;
+ typedef typename TruncDom<Domain>::Element Truncated;
+ typedef typename TruncDom<Domain>::Type_t Type_t;
+ typedef typename std::vector< Polynomial > VectPoly_t;
+
+private:
+ Type_t _q;
+ Type_t powerq;
+ Type_t _ui;
+ Polynomial _qi;
+ Polynomial _mui;
+ VectPoly_t _wi;
+ Polynomial _g2;
+ bool flip;
+ Degree _deg;
+
+public:
+ // Usage :
+ // Cstor + initialize with first evaluation (at 1)
+ // Then calls to operator(), will evaluate the blackbox at q^i
+ // Finally calls to Newton would yield the coefficients in the Newton basis
+ // While interpolator calls Newton, and then transforms to monomial basis
+
+ NewtonInterpGeomMultip (const Domain& d, const Indeter& X = Indeter() ) : TruncDom<Domain>(d,X), powerq(d.one), _ui(d.one), flip(false), _deg(0) {
+ d.generator(_q); // get a primitive root
+ }
+
+ template<typename BlackBox>
+ void initialize (const BlackBox& bb) {
+ _qi.resize(0);
+ _mui.resize(0);
+ _wi.resize(0);
+ _g2.resize(0);
+ this->_domain.assign(powerq, this->_domain.one);
+ this->_domain.assign(_ui, this->_domain.one);
+ _deg = 0;
+ _qi.push_back(this->_domain.one);
+ _mui.push_back(this->_domain.one);
+ Vect_t v0;
+ bb(v0, this->_domain.one);
+
+ _wi.resize(v0.size());
+
+ typename Vect_t::const_iterator iter_v0 = v0.begin();
+ for(typename VectPoly_t::iterator iter_wi = _wi.begin();
+ iter_wi != _wi.end(); ++iter_wi, ++iter_v0)
+ iter_wi->push_back(*iter_v0);
+
+ _g2.push_back(this->_domain.one);
+ flip = true;
+ }
+
+ template<typename BlackBox>
+ void operator() (const BlackBox& bb) {
+ Type_t qi;
+ this->_domain.mul(qi, _qi.back(), powerq);
+ _qi.push_back(qi);
+
+ this->_domain.mulin(powerq, _q);
+
+ Type_t ui, mui;
+ this->_domain.sub(ui, powerq, this->_domain.one);
+
+ this->_domain.mul(mui, powerq, _mui.back() );
+ this->_domain.divin(mui, ui );
+ this->_domain.negin(mui);
+ _mui.push_back(mui);
+
+ this->_domain.mulin(_ui, ui );
+
+ Vect_t vi;
+ bb(vi, powerq);
+
+ typename Vect_t::iterator iter_vi = vi.begin();
+ typename VectPoly_t::iterator iter_wi = _wi.begin();
+ for( ; iter_vi != vi.end(); ++iter_vi, ++iter_wi) {
+ Type_t wi;
+ this->_domain.div(wi, *iter_vi, _ui);
+ iter_wi->push_back(wi);
+ }
+
+ Type_t gi;
+ this->_domain.div(gi, qi, _ui);
+ if (flip) this->_domain.negin(gi);
+ _g2.push_back(gi);
+
+ flip = !flip;
+ ++_deg;
+ }
+
+
+
+ VectPoly_t& Newton(VectPoly_t& inter) {
+ this->getpoldomain().setdegree(_g2);
+
+ Truncated QU;
+ this->assign(QU,_g2); // truncated
+
+ inter.resize(_wi.size());
+ typename VectPoly_t::iterator iter_inter = inter.begin();
+ typename VectPoly_t::iterator iter_wi = _wi.begin();
+ for( ; iter_wi != _wi.end(); ++iter_wi, ++iter_inter) {
+ Truncated G,W;
+ this->getpoldomain().setdegree(*iter_wi);
+ this->assign(W, *iter_wi); // truncated
+
+ // truncated multiplication
+ this->mul(G, W, QU, 0, _deg);
+
+ this->convert(*iter_inter, G); // trunc to polynomial
+
+ for(size_t i=0; i<iter_inter->size(); ++i)
+ this->_domain.divin((*iter_inter)[i], _qi[i]);
+ }
+
+ return inter;
+ }
+
+
+ VectPoly_t& interpolator(VectPoly_t& inter) {
+ this->Newton(inter);
+
+ Polynomial _rev_mui;
+ this->getpoldomain().setdegree(_mui);
+ this->getpoldomain().reverse(_rev_mui, _mui);
+ Truncated U;
+ this->assign(U, _rev_mui); // truncated
+
+ typename VectPoly_t::iterator iter_inter = inter.begin();
+ for( ; iter_inter != inter.end(); ++iter_inter) {
+
+ Type_t mvi;
+ Polynomial mwi(_qi.size()), mzi(_qi.size());
+ for(size_t i=0; i<iter_inter->size(); ++i) {
+ this->_domain.mul(mvi, (*iter_inter)[i],_qi[i]);
+ if (i & 1) this->_domain.negin(mvi);
+ this->_domain.div(mwi[i], mvi, _mui[i]);
+ this->_domain.div(mzi[i], _mui[i], _qi[i]);
+ if (i & 1) this->_domain.negin(mzi[i]);
+ }
+
+ this->getpoldomain().setdegree( mwi);
+
+ Truncated G,W;
+ this->assign(W, mwi); // truncated
+
+ // Transposed multiplication (U has been reversed)
+ this->mul(G, U, W, _deg, _deg * 2);
+ this->divin(G,_deg);
+
+ this->convert(*iter_inter, G); // trunc to polynomial
+
+ for(size_t i=0; i<iter_inter->size(); ++i)
+ this->_domain.mulin( (*iter_inter)[i], mzi[i]);
+ }
+
+ return inter;
+ }
+
+};
+
+} // Givaro
+
+
+#endif // __GIVARO_multiple_interpolation_at_geometric_points_H
diff --git a/src/library/poly1/givinterpgeom.h b/src/library/poly1/givinterpgeom.h
new file mode 100644
index 0000000..aad7fd7
--- /dev/null
+++ b/src/library/poly1/givinterpgeom.h
@@ -0,0 +1,168 @@
+// ==========================================================================
+// $Source: /var/lib/cvs/Givaro/src/library/poly1/givinterp.h,v $
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Authors: JG Dumas
+// $Id: givinterp.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
+// ==========================================================================
+// Description:
+// Interpolation at geometric points
+// see: Polynomial evaluation and interpolation on special sets of points,
+// A. Bostan and E. Schost, Journal of Complexity 21(4): 420-446, 2005.
+
+#ifndef __GIVARO_interpolation_at_geometric_points_H
+#define __GIVARO_interpolation_at_geometric_points_H
+
+#include "givaro/givconfig.h"
+#include "givaro/giverror.h"
+#include "givaro/givpoly1.h"
+#include <givaro/givtruncdomain.h>
+
+namespace Givaro {
+template<class Domain, bool REDUCE = true>
+struct NewtonInterpGeom : TruncDom<Domain> {
+ typedef std::vector< typename Domain::Element > Vect_t;
+ typedef typename TruncDom<Domain>::Polynomial_t Polynomial;
+ typedef Polynomial Element;
+ typedef typename TruncDom<Domain>::Element Truncated;
+ typedef typename TruncDom<Domain>::Type_t Type_t;
+
+private:
+ Type_t _q;
+ Type_t powerq;
+ Type_t _ui;
+ Polynomial _qi;
+ Polynomial _mui;
+ Polynomial _wi;
+ Polynomial _g2;
+ bool flip;
+ Degree _deg;
+
+public:
+ // Usage :
+ // Cstor + initialize with first evaluation (at 1)
+ // Then calls to operator(), will evaluate the blackbox at q^i
+ // Finally calls to Newton would yield the coefficients in the Newton basis
+ // While interpolator calls Newton, and then transforms to monomial basis
+
+ NewtonInterpGeom (const Domain& d, const Indeter& X = Indeter() ) : TruncDom<Domain>(d,X), powerq(d.one), _ui(d.one), flip(false), _deg(0) {
+ d.generator(_q); // get a primitive root
+ }
+
+ template<typename BlackBox>
+ void initialize (const BlackBox& bb) {
+ _qi.resize(0);
+ _mui.resize(0);
+ _wi.resize(0);
+ _g2.resize(0);
+ this->_domain.assign(powerq, this->_domain.one);
+ this->_domain.assign(_ui, this->_domain.one);
+ _deg = 0;
+ _qi.push_back(this->_domain.one);
+ _mui.push_back(this->_domain.one);
+ Type_t v0;
+ bb(v0, this->_domain.one);
+ _wi.push_back(v0);
+ _g2.push_back(this->_domain.one);
+ flip = true;
+ }
+
+ template<typename BlackBox>
+ void operator() (const BlackBox& bb) {
+ Type_t qi;
+ this->_domain.mul(qi, _qi.back(), powerq);
+ _qi.push_back(qi);
+
+ this->_domain.mulin(powerq, _q);
+
+ Type_t ui, mui;
+ this->_domain.sub(ui, powerq, this->_domain.one);
+
+ this->_domain.mul(mui, powerq, _mui.back() );
+ this->_domain.divin(mui, ui );
+ this->_domain.negin(mui);
+ _mui.push_back(mui);
+
+ this->_domain.mulin(_ui, ui );
+
+ Type_t vi;
+ bb(vi, powerq);
+
+ Type_t wi;
+ this->_domain.div(wi, vi, _ui);
+ _wi.push_back(wi);
+
+ Type_t gi;
+ this->_domain.div(gi, qi, _ui);
+ if (flip) this->_domain.negin(gi);
+ _g2.push_back(gi);
+
+ flip = !flip;
+ ++_deg;
+ }
+
+
+
+ Polynomial& Newton(Polynomial& inter) {
+ this->getpoldomain().setdegree(_wi);
+ this->getpoldomain().setdegree(_g2);
+
+ Truncated G,W,QU;
+ this->assign(W, _wi); // truncated
+ this->assign(QU,_g2); // truncated
+
+ // truncated multiplication
+ this->mul(G, W, QU, 0, _deg);
+
+ this->convert(inter, G); // trunc to polynomial
+
+ for(size_t i=0; i<inter.size(); ++i)
+ this->_domain.divin(inter[i], _qi[i]);
+
+ return inter;
+ }
+
+
+ Polynomial& interpolator(Polynomial& inter) {
+ this->Newton(inter);
+
+ Type_t mvi;
+ Polynomial mwi(_qi.size()), mzi(_qi.size());
+ for(size_t i=0; i<inter.size(); ++i) {
+ this->_domain.mul(mvi,inter[i],_qi[i]);
+ if (i & 1) this->_domain.negin(mvi);
+ this->_domain.div(mwi[i], mvi, _mui[i]);
+ this->_domain.div(mzi[i], _mui[i], _qi[i]);
+ if (i & 1) this->_domain.negin(mzi[i]);
+ }
+
+ this->getpoldomain().setdegree(_mui);
+ this->getpoldomain().setdegree( mwi);
+
+ this->getpoldomain().reversein(_mui);
+
+ Truncated G,U,W;
+ this->assign(U, _mui); // truncated
+ this->assign(W, mwi); // truncated
+
+ // Transposed multiplication (U has been reversed)
+ this->mul(G, U, W, _deg, _deg * 2);
+ this->divin(G,_deg);
+
+ this->convert(inter, G); // trunc to polynomial
+
+ for(size_t i=0; i<inter.size(); ++i)
+ this->_domain.mulin(inter[i], mzi[i]);
+
+ return inter;
+ }
+
+};
+
+} // Givaro
+
+
+#endif // __GIVARO_interpolation_at_geometric_points_H
diff --git a/src/library/poly1/givpoly1.h b/src/library/poly1/givpoly1.h
index 70ce709..2c4a5d7 100644
--- a/src/library/poly1/givpoly1.h
+++ b/src/library/poly1/givpoly1.h
@@ -1,13 +1,16 @@
-#ifndef _GIV_POLY1_H_
-#define _GIV_POLY1_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givpoly1.h,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#ifndef __GIVARO_poly1_H
+#define __GIVARO_poly1_H
#include "givaro/giverror.h"
#include "givaro/givarray0.h"
@@ -15,6 +18,7 @@
#include "givaro/giviterator.h"
#include "givaro/givops.h"
+namespace Givaro {
// ==========================================================================
// --
@@ -26,10 +30,12 @@ template<class Domain, class StorageTag> class Poly1Dom;
template<class Domain> class Poly1Dom<Domain,Dense>;
template<class Domain> class Poly1Dom<Domain,Sparse>;
+} // Givaro
+
#include "givaro/givpoly1dense.h"
// #include "givaro/givvectorsparse.h"
// -- should be included in specialized class #include "givaro/givvectops.inl"
#include "givaro/givpoly1denseops.inl"
// #include "givaro/givvectsparseops.inl"
-#endif
+#endif // __GIVARO_poly1_H
diff --git a/src/library/poly1/givpoly1addsub.inl b/src/library/poly1/givpoly1addsub.inl
index 385833d..45975c4 100644
--- a/src/library/poly1/givpoly1addsub.inl
+++ b/src/library/poly1/givpoly1addsub.inl
@@ -1,22 +1,26 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1addsub.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1addsub.inl,v 1.2 2008-04-22 15:57:14 jgdumas Exp $
+// $Id: givpoly1addsub.inl,v 1.4 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-#ifndef __GIV__POLY__ADDSUB__inl__
-#define __GIV__POLY__ADDSUB__inl__
+#ifndef __GIVARO_poly_addsub_INL
+#define __GIVARO_poly_addsub_INL
+namespace Givaro {
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::addin (Rep& R, const Rep& P) const
{
// this->write(this->write(std::cout, R) << " += ", P) << std::endl;
size_t i;
- size_t sP = P.size();
- size_t sR = R.size();
+ size_t sP = P.size();
+ size_t sR = R.size();
if (sP == 0) return R;
if (sR == 0) { return assign(R,P); }
// if (sR == 0) { R.copy(P); return R; }
@@ -42,13 +46,13 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::add(Rep& R,
if (sQ == 0) { R.copy(P); return R; }
// JGD 04.11.1999
// if (sP == sQ) {
-// R.reallocate(sP);
-// _supportdomain.add(R,P,Q);
-// return;
+// R.reallocate(sP);
+// _supportdomain.add(R,P,Q);
+// return;
// }
size_t i, max = sP < sQ ? sQ : sP;
if (sR != max) R.reallocate(max);
- if (sP < sQ)
+ if (sP < sQ)
{
for (i=0; i<sP; ++i) _domain.add(R[i], P[i], Q[i]);
// for (; i<sQ; ++i) _domain.assign(R[i], Q[i]);
@@ -67,32 +71,32 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::add(Rep& R,
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::add
- (Rep& R, const Rep& P, const Type_t& val) const
+ (Rep& R, const Rep& P, const Type_t& Val) const
{
size_t sP = P.size();
if (sP == 0) {
R.reallocate(1);
- _domain.assign(R[0],val);
+ _domain.assign(R[0],Val);
}
else {
assign(R, P);
- _domain.add(R[0],P[0],val);
+ _domain.add(R[0],P[0],Val);
}
return R;
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::add
- (Rep& R, const Type_t& val, const Rep& P) const
+ (Rep& R, const Type_t& Val, const Rep& P) const
{
size_t sP = P.size();
if (sP == 0) {
R.reallocate(1);
- _domain.assign(R[0],val);
+ _domain.assign(R[0],Val);
}
else {
assign(R, P);
- _domain.add(R[0],val, P[0]);
+ _domain.add(R[0],Val, P[0]);
}
return R;
}
@@ -147,32 +151,32 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::sub(Rep& R,
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::sub
- (Rep& R, const Rep& P, const Type_t& val) const
+ (Rep& R, const Rep& P, const Type_t& Val) const
{
size_t sP = P.size();
if (sP == 0) {
R.reallocate(1);
- _domain.neg(R[0],val);
+ _domain.neg(R[0],Val);
}
else {
assign(R, P);
- _domain.sub(R[0],P[0],val);
+ _domain.sub(R[0],P[0],Val);
}
return R;
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::sub
- (Rep& R, const Type_t& val, const Rep& P) const
+ (Rep& R, const Type_t& Val, const Rep& P) const
{
size_t sP = P.size();
if (sP == 0) {
R.reallocate(1);
- _domain.neg(R[0],val);
+ _domain.neg(R[0],Val);
}
else {
neg(R, P);
- _domain.add(R[0],val, P[0]);
+ _domain.add(R[0],Val, P[0]);
}
return R;
}
@@ -198,5 +202,6 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::neg (Rep& R
return R;
}
+} // Givaro
-#endif
+#endif // __GIVARO_poly_addsub_INL
diff --git a/src/library/poly1/givpoly1axpy.inl b/src/library/poly1/givpoly1axpy.inl
index ac5b10a..3d43695 100644
--- a/src/library/poly1/givpoly1axpy.inl
+++ b/src/library/poly1/givpoly1axpy.inl
@@ -1,16 +1,24 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1axpy.inl,v $
-// Copyright(c)'2006 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: J-G. Dumas
-// $Id: givpoly1axpy.inl,v 1.1 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: givpoly1axpy.inl,v 1.6 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// axpy, axmy, amxy
+#ifndef __GIVARO_poly1axpy_INL
+#define __GIVARO_poly1axpy_INL
+
+namespace Givaro {
+
+// axpy, axmy, maxpy
// J.G.D. 16.11.2006
// A lot can be done to optimize those
-// Except for axpy, axpyin, amxy with a a Type_t,
-// all of them use a temporary vector where
+// Except for axpy, axpyin, maxpy with a a Type_t,
+// all of them use a temporary vector where
// a temporary value only would be sufficient.
template <class Domain>
@@ -30,20 +38,20 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axpy (Rep&
for( ; ix != x.end(); ++ir, ++ix, ++iy)
this->_domain.axpy(*ir, a, *ix, *iy);
for( ; ir != r.end(); ++ir, ++iy)
- this->_domain.assign(*ir, *iy);
+ this->_domain.assign(*ir, *iy);
} else {
r.resize(x.size());
typename Rep::iterator ir = r.begin();
for( ; iy != y.end(); ++ir, ++ix, ++iy)
this->_domain.axpy(*ir, a, *ix, *iy);
for( ; ir != r.end(); ++ir, ++ix)
- this->_domain.mul(*ir, a, *ix);
+ this->_domain.mul(*ir, a, *ix);
}
return r;
}
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axpyin(Rep& r, const Rep& a, const Rep& x) const
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axpyin(Rep& r, const Rep& a, const Rep& x) const
{
Rep tmp; this->init(tmp);
this->assign(tmp,r);
@@ -65,15 +73,15 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axpyin(Rep&
}
return r;
}
- // -- amxy: r <- c - a * b
+ // -- maxpy: r <- c - a * b
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::amxy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const{
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::maxpy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const{
Rep tmp; this->init(tmp);
return this->sub(r,c,this->mul(tmp,a,b));
}
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::amxy (Rep& r, const Type_t& a, const Rep& b, const Rep& c) const{
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::maxpy (Rep& r, const Type_t& a, const Rep& b, const Rep& c) const{
size_t sC = c.size();
size_t sB = b.size();
size_t sR = r.size();
@@ -83,35 +91,51 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::amxy (Rep&
if (sR != max) r.reallocate(max);
if (sC < sB)
{
- for (i=0; i<sC; ++i) _domain.amxy(r[i], a, b[i], c[i]);
+ for (i=0; i<sC; ++i) _domain.maxpy(r[i], a, b[i], c[i]);
for (; i<sB; ++i) _domain.negin( _domain.mul(r[i], a, b[i]) );
}
else {
- for (i=0; i<sB; ++i) _domain.amxy(r[i], a, b[i], c[i]);
+ for (i=0; i<sB; ++i) _domain.maxpy(r[i], a, b[i], c[i]);
for (; i<sC; ++i) _domain.assign(r[i], c[i]);
}
return r;
}
- // -- amxyin: r -= a*b
+ // -- maxpyin: r -= a*b
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::amxyin(Rep& r, const Rep& a, const Rep& b) const{
- Rep tmp; this->init(tmp);
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::maxpyin(Rep& r, const Rep& a, const Rep& b) const{
+ Rep tmp; this->init(tmp);
return this->subin(r, this->mul(tmp,a,b));
}
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::amxyin(Rep& r, const Type_t& a, const Rep& b) const{
- Rep tmp; this->init(tmp);
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::maxpyin(Rep& r, const Type_t& a, const Rep& b) const{
+ Rep tmp; this->init(tmp);
return this->subin(r, this->mul(tmp,a,b));
}
// -- axmy: r <- a * x - y
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const{
- Rep tmp; this->init(tmp);
- return this->sub(r, this->mul(tmp, a, x), y);
+ return this->subin(this->mul(r, a, x),y);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axmy (Rep& r, const Type_t& a, const Rep& x, const Rep& y) const{
- Rep tmp; this->init(tmp);
- return this->sub(r, this->mul(tmp, a, x), y);
+ return this->subin(this->mul(r, a, x),y);
+}
+// -- axmyin: r <- a * x - r
+template <class Domain>
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axmyin (Rep& r, const Rep& a, const Rep& x) const
+{
+ this->maxpyin(r, a, x);
+ return this->negin(r);
+}
+template <class Domain>
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::axmyin (Rep& r, const Type_t& a, const Rep& x) const
+{
+ this->maxpyin(r, a, x);
+ return this->negin(r);
}
+
+} // Givaro
+
+#endif // __GIVARO_poly1axpy_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1crt.h b/src/library/poly1/givpoly1crt.h
new file mode 100644
index 0000000..e720c25
--- /dev/null
+++ b/src/library/poly1/givpoly1crt.h
@@ -0,0 +1,99 @@
+// ==========================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Authors: J-G Dumas
+// Time-stamp: <06 May 10 13:47:28 Jean-Guillaume.Dumas at imag.fr>
+// Description: Polynomial Chinese Remaindering of degree 1
+// ==========================================================================
+#ifndef __GIVARO_poly1_crt_H
+#define __GIVARO_poly1_crt_H
+#include <givaro/givpoly1.h>
+#include <givaro/givindeter.h>
+#include <vector>
+
+namespace Givaro {
+template<class Field>
+class Poly1CRT {
+ typedef Poly1CRT<Field> Self_t;
+public:
+ typedef Field Field_t;
+ typedef Poly1Dom<Field, Dense> Ring_t;
+ typedef typename Field_t::Element Type_t;
+ typedef typename Ring_t::Element Element;
+ typedef Element Rep;
+ typedef std::vector<Type_t> array_T;
+ typedef std::vector<Element> array_E;
+
+ // Default Cstor, Dstor/Cstor of recopy:
+ Poly1CRT() ;
+ ~Poly1CRT();
+ Poly1CRT( const Self_t& R);
+
+ // -- Cstor with given residues so that irreds are (X-primes[i])
+ Poly1CRT( const Field& F, const array_T& primes, const Indeter& X = Indeter() );
+
+ // -- Convert a Ring Element to a its RNS representation
+ // with the "this" rns system.
+ array_T& RingToRns( array_T& rns, const Element& a ) const;
+
+ // -- Convert a RNS representation to a RING Element
+ Element& RnsToRing( Element& a, const array_T& rns );
+
+ // ------------- Access methods
+
+ // -- Returns the number of primes of this ctxt
+ int size() const { return _primes.size(); }
+
+ // -- Returns a array to the begin of the array of primes
+ const array_T& Primes() const;
+ // -- Returns the ith primes of the rns system
+ const Type_t& ith(const size_t i) const;
+
+ // -- Returns an array of the reciprocal ck = (\prod_{j=0..k-1)p_j)^(-1) [pk]
+ const array_E& Reciprocals() const;
+ const Element& reciprocal(const size_t i) const;
+
+ const Field_t& getdomain() { return _F; }
+ const Ring_t& getpolydom() { return _PolRing; }
+
+ std::ostream& write( std::ostream& o ) const {
+ return _PolRing.write(o << "CRT(") << ')';
+ }
+
+ std::istream& read ( std::istream& i, Element& n) const {
+ return _PolRing.read(i,n);
+ }
+
+ std::ostream& write( std::ostream& o, const Element& n) const {
+ return _PolRing.write(o,n);
+ }
+
+ std::istream& read ( std::istream& i, Type_t& n) const {
+ return _F.read(i,n);
+ }
+
+ std::ostream& write( std::ostream& o, const Type_t& n) const {
+ return _F.write(o,n);
+ }
+
+
+
+protected:
+ // -------------- Compute some fields of the structure :
+ void ComputeCk();
+
+ const Indeter _XIndet;
+ const Field_t& _F;
+ const Ring_t _PolRing;
+ array_T _primes; // - array of the primes
+ array_E _ck; // - Radix list reciprocals
+};
+} // Givaro
+
+#include "givaro/givpoly1crtcstor.inl"
+#include "givaro/givpoly1crtconvert.inl"
+
+#endif
diff --git a/src/library/poly1/givpoly1crtconvert.inl b/src/library/poly1/givpoly1crtconvert.inl
new file mode 100644
index 0000000..ed4ba63
--- /dev/null
+++ b/src/library/poly1/givpoly1crtconvert.inl
@@ -0,0 +1,72 @@
+// ==========================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Authors: J-G Dumas
+// Time-stamp: <20 May 10 15:52:06 Jean-Guillaume.Dumas at imag.fr>
+// Description: Polynomial Chinese Remaindering of degree 1
+// ==========================================================================
+#ifndef __GIVARO_poly1_crt_convert_INL
+#define __GIVARO_poly1_crt_convert_INL
+
+namespace Givaro {
+ // Converts a Polynomial to a RNS representation (which is given by this)
+template<class Field>
+typename Poly1CRT<Field>::array_T& Poly1CRT<Field>::RingToRns( typename Poly1CRT<Field>::array_T& rns , const typename Poly1CRT<Field>::Element& a) const {
+ size_t Size = _primes.size();
+ if (rns.size() != Size) rns.resize(Size);
+ for (size_t i=0; i<Size; i++)
+ _PolRing.eval(rns[i], a, _primes[i]);
+ return rns;
+}
+} // Givaro
+
+#ifdef GIVARO_CRT_EARLY_TERMINATION
+#ifndef GIVARO_CRT_EARLY_TERMINATION_THRESHOLD
+#define GIVARO_CRT_EARLY_TERMINATION_THRESHOLD 4
+#endif
+#endif
+
+
+namespace Givaro {
+
+ // Converts an array of field residues to a Polynomial
+template<class Field>
+typename Poly1CRT<Field>::Element& Poly1CRT<Field>::RnsToRing(typename Poly1CRT<Field>::Element& I, const typename Poly1CRT<Field>::array_T& rns) {
+ this->ComputeCk();
+ size_t Size = _primes.size();
+ _PolRing.assign(I, Degree(0), rns[0]);
+#ifdef GIVARO_CRT_EARLY_TERMINATION
+ size_t EarlyTerm = 0;
+#endif
+// _PolRing.write(std::cerr<< "R[0]: ", I) <<std::endl;
+ for(size_t i=1; i<Size; ++i) {
+ Type_t addon;
+ _PolRing.eval(addon, I, _primes[i]);
+
+// _F.write(_PolRing.write(_F.write(std::cout << "subs(X=", _primes[i]) << ",", I) << ") mod " << _F.characteristic() << " = ", addon) << ';' << std::endl;
+
+ _F.negin(addon);
+ _F.addin(addon, rns[i]);
+#ifdef GIVARO_CRT_EARLY_TERMINATION
+ if (_F.isZero(addon))
+ ++EarlyTerm;
+ else {
+ EarlyTerm=0;
+#endif // GIVARO_CRT_EARLY_TERMINATION
+ _PolRing.axpyin(I, addon, _ck[i]);
+ // _PolRing.modin(I, _ck[i+1]);
+#ifdef GIVARO_CRT_EARLY_TERMINATION
+ }
+ if (EarlyTerm >= EarlyTermThreshold)
+ break;
+#endif // GIVARO_CRT_EARLY_TERMINATION
+ }
+// loc.stop(); std::cerr << "RnsToRing. CRT: " << loc << std::endl;
+ return I;
+}
+
+} // Givaro
+#endif // __GIVARO_poly1_crt_convert_INL
diff --git a/src/library/poly1/givpoly1crtcstor.inl b/src/library/poly1/givpoly1crtcstor.inl
new file mode 100644
index 0000000..cc631af
--- /dev/null
+++ b/src/library/poly1/givpoly1crtcstor.inl
@@ -0,0 +1,116 @@
+// ==========================================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Authors: J-G Dumas
+// Time-stamp: <09 Jun 10 18:15:58 Jean-Guillaume.Dumas at imag.fr>
+// Description: Polynomial Chinese Remaindering of degree 1
+// ==========================================================================
+#ifndef __GIVARO_poly1_crt_cstor_INL
+#define __GIVARO_poly1_crt_cstor_INL
+
+namespace Givaro {
+// -- free memory allocated in array !
+template<class Field>
+Poly1CRT<Field>::~Poly1CRT()
+{}
+
+template<class Field>
+Poly1CRT<Field>::Poly1CRT ()
+ : _XIndet(), _F(), _PolRing(), _primes(0), _ck(0)
+{}
+
+template<class Field>
+Poly1CRT<Field>::Poly1CRT (const Poly1CRT<Field>& R)
+ : _XIndet(R._XIndet),
+ _F(R._F),
+ _PolRing(R._PolRing),
+ _primes(R._primes),
+ _ck(R._ck)
+{}
+
+
+ // -- Array of primes are given
+template<class Field>
+Poly1CRT<Field>::Poly1CRT( const Field& F, const Poly1CRT<Field>::array_T& inprimes, const Indeter& X)
+ : _XIndet(X),
+ _F(F),
+ _PolRing(F,X),
+ _primes(inprimes),
+ _ck(0)
+{
+ GIVARO_ASSERT( inprimes.size()>0, "[Poly1CRT<Field>::Poly1CRT] bad size of array");
+// for(typename array_T::const_iterator it=_primes.begin(); it!=_primes.end();++it)
+// _F.write(std::cout, *it) << std::endl;
+
+}
+
+ // -- Computes Ck , Ck = (\prod_{i=0}^{k-1} primes[i])^(-1) % primes[k],
+ // for k=1..(_sz-1)
+template<class Field>
+void Poly1CRT<Field>::ComputeCk()
+{
+ if (_ck.size() !=0) return; // -- already computed
+
+ size_t Size = _primes.size();
+ _ck.resize(Size+1);
+ Element irred; _PolRing.init(irred, Degree(1));
+ Element prod; _PolRing.init(prod, Degree(0));
+// Never used
+// _PolRing.assign(_ck[0], prod);
+ for (size_t k=1; k < Size; ++k) {
+ _F.assign(irred[0], _primes[k-1]);
+ _F.negin(irred[0]);
+// _PolRing.write(std::cerr<< "irred["<<k<<"]: ", irred) <<std::endl;
+ _PolRing.mulin(prod, irred);
+// _PolRing.write(std::cerr<< "prod["<<k<<"]: ", prod) <<std::endl;
+ Type_t invC; _F.init(invC);
+ _PolRing.eval(invC, prod, _primes[k]);
+// _F.write(std::cerr<< "eval["<<k<<"]: ", invC) <<std::endl;
+ _F.invin(invC);
+// _F.write(std::cerr<< "inv["<<k<<"]: ", invC) <<std::endl;
+ _PolRing.mul(_ck[k],prod,invC);
+// _PolRing.write(std::cerr<< "mul["<<k<<"]: ", _ck[k]) <<std::endl;
+ }
+ _F.assign(irred[0], _primes[Size-1]);
+ _F.negin(irred[0]);
+ _PolRing.mul(_ck[Size], prod, irred);
+
+// for(typename array_E::const_iterator it=_ck.begin(); it!=_ck.end();++it)
+// _PolRing.write(std::cout, *it) << std::endl;
+
+}
+
+
+template<class Field>
+const typename Poly1CRT<Field>::array_T& Poly1CRT<Field>::Primes() const
+{
+ return _primes;
+}
+
+
+template<class Field>
+const typename Poly1CRT<Field>::Type_t& Poly1CRT<Field>::ith(const size_t i) const
+{
+ return _primes[i];
+}
+
+
+template<class Field>
+const typename Poly1CRT<Field>::array_E& Poly1CRT<Field>::Reciprocals() const
+{
+ if (_ck.size() ==0) ((Poly1CRT<Field>*)this)->ComputeCk();
+ return _ck;
+}
+
+
+template<class Field>
+const typename Poly1CRT<Field>::Element& Poly1CRT<Field>::reciprocal(const size_t i) const
+{
+ if (_ck.size() ==0) ((Poly1CRT<Field>*)this)->ComputeCk();
+ return _ck[i];
+}
+} // Givaro
+#endif // __GIVARO_poly1_crt_cstor_INL
diff --git a/src/library/poly1/givpoly1cstor.inl b/src/library/poly1/givpoly1cstor.inl
index f394b7a..16e79f2 100644
--- a/src/library/poly1/givpoly1cstor.inl
+++ b/src/library/poly1/givpoly1cstor.inl
@@ -1,173 +1,156 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1cstor.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1cstor.inl,v 1.6 2008-09-18 08:11:46 jgdumas Exp $
+// $Id: givpoly1cstor.inl,v 1.15 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-
-template<class Domain>
-inline Poly1Dom<Domain,Dense>::Poly1Dom(const Domain& d, const Indeter& X )
- : _domain(d), _x(X) ,zero(0), one(1)
-{
- Type_t _one;
- _domain.init( _one, 1.0);
- _domain.assign( (Type_t&)one[0], _one);
-}
-
-template<class Domain>
-inline Poly1Dom<Domain,Dense>::Poly1Dom(const Self_t& P)
- : _domain(P._domain), _x(P._x) ,zero(P.zero), one(P.one)
-{}
-
-template<class Domain>
-inline Poly1Dom<Domain,Dense>::~Poly1Dom()
-{
-}
-
-
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P) const
-{ P.reallocate(0); return P; }
-
-/*
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P, const Rep& Q ) const
-{
- Degree degQ;
- degree(degQ,Q);
- if (degQ <0) {
- P.reallocate(0);
- return P;
- }
- P.reallocate(++degQ);
- for (int i=0; degQ>i; ++i)
- _domain.init(P[i], Q[i]);
- return P;
-}
-*/
-
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::assign( Rep& P, const Rep& Q ) const
-{
- Degree degQ;
- degree(degQ,Q);
- if (degQ <0) {
- P.reallocate(0);
- return P;
- }
- P.reallocate(++degQ);
- for (int i=0; degQ>i; ++i)
- _domain.assign(P[i], Q[i]);
- return P;
-}
-
-
-template<class Domain> template<class XXX>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P, const XXX& val ) const
-{
- P.reallocate(1);
- _domain.init(P[0], val);
- return P;
-}
-
-
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::convert(Poly1Dom<Domain,Dense>::Type_t & val, const Poly1Dom<Domain,Dense>::Rep& P ) const
-{
- if (P.size())
- return _domain.assign(val, P[0]);
- else
- return _domain.init(val, 0UL);
-}
-
-template<class Domain> template<class XXX>
-inline XXX& Poly1Dom<Domain,Dense>::convert( XXX& val, const Poly1Dom<Domain,Dense>::Rep& P ) const
-{
- if (P.size())
- return _domain.convert(val, P[0]);
- else
- return _domain.convert(val, 0UL);
-}
-
-template<class Domain> template<class UU, template<class XX> class Vect>
-inline Vect<UU>& Poly1Dom<Domain,Dense>::convert( Vect<UU>& val, const Poly1Dom<Domain,Dense>::Rep& P ) const
-{
- val.resize( P.size() );
- typename Vect<UU>::iterator vit = val.begin();
- typename Rep::const_iterator pit = P.begin();
- for ( ; pit != P.end(); ++pit, ++vit)
- _domain.convert(*vit, *pit);
- return val;
-}
-
-
-
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P, const Degree deg ) const
-{
- P.reallocate(value(deg+1));
- Type_t _one,_zero;
- _domain.init( _one, 1.0);
- _domain.init( _zero, 0.0);
-
- size_t sz = P.size();
- for (unsigned int i=0; i<sz-1; ++i)
- _domain.assign(P[i], _zero);
- _domain.assign(P[sz-1], _one);
- return P;
-}
-
-template<class Domain> template<class XXX>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init
- ( Rep& P, const Degree d, const XXX& val ) const
-{
- Type_t _zero;
- _domain.init( _zero, 0.0);
- long deg = value(d);
- Type_t lcoeff; _domain.init(lcoeff, val);
- if (_domain.isZero(lcoeff)) {
- P.reallocate(0);
- } else {
- P.reallocate(deg+1);
- for (int i=0; i<deg; ++i)
- _domain.assign(P[i], _zero);
- _domain.assign(P[deg], lcoeff);
- }
- return P;
-}
-// template<class Domain>
-// inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init
-// ( Rep& P, const Degree d, const Type_t& lcoeff ) const
-// {
-// Type_t _zero;
-// _domain.init( _zero, 0.0);
-// long deg = value(d);
-// if (_domain.isZero(lcoeff)) {
-// P.reallocate(0);
-// } else {
-// P.reallocate(deg+1);
-// for (int i=0; i<deg; ++i)
-// _domain.assign(P[i], _zero);
-// _domain.assign(P[deg], lcoeff);
-// }
-// return P;
-// }
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::assign
- ( Rep& P, const Degree d, const Type_t& lcoeff ) const
-{
- Type_t _zero;
- _domain.init( _zero, 0.0);
- long deg = value(d);
- if (_domain.isZero(lcoeff)) {
- P.reallocate(0);
- } else {
- P.reallocate(deg+1);
- for (int i=0; i<deg; ++i)
- _domain.assign(P[i], _zero);
- _domain.assign(P[deg], lcoeff);
- }
- return P;
-}
-
+#ifndef __GIVARO_poly1_cstor_INL
+#define __GIVARO_poly1_cstor_INL
+
+namespace Givaro {
+ template<class Domain>
+ inline Poly1Dom<Domain,Dense>::Poly1Dom(const Domain& d, const Indeter& X )
+ : _domain(d), _x(X) ,zero(1,d.zero), one(1,d.one)
+ {}
+
+ template<class Domain>
+ inline Poly1Dom<Domain,Dense>::Poly1Dom(const Self_t& P)
+ : _domain(P._domain), _x(P._x) ,zero(P.zero), one(P.one)
+ {}
+
+ template<class Domain>
+ inline Poly1Dom<Domain,Dense>::~Poly1Dom()
+ {
+ }
+
+
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P) const
+ { P.reallocate(0); return P; }
+
+ /*
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P, const Rep& Q ) const
+ {
+ Degree degQ;
+ degree(degQ,Q);
+ if (degQ <0) {
+ P.reallocate(0);
+ return P;
+ }
+ P.reallocate(++degQ);
+ for (int i=0; degQ>i; ++i)
+ _domain.init(P[i], Q[i]);
+ return P;
+ }
+ */
+
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::assign( Rep& P, const Rep& Q ) const
+ {
+ Degree degQ;
+ degree(degQ,Q);
+ if (degQ <0) {
+ P.reallocate(0);
+ return P;
+ }
+ P.reallocate(++degQ);
+ for (int i=0; degQ>i; ++i)
+ _domain.assign(P[i], Q[i]);
+ return P;
+ }
+
+
+ template<class Domain> template<class XXX>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P, const XXX& Val ) const
+ {
+ P.reallocate(1);
+ _domain.init(P[0], Val);
+ return P;
+ }
+
+
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::convert(typename Poly1Dom<Domain,Dense>::Type_t & Val, const typename Poly1Dom<Domain,Dense>::Rep& P ) const
+ {
+ if (P.size())
+ return _domain.assign(Val, P[0]);
+ else
+ return _domain.init(Val, 0UL);
+ }
+
+ template<class Domain> template<class XXX>
+ inline XXX& Poly1Dom<Domain,Dense>::convert( XXX& Val, const typename Poly1Dom<Domain,Dense>::Rep& P ) const
+ {
+ if (P.size())
+ return _domain.convert(Val, P[0]);
+ else
+ return _domain.convert(Val, 0UL);
+ }
+
+ template<class Domain> template<class UU, template<class XX> class Vect>
+ inline Vect<UU>& Poly1Dom<Domain,Dense>::convert( Vect<UU>& Val, const typename Poly1Dom<Domain,Dense>::Rep& P ) const
+ {
+ Val.resize( P.size() );
+ typename Vect<UU>::iterator vit = Val.begin();
+ typename Rep::const_iterator pit = P.begin();
+ for ( ; pit != P.end(); ++pit, ++vit)
+ _domain.convert(*vit, *pit);
+ return Val;
+ }
+
+
+
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init( Rep& P, const Degree deg ) const
+ {
+ P.reallocate(value(deg+1));
+
+ size_t sz = P.size();
+ for (unsigned int i=0; i<sz-1; ++i)
+ _domain.assign(P[i], _domain.zero);
+ _domain.assign(P[sz-1], _domain.one);
+ return P;
+ }
+
+ template<class Domain> template<class XXX>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::init
+ ( Rep& P, const Degree d, const XXX& Val ) const
+ {
+ long deg = value(d);
+ P.reallocate(deg+1);
+ for (int i=0; i<deg; ++i)
+ _domain.assign(P[i], _domain.zero);
+ _domain.init(P[deg], Val);
+
+ if (_domain.isZero(P[deg])) {
+ P.reallocate(0);
+ }
+ return P;
+ }
+
+
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::assign
+ ( Rep& P, const Degree d, const Type_t& lcoeff ) const
+ {
+ long deg = value(d);
+ if (_domain.isZero(lcoeff)) {
+ P.reallocate(0);
+ } else {
+ P.reallocate(deg+1);
+ for (int i=0; i<deg; ++i)
+ _domain.assign(P[i], _domain.zero);
+ _domain.assign(P[deg], lcoeff);
+ }
+ return P;
+ }
+
+} // Givaro
+#endif // __GIVARO_poly1_cstor_INL
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1cyclo.inl b/src/library/poly1/givpoly1cyclo.inl
index e41b4ee..e665701 100644
--- a/src/library/poly1/givpoly1cyclo.inl
+++ b/src/library/poly1/givpoly1cyclo.inl
@@ -1,12 +1,19 @@
-#ifndef _GIV_POLY1_CYCLO_INL_
-#define _GIV_POLY1_CYCLO_INL_
// =============================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro / Athapascan-1
// Cyclotomic polynomials
-// Time-stamp: <15 Jul 08 10:40:47 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <15 Jul 08 10:40:47 Jean-Guillaume.Dumas at imag.fr>
// =============================================================== //
+#ifndef __GIVARO_poly1_cyclo_INL
+#define __GIVARO_poly1_cyclo_INL
#include <givaro/givintfactor.h>
+namespace Givaro {
+
// ---------------------------------------------------------------
// Composition by a power of X
// ---------------------------------------------------------------
@@ -16,7 +23,7 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::power_compo
Degree dp; degree(dp, P);
Type_t lc;
leadcoef(lc, P);
- init( W, b*dp.value(), lc); // all coeffs to zero ...
+ assign( W, b*dp.value(), lc); // all coeffs to zero, except leading ...
for(long i=0;i<dp.value();++i) {
_domain.assign(W[i*b], P[i]);
}
@@ -27,7 +34,7 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::power_compo
// ---------------------------------------------------------------
-// n th Cyclotomic polynomial
+// n th Cyclotomic polynomial
// ---------------------------------------------------------------
template<class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::cyclotomic( Rep& P, long n) const
@@ -36,16 +43,16 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::cyclotomic(
// Integer In(n);
IntFactorDom<> IF;
if (n <= 1) {
- init(P, Degree(1), _domain.one);
+ init(P, Degree(1));
_domain.assign(P[0], _domain.one);
_domain.negin(P[0]);
return setdegree(P);
} else if (IF.isprime(n)) {
- init(P, Degree(n-1), _domain.one);
+ init(P, Degree(n-1));
for(size_t i=n-1;i--;)
- _domain.assign(P[i], _domain.one);
+ _domain.assign(P[i], _domain.one);
return setdegree(P);
- }
+ }
else {
long q,f;
q = n / 2;
@@ -60,10 +67,10 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::cyclotomic(
if (q % f) {
Rep res;
power_compose(res, inter, f);
- return div(P, res, inter);
+ return div(P, res, inter);
} else
return power_compose(P,inter,f);
- } else {
+ } else {
if (q%2) {
// q odd
cyclotomic(P,q);
@@ -84,4 +91,6 @@ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::cyclotomic(
}
}
-#endif
+} // Givaro
+
+#endif // __GIVARO_poly1_cyclo_INL
diff --git a/src/library/poly1/givpoly1dense.h b/src/library/poly1/givpoly1dense.h
index 7a74b08..aa0aef9 100644
--- a/src/library/poly1/givpoly1dense.h
+++ b/src/library/poly1/givpoly1dense.h
@@ -1,263 +1,393 @@
-#ifndef _GIV_POLY1_DENSE_H_
-#define _GIV_POLY1_DENSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1dense.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1dense.h,v 1.17 2008-09-18 08:11:46 jgdumas Exp $
+// $Id: givpoly1dense.h,v 1.29 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// Description: univariate polynom over T
-// - we assume that T is a ring (0,1,+,*) with:
+// Description: univariate polynomial over T
+// - we assume that T is a ring (0,1,+,*)
+#ifndef __GIVARO_poly1_dense_H
+#define __GIVARO_poly1_dense_H
#include <iostream>
-#include <vector>
#include "givaro/givdegree.h"
#include "givaro/givindeter.h"
#include "givaro/givinteger.h"
#include "givaro/givrandom.h"
+#ifndef __GIV_STANDARD_VECTOR
+#include <vector>
+#define __GIV_STANDARD_VECTOR std::vector
+#endif
-template < typename T, typename A=std::allocator<T> >
-class givvector : public std::vector<T,A> {
- typedef givvector<T,A> Self_t;
-public:
- givvector() : std::vector<T,A>() {}
- givvector(size_t s) : std::vector<T,A>(s) { }
- givvector(const Self_t& p, givNoCopy xxx) : std::vector<T,A>(p) {}
- givvector(const Self_t& p, givWithCopy xxx) : std::vector<T,A>(p) {}
- Self_t& reallocate (size_t s) { this->resize(s); return *this; }
- Self_t& logcopy(const Self_t& src) { return *this = src; }
- Self_t& copy(const Self_t& src) { return *this = src; }
- int areEqual(const Self_t& p) const {
- return *this == p;
- }
- int areNEqual(const Self_t& p) const {
- return *this != p;
- }
-
-};
-
-// -------------------------------------------- Class Poly1Dom<Domain>
-template <class Domain>
-class Poly1Dom<Domain,Dense> {
-protected: // -- Representation
- Domain _domain; // -- subdomain
- Indeter _x; // -- for I/O, if any
-public :
-
- // -- Exported types
- typedef Domain Domain_t;
- typedef typename Domain::Element Type_t;
-
- // -- Self_t
- typedef Poly1Dom<Domain,Dense> Self_t;
-
- // -- The representation of a dense polynomial.
- // assuming that we have correct operator, especially size, allocate
- // , reallocate
- // - zero is Rep.size() ==0 or Rep.size() =1 && Rep[0] ==0
- // - Rep.size() is the degree + 1 if !=0
-// typedef Array0<Type_t> Storage_t;
- typedef givvector<Type_t> Storage_t;
- typedef Storage_t Rep;
- typedef Storage_t Element;
-
- Poly1Dom (const Domain& d, const Indeter& X = Indeter() );
- Poly1Dom (const Self_t&);
-
- int operator==( const Poly1Dom<Domain,Dense>& BC) const
- { return _domain == BC._domain;}
- int operator!=( const Poly1Dom<Domain,Dense>& BC) const
- { return _domain != BC._domain;}
-
- // -- Return the domain of the entries
- const Domain& subdomain() const { return _domain; }
- // -- Return the domain of the entries
- const Domain& getdomain() const { return _domain; }
- Domain& setdomain(const Domain& D) { return _domain = D; }
-
-
- // -- Constantes
- Rep zero;
- Rep one;
-
- // -- Init polynomial
- Rep& init(Rep& a) const;
- // -- Init polynomial with value : F.init(p[0],cste)
- template<class XXX>
- Rep& init(Rep& p, const XXX &cste ) const;
-
- // -- Allocate a polynomial with deg+1 coefficients, each of them are
- // set to zero, except the leading coef which is set to one.
- Rep& init (Rep& r, const Degree deg) const;
-
- // -- For polynomial = lcoeff X^deg
- template<class XXX>
- Rep& init (Rep& p, const Degree deg , const XXX& lcoeff) const;
-
- // F.assign(P[deg], lcoeff);
- Rep& assign (Rep& p, const Degree deg , const Type_t& lcoeff) const;
- // -- Assign polynomial with field value : F.assign(p[0],cste)
- Rep& assign(Rep& p, const Type_t &cste ) const {
- return assign(p, Degree(0), cste);
- }
- // -- Assignment p = q
- Rep& assign( Rep& p, const Rep& q) const;
-
- // -- Convert polynomials : F.assign(cste, p[0])
- Type_t& convert(Type_t&, const Rep &) const;
-
- // -- Convert polynomials : F.convert(cste, p[0])
- template<class XXX>
- XXX& convert(XXX& p, const Rep &) const;
-
- template<class UU, template<class XX> class Vect>
- Vect<UU>& convert( Vect<UU>&, const Rep& P ) const ;
-
- // -- Dstor
- ~Poly1Dom ();
-
- // -- Comparaison operator
- int isZero ( const Rep& P ) const;
- // int isZero ( const Rep& P ) const{return iszero(P);}
- int isOne ( const Rep& P ) const;
- int areEqual ( const Rep& P, const Rep& Q ) const;
- int areNEqual( const Rep& P, const Rep& Q ) const;
-
- // -- Returns the leading coefficients
- Type_t& leadcoef(Type_t& c, const Rep& P) const;
-
- // -- Returns the i-th coefficients
- Type_t& getEntry(Type_t& c, const Degree& i, const Rep& P) const;
-
- // -- Returns the degree of polynomial
- Degree& degree(Degree& d, const Rep& P) const;
-
- // -- Returns the valuation of polynomial
- Degree& val(Degree& d, const Rep& P) const;
-
- // -- Compute the degree of P
- Rep& setdegree( Rep& P ) const;
-
- // -- Evaluation on one point.
- Type_t& eval(Type_t& pval, const Rep& P, const Type_t& val) const;
-
- // -- Returns the differentiate polynomial
- Rep& diff( Rep& P, const Rep& Q) const;
-
- // --
- std::istream& read ( std::istream& i );
- std::ostream& write( std::ostream& o ) const;
- std::istream& read ( std::istream& i, Rep& n) const;
- std::ostream& write( std::ostream& o, const Rep& n) const;
-
- // -- Arithmetics operators
- Rep& addin ( Rep& res, const Rep& u ) const;
- Rep& add ( Rep& res, const Rep& u, const Rep& v ) const;
- Rep& add ( Rep& res, const Rep& u, const Type_t& val ) const;
- Rep& add ( Rep& res, const Type_t& val, const Rep& v ) const;
-
- Rep& subin ( Rep& res, const Rep& u ) const;
- Rep& sub ( Rep& res, const Rep& u, const Rep& v ) const;
- Rep& sub ( Rep& res, const Rep& u, const Type_t& val ) const;
- Rep& sub ( Rep& res, const Type_t& val, const Rep& v ) const;
-
- Rep& negin ( Rep& res ) const;
- Rep& neg ( Rep& res, const Rep& u ) const;
-
- Rep& mulin ( Rep& q, const Rep& a ) const;
- Rep& mulin ( Rep& q, const Type_t& a ) const;
- Rep& mul ( Rep& q, const Rep& a, const Rep& b ) const;
- Rep& mul ( Rep& q, const Type_t& a, const Rep& b ) const;
- Rep& mul ( Rep& q, const Rep& a, const Type_t& b ) const;
-
- Rep& shiftin ( Rep&, int ) const;
- Rep& shift ( Rep&, const Rep&, int ) const;
-
- Rep& divin ( Rep& q, const Rep& a ) const;
- Rep& divin ( Rep& q, const Type_t& a ) const;
- Rep& div ( Rep& q, const Rep& a, const Rep& b ) const;
- Rep& div ( Rep& q, const Type_t& a, const Rep& b ) const;
- Rep& div ( Rep& q, const Rep& a, const Type_t& b ) const;
-
- Rep& modin ( Rep& q, const Rep& a ) const;
- Rep& modin ( Rep& q, const Type_t& a ) const;
- Rep& mod ( Rep& q, const Rep& a, const Rep& b ) const;
- Rep& mod ( Rep& q, const Type_t& a, const Rep& b ) const;
- Rep& mod ( Rep& q, const Rep& a, const Type_t& b ) const;
-
-
- Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const;
- Rep& axpy (Rep& r, const Type_t& a, const Rep& x, const Rep& y) const;
- Rep& axpyin(Rep& r, const Rep& a, const Rep& x) const;
- Rep& axpyin(Rep& r, const Type_t& a, const Rep& x) const;
- // -- amxy: r <- c - a * b
- Rep& amxy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const;
- Rep& amxy (Rep& r, const Type_t& a, const Rep& b, const Rep& c) const;
- // -- amxyin: r -= a*b
- Rep& amxyin(Rep& r, const Rep& a, const Rep& b) const;
- Rep& amxyin(Rep& r, const Type_t& a, const Rep& b) const;
- // -- axmy: r <- a * x - y
- Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const;
- Rep& axmy (Rep& r, const Type_t& a, const Rep& x, const Rep& y) const;
-
- // A = q*B + r
- Rep& divmod( Rep& q, Rep& r, const Rep& a, const Rep& b ) const;
-
- // m*A = q*B + r
- Rep& pdivmod( Rep& q, Rep& r, Type_t& m, const Rep& a, const Rep& b ) const;
- Rep& pmod( Rep& r, Type_t& m, const Rep& a, const Rep& b ) const;
- Rep& pmod( Rep& r, const Rep& a, const Rep& b ) const;
- Rep& pdiv( Rep& q, Type_t& m, const Rep& a, const Rep& b ) const;
- Rep& pdiv( Rep& q, const Rep& a, const Rep& b ) const;
-
-
- // -- gcd D = gcd(P,Q) = P*U+Q*V;
- Rep& gcd ( Rep& D, const Rep& P, const Rep& Q) const;
- Rep& gcd ( Rep& D, Rep& U, Rep& V, const Rep& P, const Rep& Q) const;
- Rep& lcm ( Rep& D, const Rep& P, const Rep& Q) const;
- // -- modular inverse of P : U P = 1 + V Q
- Rep& invmod ( Rep& U, const Rep& P, const Rep& Q) const;
-
- // -- misc
- // -- W <-- P^n
- Rep& pow( Rep& W, const Rep& P, long n) const;
- // -- W <-- P^n [ U ]
- Rep& powmod( Rep& W, const Rep& P, IntegerDom::Element pwr, const Rep& U) const;
- template < class MyInt >
- Rep& powmod( Rep& W, const Rep& P, MyInt pwr, const Rep& U) const {
- return powmod(W, P, (IntegerDom::Element)pwr, U);
- }
-
- // -- W <-- P(X^b)
- Rep& power_compose( Rep& W, const Rep& P, long b) const;
-
- // -- n th cyclotomic polynomial
- Rep& cyclotomic( Rep& P, long n) const;
-
-
- // -- Random generators
- // -- Random dense polynomial of degree 0
- template< class RandIter > Rep& random(RandIter& g, Rep& r) const;
- // -- Random dense polynomial of size s
- template< class RandIter > Rep& random(RandIter& g, Rep& r, long s) const ;
- // -- Random dense polynomial of degree d
- template< class RandIter > Rep& random(RandIter& g, Rep& r, Degree s) const ;
-
- Rep& random(GivRandom& g, Rep& r, Degree s) const ;
- // -- Random dense polynomial with same size as b.
- template< class RandIter > Rep& random(RandIter& g, Rep& r, const Rep& b) const;
-
- template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r) const;
- template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, long s) const;
- template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, Degree s) const ;
- template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, const Rep& b) const;
-
- // -- Square free decomposition
- size_t& sqrfree(size_t& Nfact, Rep* Fact, const Rep& P) const;
-
-
-}; // ------------------------------- End Of The Class Poly1Dom<Type_t>
-
+namespace Givaro {
+
+ template < typename T, typename A=std::allocator<T> >
+ class givvector : public __GIV_STANDARD_VECTOR<T,A> {
+ typedef givvector<T,A> Self_t;
+ public:
+ typedef typename __GIV_STANDARD_VECTOR<T,A>::const_iterator const_iterator ;
+ givvector() :
+ __GIV_STANDARD_VECTOR<T,A>()
+ {}
+ givvector(size_t s) :
+ __GIV_STANDARD_VECTOR<T,A>(s)
+ { }
+ givvector(size_t s, const T& t) :
+ __GIV_STANDARD_VECTOR<T,A>(s,t)
+ { }
+ givvector(const Self_t& p, givNoCopy xxx) :
+ __GIV_STANDARD_VECTOR<T,A>(p)
+ {}
+ givvector(const Self_t& p, givWithCopy xxx) :
+ __GIV_STANDARD_VECTOR<T,A>(p)
+ {}
+ Self_t& reallocate (size_t s)
+ {
+ this->resize(s);
+ return *this;
+ }
+ Self_t& logcopy(const Self_t& src)
+ {
+ return *this = src;
+ }
+ Self_t& copy(const Self_t& src)
+ {
+ return *this = src;
+ }
+ int areEqual(const Self_t& p) const
+ {
+ return *this == p;
+ }
+ int areNEqual(const Self_t& p) const
+ {
+ return *this != p;
+ }
+
+
+ template<typename _Tp1>
+ struct rebind {
+ typedef givvector<typename _Tp1::Element> other;
+
+ void operator() (other & P2,
+ const Self_t& P1,
+ const _Tp1& F)
+ {
+ typename Self_t::const_iterator it1 = P1.begin();
+ typename other::iterator it2 = P2.begin();
+ for (; it1 != P1.end(); ++it1, ++it2)
+ F.init (*it2, *it1);
+ }
+ };
+
+ template<typename _Elt1, typename _Alc1, typename Field>
+ givvector(const givvector<_Elt1, _Alc1>& V, const Field& F) :
+ __GIV_STANDARD_VECTOR<T,A>(V.size())
+ {
+ typename givvector<_Elt1, _Alc1>::template rebind<Field>() (*this, V, F);
+ }
+
+
+ };
+
+ // -------------------------------------------- Class Poly1Dom<Domain>
+ template <class Domain>
+ class Poly1Dom<Domain,Dense> {
+ protected: // -- Representation
+ Domain _domain; // -- subdomain
+ Indeter _x; // -- for I/O, if any
+ public :
+
+ // -- Exported types
+ typedef Domain Domain_t;
+ typedef typename Domain::Element Type_t;
+
+ // -- Self_t
+ typedef Poly1Dom<Domain,Dense> Self_t;
+
+ // -- The representation of a dense polynomial.
+ // assuming that we have correct operator, especially size, allocate
+ // , reallocate
+ // - zero is Rep.size() ==0 or Rep.size() =1 && Rep[0] ==0
+ // - Rep.size() is the degree + 1 if !=0
+ // typedef Array0<Type_t> Storage_t;
+ typedef givvector<Type_t> Storage_t;
+ typedef Storage_t Rep;
+ typedef const Storage_t constRep;
+ typedef Storage_t Element;
+
+ Poly1Dom ()
+ {}
+ Poly1Dom (const Domain& d, const Indeter& X = Indeter() );
+ Poly1Dom (const Self_t&);
+ Type_t characteristic() const
+ {
+ return _domain.characteristic();
+ }
+ Integer& characteristic( Integer& p) const
+ {
+ return _domain.characteristic(p);
+ }
+
+ int operator==( const Poly1Dom<Domain,Dense>& BC) const
+ {
+ return _domain == BC._domain;
+ }
+ int operator!=( const Poly1Dom<Domain,Dense>& BC) const
+ {
+ return _domain != BC._domain;
+ }
+
+ const Indeter& getIndeter() const
+ {
+ return _x;
+ }
+ Indeter& setIndeter(const Indeter& X)
+ {
+ return _x=X;
+ }
+
+ // -- Return the domain of the entries
+ const Domain& subdomain() const
+ {
+ return _domain;
+ }
+ // -- Return the domain of the entries
+ const Domain& getdomain() const
+ {
+ return _domain;
+ }
+ Domain& setdomain(const Domain& D)
+ {
+ return _domain = D;
+ }
+
+
+ // -- Constantes
+ Rep zero;
+ Rep one;
+
+ // -- Init polynomial
+ Rep& init(Rep& a) const;
+ // -- Init polynomial with value : F.init(p[0],cste)
+ template<class XXX>
+ Rep& init(Rep& p, const XXX &cste ) const;
+
+ // -- Allocate a polynomial with deg+1 coefficients, each of them are
+ // set to zero, except the leading coef which is set to one.
+ Rep& init (Rep& r, const Degree deg) const;
+
+ // -- For polynomial = lcoeff X^deg
+ template<class XXX>
+ Rep& init (Rep& p, const Degree deg , const XXX& lcoeff) const;
+
+ // F.assign(P[deg], lcoeff);
+ Rep& assign (Rep& p, const Degree deg , const Type_t& lcoeff) const;
+ // -- Assign polynomial with field value : F.assign(p[0],cste)
+ Rep& assign(Rep& p, const Type_t &cste ) const
+ {
+ return assign(p, Degree(0), cste);
+ }
+ // -- Assignment p = q
+ Rep& assign( Rep& p, const Rep& q) const;
+
+ // -- Convert polynomials : F.assign(cste, p[0])
+ Type_t& convert(Type_t&, const Rep &) const;
+
+ // -- Convert polynomials : F.convert(cste, p[0])
+ template<class XXX>
+ XXX& convert(XXX& p, const Rep &) const;
+
+ template<class UU, template<class XX> class Vect>
+ Vect<UU>& convert( Vect<UU>&, const Rep& P ) const ;
+
+ // -- Dstor
+ ~Poly1Dom ();
+
+ // -- Comparaison operator
+ int isZero ( const Rep& P ) const;
+#if 0
+ int isZero ( const Rep& P ) const
+ {
+ return iszero(P);
+ }
#endif
+ int isOne ( const Rep& P ) const;
+ int areEqual ( const Rep& P, const Rep& Q ) const;
+ int areNEqual( const Rep& P, const Rep& Q ) const;
+
+ // -- Returns the leading coefficients
+ Type_t& leadcoef(Type_t& c, const Rep& P) const;
+
+ // -- Returns the i-th coefficients
+ Type_t& getEntry(Type_t& c, const Degree& i, const Rep& P) const;
+
+ // -- Returns the degree of polynomial
+ Degree& degree(Degree& d, const Rep& P) const;
+
+ // -- Returns the valuation of polynomial
+ Degree& val(Degree& d, const Rep& P) const;
+
+ /*! @brief Compute the degree of P.
+ * @warning this is an infamous function that may
+ * not leave \p P constant !!
+ * @param P polynomial
+ */
+ Rep& setdegree( Rep& P ) const;
+
+ // -- Evaluation on one point.
+ Type_t& eval(Type_t& pval, const Rep& P, const Type_t& val) const;
+
+ // -- Returns the differentiate polynomial
+ Rep& diff( Rep& P, const Rep& Q) const;
+
+ // -- Computes the reverse polynomial
+ Rep& reverse( Rep&, const Rep&) const;
+ Rep& reversein( Rep&) const;
+
+
+ // --
+ std::istream& read ( std::istream& i );
+ std::ostream& write( std::ostream& o ) const;
+ std::istream& read ( std::istream& i, Rep& n) const;
+ std::ostream& write( std::ostream& o, const Rep& n) const;
+
+ // -- Arithmetics operators
+ Rep& addin ( Rep& res, const Rep& u ) const;
+ Rep& add ( Rep& res, const Rep& u, const Rep& v ) const;
+ Rep& add ( Rep& res, const Rep& u, const Type_t& val ) const;
+ Rep& add ( Rep& res, const Type_t& val, const Rep& v ) const;
+
+ Rep& subin ( Rep& res, const Rep& u ) const;
+ Rep& sub ( Rep& res, const Rep& u, const Rep& v ) const;
+ Rep& sub ( Rep& res, const Rep& u, const Type_t& val ) const;
+ Rep& sub ( Rep& res, const Type_t& val, const Rep& v ) const;
+
+ Rep& negin ( Rep& res ) const;
+ Rep& neg ( Rep& res, const Rep& u ) const;
+
+ Rep& mulin ( Rep& q, const Rep& a ) const;
+ Rep& mulin ( Rep& q, const Type_t& a ) const;
+ Rep& mul ( Rep& q, const Rep& a, const Rep& b ) const;
+ Rep& mul ( Rep& q, const Type_t& a, const Rep& b ) const;
+ Rep& mul ( Rep& q, const Rep& a, const Type_t& b ) const;
+
+ // Compute truncated mul: only the coefficients inside
+ // the degree interval, included
+ Rep& mul( Rep&, const Rep&, const Rep&, const Degree&, const Degree&) const;
+
+
+ Rep& shiftin ( Rep&, int ) const;
+ Rep& shift ( Rep&, const Rep&, int ) const;
+
+ Rep& divin ( Rep& q, const Rep& a ) const;
+ Rep& divin ( Rep& q, const Type_t& a ) const;
+ Rep& div ( Rep& q, const Rep& a, const Rep& b ) const;
+ Rep& div ( Rep& q, const Type_t& a, const Rep& b ) const;
+ Rep& div ( Rep& q, const Rep& a, const Type_t& b ) const;
+
+ Rep& modin ( Rep& q, const Rep& a ) const;
+ Rep& modin ( Rep& q, const Type_t& a ) const;
+ Rep& mod ( Rep& q, const Rep& a, const Rep& b ) const;
+ Rep& mod ( Rep& q, const Type_t& a, const Rep& b ) const;
+ Rep& mod ( Rep& q, const Rep& a, const Type_t& b ) const;
+
+
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const;
+ Rep& axpy (Rep& r, const Type_t& a, const Rep& x, const Rep& y) const;
+ Rep& axpyin(Rep& r, const Rep& a, const Rep& x) const;
+ Rep& axpyin(Rep& r, const Type_t& a, const Rep& x) const;
+ // -- maxpy: r <- c - a * b
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& b, const Rep& c) const;
+ Rep& maxpy (Rep& r, const Type_t& a, const Rep& b, const Rep& c) const;
+ // -- maxpyin: r -= a*b
+ Rep& maxpyin(Rep& r, const Rep& a, const Rep& b) const;
+ Rep& maxpyin(Rep& r, const Type_t& a, const Rep& b) const;
+ // -- axmy: r <- a * x - y
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const;
+ Rep& axmy (Rep& r, const Type_t& a, const Rep& x, const Rep& y) const;
+ // -- axmyin: r = a * x - r
+ Rep& axmyin (Rep& r, const Rep& a, const Rep& x) const;
+ Rep& axmyin (Rep& r, const Type_t& a, const Rep& x) const;
+
+ // A = q*B + r
+ Rep& divmod( Rep& q, Rep& r, const Rep& a, const Rep& b ) const;
+
+ // r <-- r - q*B ; d°(r) < d°(B)
+ Rep& divmodin( Rep& q, Rep& r, const Rep& b ) const;
+
+
+ // m*A = q*B + r
+ Rep& pdivmod( Rep& q, Rep& r, Type_t& m, const Rep& a, const Rep& b ) const;
+ Rep& pmod( Rep& r, Type_t& m, const Rep& a, const Rep& b ) const;
+ Rep& pmod( Rep& r, const Rep& a, const Rep& b ) const;
+ Rep& pdiv( Rep& q, Type_t& m, const Rep& a, const Rep& b ) const;
+ Rep& pdiv( Rep& q, const Rep& a, const Rep& b ) const;
+
+
+ // -- gcd D = gcd(P,Q) = P*U+Q*V;
+ // Rep& gcd ( Rep& D, const Rep& P, const Rep& Q) const;
+ Rep& gcd ( Rep& D, const Rep& P, const Rep& Q) const;
+ Rep& gcd ( Rep& D, Rep& U, Rep& V, const Rep& P, const Rep& Q) const;
+ Rep& lcm ( Rep& D, const Rep& P, const Rep& Q) const;
+ // -- modular inverse of P : U P = 1 + V Q
+ Rep& invmod ( Rep& U, const Rep& P, const Rep& Q) const;
+ // -- modular inverse of P : U P = e + V Q where e is of degree 0
+ Rep& invmodunit ( Rep& U, const Rep& P, const Rep& Q) const;
+
+ // -- rational reconstruction
+ // -- Builds N and D such that P * D = N mod M and degree(N) <= dk
+ void ratrecon(Rep& N, Rep& D, const Rep& P, const Rep& M, const Degree& dk) const;
+ // -- checks wether the reconstruction succeeded
+ bool ratreconcheck(Rep& N, Rep& D, const Rep& P, const Rep& M, const Degree& dk) const;
+
+ // -- misc
+ // -- W <-- P^n
+ Rep& pow( Rep& W, const Rep& P, long n) const;
+ // -- W <-- P^n [ U ]
+ Rep& powmod( Rep& W, const Rep& P, IntegerDom::Element pwr, const Rep& U) const;
+ template < class MyInt >
+ Rep& powmod( Rep& W, const Rep& P, MyInt pwr, const Rep& U) const
+ {
+ return powmod(W, P, (IntegerDom::Element)pwr, U);
+ }
+
+ // -- W <-- P(X^b)
+ Rep& power_compose( Rep& W, const Rep& P, long b) const;
+
+ // -- n th cyclotomic polynomial
+ Rep& cyclotomic( Rep& P, long n) const;
+
+
+ // -- Random generators
+ // -- Random dense polynomial of degree 0
+ template< class RandIter > Rep& random(RandIter& g, Rep& r) const;
+ // -- Random dense polynomial of size s
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, long s) const ;
+ // -- Random dense polynomial of degree d
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, Degree s) const ;
+
+ Rep& random(GivRandom& g, Rep& r, Degree s) const ;
+ // -- Random dense polynomial with same size as b.
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, const Rep& b) const;
+
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r) const;
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, long s) const;
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, Degree s) const ;
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, const Rep& b) const;
+
+ // -- Square free decomposition
+ size_t& sqrfree(size_t& Nfact, Rep* Fact, const Rep& P) const;
+
+
+ }; // ------------------------------- End Of The Class Poly1Dom<Type_t>
+
+} // Givaro
+
+#endif // __GIVARO_poly1_dense_H
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1denseops.inl b/src/library/poly1/givpoly1denseops.inl
index 66dc227..aa73429 100644
--- a/src/library/poly1/givpoly1denseops.inl
+++ b/src/library/poly1/givpoly1denseops.inl
@@ -1,5 +1,12 @@
-#ifndef __GIV__POLY1_DENSE_OPS_inl__
-#define __GIV__POLY1_DENSE_OPS_inl__
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#ifndef __GIVARO_poly1_dense_ops_INL
+#define __GIVARO_poly1_dense_ops_INL
+
#include "givaro/givpoly1cstor.inl"
#include "givaro/givpoly1misc.inl"
#include "givaro/givpoly1addsub.inl"
@@ -9,5 +16,6 @@
#include "givaro/givpoly1gcd.inl"
#include "givaro/givpoly1sqrfree.inl"
#include "givaro/givpoly1cyclo.inl"
+#include "givaro/givpoly1ratrecon.inl"
-#endif
+#endif // __GIVARO_poly1_dense_ops_INL
diff --git a/src/library/poly1/givpoly1factor.h b/src/library/poly1/givpoly1factor.h
index e1dec19..d379578 100644
--- a/src/library/poly1/givpoly1factor.h
+++ b/src/library/poly1/givpoly1factor.h
@@ -1,173 +1,220 @@
// ================================================================= //
-// Givaro / Athapascan-1
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Irreducibily test
// Factorisations de Polynomes dans Fp[X] :
// Distinct Degree
// Cantor-Zassenhaus
-// Berlekamp : in LinBox
-// Time-stamp: <27 Jun 05 11:35:32 Jean-Guillaume.Dumas at imag.fr>
+// Berlekamp: moved in LinBox
+// Time-stamp: <27 Jun 05 11:35:32 Jean-Guillaume.Dumas at imag.fr>
// ================================================================= //
-#ifndef _GIV_POLY1_FACTO_H_
-#define _GIV_POLY1_FACTO_H_
+#ifndef __GIVARO_poly1_facto_H
+#define __GIVARO_poly1_facto_H
#include <givaro/givrandom.h>
#include <givaro/givpoly1.h>
-// template<class Domain, class StorageTag> class Poly1FactorDom {};
-
-template<class Domain, class Tag, class RandIter = GivRandom>
-class Poly1FactorDom : public Poly1Dom<Domain,Tag> {
-protected:
- using Poly1Dom<Domain,Tag>::_domain;
- using Poly1Dom<Domain,Tag>::one;
- using Poly1Dom<Domain,Tag>::zero;
- typedef typename Poly1Dom<Domain,Tag>::Rep Rep;
- mutable RandIter _g;
-public:
- typedef typename Poly1Dom<Domain,Tag>::Element Element;
- typedef RandIter random_generator;
-
- // typedef typename Domain::Residu_t Residu_t;
- typedef typename Signed_Trait<typename Domain::Element>::unsigned_type Residu_t;
-
- // Warning : there is a copy of the random Iterator ...
- Poly1FactorDom (Domain& d, const Indeter& X = Indeter(), const RandIter& g = RandIter() ) : Poly1Dom<Domain,Tag> (d,X), _g(g) {}
- Poly1FactorDom (const Poly1Dom<Domain,Tag>& P, const RandIter& g = RandIter()) : Poly1Dom<Domain,Tag> (P), _g(g) {}
-
-// ---------------------------------------------------------------
-// Splits a polynomial into prime factors of same degree
-// ---------------------------------------------------------------
-
-template< template<class, class> class Container, template<class> class Alloc >
-void SplitFactor( Container< Rep, Alloc<Rep> > & L
- , const Rep& G
- , Degree d
- , Residu_t MOD) const ;
-
-template< template<class, class> class Container, template <class> class Alloc>
-void SplitFactor( Container< Rep, Alloc<Rep> > & L
- , const Rep& G
- , Degree d) const {
- SplitFactor(L,G,d,_domain.residu());
- }
-
-
- Rep& SplitFactor(
- Rep& R
- , const Rep& G
- , Degree d
- , Residu_t MOD) const ;
-
- Rep& SplitFactor(
- Rep& R
- , const Rep& G
- , Degree d) const {
- return SplitFactor(R,G,d,_domain.residu() );
- }
-
-
-
-// ---------------------------------------------------------------
-// Splits a polynomial into divisors of homogenous prime factors
-// ---------------------------------------------------------------
-
-template< template<class, class> class Container, template<class> class Alloc>
-void DistinctDegreeFactor(Container< Rep, Alloc<Rep> > & L
- , const Rep& f
- , Residu_t MOD) const ;
-
-template< template<class, class> class Container, template <class> class Alloc>
-void DistinctDegreeFactor( Container< Rep, Alloc<Rep> > & L
- , const Rep& f) const {
- DistinctDegreeFactor(L,f,_domain.residu());
- }
-
-// ---------------------------------------------------------------
-// Cantor-Zassenhaus Polynomial factorization over Z/pZ
-// ---------------------------------------------------------------
-
-template< template<class, class> class Container, template <class> class Alloc>
-void CZfactor( Container< Rep, Alloc<Rep> > & Lf,
- Container< unsigned long, Alloc<unsigned long> > & Le,
- const Rep& f,
- Residu_t MOD) const ;
-
-template< template<class, class> class Container, template <class> class Alloc>
-void CZfactor( Container< Rep, Alloc<Rep> > & Lf,
- Container< unsigned long, Alloc<unsigned long> > & Le,
- const Rep& f ) const {
- CZfactor(Lf, Le, f,_domain.residu());
- }
-
-// ---------------------------------------------------------------
-// Gives one non-trivial factor of P if P is reducible
-// returns P otherwise
-// ---------------------------------------------------------------
-
- Rep& factor(
- Rep& W
- , const Rep& P
- , Residu_t MOD ) const ;
-
- Rep& factor(
- Rep& W
- , const Rep& P ) const {
- return factor(W,P,_domain.residu());
- }
-
-
-// ---------------------------------------------------------------
-// Irreducibility test
-// ---------------------------------------------------------------
-
- bool is_irreducible(
- const Rep& P
- , Residu_t MOD ) const ;
-
- bool is_irreducible(const Rep& P ) const {
- return is_irreducible(P,_domain.residu());
- }
-
- bool is_irreducible2(
- const Rep& P
- , Residu_t MOD ) const ;
-
- bool is_irreducible2(const Rep& P ) const {
- return is_irreducible2(P,_domain.residu());
- }
-
-
-// ---------------------------------------------------------------
-// Irreducible polynomials
-// ---------------------------------------------------------------
- /// random irreducible polynomial
- Element& random_irreducible (Element& P, Degree n) const ;
- /// random irreducible polynomial tries to be sparse
- Element& creux_random_irreducible (Element& P, Degree n) const ;
-
- /// random irreducible polynomial with X as primitive root
- Element& ixe_irreducible (Element& R, Degree n) const ;
- /// random irreducible polynomial with X as primitive root
- Element& ixe_irreducible2 (Element& R, Degree n) const ;
-
-// ---------------------------------------------------------------
-// Primitive polynomials
-// ---------------------------------------------------------------
-
- IntegerDom::Element order(const Rep& P, const Rep& F) const ;
-
-
- bool is_prim_root( const Rep& P, const Rep& F) const ;
-
- Rep& random_prim_root(Rep& P, Rep& R, Degree n) const ;
-
-
- Rep& give_random_prim_root(Rep& R, const Rep& F) const ;
- Rep& give_prim_root(Rep& R, const Rep& F) const ;
-
-};
-
-
-
-#include "givaro/givpoly1factor.inl"
-#include "givaro/givpoly1proot.inl"
-#endif
+
+namespace Givaro {
+
+ // template<class Domain, class StorageTag> class Poly1FactorDom {};
+
+ template<class Domain, class Tag, class RandIter = GivRandom>
+ class Poly1FactorDom : public Poly1Dom<Domain,Tag> {
+ protected:
+ using Poly1Dom<Domain,Tag>::_domain;
+ typedef typename Poly1Dom<Domain,Tag>::Rep Rep;
+ mutable RandIter _g;
+ public:
+ using Poly1Dom<Domain,Tag>::one;
+ using Poly1Dom<Domain,Tag>::zero;
+ typedef typename Poly1Dom<Domain,Tag>::Element Element;
+ typedef RandIter random_generator;
+ typedef typename Signed_Trait<typename Domain::Element>::unsigned_type Residu_t;
+ // typedef typename Domain::Residu_t Residu_t;
+
+ Poly1FactorDom () {}
+
+ //! @warning there is a copy of the random Iterator ...
+ Poly1FactorDom (Domain& d, const Indeter& X = Indeter(), const RandIter& g = RandIter() ) :
+ Poly1Dom<Domain,Tag> (d,X), _g(g)
+ {}
+
+ Poly1FactorDom (const Poly1Dom<Domain,Tag>& P, const RandIter& g = RandIter()) :
+ Poly1Dom<Domain,Tag> (P), _g(g)
+ {}
+
+ // ---------------------------------------------------------------
+ // Splits a polynomial into prime factors of same degree
+ // ---------------------------------------------------------------
+
+ template< template<class, class> class Container, template<class> class Alloc >
+ void SplitFactor( Container< Rep, Alloc<Rep> > & L
+ , const Rep& G
+ , Degree d
+ , Residu_t MOD) const ;
+
+ template< template<class, class> class Container, template <class> class Alloc>
+ void SplitFactor( Container< Rep, Alloc<Rep> > & L
+ , const Rep& G
+ , Degree d) const {
+ SplitFactor(L,G,d,_domain.residu());
+ }
+
+
+ Rep& SplitFactor(
+ Rep& R
+ , const Rep& G
+ , Degree d
+ , Residu_t MOD) const ;
+
+ Rep& SplitFactor(
+ Rep& R
+ , const Rep& G
+ , Degree d) const {
+ return SplitFactor(R,G,d,_domain.residu() );
+ }
+
+
+
+ // ---------------------------------------------------------------
+ // Splits a polynomial into divisors of homogenous prime factors
+ // ---------------------------------------------------------------
+
+ template< template<class, class> class Container, template<class> class Alloc>
+ void DistinctDegreeFactor(Container< Rep, Alloc<Rep> > & L
+ , const Rep& f
+ , Residu_t MOD) const ;
+
+ template< template<class, class> class Container, template <class> class Alloc>
+ void DistinctDegreeFactor( Container< Rep, Alloc<Rep> > & L
+ , const Rep& f) const {
+ DistinctDegreeFactor(L,f,_domain.residu());
+ }
+
+ // ---------------------------------------------------------------
+ // Cantor-Zassenhaus Polynomial factorization over Z/pZ
+ // ---------------------------------------------------------------
+
+ template< template<class, class> class Container, template <class> class Alloc>
+ void CZfactor( Container< Rep, Alloc<Rep> > & Lf,
+ Container< unsigned long, Alloc<unsigned long> > & Le,
+ const Rep& f,
+ Residu_t MOD) const ;
+
+ template< template<class, class> class Container, template <class> class Alloc>
+ void CZfactor( Container< Rep, Alloc<Rep> > & Lf,
+ Container< unsigned long, Alloc<unsigned long> > & Le,
+ const Rep& f ) const {
+ CZfactor(Lf, Le, f,_domain.residu());
+ }
+
+ // ---------------------------------------------------------------
+ // Gives one non-trivial factor of P if P is reducible
+ // returns P otherwise
+ // ---------------------------------------------------------------
+
+ Rep& factor(
+ Rep& W
+ , const Rep& P
+ , Residu_t MOD ) const ;
+
+ Rep& factor(
+ Rep& W
+ , const Rep& P ) const {
+ return factor(W,P,_domain.residu());
+ }
+
+
+ // ---------------------------------------------------------------
+ // Irreducibility test
+ // ---------------------------------------------------------------
+
+ bool is_irreducible( const Rep& P
+ , Residu_t MOD ) const ;
+
+ bool is_irreducible( const Rep& P ) const
+ {
+ return is_irreducible(P,_domain.residu());
+ }
+
+ bool is_irreducible2( const Rep& P
+ , Residu_t MOD ) const ;
+
+ bool is_irreducible2( const Rep& P ) const
+ {
+ return is_irreducible2(P,_domain.residu());
+ }
+
+
+ // ---------------------------------------------------------------
+ // Irreducible polynomials
+ // ---------------------------------------------------------------
+ /// random irreducible polynomial
+ Element& random_irreducible (Element& P, Degree n) const ;
+ /// random irreducible polynomial tries to be sparse
+ Element& creux_random_irreducible (Element& P, Degree n) const ;
+
+ /// random irreducible polynomial with X as primitive root
+ Element& ixe_irreducible (Element& R, Degree n) const ;
+ /// random irreducible polynomial with X as primitive root
+ Element& ixe_irreducible2 (Element& R, Degree n) const ;
+
+ // ---------------------------------------------------------------
+ // Primitive polynomials
+ // ---------------------------------------------------------------
+
+ IntegerDom::Element order(const Rep& P, const Rep& F) const ;
+
+
+ bool is_prim_root( const Rep& P, const Rep& F) const ;
+
+ Rep& random_prim_root(Rep& P, Rep& R, Degree n) const ;
+
+
+ Rep& give_random_prim_root(Rep& R, const Rep& F) const ;
+ Rep& give_prim_root(Rep& R, const Rep& F) const ;
+
+ private :
+ template<class Residue>
+ bool find_irred_binomial(Element &R, Degree n, Residue MOD) const;
+ bool find_irred_binomial(Element &R, Degree n, bool MOD) const;
+ template<class Residue>
+ bool find_irred_binomial(Element &R, Degree n, Residue MOD, Element IXE) const;
+ bool find_irred_binomial(Element &R, Degree n, bool MOD, Element IXE) const;
+ template<class Residue>
+ bool find_irred_binomial2(Element &R, Degree n, Residue MOD, Element IXE) const;
+ bool find_irred_binomial2(Element &R, Degree n, bool MOD, Element IXE) const;
+
+ template<class Residue>
+ bool find_irred_trinomial(Element &R, Degree n, Residue MOD) const;
+ bool find_irred_trinomial(Element &R, Degree n, bool MOD) const;
+ template<class Residue>
+ bool find_irred_trinomial(Element &R, Degree n, Residue MOD, Element IXE) const;
+ bool find_irred_trinomial(Element &R, Degree n, bool MOD, Element IXE) const;
+ template<class Residue>
+ bool find_irred_trinomial2(Element &R, Degree n, Residue MOD, Element IXE) const;
+ bool find_irred_trinomial2(Element &R, Degree n, bool MOD, Element IXE) const;
+
+ template<class Residue>
+ bool find_irred_randomial(Element &R, Degree n, Residue MOD) const;
+ bool find_irred_randomial(Element &R, Degree n, bool MOD) const;
+ template<class Residue>
+ bool find_irred_randomial(Element &R, Degree n, Residue MOD, Element IXE) const;
+ bool find_irred_randomial(Element &R, Degree n, bool MOD, Element IXE) const;
+ template<class Residue>
+ bool find_irred_randomial2(Element &R, Degree n, Residue MOD, Element IXE) const;
+ bool find_irred_randomial2(Element &R, Degree n, bool MOD, Element IXE) const;
+
+ };
+
+} // Givaro
+
+#include "givaro/givpoly1factor.inl"
+#include "givaro/givpoly1proot.inl"
+#endif // __GIVARO_poly1_facto_H
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1factor.inl b/src/library/poly1/givpoly1factor.inl
index dfea15e..667e2de 100644
--- a/src/library/poly1/givpoly1factor.inl
+++ b/src/library/poly1/givpoly1factor.inl
@@ -1,29 +1,38 @@
// ================================================================= //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro / Athapascan-1
// Irreducibily test
// Factorisations de Polynomes dans Fp[X] :
// Distinct Degree
// Cantor-Zassenhaus
// Berlekamp : in LinBox
-// Time-stamp: <26 Feb 08 13:37:26 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <26 Feb 08 13:37:26 Jean-Guillaume.Dumas at imag.fr>
// ================================================================= //
-#ifndef _GIV_POLY1_FACTO_INL_
-#define _GIV_POLY1_FACTO_INL_
+#ifndef __GIVARO_poly1_facto_INL
+#define __GIVARO_poly1_facto_INL
#include <givaro/givpower.h>
+//!@todo use NTL if available ?
+
+
+namespace Givaro {
+
// ---------------------------------------------------------------
// Splits a polynomial into prime factors of same degree
// ---------------------------------------------------------------
template<class Domain, class Tag, class RandIter>
-template< template<class, class> class Container, template <class> class Alloc >
-inline void Poly1FactorDom<Domain,Tag, RandIter>::SplitFactor(
+template< template<class, class> class Container, template <class> class Alloc >
+inline void Poly1FactorDom<Domain,Tag, RandIter>::SplitFactor(
Container< Rep, Alloc<Rep> > & L
, const Rep& G
, Degree d
- , Residu_t MOD) const {
- typename Domain::Element one;
- _domain.init(one, 1UL);
+ , Residu_t MOD) const
+{
Degree dG;degree(dG,G);
if (dG == d)
L.push_back(G);
@@ -44,7 +53,7 @@ inline void Poly1FactorDom<Domain,Tag, RandIter>::SplitFactor(
Integer pp = (power(Integer(MOD), d.value()) - 1)/2;
// std::cerr << "pp: " << pp << std::endl;
Rep tp, tp2, G2;
- this->gcd(G2,G, sub(tp2, this->powmod(tp, tmp, pp, G) , one) );
+ this->gcd(G2,G, sub(tp2, this->powmod(tp, tmp, pp, G) , _domain.one) );
Degree dG2; degree(dG2,G2);
// write(std::cerr << "SF t2: ", tp2) << std::endl;
// write(std::cerr << "SF G2: ", G2) << std::endl;
@@ -54,7 +63,7 @@ inline void Poly1FactorDom<Domain,Tag, RandIter>::SplitFactor(
SplitFactor ( L, G2, d, MOD) ;
}
// UNNECESSARY : ANYTHING FOUND BY G3 WOULD HAVE THE COFACTOR IN G2
- Rep G3; this->gcd(G3, G, add(tp2,tp,one) );
+ Rep G3; this->gcd(G3, G, add(tp2,tp,_domain.one) );
Degree dG3; degree(dG3,G3);
// write(std::cerr << "SF t3: ", tp2) << std::endl;
// write(std::cerr << "SF G3: ", G3) << std::endl;
@@ -75,8 +84,6 @@ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain
, const Rep& G
, Degree d
, Residu_t MOD) const {
- typename Domain::Element one;
- _domain.init(one, 1UL);
Degree dG;degree(dG,G);
if (dG == d)
return G1.copy(G) ;
@@ -93,7 +100,7 @@ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain
}
Integer pp = (power(Integer(MOD), d.value()) - 1)/2;
Rep tp, tp2, G2;
- this->gcd(G2,G, sub(tp2, this->powmod(tp, tmp, pp, G) , one) );
+ this->gcd(G2,G, sub(tp2, this->powmod(tp, tmp, pp, G) , _domain.one) );
Degree dG2; degree(dG2,G2);
// write(std::cerr << "SF t2: ", tp2) << std::endl;
// write(std::cerr << "SF G2: ", G2) << std::endl;
@@ -102,7 +109,7 @@ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain
return G1.copy(G2);
}
// UNNECESSARY : ANYTHING FOUND BY G3 WOULD HAVE THE COFACTOR IN G2
- Rep G3; this->gcd(G3, G, add(tp2,tp,one) );
+ Rep G3; this->gcd(G3, G, add(tp2,tp,_domain.one) );
Degree dG3; degree(dG3,G3);
// write(std::cerr << "SF t3: ", tp2) << std::endl;
// write(std::cerr << "SF G3: ", G3) << std::endl;
@@ -121,19 +128,17 @@ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain
// ---------------------------------------------------------------
template<class Domain, class Tag, class RandIter>
-template< template<class, class> class Container, template <class> class Alloc >
+template< template<class, class> class Container, template <class> class Alloc >
inline void Poly1FactorDom<Domain,Tag, RandIter>::DistinctDegreeFactor(
Container< Rep, Alloc<Rep> > & L
, const Rep& f
, Residu_t MOD) const {
- typename Domain::Element one;
- _domain.init(one, 1UL);
// srand48(BaseTimer::seed());
// write(std::cerr << "DD in: ", f) << std::endl;
Rep W, D, P = f;
Degree dP;
- Rep Unit, G1; init(Unit, Degree(1), one);
+ Rep Unit, G1; init(Unit, Degree(1));
W.copy(Unit);
degree(dP,P); Degree dPo = (dP/2);
for(Degree dp = 1; dp <= dPo; ++dp) {
@@ -147,7 +152,7 @@ inline void Poly1FactorDom<Domain,Tag, RandIter>::DistinctDegreeFactor(
divin(P,G1);
}
}
- degree(dP,P);
+ degree(dP,P);
if (dP > 0)
L.push_back(P);
// write(std::cerr << "DD: ", P) << std::endl;
@@ -159,14 +164,15 @@ inline void Poly1FactorDom<Domain,Tag, RandIter>::DistinctDegreeFactor(
template<class Domain, class Tag, class RandIter>
template< template<class, class> class Container, template <class> class Alloc>
-inline void
+inline void
Poly1FactorDom<Domain,Tag, RandIter>::CZfactor( Container< Rep, Alloc<Rep> > & Lf,
Container< unsigned long, Alloc<unsigned long> > & Le,
const Rep& P,
- Residu_t MOD) const {
+ Residu_t MOD) const
+{
// write(std::cerr << "CZ in: ", P) << std::endl;
Degree dp; degree(dp,P);
- size_t nb=dp.value()+1;
+ size_t nb=dp.value()+1;
Rep * g = new Rep[nb];
sqrfree(nb,g,P);
// std::cerr << "CZ sqrfree: " << nb << std::endl;
@@ -180,7 +186,7 @@ Poly1FactorDom<Domain,Tag, RandIter>::CZfactor( Container< Rep, Alloc<Rep> > & L
// for (typename Container< unsigned long, Alloc<unsigned long> >::const_iterator e=Le.begin(); e!=Le.end(); ++e)
// std::cerr << " " << *e;
// std::cerr << std::endl;
-
+
}
::delete [] g;
}
@@ -192,27 +198,23 @@ Poly1FactorDom<Domain,Tag, RandIter>::CZfactor( Container< Rep, Alloc<Rep> > & L
// ---------------------------------------------------------------
template<class Domain, class Tag, class RandIter>
-inline bool Poly1FactorDom<Domain,Tag, RandIter>::is_irreducible(
- const Rep& P
- , Residu_t MOD ) const {
- typename Domain::Element one;
- _domain.init(one, 1UL);
- // Square free ?
- typename Domain::Element _one;
- _domain.init(_one,1UL);
- Rep W,D; this->gcd(W,diff(D,P),P);
- Degree d, dP;
- if (degree(d,W) > 0) return 0;
- // Distinct degree free ?
- Rep Unit, G1; init(Unit, Degree(1), _one);
- W.copy(Unit);
- degree(dP,P); Degree dPo = (dP/2);
- for(Degree dp = 1; dp <= dPo; ++dp) {
- this->powmod(W, D.copy(W), MOD, P);
- this->gcd (G1, sub(D,W,Unit), P) ;
- if ( degree(d,G1) > 0 ) return 0;
- }
- return 1;
+inline bool Poly1FactorDom<Domain,Tag, RandIter>::is_irreducible( const Rep& P
+ , Residu_t MOD ) const
+{
+ Rep W,D;
+ this->gcd(W,diff(D,P),P);
+ Degree d, dP;
+ if (degree(d,W) > 0) return 0;
+ // Distinct degree free ?
+ Rep Unit, G1; init(Unit, Degree(1));
+ W.copy(Unit);
+ degree(dP,P); Degree dPo = (dP/2);
+ for(Degree dp = 1; dp <= dPo; ++dp) {
+ this->powmod(W, D.copy(W), MOD, P);
+ this->gcd (G1, sub(D,W,Unit), P) ;
+ if ( degree(d,G1) > 0 ) return 0;
+ }
+ return 1;
}
@@ -225,17 +227,18 @@ template<class Domain, class Tag, class RandIter>
inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::factor(
Rep& W
, const Rep& P
- , Residu_t MOD) const {
+ , Residu_t MOD) const
+{
// write(cerr << "In factor P:", P) << endl;
// Square free ?
Rep D; this->gcd(W,diff(D,P),P);
Degree d, dP;
// write(cerr << "In factor P':", D) << "(deg: " << degree(d,D) << ")" << endl;
// write(cerr << "In factor P^P':", W) << "(deg: " << degree(d,W) << ")" << endl;
-
+
if (degree(d,W) > 0) return W;
// Distinct degree free ?
- Rep Unit, G1; init(Unit, Degree(1), one);
+ Rep Unit, G1; init(Unit, Degree(1));
// write(cerr << "In factor U:", Unit) << endl;
W.copy(Unit);
degree(dP,P); Degree dPo = (dP/2);
@@ -254,5 +257,10 @@ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain
return W.copy(P);
}
+} // Givaro
+
+
+#endif // __GIVARO_poly1_facto_INL
-#endif
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1gcd.inl b/src/library/poly1/givpoly1gcd.inl
index 15c8bcd..fcfe6c2 100644
--- a/src/library/poly1/givpoly1gcd.inl
+++ b/src/library/poly1/givpoly1gcd.inl
@@ -1,421 +1,478 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1gcd.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Author: J-L. Roch, T. Gautier, J-G. Dumas
-// $Id: givpoly1gcd.inl,v 1.6 2005/07/05 08:51:34 pernet Exp $
+// $Id: givpoly1gcd.inl,v 1.11 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
-// friend void bezout (const Poly1<T> &P,
-// const Poly1<T> &Q,
-// Poly1<T> &d,
-// Poly1<T> &u,
-// Poly1<T> &v);
-// computes d = unitary gcd(P,Q) and u,v such that :
-// u*P+v*Q = d
-// u and v are the unique polynomisals such that :
-// deg(u) <= deg(Q)-deg(d) and deg(v) <= deg(P) - deg(d)
-// friend Poly1<T> gcd (const Poly1<T> &P, const Poly1<T> &Q );
-// computes d = unitary gcd(P,Q)
-// ===========================================================================
-// A coder par PRS : cf Geddes page 283
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::gcd ( Rep& G, const Rep& P, const Rep& Q) const
-{
-
- typename Domain::Element one;
- _domain.init(one,1UL);
-
- Rep U,V;
- Degree degU, degV;
- degree(degU,P); degree(degV,Q);
- if ((degU < 0) || (degV == 0)) return assign(G, Q);
- if ((degV < 0) || (degU == 0)) return assign(G, P);
-
- if (degU >= degV) {
- assign(U, P);
- assign(V, Q);
- }
- else {
- assign(U, Q);
- assign(V, P);
- }
- // -- PRS (U,V) using pmod:
- Type_t g;
- _domain.assign(g, one);
- Degree degR;
- Rep R;
- do {
-// write(cout << "gcd: U:", U) << endl;
-// write(cout << "gcd: V:", V) << endl;
- mod( R, U, V);
- setdegree(R);
- degree(degR, R);
-// write(cout << "mod: R:", R) << endl;
- if (degR < 0) break;
- assign(U,V);
- assign(V,R);
- } while (1);
-
- degree(degV, V);
- G.logcopy(V);
-// JGD 15.12.1999
-// if (degV <= 1) assign(G,one);
- if (degV <= 0) assign(G,one);
-// write(cout << "gcd: G:", G) << endl;
- return G;
-}
-
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::gcd ( Rep& F, Rep& S0, Rep& T0, const Rep& A, const Rep& B) const
-{
- Type_t r0, r1, tt;
- Rep G;
- Degree degF, degG;
- degree(degF,A); degree(degG,B);
- if ((degF < 0) || (degG == 0)) {
- assign(T0, Degree(0), _domain.inv( tt, leadcoef(r0,B)));
- init(S0, 0);
- assign(F, B);
- return mulin(F,tt);
- }
- if ((degG < 0) || (degF == 0)) {
- assign(S0, Degree(0), _domain.inv( tt, leadcoef(r0,A)));
- init(T0, 0);
- assign(F, A);
- return mulin(F,tt);
- }
-
-
-// if (degF >= degG) {
- assign(F, A);
- assign(G, B);
-// }
-// else {
-// assign(F, B);
-// assign(G, A);
-// }
-
- leadcoef(r0, F);
- leadcoef(r1, G);
-
- divin(F,r0);
- divin(G,r1);
-
- Rep S1,R1,T1,Q,TMP, TMP2;
-
- assign(S0, 0, _domain.inv(tt,r0) );
- assign(S1,zero);
- assign(T0,zero);
- assign(T1, 0, _domain.inv(tt,r1) );
-
- while ( ! isZero(G) ) {
- divmod(Q,R1,F,G);
- leadcoef(r1, R1); if (_domain.isZero(r1)) _domain.assign(r1,_domain.one);
- assign(F,G);
- div(G,R1,r1);
- mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); div(S1,TMP2,r1);
- mul(TMP,Q,T1); sub(TMP2,T0,TMP); assign(T0,T1); div(T1,TMP2,r1);
- }
-
- return F;
-}
-
-
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::invmod ( Rep& S0, const Rep& A, const Rep& B) const
-{
- Type_t r0, r1, tt;
- Rep F, G;
- Degree degF, degG;
- degree(degF,A); degree(degG,B);
- if ((degF <= 0) || (degG <= 0) ) {
- return assign(S0, Degree(0), _domain.inv( tt, leadcoef(r0,A)));
- }
-
-// if (degF >= degG) {
- assign(F, A);
- assign(G, B);
-// }
-// else {
-// assign(F, B);
-// assign(G, A);
-// }
-
- leadcoef(r0, F);
- leadcoef(r1, G);
-
- divin(F,r0);
- divin(G,r1);
-
- Rep S1,R1,Q,TMP, TMP2;
-
- assign(S0, 0, _domain.inv(tt,r0) );
- assign(S1,zero);
-
- while ( ! isZero(G) ) {
- divmod(Q,R1,F,G);
- leadcoef(r1, R1); if (_domain.isZero(r1)) _domain.assign(r1,_domain.one);
- assign(F,G);
- div(G,R1,r1);
- mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); div(S1,TMP2,r1);
- }
-
- return S0;
-}
-
-
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::lcm ( Rep& F, const Rep& A, const Rep& B) const
-{
- Rep G, S0, T0;
- Degree degA, degB, degG;
- degree(degA,A); degree(degB,B);
- if ((degA < 0) || (degB == 0)) return assign(F, B);
- if ((degB < 0) || (degA == 0)) return assign(F, A);
-
- if (degA >= degB) {
- assign(F, A);
- assign(G, B);
- }
- else {
- assign(F, B);
- assign(G, A);
- }
-
- Type_t r0, r1, tt;
- leadcoef(r0, F);
- leadcoef(r1, G);
-
- divin(F,r0);
- divin(G,r1);
-
- Rep S1,R1,T1,Q,TMP, TMP2;
-
- assign(S0, 0, _domain.inv(tt,r0) );
- assign(S1,zero);
- assign(T0,zero);
- assign(T1, 0, _domain.inv(tt,r1) );
-
- while ( ! isZero(G) ) {
- divmod(Q,R1,F,G);
- leadcoef(r1, R1); if (_domain.isZero(r1)) _domain.assign(r1,_domain.one);
- assign(F,G);
- div(G,R1,r1);
- mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); div(S1,TMP2,r1);
- mul(TMP,Q,T1); sub(TMP2,T0,TMP); assign(T0,T1); div(T1,TMP2,r1);
-
-
-// std::cerr << "Degree Q : " << degree(degF,Q) << std::endl;
-// std::cerr << "Degree R1 : " << degree(degF,R1) << std::endl;
-// std::cerr << "Degree F : " << degree(degF,F) << std::endl;
-// std::cerr << "Degree G : " << degree(degF,G) << std::endl;
-// std::cerr << "Degree S0 : " << degree(degF,S0) << std::endl;
-// std::cerr << "Degree T0 : " << degree(degF,T0) << std::endl;
-// std::cerr << "Degree S1 : " << degree(degF,S1) << std::endl;
-// std::cerr << "Degree T1 : " << degree(degF,T1) << std::endl;
-
-// write( write( write( write( write( std::cerr, G ) << " = ((", T1) << ") * (", A) << ")) + ((", S1) << ") * (", B) << "))" << std::endl;
-
- }
-
- degree(degG, G);
-
-
- if ( degG <= 0) {
-// If normalisation is needed
-// if (degA >= degB) {
-// return mul(G, S1, A);
-// } else {
-// return mul(G, S1, B);
-// }
-// leadcoef(tt, G);
-// return div(F,G,tt);
- if (degA >= degB) {
- return mul(F, S1, A);
- } else {
- return mul(F, S1, B);
- }
- } else {
- return mul(F, A, B);
- }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#ifndef __GIVARO_poly1_gcd_INL
+#define __GIVARO_poly1_gcd_INL
+namespace Givaro {
+#if 0
+ friend void bezout (const Poly1<T> &P,
+ const Poly1<T> &Q,
+ Poly1<T> &d,
+ Poly1<T> &u,
+ Poly1<T> &v);
+#endif
+ // computes d = unitary gcd(P,Q) and u,v such that :
+ // u*P+v*Q = d
+ // u and v are the unique polynomisals such that :
+ // deg(u) <= deg(Q)-deg(d) and deg(v) <= deg(P) - deg(d)
+ // friend Poly1<T> gcd (const Poly1<T> &P, const Poly1<T> &Q );
+ // computes d = unitary gcd(P,Q)
+ // ===========================================================================
+ // A coder par PRS : cf Geddes page 283
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::gcd ( Rep& G, const Rep& P, const Rep& Q) const
+ {
+
+ Rep U,V;
+ Degree degU, degV;
+ degree(degU,P);
+ degree(degV,Q);
+ if ((degU < 0) || (degV == 0)) return assign(G, Q);
+ if ((degV < 0) || (degU == 0)) return assign(G, P);
+
+ if (degU >= degV) {
+ assign(U, P);
+ assign(V, Q);
+ }
+ else {
+ assign(U, Q);
+ assign(V, P);
+ }
+ // -- PRS (U,V) using pmod:
+ Type_t g;
+ _domain.assign(g, _domain.one);
+ Degree degR;
+ Rep R;
+ do {
+ // write(cout << "gcd: U:", U) << endl;
+ // write(cout << "gcd: V:", V) << endl;
+ mod( R, U, V);
+ setdegree(R);
+ degree(degR, R);
+ // write(cout << "mod: R:", R) << endl;
+ if (degR < 0) break;
+ assign(U,V);
+ assign(V,R);
+ } while (1);
+
+ degree(degV, V);
+ G.logcopy(V);
+ // JGD 15.12.1999
+ // if (degV <= 1) assign(G,one);
+ if (degV <= 0) assign(G,_domain.one);
+ // write(cout << "gcd: G:", G) << endl;
+ return G;
+ }
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::gcd ( Rep& F, Rep& S0, Rep& T0, const Rep& A, const Rep& B) const
+ {
+ Type_t r0, r1, tt;
+ Rep G;
+ Degree degF, degG;
+ degree(degF,A); degree(degG,B);
+ if ((degF < 0) || (degG == 0)) {
+ assign(T0, Degree(0), _domain.inv( tt, leadcoef(r0,B)));
+ init(S0, 0);
+ assign(F, B);
+ return mulin(F,tt);
+ }
+ if ((degG < 0) || (degF == 0)) {
+ assign(S0, Degree(0), _domain.inv( tt, leadcoef(r0,A)));
+ init(T0, 0);
+ assign(F, A);
+ return mulin(F,tt);
+ }
+
+
+ // if (degF >= degG) {
+ assign(F, A);
+ assign(G, B);
+ // }
+ // else {
+ // assign(F, B);
+ // assign(G, A);
+ // }
+
+ leadcoef(r0, F);
+ leadcoef(r1, G);
+
+ divin(F,r0);
+ divin(G,r1);
+
+ Rep S1,R1,T1,Q,TMP, TMP2;
+
+ assign(S0, 0, _domain.inv(tt,r0) );
+ assign(S1,zero);
+ assign(T0,zero);
+ assign(T1, 0, _domain.inv(tt,r1) );
+
+ while ( ! isZero(G) ) {
+ divmod(Q,R1,F,G);
+ leadcoef(r1, R1); if (_domain.isZero(r1)) _domain.assign(r1,_domain.one);
+ assign(F,G);
+ div(G,R1,r1);
+ mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); div(S1,TMP2,r1);
+ mul(TMP,Q,T1); sub(TMP2,T0,TMP); assign(T0,T1); div(T1,TMP2,r1);
+ }
+
+ return F;
+ }
+
+
+ // #include <typeinfo>
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::invmod ( Rep& S0, const Rep& A, const Rep& B) const
+ {
+ // std::cerr << "BEG invmod of " << typeid(*this).name() << std::endl;
+ // std::cerr << "with domain " << typeid(_domain).name() << std::endl;
+ // write(std::cout << "A:=", A) << ';' << std::endl;
+ // write(std::cout << "B:=", B) << ';' << std::endl;
+ Type_t r0, r1, tt;
+ Rep F, G;
+ Degree degF, degG;
+ degree(degF,A); degree(degG,B);
+ if ((degF <= 0) || (degG <= 0) ) {
+ return assign(S0, Degree(0), _domain.inv( tt, leadcoef(r0,A)));
+ }
+
+ assign(F, A);
+ assign(G, B);
+
+ leadcoef(r0, F);
+ leadcoef(r1, G);
+ // getdomain().write(std::cout << "r0: ", r0) << std::endl;
+ // getdomain().write(std::cout << "r1: ", r1) << std::endl;
+
+ divin(F,r0);
+ divin(G,r1);
+ // write(std::cout << "F1: ", F) << std::endl;
+ // write(std::cout << "G1: ", G) << std::endl;
+
+ Rep S1,R1,Q,TMP, TMP2;
+
+ assign(S0, 0, _domain.inv(tt,r0) );
+ assign(S1,zero);
+
+ while ( ! isZero(G) ) {
+ // write(std::cout << "F: ", F) << std::endl;
+ // write(std::cout << "G: ", G) << std::endl;
+
+ divmod(Q,R1,F,G);
+ // write(std::cout << "Q: ", Q) << std::endl;
+ // write(std::cout << "R: ", R1) << std::endl;
+
+ leadcoef(r1, R1); if (_domain.isZero(r1)) _domain.assign(r1,_domain.one);
+ // getdomain().write(std::cout << "l: ", r1) << std::endl;
+
+ assign(F,G);
+ div(G,R1,r1);
+ // write(std::cout << "Fn: ", F) << std::endl;
+ // write(std::cout << "Gn: ", G) << std::endl;
+ mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); div(S1,TMP2,r1);
+ // write(std::cout << "S: ", S1) << std::endl;
+ }
+
+ // write(std::cout << "S: ", S0) << std::endl;
+ // std::cerr << "END invmod of " << typeid(*this).name() << std::endl;
+ return S0;
+ }
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::invmodunit ( Rep& S0, const Rep& A, const Rep& B) const
+ {
+ // std::cerr << "BEG invmodunit of " << typeid(*this).name() << std::endl;
+
+ Type_t r0, r1, tt;
+ Rep F, G;
+ Degree degF, degG;
+ degree(degF,A); degree(degG,B);
+ if ((degF <= 0) || (degG <= 0) ) {
+ return assign(S0, Degree(0), _domain.one);
+ }
+
+ // if (degF >= degG) {
+ assign(F, A);
+ assign(G, B);
+ // }
+ // else {
+ // assign(F, B);
+ // assign(G, A);
+ // }
+
+ Rep S1,R1,Q,TMP, TMP2;
+
+ assign(S0,one);
+ assign(S1,zero);
+
+ while ( ! isZero(G) ) {
+ // write(std::cout << "F: ", F) << std::endl;
+ // write(std::cout << "G: ", G) << std::endl;
+
+ divmod(Q,R1,F,G);
+ // write(std::cout << "Q: ", Q) << std::endl;
+ // write(std::cout << "R: ", R1) << std::endl;
+
+ assign(F,G);
+ assign(G,R1);
+ // write(std::cout << "Fn: ", F) << std::endl;
+ // write(std::cout << "Gn: ", G) << std::endl;
+ mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); assign(S1,TMP2);
+ // write(std::cout << "S: ", S1) << std::endl;
+ }
+ // std::cerr << "END invmodunit of " << typeid(*this).name() << std::endl;
+
+ return S0;
+ }
+
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::lcm ( Rep& F, const Rep& A, const Rep& B) const
+ {
+ // write(write(std::cerr << "A: ", A) << ", B: ", B) << std::endl;
+
+ Rep G, S0, T0;
+ Degree degA, degB, degG;
+ degree(degA,A); degree(degB,B);
+ if (degA < 0) return assign(F, Degree(0), _domain.zero);
+ if (degB < 0) return assign(F, Degree(0), _domain.zero);
+ if (degB == 0) return assign(F, A);
+ if (degA == 0) return assign(F, B);
+
+ if (degA >= degB) {
+ assign(F, A);
+ assign(G, B);
+ }
+ else {
+ assign(F, B);
+ assign(G, A);
+ }
+
+ Type_t r0, r1, tt;
+ leadcoef(r0, F);
+ leadcoef(r1, G);
+
+ divin(F,r0);
+ divin(G,r1);
+
+ Rep S1,R1,T1,Q,TMP, TMP2;
+
+ assign(S0, 0, _domain.inv(tt,r0) );
+ assign(S1,zero);
+ assign(T0,zero);
+ assign(T1, 0, _domain.inv(tt,r1) );
+
+ while ( ! isZero(G) ) {
+ divmod(Q,R1,F,G);
+ leadcoef(r1, R1); if (_domain.isZero(r1)) _domain.assign(r1,_domain.one);
+ assign(F,G);
+ div(G,R1,r1);
+ mul(TMP,Q,S1); sub(TMP2,S0,TMP); assign(S0,S1); div(S1,TMP2,r1);
+ mul(TMP,Q,T1); sub(TMP2,T0,TMP); assign(T0,T1); div(T1,TMP2,r1);
+
+
+ // std::cerr << "Degree Q : " << degree(degF,Q) << std::endl;
+ // std::cerr << "Degree R1 : " << degree(degF,R1) << std::endl;
+ // std::cerr << "Degree F : " << degree(degF,F) << std::endl;
+ // std::cerr << "Degree G : " << degree(degF,G) << std::endl;
+ // std::cerr << "Degree S0 : " << degree(degF,S0) << std::endl;
+ // std::cerr << "Degree T0 : " << degree(degF,T0) << std::endl;
+ // std::cerr << "Degree S1 : " << degree(degF,S1) << std::endl;
+ // std::cerr << "Degree T1 : " << degree(degF,T1) << std::endl;
+
+ // write( write( write( write( write( std::cerr, G ) << " = ((", T1) << ") * (", A) << ")) + ((", S1) << ") * (", B) << "))" << std::endl;
+
+ }
+
+ degree(degG, G);
+
+ // write(write(std::cerr << "S1: ", S1) << ", T1: ", T1) << std::endl;
+
+ if ( degG <= 0) {
+ // If normalisation is needed
+ // if (degA >= degB) {
+ // return mul(G, S1, A);
+ // } else {
+ // return mul(G, T1, B);
+ // }
+ // leadcoef(tt, G);
+ // return div(F,G,tt);
+ if (degA >= degB) {
+ return mul(F, S1, A);
+ } else {
+ return mul(F, T1, B);
+ }
+ } else {
+ return mul(F, A, B);
+ }
+ }
#if 0
-// A coder par PRS : cf Geddes page 283
-template <class Domain>
-void Poly1Dom<Domain,Dense>::gcd
- ( Poly1<T> &d, Poly1<T> &u, Poly1<T> &v,
- const Poly1<T> &P, const Poly1<T> &Q )
-{
- // computes d = unitary gcd(P,Q) and u,v such that :
- // u*P+v*Q = d
- // u and v are the unique polynomisals such that :
- // deg(u) <= deg(Q)-deg(d) and deg(v) <= deg(P) - deg(d)
-
- // Auxilliary matrix : [oldu oldv] which is left multiplies by [0 1]
- // [newu newv] [1 -q]
- // at each step.
- // At the end, u = oldu, v = old v
-
- Rep A;
- Rep B;
- Rep quot;
- Rep rem;
- int permuter;
-
- if (degree(P) < degree(Q)) {
- assign(A, Q);
- assign(B, P);
- permuter = 1;
- }
- else {
- assign(A, P);
- assign(B, Q);
- permuter = 0;
- }
-
- if (isZero(B) {
- Type_t inv_lcoeff_A;
- if (isZero(A)) {
- _domain.assign(inv_lcoeff_A, _domain.one);
- }
- else {
- _domain.inv(inv_lcoeff_A, A[degree(A)];
- }
-
- d = A * inv_lcoeff_A;
- Poly1<T> cste(0, inv_lcoeff_A);
- if (permuter) { u = Poly1<T>::Zero; v = cste; }
- else { u = cste; v = Poly1<T>::Zero; }
- }
- else {
- // -- On rend B unitaire
- T inv_lcoeff_B = csteT1 / B[B.degree()];
- B = B * inv_lcoeff_B;
-
- Poly1<T> oldu(0, csteT1);
- Poly1<T> oldv(0, csteT0 );
- Poly1<T> newu(0, csteT0 );
- Poly1<T> newv(0, inv_lcoeff_B);
-
- int cont;
- do {
- Poly1<T>::divide(quot, rem, A, B);
- A = B;
- cont = !isZero(rem);
- if (cont) {
- inv_lcoeff_B = csteT1/rem[rem.degree()];
- B = rem*inv_lcoeff_B;
-
- Poly1<T> tmpu = (oldu - quot*newu) * inv_lcoeff_B;
- Poly1<T> tmpv = (oldv - quot*newv) * inv_lcoeff_B;
- oldu = newu;
- oldv = newv;
- newu = tmpu;
- newv = tmpv;
- }
- } while (cont);
-
-
- d = A;
-
- if (permuter) { u = newv; v = newu; }
- else { u = newu; v = newv; }
- }
+ // A coder par PRS : cf Geddes page 283
+ template <class Domain>
+ void Poly1Dom<Domain,Dense>::gcd
+ ( Poly1<T> &d, Poly1<T> &u, Poly1<T> &v,
+ const Poly1<T> &P, const Poly1<T> &Q )
+ {
+ // computes d = unitary gcd(P,Q) and u,v such that :
+ // u*P+v*Q = d
+ // u and v are the unique polynomisals such that :
+ // deg(u) <= deg(Q)-deg(d) and deg(v) <= deg(P) - deg(d)
+
+ // Auxilliary matrix : [oldu oldv] which is left multiplies by [0 1]
+ // [newu newv] [1 -q]
+ // at each step.
+ // At the end, u = oldu, v = old v
+
+ Rep A;
+ Rep B;
+ Rep quot;
+ Rep rem;
+ int permuter;
+
+ if (degree(P) < degree(Q)) {
+ assign(A, Q);
+ assign(B, P);
+ permuter = 1;
+ }
+ else {
+ assign(A, P);
+ assign(B, Q);
+ permuter = 0;
+ }
+
+ if (isZero(B) {
+ Type_t inv_lcoeff_A;
+ if (isZero(A)) {
+ _domain.assign(inv_lcoeff_A, _domain.one);
+ }
+ else {
+ _domain.inv(inv_lcoeff_A, A[degree(A)];
+ }
+
+ d = A * inv_lcoeff_A;
+ Poly1<T> cste(0, inv_lcoeff_A);
+ if (permuter) { u = Poly1<T>::Zero; v = cste; }
+ else { u = cste; v = Poly1<T>::Zero; }
+ }
+ else {
+ // -- On rend B unitaire
+ T inv_lcoeff_B = csteT1 / B[B.degree()];
+ B = B * inv_lcoeff_B;
+
+ Poly1<T> oldu(0, csteT1);
+ Poly1<T> oldv(0, csteT0 );
+ Poly1<T> newu(0, csteT0 );
+ Poly1<T> newv(0, inv_lcoeff_B);
+
+ int cont;
+ do {
+ Poly1<T>::divide(quot, rem, A, B);
+ A = B;
+ cont = !isZero(rem);
+ if (cont) {
+ inv_lcoeff_B = csteT1/rem[rem.degree()];
+ B = rem*inv_lcoeff_B;
+
+ Poly1<T> tmpu = (oldu - quot*newu) * inv_lcoeff_B;
+ Poly1<T> tmpv = (oldv - quot*newv) * inv_lcoeff_B;
+ oldu = newu;
+ oldv = newv;
+ newu = tmpu;
+ newv = tmpv;
+ }
+ } while (cont);
+
+
+ d = A;
+
+ if (permuter) { u = newv; v = newu; }
+ else { u = newu; v = newv; }
+ }
#ifdef GIVARO_ASSERT
- if (!isZero(u*P+v*Q-d)) {
- cout << "Erreur dans la verif de bezout. " << endl
- << " P =" << P << endl
- << " Q =" << Q << endl
- << " d =" << d << endl
- << " u =" << u << endl
- << " v =" << v << endl;
- }
-#endif
-}
-
-template <class T>
-Poly1<T>& Poly1<T>::gcd1 (Poly1<T>& G, Poly1<T>& u, Poly1<T>& v,
- const Poly1<T>& P, const Poly1<T>& Q)
-{ bezout(P,Q,G,u,v); return G;}
-
-
-template <class T>
-Poly1<T>& Poly1<T>::gcd1 (Poly1<T>& G, const Poly1<T> &P, const Poly1<T> &Q)
-{
- Poly1<T> A;
- Poly1<T> B;
-
- if (P.degree() < Q.degree()) { A = Q; B = P; }
- else { A = P; B = Q; }
-
- if (isZero(B)) {
- if (isZero(A)) { return G.logcopy(A); }
- else { return G.logcopy(A/A[A.degree()]); }
- }
-
- B = B/B[B.degree()]; // B is made unitary
- Poly1<T> rem = A % B;
- while (!isZero(rem = A % B)) {
- A = B;
- B = rem / rem.leadcoef();
- }
- return G.logcopy(B);
-}
-
-
-template<class T>
-inline const Poly1<T> prime_part(const Poly1<T>& P, const Poly1<T>& Q)
-{
- Poly1<T> E,D;
- E = P;
- D = Q;
- while (D.degree() >0)
- {
- E = E / D;
- D = gcd(E,D);
- }
- return E;
-}
-
-// Split the argument into two factors prime_Q and divisor_Q such that :
-// divisor_Q = gcd(*this, Q)
-// There exists a constant k such that P divides (prime_Q * divisor_Q)^k
-template<class T>
-inline void decomposition(const Poly1<T> &Q, Poly1<T> & prime_Q, Poly1<T> & divisor_Q)
-{
- divisor_Q = gcd(*this, Q);
- prime_Q= *this / gcd( ::pow(divisor_Q,((long)(degree() - divisor_Q.degree()))),
- *this );
-}
+ if (!isZero(u*P+v*Q-d)) {
+ cout << "Erreur dans la verif de bezout. " << endl
+ << " P =" << P << endl
+ << " Q =" << Q << endl
+ << " d =" << d << endl
+ << " u =" << u << endl
+ << " v =" << v << endl;
+ }
+#endif
+ }
+
+ template <class T>
+ Poly1<T>& Poly1<T>::gcd1 (Poly1<T>& G, Poly1<T>& u, Poly1<T>& v,
+ const Poly1<T>& P, const Poly1<T>& Q)
+ { bezout(P,Q,G,u,v); return G;}
+
+
+ template <class T>
+ Poly1<T>& Poly1<T>::gcd1 (Poly1<T>& G, const Poly1<T> &P, const Poly1<T> &Q)
+ {
+ Poly1<T> A;
+ Poly1<T> B;
+
+ if (P.degree() < Q.degree()) { A = Q; B = P; }
+ else { A = P; B = Q; }
+
+ if (isZero(B)) {
+ if (isZero(A)) { return G.logcopy(A); }
+ else { return G.logcopy(A/A[A.degree()]); }
+ }
+
+ B = B/B[B.degree()]; // B is made unitary
+ Poly1<T> rem = A % B;
+ while (!isZero(rem = A % B)) {
+ A = B;
+ B = rem / rem.leadcoef();
+ }
+ return G.logcopy(B);
+ }
+
+
+ template<class T>
+ inline const Poly1<T> prime_part(const Poly1<T>& P, const Poly1<T>& Q)
+ {
+ Poly1<T> E,D;
+ E = P;
+ D = Q;
+ while (D.degree() >0)
+ {
+ E = E / D;
+ D = gcd(E,D);
+ }
+ return E;
+ }
+
+ // Split the argument into two factors prime_Q and divisor_Q such that :
+ // divisor_Q = gcd(*this, Q)
+ // There exists a constant k such that P divides (prime_Q * divisor_Q)^k
+ template<class T>
+ inline void decomposition(const Poly1<T> &Q, Poly1<T> & prime_Q, Poly1<T> & divisor_Q)
+ {
+ divisor_Q = gcd(*this, Q);
+ prime_Q= *this / gcd( ::pow(divisor_Q,((long)(degree() - divisor_Q.degree()))),
+ *this );
+ }
#endif // 0
+
+} // GIVARO
+
+#endif // __GIVARO_poly1_gcd_INL
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1io.inl b/src/library/poly1/givpoly1io.inl
index 6d19419..fbfaaff 100644
--- a/src/library/poly1/givpoly1io.inl
+++ b/src/library/poly1/givpoly1io.inl
@@ -1,14 +1,20 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1io.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1io.inl,v 1.5 2008-02-26 12:44:42 jgdumas Exp $
+// $Id: givpoly1io.inl,v 1.7 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#ifndef __GIVARO_poly1_io_INL
+#define __GIVARO_poly1_io_INL
#include <iostream>
+namespace Givaro {
// --
template<class Domain>
std::istream& Poly1Dom<Domain,Dense>::read ( std::istream& sin )
@@ -76,13 +82,13 @@ std::ostream& Poly1Dom<Domain,Dense>::write( std::ostream& o, const Rep& R) cons
if (! _domain.isOne(P[l])) {
_domain.write(o << "(",P[l]) << ")*";
}
- o << _x << "^" << l;
+ o << _x << "^" << l;
}
}
}
return o;
}
- }
+ }
return o << "0";
}
@@ -98,3 +104,5 @@ std::istream& Poly1Dom<Domain,Dense>::read ( std::istream& i, Rep& P) const
// i >> P[deg];
return i;
}
+} // Givaro
+#endif // __GIVARO_poly1_io_INL
diff --git a/src/library/poly1/givpoly1kara.inl b/src/library/poly1/givpoly1kara.inl
index e94e189..2a5bf69 100644
--- a/src/library/poly1/givpoly1kara.inl
+++ b/src/library/poly1/givpoly1kara.inl
@@ -1,43 +1,51 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1kara.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1kara.inl,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givpoly1kara.inl,v 1.3 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description: To be rewrite using Array0 and subarray0 or generator!!!
+#ifndef __GIVARO_poly1_kara_INL
+#define __GIVARO_poly1_kara_INL
#define KARA_THRESHOLD 10
+
+namespace Givaro {
+
template<class T>
-void Poly1<T>::stdmul(Array0<T>& R,
- const Array0<T>& P, const Array0<T>& Q,
- Degree tP, Degree tQ)
+void Poly1<T>::stdmul(Array0<T>& R,
+ const Array0<T>& P, const Array0<T>& Q,
+ Degree tP, Degree tQ)
{
int i,j ;
for (i=0 ; i <= tP+tQ ; i++) R[i] = T(zero) ;
for (i=0 ; i <= tP ; i++)
for (j=0 ; j <= tQ ; j++)
- R[i+j] += P[i]*Q[j] ;
+ R[i+j] += P[i]*Q[j] ;
}
// Tailles requises par les entrees.
// P : polynome de degre tP
- // Q : " " tQ
- // R : " " tP+tQ
+ // Q : " " tQ
+ // R : " " tP+tQ
// Tmp1 : " " 2*([1+max(tP,tQ)] div 2)
// Tmp2 : " " ([1+max(tP,tQ)] div 2)
// Au sein de l'algo :
- // P0 : " " k <= tP
+ // P0 : " " k <= tP
// P1 : " " tP - k <= k
- // Q0 : " " k <= tQ
+ // Q0 : " " k <= tQ
// Q1 : " " tQ - k <= k
template<class T>
-void Poly1<T>::karatsuba(Array0<T>& P, const Array0<T>& Q,
+void Poly1<T>::karatsuba(Array0<T>& P, const Array0<T>& Q,
Array0<T>& R, Array0<T>& Tmp1,
- Degree tP, Degree tQ)
+ Degree tP, Degree tQ)
{
- if ((tP <=KARA_THRESHOLD) || (tQ <=KARA_THRESHOLD))
+ if ((tP <=KARA_THRESHOLD) || (tQ <=KARA_THRESHOLD))
{
Poly1<T>::stdmul(P, Q, R, tP, tQ) ;
return ;
@@ -48,9 +56,9 @@ void Poly1<T>::karatsuba(Array0<T>& P, const Array0<T>& Q,
{
int i ;
k = tP/2 ;
- if (tQ <= k)
+ if (tQ <= k)
{
-//cout << "heheh : tP:" << tP << " tQ: " << tQ << endl ;
+//cout << "heheh : tP:" << tP << " tQ: " << tQ << endl ;
Poly1<T>::karatsuba(P, Q, R, Tmp1, k, tQ) ;
Poly1<T>::karatsuba(P+k+1, Q, Tmp1, P, tP-k-1, tQ) ;
for (i=0 ; i <= tP+tQ-k-1 ; i++) R[i+k+1] += Tmp1[i] ;
@@ -70,19 +78,19 @@ void Poly1<T>::karatsuba(Array0<T>& P, const Array0<T>& Q,
for (i=0 ; i < tP-k ; i++) R00[i] = P1[i] - P0[i] ;
for (i=tP-k ; i <= k ; i++) R00[i] = -P0[i] ;
- // Q0-Q1 -> R01, degQ0 = k > degQ1 = tQ-k
+ // Q0-Q1 -> R01, degQ0 = k > degQ1 = tQ-k
for (i=0 ; i < tQ-k ; i++) R01[i] = Q0[i] - Q1[i] ;
for (i=tQ-k ; i <= k ; i++) R01[i] = Q0[i] ;
// Recursive calls
- _karatsuba(R00, R01, Tmp1, R1, k, k) ;
- _karatsuba(P0, Q0, R0, R1, k, k) ;
- _karatsuba(P1, Q1, R1, P0, tP-k-1, tQ-k-1) ;
-
+ _karatsuba(R00, R01, Tmp1, R1, k, k) ;
+ _karatsuba(P0, Q0, R0, R1, k, k) ;
+ _karatsuba(P1, Q1, R1, P0, tP-k-1, tQ-k-1) ;
+
// Merge des termes
- // Correction des termes du milieu:
+ // Correction des termes du milieu:
for (i=0 ; i <=2*k ; i++) Tmp1[i] += R0[i] ;
- for (i=0 ; i <=tP+tQ-2*k-2 ; i++) Tmp1[i] += R1[i] ;
+ for (i=0 ; i <=tP+tQ-2*k-2 ; i++) Tmp1[i] += R1[i] ;
// Mis a jour du resultat
R[2*k+1] = T(zero) ;
@@ -92,9 +100,9 @@ void Poly1<T>::karatsuba(Array0<T>& P, const Array0<T>& Q,
{
int i ;
k = tQ/2 ;
- if (tP <= k)
+ if (tP <= k)
{
-//cout << "heheh : tP:" << tP << " tQ: " << tQ << endl ;
+//cout << "heheh : tP:" << tP << " tQ: " << tQ << endl ;
_karatsuba(P, Q, R, Tmp1, tP, k) ;
_karatsuba(P, Q+k+1, Tmp1, P, tP, tQ-k-1) ;
for (i=0 ; i <= tP+tQ-k-1 ; i++) R[i+k+1] += Tmp1[i] ;
@@ -143,21 +151,23 @@ const Poly1<T> Karatsuba(const Poly1<T>& P, const Poly1<T>& Q)
T* Res = new T[degP+degQ+1];
T* PP = new T[degP+1];
T* Tmp1, *Tmp2 ;
- if (degQ <= degP)
- {
+ if (degQ <= degP)
+ {
Tmp1 = new T[degP+1];
// Tmp2 = new T[degP+1];
}
- else
- {
+ else
+ {
Tmp1 = new T[degQ+1];
// Tmp2 = new T[degQ+1];
}
int i ;
- for (i=0 ; i<= degQ+degP ; i++) Res[i] = T(zero) ;
- for (i=0 ; i<= degP ; i++) PP[i] = P[i] ;
+ for (i=0 ; i<= degQ+degP ; i++) Res[i] = T(zero) ;
+ for (i=0 ; i<= degP ; i++) PP[i] = P[i] ;
_karatsuba(PP, Q.baseptr(), Res, Tmp1, degP, degQ) ;
Poly1<T> PRes(P.variable(), degP+degQ, Res) ;
delete [] Tmp1 ; delete [] PP ; delete [] Res ;
return PRes ;
}
+}
+#endif // __GIVARO_poly1_kara_INL
diff --git a/src/library/poly1/givpoly1misc.inl b/src/library/poly1/givpoly1misc.inl
index 179b049..8449341 100644
--- a/src/library/poly1/givpoly1misc.inl
+++ b/src/library/poly1/givpoly1misc.inl
@@ -1,300 +1,354 @@
-/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1misc.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1misc.inl,v 1.12 2007-12-05 15:17:50 jgdumas Exp $
+// $Id: givpoly1misc.inl,v 1.22 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#include <algorithm>
+
+#ifndef __GIVARO_poly_misc_INL
+#define __GIVARO_poly_misc_INL
+
+namespace Givaro {
+ template<class Domain>
+ inline int Poly1Dom<Domain,Dense>::isZero (const Rep& P) const
+ {
+ setdegree(const_cast<Rep&>(P));
+ if (P.size() ==0) return 1;
+ if (P.size() ==1) return _domain.isZero(P[0]);
+ else return 0;
+ }
+
+ template<class Domain>
+ inline int Poly1Dom<Domain,Dense>::isOne ( const Rep& P ) const
+ {
+ setdegree(const_cast<Rep&>(P));
+ if (P.size() ==1)
+ return _domain.isOne(P[0]);
+ else
+ return 0;
+ }
+
+ template<class Domain>
+ inline int Poly1Dom<Domain,Dense>::areEqual (const Rep& P, const Rep& Q) const
+ {
+ setdegree(const_cast<Rep&>(P));
+ setdegree(const_cast<Rep&>(Q));
+ if (P.size() != Q.size()) return 0;
+ for( typename Element::const_iterator pit = P.begin(), qit = Q.begin();
+ pit != P.end();
+ ++pit, ++qit)
+ if ( !_domain.areEqual(*pit, *qit) ) return 0;
+ return 1;
+ }
+
+
+ template<class Domain>
+ inline int Poly1Dom<Domain,Dense>::areNEqual (const Rep& P, const Rep& Q) const
+ {
+ setdegree(const_cast<Rep&>(P));
+ setdegree(const_cast<Rep&>(Q));
+ if (P.size() != Q.size()) return 1;
+ for( typename Element::const_iterator pit = P.begin(), qit = Q.begin();
+ pit != P.end();
+ ++pit, ++qit)
+ if ( !_domain.areEqual(*pit, *qit) ) return 1;
+ return 0;
+ }
+
+
+ // -- Compute the degree of P
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::setdegree ( Rep& P ) const
+ {
+ int sz = (int) (P.size() - 1);
+ if (P.size() <= 0) return P.reallocate(0);
+ if (_domain.isZero(P[sz]) ==0) {
+ return P;
+ }
+ for (int j=sz; j--; )
+ if (_domain.isZero(P[j]) ==0) {
+ P.reallocate(j+1);
+ return P;
+ }
+ return P.reallocate(0);
+ }
+
+ template <class Domain>
+ inline Degree& Poly1Dom<Domain,Dense>::degree(Degree& deg, const Rep& P) const
+ {
+ int sz = (int) P.size();
+ if (sz ==0) {
+ return deg = Degree::deginfty;
+ }
+ if (_domain.isZero(P[sz-1])) {
+ setdegree(const_cast<Rep&>(P));
+ sz = (int) P.size();
+ }
+ return deg = (Degree) (sz-1);
+ }
+
+
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::leadcoef (Type_t& c, const Rep& P) const
+ {
+ Degree dP;
+ degree(dP, P);
+ if (dP == Degree::deginfty) return _domain.assign(c, _domain.zero);
+ else return _domain.assign(c, P[dP.value()]);
+ }
+
+
+ // -- Returns the i-th coefficients
+ template<class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::getEntry (Type_t& c, const Degree& i, const Rep& P) const
+ {
+ Degree dP;
+ degree(dP, P);
+ if (dP < i) return _domain.assign(c, _domain.zero);
+ else return _domain.assign(c, P[i.value()]);
+ }
+
+
+
+
+ template <class Domain>
+ inline Degree& Poly1Dom<Domain,Dense>::val(Degree& d, const Rep& P) const
+ {
+ size_t sz = P.size();
+ if (sz ==0) {
+ return d = Degree::deginfty;
+ }
+ if (!_domain.isZero(P[0])) {
+ return d = 0;
+ }
+ for (size_t i=1; i<sz; ++i)
+ {
+ if (!_domain.isZero(P[i])) {
+ return d = i;
+ }
+ }
+ return d=0;
+ }
+
+
+ // Horner's scheme for evaluation
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::eval (Type_t& res, const Rep& P, const Type_t& Val) const
+ {
+ typename Domain::Element tmp;
+ _domain.init(tmp,0UL);
+ Degree dP ; degree(dP, P);
+ if (dP == Degree::deginfty) _domain.assign(res, _domain.zero);
+ else {
+ _domain.assign(res, P[dP.value()]);
+ for (int i = (int)dP.value(); i--; )
+ _domain.assign(res,_domain.axpy(tmp, res, Val, P[i]));
+ }
+ return res;
+ }
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::diff(Rep& P, const Rep& Q) const
+ {
+ Degree dQ;
+ degree(dQ, Q);
+ if ((dQ == Degree::deginfty) || (dQ == 0)) {
+ P.reallocate(0);
+ return P;
+ }
+ P.reallocate(dQ.value());
+ Type_t cste; _domain.assign(cste, _domain.zero);
+ for (int i=0; dQ>i; ++i) {
+ _domain.add(cste, cste, _domain.one);
+ _domain.mul(P[i], Q[i+1], cste);
+ }
+ return P;
+ }
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::pow( Rep& W, const Rep& P, long n) const
+ {
+ Rep puiss2;
+ assign(puiss2, P); // -- P**(2^k)
+ Rep tmp;
+ assign(W,one);
+ unsigned int p;
+ p = (unsigned int) (n < 0 ? -n : n); // cannot treats the case of <0 exponent
+ while (p != 0) {
+ if (p & 0x1) {
+ mul( tmp, W, puiss2);
+ assign(W,tmp);
+ }
+ if ((p >>= 1) != 0) {
+ mul( tmp, puiss2, puiss2);
+ assign(puiss2,tmp);
+ }
+ }
+ return W;
+ }
+
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::powmod( Rep& W, const Rep& P, IntegerDom::Element pwr, const Rep& U) const
+ {
+ IntegerDom ID;
+ // ID.write(cerr << "\n----------- POWMOD -----------\n pwr: ", pwr) << endl;
+ // write(cerr << "P: ",P) << endl;
+ // write(cerr << "U: ",U) << endl;
+ Rep puiss, tmp;
+ mod(puiss, P, U);
+ assign(W,one);
+ IntegerDom::Element n,q,r,deux,Zero;
+ ID.init(deux,2);
+ ID.init(Zero,0UL);
+ if (ID.islt(pwr,Zero) )
+ ID.neg(n,pwr);
+ else
+ ID.init(n,pwr);
+
+ while (n > 0) {
+ ID.divmod(q,r,n,deux);
+ n.copy(q);
+ if (! ID.isZero(r)) {
+ mulin(W,puiss);
+ mod(tmp, W, U);
+ assign(W,tmp);
+ }
+ mul(tmp,puiss,puiss);
+ mod(puiss,tmp,U);
+ }
+
+ // write(cerr << "W: ", W) << "\n----------- END POWMOD -----------" << endl;
+ return setdegree(W);
+ }
+
+
+ // -- Random dense polynomial of degree 0
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r) const
+ {
+ return random(g, r,Degree(0));
+ }
+
+ // -- Random dense polynomial of size s
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, long s) const
+ {
+ return random(g, r,Degree(s-1));
+ }
+
+
+ // -- Random dense polynomial of degree d
+ // TEMPORARY VERSION SATISFYING LINBOX
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, typename Poly1Dom<Domain,Dense>::Rep& r, Degree d) const
+ {
+ r.reallocate(d.value()+1);
+ typename Domain::Element tmp;
+ while (_domain.isZero(g.random(tmp))) ;
+ r[d.value()] = tmp;
+ for (int i=(int)d.value(); i--;)
+ g.random(r[i]);
+ return r;
+ }
+
+ // -- Random dense polynomial of degree d
+ // specialization pour Givrandom
+ // #if !defined(__INTEL_COMPILER) && !defined(__CUDACC__)
+ // template<>
+ // #endif
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(GivRandom& g, Rep& r, Degree d) const
+ {
+ r.reallocate(d.value()+1);
+ _domain.nonzerorandom(g, r[d.value()]);
+ for (int i= (int)d.value(); i--;)
+ _domain.random(g,r[i]);
+ return r;
+ }
+
+#if 0
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, Degree d) const
+ {
+ r.reallocate(d.value()+1);
+ while (_domain.isZero(_domain.init(r[d.value()], g()))) {};
+ for (int i=d.value(); i--;)
+ _domain.init(r[i],g());
+ _domain.nonzerorandom(g, r[d.value()]);
+ for (int i=d.value(); i--;)
+ _domain.random(g,r[i]);
+ return r;
+ }
+#endif
-#ifndef __GIV_POLY_MISC_INL__
-#define __GIV_POLY_MISC_INL__
-
-template<class Domain>
-inline int Poly1Dom<Domain,Dense>::isZero (const Rep& P) const
-{
- setdegree((Rep&)P);
- if (P.size() ==0) return 1;
- if (P.size() ==1) return _domain.isZero(P[0]);
- else return 0;
-}
-
-template<class Domain>
-inline int Poly1Dom<Domain,Dense>::isOne (const Rep& P) const
-{
- setdegree((Rep&)P);
- if (P.size() ==1) return _domain.isOne(P[0]);
- else return 0;
-}
-
-template<class Domain>
-inline int Poly1Dom<Domain,Dense>::areEqual (const Rep& P, const Rep& Q) const
-{
- setdegree((Rep&)P);
- setdegree((Rep&)Q);
- if (P.size() != Q.size()) return 0;
- for( typename Element::const_iterator pit = P.begin(), qit = Q.begin();
- pit != P.end();
- ++pit, ++qit)
- if ( !_domain.areEqual(*pit, *qit) ) return 0;
- return 1;
-}
-
-
-template<class Domain>
-inline int Poly1Dom<Domain,Dense>::areNEqual (const Rep& P, const Rep& Q) const
-{
- setdegree((Rep&)P);
- setdegree((Rep&)Q);
- if (P.size() != Q.size()) return 1;
- for( typename Element::const_iterator pit = P.begin(), qit = Q.begin();
- pit != P.end();
- ++pit, ++qit)
- if ( !_domain.areEqual(*pit, *qit) ) return 1;
- return 0;
-}
-
-
- // -- Compute the degree of P
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::setdegree ( Rep& P ) const
-{
- int sz = P.size() - 1;
- if (P.size() <= 0) return P.reallocate(0);
- if (_domain.isZero(P[sz]) ==0) {
- return P;
- }
- for (int j=sz-1; j>=0; --j)
- if (_domain.isZero(P[j]) ==0) {
- P.reallocate(j+1);
- return P;
- }
- return P.reallocate(0);
-}
-
-template <class Domain>
-inline Degree& Poly1Dom<Domain,Dense>::degree(Degree& deg, const Rep& P) const
-{
- size_t sz = P.size();
- if (sz ==0) { return deg = Degree::deginfty; }
- if (_domain.isZero(P[sz-1])) {
- setdegree((Rep&)P);
- sz = P.size();
- }
- return deg = sz-1;
-}
-
-
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::leadcoef (Type_t& c, const Rep& P) const
-{
-typename Domain::Element zero;
-_domain.init(zero,0UL);
- Degree dP;
- degree(dP, P);
- if (dP == Degree::deginfty) return _domain.assign(c, zero);
- else return _domain.assign(c, P[dP.value()]);
-}
-
-
- // -- Returns the i-th coefficients
-template<class Domain>
-inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::getEntry (Type_t& c, const Degree& i, const Rep& P) const
-{
- typename Domain::Element zero;
- _domain.init(zero,0UL);
- Degree dP;
- degree(dP, P);
- if (dP < i) return _domain.assign(c, zero);
- else return _domain.assign(c, P[i.value()]);
-}
-
-
-
-
-template <class Domain>
-inline Degree& Poly1Dom<Domain,Dense>::val(Degree& d, const Rep& P) const
-{
- size_t sz = P.size();
- if (sz ==0) { return d = Degree::deginfty;}
- if (!_domain.isZero(P[0])) { return d = 0;}
- for (int i=1; i<sz; ++i)
- {
- if (!_domain.isZero(P[i])) { return d = i; }
- }
-}
-
-
-// Horner's scheme for evaluation
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Type_t& Poly1Dom<Domain,Dense>::eval (Type_t& res, const Rep& P, const Type_t& val) const
-{
-typename Domain::Element zero;
-_domain.init(zero,0UL);
- Degree dP ; degree(dP, P);
- if (dP == Degree::deginfty) _domain.assign(res, zero);
- else {
- _domain.assign(res, P[dP.value()]);
- for (int i = dP.value(); i>0; --i)
- _domain.axpy(res, res, val, P[i-1]);
- }
- return res;
-}
-
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::diff(Rep& P, const Rep& Q) const
-{
-typename Domain::Element zero, one;
-_domain.init(zero,0UL);
-_domain.init(one,1UL);
-
- Degree dQ;
- degree(dQ, Q);
- if ((dQ == Degree::deginfty) || (dQ == 0)) {
- P.reallocate(0);
- return P;
- }
- P.reallocate(dQ.value());
- Type_t cste; _domain.init(cste, zero);
- for (int i=0; dQ>i; ++i) {
- _domain.add(cste, cste, one);
- _domain.mul(P[i], Q[i+1], cste);
- }
- return P;
-}
-
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::pow( Rep& W, const Rep& P, long n) const
-{
- Rep puiss2;
- assign(puiss2, P); // -- P**(2^k)
- Rep tmp;
- assign(W,one);
- unsigned int p;
- p = (n < 0 ? -n : n); // cannot treats the case of <0 exponent
- while (p != 0) {
- if (p & 0x1) {
- mul( tmp, W, puiss2);
- assign(W,tmp);
- }
- if ((p >>= 1) != 0) {
- mul( tmp, puiss2, puiss2);
- assign(puiss2,tmp);
- }
- }
- return W;
-}
-
-
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::powmod( Rep& W, const Rep& P, IntegerDom::Element pwr, const Rep& U) const
-{
- IntegerDom ID;
-// ID.write(cerr << "\n----------- POWMOD -----------\n pwr: ", pwr) << endl;
-// write(cerr << "P: ",P) << endl;
-// write(cerr << "U: ",U) << endl;
- Rep puiss, tmp;
- mod(puiss, P, U);
- assign(W,one);
- IntegerDom::Element n,q,r,deux,zero;
- ID.init(deux,2);
- ID.init(zero,0UL);
- if (ID.islt(pwr,zero) )
- ID.neg(n,pwr);
- else
- ID.init(n,pwr);
-
- while (n > 0) {
- ID.divmod(q,r,n,deux);
- n.copy(q);
- if (! ID.isZero(r)) {
- mulin(W,puiss);
- mod(tmp, W, U);
- assign(W,tmp);
- }
- mul(tmp,puiss,puiss);
- mod(puiss,tmp,U);
- }
-
-// write(cerr << "W: ", W) << "\n----------- END POWMOD -----------" << endl;
- return setdegree(W);
-}
-
-
-// -- Random dense polynomial of degree 0
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r) const { return random(g, r,Degree(0)); }
-
-// -- Random dense polynomial of size s
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, long s) const { return random(g, r,Degree(s-1)); }
-
-
-// -- Random dense polynomial of degree d
-// template <class Domain> template<class RandIter>
-// inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, Degree d) const {
-// r.reallocate(d.value()+1);
-// _domain.nonzerorandom(g,r[d.value()]);
-// for (int i=d.value(); i--;)
-// _domain.random(g,r[i]);
-// return r;
-// }
-
-// -- Random dense polynomial of degree d
-// TEMPORARY VERSION SATISFYING LINBOX
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Poly1Dom<Domain,Dense>::Rep& r, Degree d) const {
- r.reallocate(d.value()+1);
- typename Domain::Element tmp;
- while (_domain.isZero(g.random(tmp))) ;
- r[d.value()] = tmp;
- for (int i=d.value(); i--;)
- g.random(r[i]);
- return r;
-}
-
-// -- Random dense polynomial of degree d
-// specialization pour Givrandom
-template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(GivRandom& g, Rep& r, Degree d) const {
- r.reallocate(d.value()+1);
- _domain.nonzerorandom(g, r[d.value()]);
- for (int i=d.value(); i--;)
- _domain.random(g,r[i]);
- return r;
-}
-
-// template <class Domain> template<class RandIter>
-// inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, Degree d) const {
-// r.reallocate(d.value()+1);
-// while (_domain.isZero(_domain.init(r[d.value()], g()))) {};
-// for (int i=d.value(); i--;)
-// _domain.init(r[i],g());
-// _domain.nonzerorandom(g, r[d.value()]);
-// for (int i=d.value(); i--;)
-// _domain.random(g,r[i]);
-// return r;
-// }
-
-// -- Random dense polynomial with same size as b.
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, const Rep& b) const { return random(g, r,b.size()); }
-
-
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r) const { return random(g, r); }
-
-
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r, long s) const { return random(g, r,s); }
-
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r, Degree d) const { return random(g, r,d); }
-
-template <class Domain> template<class RandIter>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r, const Rep& b) const { return random(g, r,b); }
+ // -- Random dense polynomial with same size as b.
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::random(RandIter& g, Rep& r, const Rep& b) const
+ {
+ return random(g, r,b.size());
+ }
-#endif
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r) const
+ {
+ return random(g, r);
+ }
+
+
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r, long s) const
+ {
+ return random(g, r,s);
+ }
+
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r, Degree d) const
+ {
+ return random(g, r,d);
+ }
+
+ template <class Domain> template<class RandIter>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::nonzerorandom(RandIter& g, Rep& r, const Rep& b) const
+ {
+ return random(g, r,b);
+ }
+
+
+
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::reverse( Rep& P, const Rep& Q) const {
+
+ // this->setdegree(Q);
+ P.resize(Q.size());
+ std::reverse_copy(Q.begin(), Q.end(), P.begin());
+ this->setdegree(P);
+ return P;
+ }
+
+
+
+ template <class Domain>
+ inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::reversein( Rep& P) const
+ {
+ this->setdegree(P);
+ std::reverse(P.begin(), P.end());
+ this->setdegree(P);
+ return P;
+ }
+
+} // Givaro
+
+#endif // __GIVARO_poly_misc_INL
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1muldiv.inl b/src/library/poly1/givpoly1muldiv.inl
index f996f84..a435edc 100644
--- a/src/library/poly1/givpoly1muldiv.inl
+++ b/src/library/poly1/givpoly1muldiv.inl
@@ -1,130 +1,166 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1muldiv.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1muldiv.inl,v 1.6 2007-01-11 18:42:51 jgdumas Exp $
+// $Id: givpoly1muldiv.inl,v 1.14 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
+#ifndef __GIVARO_poly1_muldiv_INL
+#define __GIVARO_poly1_muldiv_INL
#include "givaro/givpower.h"
#include "givaro/giverror.h"
+namespace Givaro {
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::shiftin ( Rep& R, int s) const
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::shiftin ( Rep& R, int s) const
{
- Type_t zer;
- R.insert(R.begin(), s, this->_domain.init(zer,0) );
- return R;
+ R.insert(R.begin(), s, this->_domain.zero );
+ return R;
}
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::shift ( Rep& R, const Rep& a, int s) const
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::shift ( Rep& R, const Rep& a, int s) const
{
- R = a;
- return R.shiftin(R, s);
+ R = a;
+ return R.shiftin(R, s);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mulin( Rep& R, const Type_t& u ) const
{
- for(typename Rep::iterator ri = R.begin();ri!=R.end();++ri)
- _domain.mulin(*ri, u);
- return R;
+ for(typename Rep::iterator ri = R.begin();ri!=R.end();++ri)
+ _domain.mulin(*ri, u);
+ return R;
-// return _supportdomain.mulin(R,u);
+ // return _supportdomain.mulin(R,u);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mulin( Rep& R, const Rep& P ) const
{
- size_t sR = R.size();
- size_t sP = P.size();
- Rep tmp(sR+sP);
- mul(tmp, R, P);
-// R.logcopy(tmp);
-// return R;
- return assign(R,tmp);
+ size_t sR = R.size();
+ size_t sP = P.size();
+ Rep tmp(sR+sP);
+ mul(tmp, R, P);
+ // R.logcopy(tmp);
+ // return R;
+ return assign(R,tmp);
}
-// template <class Domain>
-// Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mul( Rep& R, const Rep& P, const Rep& Q ) const
-// {
-// size_t sR = R.size();
-// size_t sP = P.size();
-// size_t sQ = Q.size();
-// if ((sQ ==0) || (sP ==0)) { R.reallocate(0); return R; }
-// if (sR != sQ+sP) R.reallocate(sR = sP+sQ-1);
-
-// size_t i,j;
-// for (i=0; i<sR; ++i) _domain.init(R[i], _domain.zero);
-// for (i=0; i<sP; ++i)
-// if (! _domain.isZero(P[i]))
-// for (j=0; j<sQ; ++j)
-// _domain.axpy(R[i+j], P[i], Q[j], R[i+j]);
-// return setdegree(R);
-// }
+#if 0
+template <class Domain>
+Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mul( Rep& R, const Rep& P, const Rep& Q ) const
+{
+ size_t sR = R.size();
+ size_t sP = P.size();
+ size_t sQ = Q.size();
+ if ((sQ ==0) || (sP ==0)) { R.reallocate(0); return R; }
+ if (sR != sQ+sP) R.reallocate(sR = sP+sQ-1);
+
+ size_t i,j;
+ for (i=0; i<sR; ++i) _domain.assign(R[i], _domain.zero);
+ for (i=0; i<sP; ++i)
+ if (! _domain.isZero(P[i]))
+ for (j=0; j<sQ; ++j)
+ _domain.axpy(R[i+j], P[i], Q[j], R[i+j]);
+ return setdegree(R);
+}
+#endif
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mul( Rep& R, const Rep& P, const Rep& Q ) const
{
- Type_t _zero;
- _domain.init( _zero, 0.0);
- size_t sR = R.size();
- size_t sP = P.size();
- size_t sQ = Q.size();
- if ((sQ ==0) || (sP ==0)) { R.reallocate(0); return R; }
- if (sR != sQ+sP) R.reallocate(sR = sP+sQ-1);
-
- typename Rep::const_iterator ai=P.begin(),bi=Q.begin();
- typename Rep::iterator ri=R.begin(), rig=R.begin();
- if (_domain.isZero(*ai))
- for(;bi!=Q.end();++bi,++ri)
- *ri = _zero;
- else
- for(;bi!=Q.end();++bi,++ri)
- if (_domain.isZero(*bi))
- *ri = _zero;
- else
- _domain.mul(*ri,*ai,*bi);
- for(;ri!=R.end();++ri)
- *ri = _zero;
- for(++ai,++rig;ai!=P.end();++ai,++rig)
- if (! _domain.isZero(*ai))
- for(ri=rig,bi=Q.begin();bi!=Q.end();++bi,++ri)
- _domain.axpyin(*ri,*ai,*bi);
- return setdegree(R);
+ size_t sR = R.size();
+ size_t sP = P.size();
+ size_t sQ = Q.size();
+ if ((sQ ==0) || (sP ==0)) { R.reallocate(0); return R; }
+ if (sR != sQ+sP) R.reallocate(sR = sP+sQ-1);
+
+ typename Rep::const_iterator ai=P.begin(),bi=Q.begin();
+ typename Rep::iterator ri=R.begin(), rig=R.begin();
+ if (_domain.isZero(*ai))
+ for(;bi!=Q.end();++bi,++ri)
+ *ri = _domain.zero;
+ else
+ for(;bi!=Q.end();++bi,++ri)
+ if (_domain.isZero(*bi))
+ *ri = _domain.zero;
+ else
+ _domain.mul(*ri,*ai,*bi);
+ for(;ri!=R.end();++ri)
+ *ri = _domain.zero;
+ for(++ai,++rig;ai!=P.end();++ai,++rig)
+ if (! _domain.isZero(*ai))
+ for(ri=rig,bi=Q.begin();bi!=Q.end();++bi,++ri)
+ _domain.axpyin(*ri,*ai,*bi);
+ return setdegree(R);
+}
+
+template <class Domain>
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mul( Rep& R, const Rep& P, const Rep& Q, const Degree& Val, const Degree& deg) const
+{
+ size_t sR = R.size();
+ size_t sP = P.size();
+ size_t sQ = Q.size();
+ if ((sQ ==0) || (sP ==0)) { R.reallocate(0); return R; }
+ size_t newS = value(deg-Val)+1;
+ if (sR != newS) R.reallocate(sR = newS);
+ for(typename Rep::iterator ri=R.begin(); ri!= R.end(); ++ri)
+ *ri = _domain.zero;
+
+ for(size_t i=0; i<sR; ++i) {
+ long k=i+Val.value();
+ size_t j=0;
+ if (static_cast<size_t>(k)>=sQ) {
+ j=k;
+ k=sQ-1;
+ j-=k;
+ }
+ for( ; (j<sP) && (k>=0); ++j,--k) {
+ _domain.axpyin(R[i],P[j],Q[k]);
+ }
+ }
+ return setdegree(R);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mul
- ( Rep& R, const Rep& P, const Type_t& val ) const
+( Rep& R, const Rep& P, const Type_t& Val ) const
{
- typename Rep::const_iterator ip = P.begin();
- R.resize(P.size());
- for(typename Rep::iterator ir = R.begin(); ir != R.end(); ++ir, ++ip)
- this->_domain.mul(*ir, *ip, val);
- return R;
+ typename Rep::const_iterator ip = P.begin();
+ R.resize(P.size());
+ for(typename Rep::iterator ir = R.begin(); ir != R.end(); ++ir, ++ip)
+ this->_domain.mul(*ir, *ip, Val);
+ return R;
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mul
- ( Rep& R, const Type_t& val, const Rep& P ) const
+( Rep& R, const Type_t& Val, const Rep& P ) const
{
- return this->mul(R,P,val);
+ return this->mul(R,P,Val);
}
+} // Givaro
+
+#include <typeinfo>
+namespace Givaro {
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::divin(Rep& R, const Type_t& u) const
{
#ifdef GIVARO_DEBUG
- if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::divin]"));
+ if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::divin]"));
#endif
- size_t sz =R.size();
- for (unsigned int i=0; i<sz; ++i)
- _domain.divin(R[i],u);
- return setdegree(R);
+ size_t sz =R.size();
+ for (unsigned int i=0; i<sz; ++i)
+ _domain.divin(R[i],u);
+ return setdegree(R);
}
@@ -132,13 +168,13 @@ template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::div(Rep& R, const Rep& P, const Type_t& u) const
{
#ifdef GIVARO_DEBUG
- if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
+ if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
#endif
- size_t sP =P.size();
- R.reallocate(sP);
- for (unsigned int i=0; i<sP; ++i)
- _domain.div(R[i],P[i],u);
- return setdegree(R);
+ size_t sP =P.size();
+ R.reallocate(sP);
+ for (unsigned int i=0; i<sP; ++i)
+ _domain.div(R[i],P[i],u);
+ return setdegree(R);
}
@@ -146,40 +182,40 @@ template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::div(Rep& R, const Type_t& u, const Rep& P) const
{
#ifdef GIVARO_DEBUG
- if (isZero(P)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::divin]"));
+ if (isZero(P)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
#endif
- if (_domain.isZero(u)) { return assign(R,zero);}
- size_t sP =P.size();
- if (sP >1) { R.reallocate(0); return R; }
- size_t sR =R.size();
- if (sR !=1) R.reallocate(1);
- _domain.div(R[0], u, P[0]);
- return setdegree(R);
+ if (_domain.isZero(u)) { return assign(R,zero);}
+ size_t sP =P.size();
+ if (sP >1) { R.reallocate(0); return R; }
+ size_t sR =R.size();
+ if (sR !=1) R.reallocate(1);
+ _domain.div(R[0], u, P[0]);
+ return setdegree(R);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::div(Rep& Q, const Rep& A, const Rep& B) const
{
- Rep R;
- return divmod(Q,R,A,B);
+ Rep R;
+ return divmod(Q,R,A,B);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::divin(Rep& Q, const Rep& A) const
{
- Rep R, B;
- divmod(B,R,Q,A);
- return assign(Q,B);
+ Rep R, B;
+ divmod(B,R,Q,A);
+ return assign(Q,B);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::modin(Rep& R, const Type_t& u) const
{
#ifdef GIVARO_DEBUG
- if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::modin]"));
+ if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::modin]"));
#endif
- R.reallocate(0);
- return R;
+ R.reallocate(0);
+ return R;
}
@@ -187,10 +223,10 @@ template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mod(Rep& R, const Rep& P, const Type_t& u) const
{
#ifdef GIVARO_DEBUG
- if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::mod]"));
+ if (_domain.isZero(u)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::mod]"));
#endif
- R.reallocate(0);
- return R;
+ R.reallocate(0);
+ return R;
}
@@ -198,265 +234,339 @@ template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mod(Rep& R, const Type_t& u, const Rep& P) const
{
#ifdef GIVARO_DEBUG
- if (isZero(P)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::mod]"));
+ if (isZero(P)) GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::mod]"));
#endif
- if (_domain.isZero(u)) { return assign(P,R); }
- size_t sP =P.size();
- if (sP >1) {
- R.reallocate(1);
- _domain.assign(R[0], u);
- return R;
- }
- R.reallocate(1);
- _domain.mod(R[0],u,P[0]);
- return R;
+ if (_domain.isZero(u)) { return assign(P,R); }
+ size_t sP =P.size();
+ if (sP >1) {
+ R.reallocate(1);
+ _domain.assign(R[0], u);
+ return R;
+ }
+ R.reallocate(1);
+ _domain.mod(R[0],u,P[0]);
+ return R;
}
-
-// template <class Domain>
-// inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::modin(Rep& R, const Rep& A) const {
-// Rep tR; assign(tR,R);
-// return mod(R,tR,A);
-// }
+#if 0
+template <class Domain>
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::modin(Rep& R, const Rep& A) const
+{
+ Rep tR; assign(tR,R);
+ return mod(R,tR,A);
+}
+#endif
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::modin(Rep& A, const Rep& B) const {
- // In place remainder
- // A is written with next remainder in
- // the division algorithm written at the end.
- // Last step is erasing of the first values.
-// write(std::cerr << "Rem(", A) << " ,";
-// write(std::cerr, B) << ", X) mod " << _domain.size();
- Type_t _zero;
- _domain.init( _zero, 0.0);
- long i = A.size()-B.size();
- if (i >= 0) {
- typedef typename Rep::value_type TT;
- TT l;
- typename Rep::reverse_iterator ai,aai;
- typename Rep::const_reverse_iterator bi;
- for (; i>=0; --i) {
- ai = A.rbegin();
- bi = B.rbegin();
- _domain.div(l,*ai,*bi);
- aai = A.rbegin();
- for(++bi,++ai;bi!=B.rend();++bi,++ai,--i) {
- _domain.amxy(*aai,l,*bi,*ai);
- if (! _domain.isZero(*aai)) break;
- }
- if (bi!=B.rend())
- for(++bi,++ai,++aai;bi!=B.rend();++bi,++ai,++aai)
- _domain.amxy(*aai,l,*bi,*ai);
- for(;ai!=A.rend();++ai,++aai)
- *aai = *ai;
- *aai = _zero;
- }
-// write(std::cerr << " = ", A) << ";" << std::endl;
- A.erase(A.begin(), A.begin()+(A.size()-B.size()-i));
- }
-// write(std::cerr << " = ", setdegree(A)) << ";" << std::endl;
- return setdegree(A);
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::modin(Rep& A, const Rep& B) const
+{
+ // In place remainder
+ // A is written with next remainder in
+ // the division algorithm written at the end.
+ // Last step is erasing of the first values.
+ // write(std::cerr << "Rem(", A) << " ,";
+ // write(std::cerr, B) << ", X) mod " << _domain.size();
+ long i = A.size()-B.size();
+ if (i >= 0) {
+ typedef typename Rep::value_type TT;
+ TT l;
+ typename Rep::reverse_iterator ai,aai;
+ typename Rep::const_reverse_iterator bi;
+ for (; i>=0; --i) {
+ ai = A.rbegin();
+ bi = B.rbegin();
+ _domain.div(l,*ai,*bi);
+ aai = A.rbegin();
+ for(++bi,++ai;bi!=B.rend();++bi,++ai,--i) {
+ _domain.maxpy(*aai,l,*bi,*ai);
+ if (! _domain.isZero(*aai)) break;
+ }
+ if (bi!=B.rend())
+ for(++bi,++ai,++aai;bi!=B.rend();++bi,++ai,++aai)
+ _domain.maxpy(*aai,l,*bi,*ai);
+ for(;ai!=A.rend();++ai,++aai)
+ *aai = *ai;
+ *aai = _domain.zero;
+ }
+ // write(std::cerr << " = ", A) << ";" << std::endl;
+ A.erase(A.begin(), A.begin()+(A.size()-B.size()-i));
+ }
+ // write(std::cerr << " = ", setdegree(A)) << ";" << std::endl;
+ return setdegree(A);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::mod(Rep& R, const Rep& A, const Rep& B) const
{
- Rep Q;
-// write(std::cerr, A) << " = (";
-// write(std::cerr, B) << ") * (";
- divmod(Q,R,A,B);
-// write(std::cerr, Q) << ") + (";
-// write(std::cerr, R) << ");" << std::endl;
- return R;
+ Rep Q;
+ // write(std::cerr, A) << " = (";
+ // write(std::cerr, B) << ") * (";
+ divmod(Q,R,A,B);
+ // write(std::cerr, Q) << ") + (";
+ // write(std::cerr, R) << ");" << std::endl;
+ return R;
}
+// #include <typeinfo>
template <class Domain>
-inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::divmod( Rep& Q, Rep& R, const Rep& A, const Rep& B) const
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::divmod( Rep& Q, Rep& R, const Rep& A, const Rep& B) const
// returns Q such that A = B Q + R
{
- Degree degB; degree(degB, B);
- Type_t _zero;
- _domain.init( _zero, 0.0);
+ // std::cerr << "BEG divmod of " << typeid(*this).name() << std::endl;
+ // std::cerr << "BEG with _domain " << typeid(_domain).name() << std::endl;
+ Degree degB;
+ degree(degB, B);
#ifdef GIVARO_DEBUG
- if (degB == Degree::deginfty)
- GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
+ if (degB == Degree::deginfty)
+ GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
#endif
- Degree degA; degree(degA, A);
- if (degA == Degree::deginfty) {
- assign(R, zero);
- return assign(Q, zero);
- }
- if (degB == 0) // cste
- {
- assign(R, zero);
- return div(Q, A, B[0]);
- }
-// JGD 15.12.1999 :
-// if (degA ==0)
-// {
-// assign(R, zero);
-// return assign(Q, zero);
-// }
- if (degB > degA) {
- assign(R, A);
- return assign(Q, zero);
- }
-
- long degQuo = value(degA-degB);
- long degRem = value(degA);
- Q.reallocate(degQuo+1);
-
- assign(R,A);
-
- Type_t tmp;
- long i,j;
- for (i=degQuo; i>=0; --i)
- {
- // == ld X^ (degRem-degQ)
- _domain.div(Q[degQuo], R[degRem], B[degB.value()]);
-
- _domain.neg(tmp, Q[degQuo]);
- for (j=0; degB>j; j++) { // rem <- rem - ld*x^(degRem-degB)*B
- _domain.axpyin(R[j+degQuo], tmp, B[j]);
- }
- _domain.assign(R[degRem],_zero) ; degQuo--; degRem--;
- }
- R.reallocate(degRem+1);
- setdegree(R);
- return setdegree(Q);
+ Degree degA; degree(degA, A);
+ if (degA == Degree::deginfty) {
+ assign(R, zero);
+ return assign(Q, zero);
+ }
+ if (degB == 0) // cste
+ {
+ assign(R, zero);
+ return div(Q, A, B[0]);
+ }
+ // write(std::cerr, A) << " of degA " << degA << std::endl;
+ // write(std::cerr, B) << " of degB " << degB << std::endl;
+
+
+ // JGD 15.12.1999 :
+ // if (degA ==0)
+ // {
+ // assign(R, zero);
+ // return assign(Q, zero);
+ // }
+ if (degB > degA) {
+ assign(R, A);
+ return assign(Q, zero);
+ }
+
+ long degQuo = value(degA-degB);
+ long degRem = value(degA);
+ Q.reallocate(degQuo+1);
+
+ assign(R,A);
+ // write(std::cerr << "A:=", A) << "; # of degA " << degA << std::endl;
+ // write(std::cerr << "B:=", B) << "; # of degB " << degB << std::endl;
+
+ for (long i=degQuo; i>=0; --i)
+ {
+ // == ld X^ (degRem-degQ)
+ _domain.div(Q[i], R[degRem], B[degB.value()]);
+ // _domain.write(std::cerr << "Q[" << i << "]:=", Q[i]) << ';' << std::endl;
+ // std::cerr << "degB: " << degB << std::endl;
+ for (long j=0; degB>j; ++j) { // rem <- rem - ld*x^(degRem-degB)*B
+ _domain.maxpyin(R[j+i], Q[i], B[j]);
+ }
+ _domain.assign(R[degRem],_domain.zero) ; --degRem;
+ // write(std::cerr << "inR:=", R) << ';' << std::endl;
+ }
+ // write(std::cerr << "Q:=", Q) << "; # of degQ " << degQuo << std::endl;
+ // write(std::cerr << "R:=", R) << "; # of degR " << degRem << std::endl;
+ R.reallocate(degRem+1);
+ setdegree(R);
+ // std::cerr << "END divmod of " << typeid(*this).name() << std::endl;
+ return setdegree(Q);
+}
+
+template <class Domain>
+inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::divmodin( Rep& Q, Rep& R, const Rep& B) const
+// returns Q such that A = B Q + R
+{
+ // std::cerr << "BEG divmod of " << typeid(*this).name() << std::endl;
+ // std::cerr << "BEG with _domain " << typeid(_domain).name() << std::endl;
+ Degree degB; degree(degB, B);
+#ifdef GIVARO_DEBUG
+ if (degB == Degree::deginfty)
+ GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
+#endif
+ Degree degA; degree(degA, R);
+ if (degA == Degree::deginfty) {
+ assign(R, zero);
+ return assign(Q, zero);
+ }
+ if (degB == 0) // cste
+ {
+ div(Q, R, B[0]);
+ assign(R, zero);
+ return Q;
+ }
+ // write(std::cerr, A) << " of degA " << degA << std::endl;
+ // write(std::cerr, B) << " of degB " << degB << std::endl;
+
+
+ // JGD 15.12.1999 :
+ // if (degA ==0)
+ // {
+ // assign(R, zero);
+ // return assign(Q, zero);
+ // }
+ if (degB > degA) {
+ return assign(Q, zero);
+ }
+
+ long degQuo = value(degA-degB);
+ long degRem = value(degA);
+ Q.reallocate(degQuo+1);
+
+ // write(std::cerr << "A:=", A) << "; # of degA " << degA << std::endl;
+ // write(std::cerr << "B:=", B) << "; # of degB " << degB << std::endl;
+
+ for (long i=degQuo; i>=0; --i)
+ {
+ // == ld X^ (degRem-degQ)
+ _domain.div(Q[i], R[degRem], B[degB.value()]);
+ // _domain.write(std::cerr << "Q[" << i << "]:=", Q[i]) << ';' << std::endl;
+ // std::cerr << "degB: " << degB << std::endl;
+ for (long j=0; degB>j; ++j) { // rem <- rem - ld*x^(degRem-degB)*B
+ _domain.maxpyin(R[j+i], Q[i], B[j]);
+ }
+ _domain.assign(R[degRem],_domain.zero) ; --degRem;
+ // write(std::cerr << "inR:=", R) << ';' << std::endl;
+ }
+ // write(std::cerr << "Q:=", Q) << "; # of degQ " << degQuo << std::endl;
+ // write(std::cerr << "R:=", R) << "; # of degR " << degRem << std::endl;
+ R.reallocate(degRem+1);
+ setdegree(R);
+ // std::cerr << "END divmod of " << typeid(*this).name() << std::endl;
+ return setdegree(Q);
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::pdivmod
- ( Rep& Q, Rep& R, Type_t& m, const Rep& A, const Rep& B) const
+( Rep& Q, Rep& R, Type_t& m, const Rep& A, const Rep& B) const
// returns Q ...
{
- Type_t _zero, _one;
- _domain.init( _one, 1.0);
- _domain.init( _zero, 0.0);
- Degree degB; degree(degB, B);
+ Degree degB; degree(degB, B);
#ifdef GIVARO_DEBUG
- if (degB == Degree::deginfty)
- GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
+ if (degB == Degree::deginfty)
+ GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
#endif
- Degree degA; degree(degA, A);
- if (degA == Degree::deginfty) {
- assign(R, zero);
- _domain.assign(m, _domain.one);
- return assign(Q, zero);
- }
- if (degB == 0) // cste
- {
- assign(R, zero);
- _domain.assign(m, B[0]);
- return assign(Q, A);
- }
- if (degA ==0)
- {
- assign(R, zero);
- _domain.assign(m, _domain.one);
- return assign(Q, zero);
- }
- if (degB > degA) {
- assign(R, A);
- _domain.assign(m, _domain.one);
- return assign(Q, zero);
- }
-
- long degQuo = value(degA-degB);
- long degRem = value(degA);
- Q.reallocate(degQuo+1);
- assign(R,A);
-
- Type_t tmp, lB;
- _domain.assign(lB, B[degB.value()]);
- _domain.assign(m, _domain.one);
- long i,j;
- for (i=degQuo; i>=0; --i)
- {
- // == ld X^ (degRem-degQ)
- _domain.assign(Q[degQuo], R[degRem]);
-
- // rem <- lB*rem - lQ*x^(degRem-degB)*B
- for (j=0; j<degQuo; j++)
- _domain.mulin (R[j], lB);
- for (j=0; degB>j; j++)
- {
- _domain.mulin(R[j+degQuo], lB);
- _domain.axmyin(R[j+degQuo], Q[degQuo], B[j]);
- }
- _domain.assign(R[degRem],_zero); degQuo--; degRem--;
- _domain.mulin(m, lB);
- }
- R.reallocate(degRem+1);
- setdegree(R);
- return setdegree(Q);
-// Poly1Dom<Domain,Dense>::Rep U,V;
-// assign(U,A);
-// mulin(U,m);
-// write(std::cout << "m*A:", U) << std::endl;
-// mul(U,Q,B);
-// write(std::cout << "Q*B:", U) << std::endl;
+ Degree degA; degree(degA, A);
+ if (degA == Degree::deginfty) {
+ assign(R, zero);
+ _domain.assign(m, _domain.one);
+ return assign(Q, zero);
+ }
+ if (degB == 0) // cste
+ {
+ assign(R, zero);
+ _domain.assign(m, B[0]);
+ return assign(Q, A);
+ }
+ if (degA ==0)
+ {
+ assign(R, zero);
+ _domain.assign(m, _domain.one);
+ return assign(Q, zero);
+ }
+ if (degB > degA) {
+ assign(R, A);
+ _domain.assign(m, _domain.one);
+ return assign(Q, zero);
+ }
+
+ long degQuo = value(degA-degB);
+ long degRem = value(degA);
+ Q.reallocate(degQuo+1);
+ assign(R,A);
+
+ Type_t tmp, lB;
+ _domain.assign(lB, B[degB.value()]);
+ _domain.assign(m, _domain.one);
+ long i,j;
+ for (i=degQuo; i>=0; --i)
+ {
+ // == ld X^ (degRem-degQ)
+ _domain.assign(Q[degQuo], R[degRem]);
+
+ // rem <- lB*rem - lQ*x^(degRem-degB)*B
+ for (j=0; j<degQuo; j++)
+ _domain.mulin (R[j], lB);
+ for (j=0; degB>j; j++)
+ {
+ _domain.mulin(R[j+degQuo], lB);
+ _domain.maxpyin(R[j+degQuo], Q[degQuo], B[j]);
+ }
+ _domain.assign(R[degRem],_domain.zero); degQuo--; degRem--;
+ _domain.mulin(m, lB);
+ }
+ R.reallocate(degRem+1);
+ setdegree(R);
+ return setdegree(Q);
+ // Poly1Dom<Domain,Dense>::Rep U,V;
+ // assign(U,A);
+ // mulin(U,m);
+ // write(std::cout << "m*A:", U) << std::endl;
+ // mul(U,Q,B);
+ // write(std::cout << "Q*B:", U) << std::endl;
}
template <class Domain>
inline typename Poly1Dom<Domain,Dense>::Rep& Poly1Dom<Domain,Dense>::pmod
- ( Rep& R, Type_t& m, const Rep& A, const Rep& B) const
+( Rep& R, Type_t& m, const Rep& A, const Rep& B) const
{
- Degree degB; degree(degB, B);
+ Degree degB; degree(degB, B);
#ifdef GIVARO_DEBUG
- if (degB == Degree::deginfty)
- GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
+ if (degB == Degree::deginfty)
+ GivError::throw_error(GivMathDivZero("[Poly1Dom<D>::div]"));
#endif
- Degree degA; degree(degA, A);
- if (degA == Degree::deginfty) {
- _domain.assign(m, _domain.one);
- return assign(R, zero);
- }
- if (degB == 0) // cste
- {
- _domain.assign(m, B[0]);
- return assign(R, zero);
- }
- if (degA ==0)
- {
- _domain.assign(m, _domain.one);
- return assign(R, zero);
- }
- if (degB > degA) {
- _domain.assign(m, _domain.one);
- return assign(R, A);
- }
-
- Degree degR = degA;
- assign(R,A);
-
- Type_t tmp, lB;
- _domain.assign(lB, B[degB.value()]);
- long i,j;
-//write(std::cout << "B:", B) << std::endl;
-//_domain.write(std::cout << "lB:", lB) << "^" << degA-degB+1 << std::endl;
-// _domain.pow(m, lB, degA.value()-degB.value()+1);
- dom_power(m, lB, degA.value()-degB.value()+1,_domain);
-//_domain.write(std::cout << "m:", m) << std::endl;
- for (; degB<= degR; )
- {
- long d = degR.value()-degB.value();
- // R <- lB*R - lR*x^(degR-degB)*B
- for (j=0; degB>j; j++)
- {
- _domain.mulin (R[j+d], lB);
- _domain.axmyin(R[j+d], R[degR.value()], B[j]);
- }
- for (j=0; j<d; ++j)
- _domain.mulin (R[j], lB);
- _domain.assign(R[degR.value()],_domain.zero);
- degree(degR, R);
- }
- R.reallocate(degR.value()+1);
- return setdegree(R);
+ Degree degA; degree(degA, A);
+ if (degA == Degree::deginfty) {
+ _domain.assign(m, _domain.one);
+ return assign(R, zero);
+ }
+ if (degB == 0) // cste
+ {
+ _domain.assign(m, B[0]);
+ return assign(R, zero);
+ }
+ if (degA ==0)
+ {
+ _domain.assign(m, _domain.one);
+ return assign(R, zero);
+ }
+ if (degB > degA) {
+ _domain.assign(m, _domain.one);
+ return assign(R, A);
+ }
+
+ Degree degR = degA;
+ assign(R,A);
+
+ Type_t tmp, lB;
+ _domain.assign(lB, B[degB.value()]);
+ //write(std::cout << "B:", B) << std::endl;
+ //_domain.write(std::cout << "lB:", lB) << "^" << degA-degB+1 << std::endl;
+ // _domain.pow(m, lB, degA.value()-degB.value()+1);
+ dom_power(m, lB, degA.value()-degB.value()+1,_domain);
+ //_domain.write(std::cout << "m:", m) << std::endl;
+ for (; degB<= degR; )
+ {
+ long d = degR.value()-degB.value();
+ // R <- lB*R - lR*x^(degR-degB)*B
+ for (long j=0; degB>j; j++)
+ {
+ _domain.mulin (R[j+d], lB);
+ _domain.maxpyin(R[j+d], R[degR.value()], B[j]);
+ }
+ for (long j=0; j<d; ++j)
+ _domain.mulin (R[j], lB);
+ _domain.assign(R[degR.value()],_domain.zero);
+ degree(degR, R);
+ }
+ R.reallocate(degR.value()+1);
+ return setdegree(R);
}
+
+} // Givaro
+#endif // __GIVARO_poly1_muldiv_INL
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1padic.h b/src/library/poly1/givpoly1padic.h
index e2e7897..789ead8 100644
--- a/src/library/poly1/givpoly1padic.h
+++ b/src/library/poly1/givpoly1padic.h
@@ -1,24 +1,28 @@
// ================================================================= //
-// (C) The Linbox Group 1999
-// Time-stamp: <21 Nov 07 11:36:37 Jean-Guillaume.Dumas at imag.fr>
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <11 Jun 10 14:43:52 Jean-Guillaume.Dumas at imag.fr>
// ================================================================= //
-#ifndef _GIV_POLY1_P_ADIC_H_
-#define _GIV_POLY1_P_ADIC_H_
+#ifndef __GIVARO_poly1_p_adic_H
+#define __GIVARO_poly1_p_adic_H
#include <givaro/givinteger.h>
#include <givaro/givpoly1.h>
-#include <math.h>
+#include <cmath>
#include <iostream>
-template<class Domain, class Tag> class Poly1PadicDom;
-
+namespace Givaro {
+template<class Domain, class Tag=Dense> class Poly1PadicDom;
template<class Domain>
class Poly1PadicDom<Domain,Dense> : public Poly1Dom<Domain,Dense>, public IntegerDom {
using Poly1Dom<Domain,Dense>::_domain;
typedef Poly1Dom<Domain,Dense> Poly_t;
-
+
typedef typename Poly_t::Rep Rep;
public:
typedef typename Poly_t::Element Element;
@@ -31,11 +35,11 @@ public:
- std::ostream& write( std::ostream& o, const pol_Element& p) {
- return Poly_t::write(o, p);
+ std::ostream& write( std::ostream& o, const pol_Element& p) {
+ return Poly_t::write(o, p);
}
-
-
+
+
// Horner like evaluation of the polynomial for p = _domain.size()
@@ -93,13 +97,14 @@ public:
vect& radix(vect& P, const IntegerDom::Element& E, long n = 0) {
if (n < 1) n = logp(E,_domain.size()) + 1;
if (n == 1) {
- // Could also be
+ // Could also be
// typename Domain::Element e;
// Poly_t::assign(P, Degree(0), _domain.init(e, E) );
+ // But Poly_t::init uses less temporaries
return Poly_t::init(P, Degree(0), E );
}
IntegerDom::Element iq, ir;
- vect Q;
+ vect Q;
long t = (n+1)/2;
IntegerDom::Element q;
IntegerDom::pow(q, _domain.size(), t);
@@ -111,7 +116,7 @@ public:
P.push_back(_domain.zero);
P.insert(P.end(),Q.begin(),Q.end());
return setdegree(P);
- }
+ }
// vect is supposed to be a vector of doubles
@@ -121,13 +126,13 @@ public:
if (n <= 1) {
P.resize(0);
typedef typename vect::value_type elem;
- P.push_back( E );
+ P.push_back( static_cast<elem>(E) );
return P;
}
double iq, ir;
- vect Q;
+ vect Q;
long t = (n+1)/2;
- double q = pow(double(_domain.size()), double(t));
+ double q = std::pow(double(_domain.size()), double(t));
iq = floor( E / q );
ir = E - iq*q;
radixdirect(Q, iq, n-t);
@@ -137,9 +142,21 @@ public:
P.push_back(_domain.zero);
P.insert(P.end(),Q.begin(),Q.end());
return setdegree(P);
- }
+ }
+ template<class vect, class TT>
+ vect& radixdirect(vect& P, const TT& E, unsigned long n) {
+ P.resize(n);
+ TT r = E, s=r;
+ for(typename vect::iterator pit=P.begin(); pit != P.end(); ++pit) {
+ s /= _domain.size();
+ *pit = typename vect::value_type(r-s*_domain.size());
+ r = s;
+ }
+ return P;
+ }
+
template<class vect>
vect& radixdirect(vect& P, const double& E, unsigned long n) {
P.resize(n);
@@ -150,7 +167,9 @@ public:
r = s;
}
return P;
- }
+ }
+
};
-#endif
+} // Givaro
+#endif // __GIVARO_poly1_p_adic_H
diff --git a/src/library/poly1/givpoly1proot.inl b/src/library/poly1/givpoly1proot.inl
index d263f33..5f9e939 100644
--- a/src/library/poly1/givpoly1proot.inl
+++ b/src/library/poly1/givpoly1proot.inl
@@ -1,11 +1,16 @@
// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Givaro / Athapascan-1
// Irreducible polynomial finder
// Primitive root finder
-// Time-stamp: <10 Jul 07 15:31:18 Jean-Guillaume.Dumas at imag.fr>
+// Time-stamp: <10 Jul 07 15:31:18 Jean-Guillaume.Dumas at imag.fr>
// =================================================================== //
-#ifndef _GIVARO_POLY_PRIMITIVE_ROOT_
-#define _GIVARO_POLY_PRIMITIVE_ROOT_
+#ifndef __GIVARO_poly_primitive_root_INL
+#define __GIVARO_poly_primitive_root_INL
// Reasonible cyclotomic polynomial size
#define CYCLO_DEGREE_BOUND 1000
@@ -20,343 +25,652 @@
#include <givaro/givpoly1factor.h>
#include <givaro/givpoly1cyclo.inl>
-// ---------------------------------------------------------------
-// Monic irreducible polynomial of degree n over Z/pZ
-// having 2, 3 nonzero terms or dividing a cyclotomic polynomial
-// of degree < CYCLO_DEGREE_BOUND or a random one.
-// ---------------------------------------------------------------
-
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::creux_random_irreducible (Element& R, Degree n) const {
- init(R, n, _domain.one);
- Residu_t MOD = _domain.residu();
-
- // Search for an irreducible BINOMIAL : X^n + a
- // WARNING : Here we may have X^n + x,
- // where a = representation of x, and sometimes a != x.
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R))
- return R;
- }
- // Search for an irreducible TRINOMIAL : X^n + b*X^i + a
- // Precondition : n >= 2
- // WARNING : same warning as for the binomial.
- // JGD 21.10.02
- // for(Residu_t d=2;d<n.value();++d) {
- for(long d=1;d<=(n.value()/2);++d) {
- for(Residu_t b=0; b<MOD; ++b) {
- _domain.assign(R[d],b);
- for(Residu_t a=1; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R))
- return R;
- }
- }
- // _domain.assign(R[0],_domain.zero);
- // JGD 21.10.02
- _domain.assign(R[d],_domain.zero);
- }
-
- // Search for a monic irreducible Polynomial
- // with random Elements
- do {
- this->random( (RandIter&)_g, R, n); // must cast away const
- _domain.assign(R[n.value()],_domain.one);
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R))
- return R;
- }
- } while(1);
-}
-
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::random_irreducible (Element& R, Degree n) const {
- // Search for a monic irreducible Polynomial
- // with random Elements
- init(R, n, _domain.one);
- Residu_t MOD = _domain.residu();
-
- do {
- this->random( (RandIter&)_g, R, n); // must cast away const
- _domain.assign(R[n.value()],_domain.one);
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R))
- return R;
- }
- } while(1);
-}
-
-
-// ---------------------------------------------------------------
-// Monic irreducible polynomial of degree n over Z/pZ
-// having 2, 3 nonzero terms or or a random one,
-// with X as a primitive root.
-// ---------------------------------------------------------------
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::ixe_irreducible (Element& R, Degree n) const {
- init(R, n, _domain.one);
- Element IXE;
- init(IXE,Degree(1),_domain.one);
- Residu_t MOD = _domain.residu();
-
- // Search for an irreducible BINOMIAL : X^n + a
- // WARNING : Here we may have X^n + x,
- // where a = representation of x, and sometimes a != x.
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R) && (is_prim_root(IXE,R) ))
- return R;
- }
- // Search for an irreducible TRINOMIAL : X^n + b*X^i + a
- // Precondition : n >= 2
- // WARNING : same warning as for the binomial.
- // // JGD 21.10.02
- // for(unsigned long d=2;d<n.value();++d) {
- for(long d=2;d<=(n.value()/2);++d) {
- for(Residu_t b=0; b<MOD; ++b) {
- _domain.assign(R[d],b);
- for(Residu_t a=1; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R) && (is_prim_root(IXE,R) ))
- return R;
- }
- }
- // _domain.assign(R[0],_domain.zero);
- // JGD 21.10.02
- _domain.assign(R[d],_domain.zero);
- }
-
- // Search for a monic irreducible Polynomial
- // with random Elements
- do {
- this->random( (RandIter&)_g, R, n); // must cast away const
- _domain.assign(R[n.value()],_domain.one);
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible(R) && (is_prim_root(IXE,R) ))
- return R;
- }
- } while(1);
-}
-
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::ixe_irreducible2 (Element& R, Degree n) const {
- init(R, n, _domain.one);
- Element IXE;
- init(IXE,Degree(1),_domain.one);
- Residu_t MOD = _domain.residu();
-
- // Search for an irreducible BINOMIAL : X^n + a
- // WARNING : Here we may have X^n + x,
- // where a = representation of x, and sometimes a != x.
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
- return R;
- }
- // Search for an irreducible TRINOMIAL : X^n + b*X^i + a
- // Precondition : n >= 2
- // WARNING : same warning as for the binomial.
- for(Residu_t d=2;d<n.value();++d) {
- for(Residu_t b=0; b<MOD; ++b) {
- _domain.assign(R[d],b);
- for(Residu_t a=1; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
- return R;
- }
- }
- _domain.assign(R[0],_domain.zero);
- }
-
- // Search for a monic irreducible Polynomial
- // with random Elements
- do {
- this->random( (RandIter&)_g, R, n); // must cast away const
- _domain.assign(R[n.value()],_domain.one);
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
- return R;
- }
- } while(1);
-}
-// ---------------------------------------------------------------
-// Irreducibility tests
-// ---------------------------------------------------------------
-
-template<class Domain, class Tag, class RandIter>
-inline bool Poly1FactorDom<Domain,Tag, RandIter>::is_irreducible2(
- const Rep& P
- , Residu_t MOD ) const {
- // Square free ?
- Rep W,D; this->gcd(W,diff(D,P),P);
- Degree d, dP;
- if (degree(d,W) > 0) return 0;
- IntFactorDom<> FD;
-
- long n = degree(dP,P).value();
- IntFactorDom<>::Rep qn;
-
- FD.pow( qn, IntFactorDom<>::Rep(MOD), n);
- Rep Unit, G1; init(Unit, Degree(1), _domain.one);
- this->powmod(G1, Unit, qn, P);
- if (degree(d, sub(D,G1,Unit)) >= 0) return 0;
-
- std::vector<IntFactorDom<>::Rep> Lp; std::vector<unsigned long> Le;
- FD.set(Lp, Le, n );
- for( std::vector<IntFactorDom<>::Rep>::const_iterator p = Lp.begin(); p != Lp.end(); ++p) {
- long ttmp;
- FD.pow( qn, IntFactorDom<>::Rep(MOD), n/FD.convert(ttmp,*p) );
- this->powmod(G1, Unit, qn, P);
- if (degree(d, sub(D,G1,Unit)) < 0) return 0;
- }
-
- return 1;
-}
-
-
-
-
-// ---------------------------------------------------------------
-// Primitive Root over Z/pZ / F
-// returns 1 if P is a generator.
-// ---------------------------------------------------------------
-
-template<class Domain, class Tag, class RandIter>
-bool Poly1FactorDom<Domain,Tag, RandIter>::is_prim_root( const Rep& P, const Rep& F) const {
- bool isproot = 0;
- Rep A, G; mod(A,P,F);
- Degree d;
- if ( degree(d, this->gcd(G,A,F)) == 0) {
- Residu_t MOD = _domain.residu();
- IntFactorDom<> FD;
- IntFactorDom<>::Element IMOD( MOD ), q, qp;
- degree(d,F);
-// FD.pow(q ,IMOD, d.value());
-// FD.sub(qp, q, FD.one);
- FD.subin( FD.pow(qp ,IMOD, d.value()) , FD.one);
- std::list< IntFactorDom<>::Element > L;
- FD.set(L, qp);
- L.sort();
- std::list< IntFactorDom<>::Element >::iterator li = L.begin();
- isproot = 1;
- for(;(li != L.end()) && isproot; ++li)
- isproot = ( ! this->isOne(this->powmod(G, A, FD.div(q, qp , *li), F) ) );
- }
- return isproot;
-}
-
-template<class Domain, class Tag, class RandIter>
-inline typename IntegerDom::Element Poly1FactorDom<Domain,Tag, RandIter>::order( const Rep& P, const Rep& F) const {
- bool isproot = 0;
- Rep A, G; mod(A,P,F);
- Degree d;
- if ( degree(d, this->gcd(G,A,F)) == 0) {
- Residu_t MOD = _domain.residu();
- IntFactorDom<> FD;
- IntFactorDom<>::Element IMOD( MOD ), g, gg, tt, qp;
- degree(d,F);
-// FD.pow(q ,IMOD, d.value());
-// FD.sub(qp, q, FD.one);
- FD.subin( FD.pow(qp ,IMOD, d.value()) , FD.one);
- std::list< IntFactorDom<>::Element > L;
- FD.set(L, qp);
- L.sort();
- std::list< IntFactorDom<>::Element >::iterator li = L.begin();
- isproot = 1;
- for(;(li != L.end()) && isproot; ++li)
- isproot = ( ! this->isOne(this->powmod(G, A, FD.div(g, qp , *li), F) ) );
-
- if (isproot)
- return qp;
- else {
- for(--li;li!=L.end();++li)
- while ( FD.isZero(FD.mod(tt,g,*li)) && (this->isOne(this->powmod(G, A, FD.div(gg,g,*li), F))))
- g.copy(gg);
- return g;
- }
- }
- IntegerDom ID;
- return ID.zero;
-}
-
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::give_prim_root(Rep& R, const Rep& F) const {
- Degree n; degree(n,F);
- Residu_t MOD = _domain.residu();
-// this->write(std::cout << "Give Pr: ", F) << std::endl;
-
-
- // Search for a primitive BINOMIAL : X^i + a
- for(Degree di=1;di<n;++di) {
- init(R, di, _domain.one);
-// for(Residu_t a=MOD; a--; ) {
- for(Residu_t a=0; a<MOD;++a ) {
- _domain.assign(R[0],a);
- if (is_prim_root(R,F))
- return R;
- }
- }
- // Search for a primitive TRINOMIAL : X^i + b*X^j + a
- for(Degree di=2;di<n;++di) {
- init(R, di, _domain.one);
- for(Degree dj=1;dj<di;++dj)
-// for(Residu_t b=MOD; b--;) {
- for(Residu_t b=0; b<MOD;++b) {
- _domain.assign(R[dj.value()],b);
-// for(Residu_t a=MOD; a--;) {
- for(Residu_t a=0; a<MOD;++a ) {
- _domain.assign(R[0],a);
- if (is_prim_root(R,F))
- return R;
- }
- }
- }
-
- // Search for a primitive Polynomial
- // with random Elements
- do {
- this->random( (RandIter&)_g, R, n); // must cast away const
- _domain.assign(R[n.value()],_domain.one);
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_prim_root(R,F))
- return R;
- }
- } while(1);
-}
-
-
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::give_random_prim_root(Rep& R, const Rep& F) const {
- Degree n; degree(n,F);
- Residu_t MOD = _domain.residu();
-
- // Search for a primitive Polynomial
- // with random Elements
- do {
- this->random( (RandIter&)_g, R, n); // must cast away const
- _domain.assign(R[n.value()],_domain.one);
- for(Residu_t a=0; a<MOD; ++a) {
- _domain.assign(R[0],a);
- if (is_prim_root(R,F))
- return R;
- }
- } while(1);
-}
-
-
-template<class Domain, class Tag, class RandIter >
-inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::random_prim_root(Rep& P, Rep& R, Degree n) const {
- // P is irreducible
- // R is a primitive root. i.e R generates (Z_p)/P.
- // returns R
- return give_prim_root(R, random_irreducible(P,n));
-}
-
-
-#endif
+namespace Givaro {
+
+ ////////////////////////////////////////////
+ // BINOM
+ ////////////////////////////////////////////
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_binomial (Element& R, Degree n, Residue MOD) const
+ {
+ for(Residue a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible(R))
+ return true;
+ }
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_binomial (Element& R, Degree n, bool MOD) const
+ {
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_binomial (Element& R, Degree n, Residue MOD, Element IXE) const
+ {
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_binomial (Element& R, Degree n, bool MOD, Element IXE) const
+ {
+ return false;
+ }
+
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_binomial2 (Element& R, Degree n, Residue MOD, Element IXE) const
+ {
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_binomial2 (Element& R, Degree n, bool MOD, Element IXE) const
+ {
+ return false;
+ }
+
+ ////////////////////////////////////////////
+ // TRINOM
+ ////////////////////////////////////////////
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_trinomial (Element& R, Degree n, Residue MOD) const
+ {
+
+ for(long d=1;d<=(n.value()/2);++d) {
+ for(Residu_t b=0; b<MOD; ++b) {
+ _domain.assign(R[d],b);
+ for(Residu_t a=1; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible(R))
+ return true;
+ }
+ }
+ // _domain.assign(R[0],_domain.zero);
+ // JGD 21.10.02
+ _domain.assign(R[d],_domain.zero);
+ }
+ return false ;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_trinomial (Element& R, Degree n, bool MOD) const
+ {
+
+ _domain.assign(R[0],_domain.one);
+ for(long d=1;d<=(n.value()/2);++d) {
+ _domain.assign(R[d],_domain.one);
+ if (is_irreducible(R))
+ return true;
+ _domain.assign(R[d],_domain.zero);
+ }
+ return false ;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_trinomial (Element& R, Degree n, Residue MOD, Element IXE) const
+ {
+ for(long d=2;d<=(n.value()/2);++d) {
+ for(Residu_t b=0; b<MOD; ++b) {
+ _domain.assign(R[d],b);
+ for(Residu_t a=1; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+ }
+ // _domain.assign(R[0],_domain.zero);
+ // JGD 21.10.02
+ _domain.assign(R[d],_domain.zero);
+ }
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_trinomial (Element& R, Degree n, bool MOD, Element IXE) const
+ {
+
+ _domain.assign(R[0],_domain.one);
+ for(long d=2;d<=(n.value()/2);++d) {
+ _domain.assign(R[d],_domain.one);
+ if (is_irreducible(R) && (is_prim_root(IXE,R) ))
+ return true;
+ _domain.assign(R[d],_domain.zero);
+ }
+ return false ;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_trinomial2 (Element& R, Degree n, Residue MOD, Element IXE) const
+ {
+ for(long d=2;d<n.value();++d) {
+ for(Residu_t b=0; b<MOD; ++b) {
+ _domain.assign(R[d],b);
+ for(Residu_t a=1; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+ }
+ _domain.assign(R[0],_domain.zero);
+ }
+ return false;
+
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_trinomial2 (Element& R, Degree n, bool MOD, Element IXE) const
+ {
+
+ _domain.assign(R[0],_domain.one);
+ for(long d=2;d<=n.value();++d) {
+ _domain.assign(R[d],_domain.one);
+ if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
+ return true;
+ _domain.assign(R[d],_domain.zero);
+ }
+ return false ;
+ }
+
+ ////////////////////////////////////////////
+ // RANDOM
+ ////////////////////////////////////////////
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_randomial (Element& R, Degree n, Residue MOD) const
+ {
+#ifdef DEBUG
+ int no_inf_loop =(int) n.value()/2+5 ;
+#endif
+
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible(R))
+ return true;
+ }
+ }
+#ifdef DEBUG
+ while(--no_inf_loop);
+#else
+ while(1);
+#endif
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_randomial (Element& R, Degree n, bool MOD) const
+ {
+#ifdef DEBUG
+ int no_inf_loop = n.value()/2+5 ;
+#endif
+
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ _domain.assign(R[0],_domain.one);
+ if (is_irreducible(R))
+ return true;
+ }
+#ifdef DEBUG
+ while(--no_inf_loop);
+#else
+ while(1);
+#endif
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_randomial (Element& R, Degree n, Residue MOD, Element IXE) const
+ {
+#ifdef DEBUG
+ int no_inf_loop = (int)n.value()/2+5 ;
+#endif
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+ }
+#ifdef DEBUG
+ while(--no_inf_loop);
+#else
+ while(1);
+#endif
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_randomial (Element& R, Degree n, bool MOD, Element IXE) const
+ {
+#ifdef DEBUG
+ int no_inf_loop = n.value()/2+5 ;
+#endif
+
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ _domain.assign(R[0],_domain.one);
+ if (is_irreducible(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+#ifdef DEBUG
+ while(--no_inf_loop);
+#else
+ while(1);
+#endif
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ template<class Residue>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_randomial2 (Element& R, Degree n, Residue MOD, Element IXE) const
+ {
+#ifdef DEBUG
+ int no_inf_loop = n.value()/2+5 ;
+#endif
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+ }
+#ifdef DEBUG
+ while(--no_inf_loop);
+#else
+ while(1);
+#endif
+
+ return false;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ // template<>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::find_irred_randomial2 (Element& R, Degree n, bool MOD, Element IXE) const
+ {
+#ifdef DEBUG
+ int no_inf_loop = n.value()/2+5 ;
+#endif
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ _domain.assign(R[0],_domain.one);
+ if (is_irreducible2(R) && (is_prim_root(IXE,R) ))
+ return true;
+ }
+#ifdef DEBUG
+ while(--no_inf_loop);
+#else
+ while(1);
+#endif
+ return false;
+
+ }
+
+ ////////////////////////////////////////////
+
+
+ // ---------------------------------------------------------------
+ // Monic irreducible polynomial of degree n over Z/pZ
+ // having 2, 3 nonzero terms or dividing a cyclotomic polynomial
+ // of degree < CYCLO_DEGREE_BOUND or a random one.
+ // ---------------------------------------------------------------
+
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::creux_random_irreducible (Element& R, Degree n) const
+ {
+ init(R, n);
+
+ Residu_t MOD = _domain.residu();
+
+
+ // Search for an irreducible BINOMIAL : X^n + a
+ // WARNING : Here we may have X^n + x,
+ // where a = representation of x, and sometimes a != x.
+ if (find_irred_binomial(R,n,MOD))
+ return R ;
+
+ // Search for an irreducible TRINOMIAL : X^n + b*X^i + a
+ // Precondition : n >= 2
+ assert(n.value()>=2);
+ // WARNING : same warning as for the binomial.
+ // JGD 21.10.02
+ // for(Residu_t d=2;d<n.value();++d)
+
+ if (find_irred_trinomial(R,n,MOD))
+ return R ;
+
+ // Search for a monic irreducible Polynomial
+ // with random Elements
+
+ if (find_irred_randomial(R,n,MOD))
+ return R ;
+ else
+ throw "could not find a random polynomial" ;
+
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::random_irreducible (Element& R, Degree n) const
+ {
+ // Search for a monic irreducible Polynomial
+ // with random Elements
+ init(R, n);
+ Residu_t MOD = _domain.residu();
+
+ if (find_irred_randomial(R,n,MOD))
+ return R ;
+ else
+ throw "could not find a random polynomial" ;
+
+ }
+
+
+ // ---------------------------------------------------------------
+ // Monic irreducible polynomial of degree n over Z/pZ
+ // having 2, 3 nonzero terms or or a random one,
+ // with X as a primitive root.
+ // ---------------------------------------------------------------
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::ixe_irreducible (Element& R, Degree n) const
+ {
+ init(R, n);
+ Element IXE;
+ init(IXE,Degree(1));
+ Residu_t MOD = _domain.residu();
+
+ // Search for an irreducible BINOMIAL : X^n + a
+ // WARNING : Here we may have X^n + x,
+ // where a = representation of x, and sometimes a != x.
+
+ if (find_irred_binomial(R,n,MOD,IXE))
+ return R ;
+
+ // Search for an irreducible TRINOMIAL : X^n + b*X^i + a
+ // Precondition : n >= 2
+ assert(n.value()>=2);
+ // WARNING : same warning as for the binomial.
+ // // JGD 21.10.02
+ // for(unsigned long d=2;d<n.value();++d)
+
+ if (find_irred_trinomial(R,n,MOD,IXE))
+ return R ;
+
+
+ // Search for a monic irreducible Polynomial
+ // with random Elements
+
+
+ if (find_irred_randomial(R,n,MOD,IXE))
+ return R ;
+ else
+ throw "could not find a random polynomial" ;
+
+
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Element& Poly1FactorDom<Domain,Tag, RandIter>::ixe_irreducible2 (Element& R, Degree n) const
+ {
+ init(R, n);
+ Element IXE;
+ init(IXE,Degree(1));
+ Residu_t MOD = _domain.residu();
+
+ // Search for an irreducible BINOMIAL : X^n + a
+ // WARNING : Here we may have X^n + x,
+ // where a = representation of x, and sometimes a != x.
+
+ if (find_irred_binomial2(R,n,MOD,IXE))
+ return R ;
+
+ // Search for an irreducible TRINOMIAL : X^n + b*X^i + a
+ // Precondition : n >= 2
+ assert(n.value()>=2);
+ // WARNING : same warning as for the binomial.
+
+ if (find_irred_trinomial2(R,n,MOD,IXE))
+ return R ;
+
+
+
+ // Search for a monic irreducible Polynomial
+ // with random Elements
+
+ if (find_irred_randomial2(R,n,MOD,IXE))
+ return R ;
+ else
+ throw "could not find a random polynomial" ;
+
+
+ }
+ // ---------------------------------------------------------------
+ // Irreducibility tests
+ // ---------------------------------------------------------------
+
+ template<class Domain, class Tag, class RandIter>
+ inline bool Poly1FactorDom<Domain,Tag, RandIter>::is_irreducible2( const Rep& P
+ , Residu_t MOD ) const
+ {
+ // Square free ?
+ Rep W,D; this->gcd(W,diff(D,P),P);
+ Degree d, dP;
+ if (degree(d,W) > 0) return 0;
+ IntFactorDom<> FD;
+
+ long n = degree(dP,P).value();
+ IntFactorDom<>::Rep qn;
+
+ FD.pow( qn, IntFactorDom<>::Rep(MOD), n);
+ Rep Unit, G1; init(Unit, Degree(1));
+ this->powmod(G1, Unit, qn, P);
+ if (degree(d, sub(D,G1,Unit)) >= 0) return 0;
+
+ std::vector<IntFactorDom<>::Rep> Lp; std::vector<unsigned long> Le;
+ FD.set(Lp, Le, n );
+ for( std::vector<IntFactorDom<>::Rep>::const_iterator p = Lp.begin(); p != Lp.end(); ++p) {
+ long ttmp;
+ FD.pow( qn, IntFactorDom<>::Rep(MOD), n/FD.convert(ttmp,*p) );
+ this->powmod(G1, Unit, qn, P);
+ if (degree(d, sub(D,G1,Unit)) < 0) return 0;
+ }
+
+ return 1;
+ }
+
+
+
+
+ // ---------------------------------------------------------------
+ // Primitive Root over Z/pZ / F
+ // returns 1 if P is a generator.
+ // ---------------------------------------------------------------
+
+ template<class Domain, class Tag, class RandIter>
+ bool Poly1FactorDom<Domain,Tag, RandIter>::is_prim_root( const Rep& P, const Rep& F) const
+ {
+ bool isproot = 0;
+ Rep A, G;
+ mod(A,P,F);
+ Degree d;
+ if ( degree(d, this->gcd(G,A,F)) == 0) {
+ Residu_t MOD = _domain.residu();
+ IntFactorDom<> FD;
+ IntFactorDom<>::Element IMOD( MOD ), q, qp;
+ degree(d,F);
+ // FD.pow(q ,IMOD, d.value());
+ // FD.sub(qp, q, FD.one);
+ FD.subin( FD.pow(qp ,IMOD, d.value()) , FD.one);
+ std::list< IntFactorDom<>::Element > L;
+ FD.set(L, qp);
+ L.sort();
+ std::list< IntFactorDom<>::Element >::iterator li = L.begin();
+ isproot = 1;
+ for(;(li != L.end()) && isproot; ++li) {
+ isproot = ( ! this->isOne(this->powmod(G, A, FD.div(q, qp , *li), F) ) );
+ }
+ }
+ return isproot;
+ }
+
+ template<class Domain, class Tag, class RandIter>
+ inline typename IntegerDom::Element Poly1FactorDom<Domain,Tag, RandIter>::order( const Rep& P, const Rep& F) const
+ {
+ bool isproot = 0;
+ Rep A, G; mod(A,P,F);
+ Degree d;
+ if ( degree(d, this->gcd(G,A,F)) == 0) {
+ Residu_t MOD = _domain.residu();
+ IntFactorDom<> FD;
+ IntFactorDom<>::Element IMOD( MOD ), g, gg, tt, qp;
+ degree(d,F);
+ // FD.pow(q ,IMOD, d.value());
+ // FD.sub(qp, q, FD.one);
+ FD.subin( FD.pow(qp ,IMOD, d.value()) , FD.one);
+ std::list< IntFactorDom<>::Element > L;
+ FD.set(L, qp);
+ L.sort();
+ std::list< IntFactorDom<>::Element >::iterator li = L.begin();
+ isproot = 1;
+ for(;(li != L.end()) && isproot; ++li)
+ isproot = ( ! this->isOne(this->powmod(G, A, FD.div(g, qp , *li), F) ) );
+
+ if (isproot)
+ return qp;
+ else {
+ for(--li;li!=L.end();++li)
+ while ( FD.isZero(FD.mod(tt,g,*li)) && (this->isOne(this->powmod(G, A, FD.div(gg,g,*li), F))))
+ g.copy(gg);
+ return g;
+ }
+ }
+ IntegerDom ID;
+ return ID.zero;
+ }
+
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::give_prim_root(Rep& R, const Rep& F) const
+ {
+ Degree n; degree(n,F);
+ Residu_t MOD = _domain.residu();
+ // this->write(std::cout << "Give Pr: ", F) << std::endl;
+
+
+ // Search for a primitive BINOMIAL : X^i + a
+ for(Degree di=1;di<n;++di) {
+ init(R, di);
+ // for(Residu_t a=MOD; a--; )
+ for(Residu_t a=0; a<MOD;++a ) {
+ _domain.assign(R[0],a);
+ if (is_prim_root(R,F))
+ return R;
+ }
+ }
+ // Search for a primitive TRINOMIAL : X^i + b*X^j + a
+ for(Degree di=2;di<n;++di) {
+ init(R, di);
+ for(Degree dj=1;dj<di;++dj)
+ // for(Residu_t b=MOD; b--;)
+ for(Residu_t b=0; b<MOD;++b) {
+ _domain.assign(R[dj.value()],b);
+ // for(Residu_t a=MOD; a--;)
+ for(Residu_t a=0; a<MOD;++a ) {
+ _domain.assign(R[0],a);
+ if (is_prim_root(R,F))
+ return R;
+ }
+ }
+ }
+
+ // Search for a primitive Polynomial
+ // with random Elements
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_prim_root(R,F))
+ return R;
+ }
+ } while(1);
+ }
+
+
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::give_random_prim_root(Rep& R, const Rep& F) const
+ {
+ Degree n; degree(n,F);
+ Residu_t MOD = _domain.residu();
+
+ // Search for a primitive Polynomial
+ // with random Elements
+ do {
+ this->random( (RandIter&)_g, R, n); // must cast away const
+ _domain.assign(R[n.value()],_domain.one);
+ for(Residu_t a=0; a<MOD; ++a) {
+ _domain.assign(R[0],a);
+ if (is_prim_root(R,F))
+ return R;
+ }
+ } while(1);
+ }
+
+
+ template<class Domain, class Tag, class RandIter >
+ inline typename Poly1FactorDom<Domain,Tag, RandIter>::Rep& Poly1FactorDom<Domain,Tag, RandIter>::random_prim_root(Rep& P, Rep& R, Degree n) const
+ {
+ // P is irreducible
+ // R is a primitive root. i.e R generates (Z_p)/P.
+ // returns R
+ return give_prim_root(R, random_irreducible(P,n));
+ }
+
+} // Givaro
+
+#endif // __GIVARO_poly_primitive_root_INL
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/poly1/givpoly1ratrecon.inl b/src/library/poly1/givpoly1ratrecon.inl
new file mode 100644
index 0000000..87455c4
--- /dev/null
+++ b/src/library/poly1/givpoly1ratrecon.inl
@@ -0,0 +1,115 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Author: J-G. Dumas
+// Time-stamp: <01 Apr 11 17:18:03 Jean-Guillaume.Dumas at imag.fr>
+// Description: generic rational fraction reconstruction
+// ===============================================================
+#ifndef __GIVARO_poly1_ratrecon_INL
+#define __GIVARO_poly1_ratrecon_INL
+
+
+namespace Givaro {
+
+template <class Domain>
+void Poly1Dom<Domain,Dense>::ratrecon(typename Poly1Dom<Domain,Dense>::Rep& N, typename Poly1Dom<Domain,Dense>::Rep& D, const typename Poly1Dom<Domain,Dense>::Rep& P, const typename Poly1Dom<Domain,Dense>::Rep& M, const Degree& dk) const {
+
+ Degree degU, degV;
+ this->degree(degU,P); this->degree(degV,M);
+ if ((degU < dk) || (degV == 0)) { this->assign(N,P); this->assign(D,one); return ; }
+ if ((degV < 0) || (degU == 0)) { this->assign(N,one); this->assign(D,one); return ; }
+
+ typename Poly1Dom<Domain,Dense>::Rep U;
+ this->assign(N, M);
+ this->assign(U, P);
+
+ Degree degN;
+ typename Poly1Dom<Domain,Dense>::Rep Q, D0;
+ this->assign(D0,this->zero);
+ this->assign(D,this->one);
+// do {
+// this->divmod(Q,N,V,U);
+
+// this->assign(V,U);
+// this->assign(U,N);
+// this->maxpy(TMP2,Q,D,D0);
+// this->assign(D0,D);
+// this->assign(D,TMP2);
+// this->degree(degN, N);
+// if (degN <= dk) break;
+// } while (degN>=0);
+
+ do {
+ this->divmodin(Q,N,U);
+ this->maxpyin(D0,Q,D);
+ this->degree(degN, N);
+ if ((degN <= dk) || (degN <0)) {
+ this->assign(D,D0);
+ break;
+ }
+
+ this->divmodin(Q,U,N);
+ this->maxpyin(D,Q,D0);
+
+ this->degree(degN, U);
+ if (degN <= dk) {
+ this->assign(N,U);
+ break;
+ }
+
+ } while (degN>=0);
+
+
+// do {
+// this->divmod(Q,N,V,U);
+// this->maxpyin(D0,Q,D);
+// this->degree(degN, N);
+// if ((degN <= dk) || (degN <0)) {
+// this->assign(D,D0);
+// break;
+// }
+// this->assign(V,N);
+
+// this->divmod(Q,N,U,V);
+// this->maxpyin(D,Q,D0);
+
+// this->degree(degN, N);
+// if (degN <= dk) break;
+
+// this->assign(U,N);
+// } while (degN>=0);
+
+}
+
+
+template <class Domain>
+bool Poly1Dom<Domain,Dense>::ratreconcheck(typename Poly1Dom<Domain,Dense>::Rep& N, typename Poly1Dom<Domain,Dense>::Rep& D, const typename Poly1Dom<Domain,Dense>::Rep& P, const typename Poly1Dom<Domain,Dense>::Rep& M, const Degree& dk) const {
+ Degree degU, degV;
+ this->degree(degU,P); this->degree(degV,M);
+ if ((degU < dk) || (degV == 0)) { this->assign(N,P); this->assign(D,one); return true; }
+ if ((degV < 0) || (degU == 0)) { this->assign(N,one); this->assign(D,one); return false; }
+
+
+ ratrecon(N,D,P,M,dk);
+
+
+ typename Poly1Dom<Domain,Dense>::Rep G;
+ Degree degG;
+ if ( degree(degG, gcd(G, N, D)) > 0)
+ return false;
+
+ Type_t r; leadcoef(r, D);
+ if (! _domain.isOne(r)) {
+ this->divin(D, r);
+ this->divin(N, r);
+ }
+
+ return true;
+}
+
+} // Givaro
+
+#endif // __GIVARO_poly1_ratrecon_INL
diff --git a/src/library/poly1/givpoly1sqrfree.inl b/src/library/poly1/givpoly1sqrfree.inl
index 59ef9bc..0b6dc7d 100644
--- a/src/library/poly1/givpoly1sqrfree.inl
+++ b/src/library/poly1/givpoly1sqrfree.inl
@@ -1,19 +1,23 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givpoly1sqrfree.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givpoly1sqrfree.inl,v 1.7 2005/07/13 14:02:20 pernet Exp $
+// $Id: givpoly1sqrfree.inl,v 1.9 2011-02-02 16:23:56 bboyer Exp $
// ==========================================================================
// Description:
+#ifndef __GIVARO_poly1_sqrfree_INL
+#define __GIVARO_poly1_sqrfree_INL
-using namespace std;
-
+namespace Givaro {
/** Sqrfree decomposition.
-Decompose P such that: P = Fact[0]^0 * Fact[1]^1 * ... * Fact[P.degree()]^(P.degree()),
+Decompose P such that: P = Fact[0]^0 * Fact[1]^1 * ... * Fact[P.degree()]^(P.degree()),
with Fact[0] the leading coefficient.
The array Fact must be allocated before calling the function.
-The size of Fact must be degP+1 is all factors should be computed.
+The size of Fact must be degP+1 is all factors should be computed.
For more readeable version of the algorithm, see Geddes, p342.
@param Nfact [in] the size of Fact
@param Fact [in] an array of dimension Nfact
@@ -56,7 +60,7 @@ size_t& Poly1Dom<Domain,Dense>::sqrfree(size_t& Nfact, Rep* Fact, const Rep& P)
diff(Z, W);
// write(cout << "W':", Z) << endl;
sub(Z, Y, Z);
- while (!isZero(Z))
+ while (!isZero(Z))
{
gcd(Fact[count], W, Z);
// write(cout << "L" << count << ":", Fact[count]) << endl;
@@ -64,11 +68,14 @@ size_t& Poly1Dom<Domain,Dense>::sqrfree(size_t& Nfact, Rep* Fact, const Rep& P)
div(C, W, Fact[count]); assign(W, C);
div(Y, Z, Fact[count]);
diff(Z, W);
- sub(Z, Y, Z);
+ sub(Z, Y, Z);
if (++count > Nfact) return Nfact;
- }
+ }
}
assign(Fact[count], W);
//write(cout << "L" << count << ":", Fact[count]) << endl;
return Nfact = ++count;
-}
+}
+} // Givaro
+
+#endif // __GIVARO_poly1_sqrfree_INL
diff --git a/src/library/tools/Makefile.am b/src/library/tools/Makefile.am
index 0338fe4..211336f 100644
--- a/src/library/tools/Makefile.am
+++ b/src/library/tools/Makefile.am
@@ -1,12 +1,25 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(prefix)/include
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(prefix)/include
+
+pkginclude_HEADERS= \
givcategory.h \
- givops.h \
+ givops.h \
giviterator.h \
- givarithmetics.h
+ givarithmetics.h \
+ givfractiondomain.h \
+ givquotientdomain.h \
+ givtruncdomain.h \
+ givtruncdomain.inl \
+ givfixedtrunc.h \
+ givhighorder.h
noinst_LTLIBRARIES=libgivtools.la
diff --git a/src/library/tools/Makefile.in b/src/library/tools/Makefile.in
index 60c8406..692adc3 100644
--- a/src/library/tools/Makefile.in
+++ b/src/library/tools/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -39,7 +46,14 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -50,8 +64,8 @@ libgivtools_la_LIBADD =
am_libgivtools_la_OBJECTS = givops.lo
libgivtools_la_OBJECTS = $(am_libgivtools_la_OBJECTS)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -83,26 +97,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -112,40 +127,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -185,15 +210,22 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(prefix)/include
+AM_CPPFLAGS = -I$(top_srcdir) -I$(prefix)/include
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
givcategory.h \
- givops.h \
+ givops.h \
giviterator.h \
- givarithmetics.h
+ givarithmetics.h \
+ givfractiondomain.h \
+ givquotientdomain.h \
+ givtruncdomain.h \
+ givtruncdomain.inl \
+ givfixedtrunc.h \
+ givhighorder.h
noinst_LTLIBRARIES = libgivtools.la
libgivtools_la_SOURCES = givops.C
@@ -205,14 +237,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/library/tools/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/library/tools/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/library/tools/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/library/tools/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -248,28 +280,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/givops.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -299,7 +317,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -404,7 +422,6 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -415,6 +432,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -423,22 +442,31 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/library/tools/givarithmetics.h b/src/library/tools/givarithmetics.h
index 6988ed0..8d65f41 100644
--- a/src/library/tools/givarithmetics.h
+++ b/src/library/tools/givarithmetics.h
@@ -1,17 +1,22 @@
-#ifndef _GIV_ARITH_H_
-#define _GIV_ARITH_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/tools/givarithmetics.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givarithmetics.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givarithmetics.h,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// - definition of standard arithmetics over Vector & Matrix
-//
+#ifndef __GIVARO_arithmethics_H
+#define __GIVARO_arithmethics_H
+//
#include "givaro/givconfig.h"
+namespace Givaro {
+
template<class Domain>
struct KSpace {
@@ -25,7 +30,7 @@ struct KSpace {
// -- Cstor
KSpace() : _domain(), _entry() {};
KSpace(const Domain_t& D) : _domain(D), _entry() {};
- KSpace(const Domain_t& D, size_t dim ) : _domain(D), _entry()
+ KSpace(const Domain_t& D, size_t dim ) : _domain(D), _entry()
{
_domain.init(_entry, dim);
};
@@ -44,11 +49,11 @@ struct KSpace {
// -- arithmetic operators:
Self_t& operator+= ( const Self_t& a ) {
- _domain.addin( _entry, a._entry );
+ _domain.addin( _entry, a._entry );
return *this;
}
Self_t& operator-= ( const Self_t& a ) {
- _domain.subin( _entry, a._entry );
+ _domain.subin( _entry, a._entry );
return *this;
}
Self_t& operator*= ( const Scalar_t& v ) {
@@ -60,13 +65,13 @@ struct KSpace {
Self_t operator+ ( const Self_t& a ) const {
KSpace<Domain> res(_domain);
_domain.init( res._entry, _domain.dim(_entry) );
- _domain.add( res._entry, _entry, a._entry );
+ _domain.add( res._entry, _entry, a._entry );
return res;
}
Self_t operator- ( const Self_t& a ) const {
KSpace<Domain> res(_domain);
_domain.init( res._entry, _domain.dim(_entry) );
- _domain.sub( res._entry, _entry, a._entry );
+ _domain.sub( res._entry, _entry, a._entry );
return res;
}
Self_t operator* ( const Scalar_t& v ) const {
@@ -89,8 +94,8 @@ struct KSpace {
// -- friend operator
template<class Domain>
-KSpace<Domain> operator*
- ( const typename KSpace<Domain>::Scalar_t& v, const KSpace<Domain>& U )
+KSpace<Domain> operator*
+ ( const typename KSpace<Domain>::Scalar_t& v, const KSpace<Domain>& U )
{
typedef typename KSpace<Domain>::Scalar_t Scalar_t;
typedef typename Domain::Domain_t SubDomain_t; // domain of the scalar
@@ -102,12 +107,12 @@ KSpace<Domain> operator*
}
template<class Domain>
-inline void dotprod(
- typename Domain::Scalar_t& dot,
- const KSpace<Domain>& U,
+inline void dotprod(
+ typename Domain::Scalar_t& dot,
+ const KSpace<Domain>& U,
const KSpace<Domain>& V)
{
- U._domain.dot(dot, U._entry, V._entry);
+ U._domain.dot(dot, U._entry, V._entry);
}
template<class Domain>
@@ -122,4 +127,6 @@ inline istream& operator>>(istream& sin, KSpace<Domain>& U )
return U._domain.read(sin, U._entry);
}
+} // Givaro
+
#endif
diff --git a/src/library/tools/givcategory.h b/src/library/tools/givcategory.h
index 774c711..009062a 100644
--- a/src/library/tools/givcategory.h
+++ b/src/library/tools/givcategory.h
@@ -1,19 +1,23 @@
-#ifndef _GIV_CATEGORY_H_
-#define _GIV_CATEGORY_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/tools/givcategory.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givcategory.h,v 1.3 2005/06/29 12:17:52 jgdumas Exp $
+// $Id: givcategory.h,v 1.4 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// - Definition of traits.
// It's a beta-beta version
+#ifndef __GIVARO_category_H
+#define __GIVARO_category_H
+namespace Givaro {
// -- nothing
-class Undefined{};
+class Undefined{};
// ==========================================================================
@@ -41,14 +45,14 @@ struct IsNotEqual { enum {val = !IsEqual<A,B>::val }; };
// -- Characteristic for representation of vector and matrix
// --
// Sporadic is a Dense but may have quite a few zero Elements
-// Therefore some algorithms might be specialized and might
+// Therefore some algorithms might be specialized and might
// take advantage of this.
-class Sporadic{};
-class Dense : public Sporadic {};
-class Sparse{};
-// class Diagonal{}; typedef Diagonal Diag;
-// class Toeplitz{};
-// class Hensel{};
+class Sporadic{};
+class Dense : public Sporadic {};
+class Sparse{};
+// class Diagonal{}; typedef Diagonal Diag;
+// class Toeplitz{};
+// class Hensel{};
template<class CLASS>
struct Sparsity_Trait {
@@ -73,4 +77,6 @@ template<class T, class Tag>
StructFormat<T,Tag> Formatted( const T& val, Tag xx )
{ return StructFormat<T,Tag>(val); }
+} // Givaro
+
#endif
diff --git a/src/library/tools/givfixedtrunc.h b/src/library/tools/givfixedtrunc.h
new file mode 100644
index 0000000..13ae9a6
--- /dev/null
+++ b/src/library/tools/givfixedtrunc.h
@@ -0,0 +1,246 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <01 Apr 11 11:38:28 Jean-Guillaume.Dumas at imag.fr>
+// Author: J-G. Dumas
+// Description: Polynomials modulo X^{k+1}
+// ===============================================================
+#ifndef __GIVARO_fixed_trunc_domain_H
+#include <givaro/givtruncdomain.h>
+
+namespace Givaro {
+template <class Domain>
+class FixedTruncDom : public TruncDom<Domain> {
+public :
+ // -- Self_t
+ typedef FixedTruncDom<Domain> Self_t;
+ // -- Father_t
+ typedef TruncDom<Domain> Father_t;
+ typedef typename TruncDom<Domain>::Father_t PolDom;
+ // -- Exported types
+ typedef Domain Domain_t;
+ typedef typename Domain::Element Type_t;
+ typedef typename Father_t::Polynomial_t Polynomial_t;
+ typedef typename Father_t::Storage_t Storage_t;
+ typedef Storage_t Rep;
+ typedef Storage_t Element;
+
+ Degree _deg;
+
+ FixedTruncDom (const Domain& d, const Degree deg, const Indeter& X = Indeter() ) : Father_t(d,X), _deg(deg) {}
+ FixedTruncDom (const Self_t& t) : Father_t(static_cast<const Father_t&>(t)),_deg(t._deg) {}
+ FixedTruncDom (const Father_t& t, const Degree deg) : Father_t(t), _deg(deg) {}
+
+
+ Degree& getModulus(Degree& d) const
+ {
+ return d=_deg;
+ }
+
+ Rep& init(Rep& p) const
+ {
+ return Father_t::init(p);
+ }
+
+ template<class XXX>
+ Rep& init(Rep& p, const XXX &cste ) const
+ {
+ return Father_t::truncin(Father_t::init(p,cste),0,_deg);
+ }
+
+ // -- For polynomial = lcoeff X^deg
+ template<class XXX>
+ Rep& init (Rep& p, const Degree deg , const XXX& lcoeff) const
+ {
+ return Father_t::truncin(Father_t::init(p,deg,lcoeff),0,_deg);
+ }
+ // F.assign(P[deg], lcoeff);
+ Rep& assign (Rep& p, const Degree deg , const Type_t& lcoeff) const
+ {
+ return Father_t::truncin(Father_t::assign(p,deg,lcoeff),0,_deg);
+ }
+ // -- Assignment p = q
+ Rep& assign( Rep& p, const Rep& q) const
+ {
+ return Father_t::assign(p,q);
+ }
+
+ Rep& assign(Rep& p, const Polynomial_t& r ) const
+ {
+ return Father_t::truncin(Father_t::assign(p,r),0,_deg);
+ }
+
+ Rep& assign(Rep& p, const Polynomial_t& r, const Degree v, const Degree d) const;
+
+
+ Rep& mulin(Rep& p, const Degree& s) const
+ {
+ return Father_t::truncin(Father_t::mulin(p,s),0,_deg);
+ }
+
+ Rep& shiftin(Rep& p, const Degree& s) const
+ {
+ return Father_t::truncin(Father_t::mulin(p,s),0,_deg);
+ }
+ Rep& truncin(Rep& p, const Degree& v, const Degree& d) const
+ {
+ return Father_t::truncin(p,v,(d>_deg?_deg:d));
+ }
+ Rep& trunc(Rep& p, const Rep& R, const Degree& v, const Degree& d) const
+ {
+ return Father_t::trunc(p,R,v,(d>_deg?_deg:d));
+ }
+
+
+ // -- Arithmetics operators
+ Rep& addin ( Rep& R, const Rep& P) const
+ {
+ return Father_t::addin(R, P, 0, _deg);
+ }
+
+ Rep& add ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ return Father_t::add(res, u, v, 0, _deg);
+ }
+
+ Rep& addin ( Rep& R, const Rep& P, const Degree& v, const Degree& d) const;
+
+ Rep& add ( Rep& res, const Rep& u, const Rep& v, const Degree& val, const Degree& deg) const;
+
+ Rep& sub ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ return Father_t::sub(res,u,v,0,_deg);
+ }
+ Rep& subin ( Rep& R, const Rep& P) const
+ {
+ return Father_t::subin(R,P,0,_deg);
+ }
+ Rep& sub ( Rep& R, const Rep& P, const Rep& Q, const Degree& v, const Degree& d) const;
+ Rep& subin ( Rep& R, const Rep& P, const Degree& v, const Degree& d) const;
+
+ Rep& mul ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ return Father_t::mul(res,u,v, 0, _deg);
+ }
+ Rep& mulin ( Rep& P, const Rep& Q ) const
+ {
+ return Father_t::mulin(P,Q, 0, _deg);
+ }
+
+
+ Rep& mul( Rep& r, const Rep& u, const Rep& v, const Degree& val, const Degree& deg) const;
+ Rep& mulin( Rep& r, const Rep& v, const Degree& val, const Degree& deg) const;
+
+
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return Father_t::axpy(r,a,x,y, 0, _deg);
+ }
+ Rep& axpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return Father_t::axpyin(r,a,x, 0, _deg);
+ }
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y, const Degree& val, const Degree& deg) const;
+
+ Rep& axpyin (Rep& r, const Rep& a, const Rep& x, const Degree& val, const Degree& deg) const;
+
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return Father_t::axmy(r,a,x,y, 0, _deg);
+ }
+ Rep& axmyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return Father_t::axmyin(r,a,x, 0, _deg);
+ }
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y, const Degree& val, const Degree& deg) const ;
+
+ Rep& axmyin (Rep& r, const Rep& a, const Rep& x, const Degree& val, const Degree& deg) const;
+
+
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return Father_t::maxpy(r,a,x,y, 0, _deg);
+ }
+ Rep& maxpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return Father_t::maxpyin(r,a,x, 0, _deg);
+ }
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Rep& y, const Degree& val, const Degree& deg) const;
+
+ Rep& maxpyin (Rep& r, const Rep& a, const Rep& x, const Degree& val, const Degree& deg) const;
+
+
+
+ Rep& invin ( Rep& q) const
+ {
+ Polynomial_t Xk; PolDom::init(Xk,_deg+1);
+ Polynomial_t pq; Father_t::convert(pq,q);
+ Polynomial_t t; PolDom::invmod(t,pq,Xk);
+ return Father_t::assign(q,t);
+ }
+ Rep& inv( Rep& r, const Rep& u) const
+ {
+ return this->invin(Father_t::assign(r,u));
+ }
+
+ Rep& divin ( Rep& q, const Rep& a ) const
+ {
+ Rep t;
+ return this->mulin(q,this->inv(t,a));
+ }
+ Rep& div ( Rep& q, const Rep& a, const Rep& b ) const
+ {
+ return this->mulin(this->inv(q, b),a);
+ }
+
+
+
+
+ // -- Random dense polynomial of degree d
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, Degree s) const
+ {
+ return Father_t::truncin(Father_t::random(g,r,s),0,_deg);
+ }
+
+ Rep& random(GivRandom& g, Rep& r, Degree s) const
+ {
+ return Father_t::truncin(Father_t::random(g,r,s),0,_deg);
+ }
+
+ Type_t& getEntry(Type_t& c, const Degree& i, const Rep& P) const
+ {
+ if (i>=_deg)
+ return this->_domain.assign(c, this->_domain.zero);
+ else
+ return PolDom::getEntry(c,i,P.first);
+ }
+
+ Type_t& leadcoef (Type_t& c, const Rep& P) const
+ {
+ return PolDom::leadcoef(c,P.first);
+ }
+
+ std::ostream& write( std::ostream& o) const
+ {
+ return PolDom::write(o) << " mod " << this->_x << '^' << _deg;
+ }
+
+ std::istream& read ( std::istream& i, Rep& n) const
+ {
+ n.second=0;
+ return Father_t::read(i,n.first);
+ }
+ std::ostream& write( std::ostream& o, const Rep& n) const
+ {
+ return Father_t::write(o,n);
+ }
+
+};
+
+} // Givaro
+
+#endif
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/tools/givfractiondomain.h b/src/library/tools/givfractiondomain.h
new file mode 100644
index 0000000..c763db3
--- /dev/null
+++ b/src/library/tools/givfractiondomain.h
@@ -0,0 +1,530 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <20 Jan 11 08:59:29 Jean-Guillaume.Dumas at imag.fr>
+// Author: J-G. Dumas
+// Description: fractions over a Ring domain
+// ===============================================================
+#ifndef __GIVARO_frac_domain_H
+#define __GIVARO_frac_domain_H
+#include <givaro/givpower.h>
+
+#ifndef GIVABS
+#define GIVABS(a) ((a)>0?(a):-(a))
+#endif
+
+namespace Givaro {
+template<class T1, class T2>
+struct Frac {
+ T1 _num;
+ T2 _den;
+ Frac() {}
+ template<class Z1, class Z2>
+ Frac( const Z1& v1, const Z2& v2) : _num(v1), _den(v2) {}
+ T1& nume() { return _num; }
+ const T1& nume() const
+ { return _num; }
+ T2& deno() { return _den; }
+ const T2& deno() const
+ { return _den; }
+};
+
+
+template<class RingDom>
+struct FracDom : public RingDom {
+
+public :
+ // -- Self_t
+ typedef FracDom<RingDom> Self_t;
+
+ // -- Exported types
+ typedef RingDom Ring_t;
+ typedef typename RingDom::Element Ring_E;
+ typedef Frac<Ring_E, Ring_E> Element;
+ typedef Frac<Ring_E, Ring_E> Rep;
+
+ // -- Constantes
+ const Rep zero;
+ const Rep one;
+
+ void reduce(Ring_E& a, Ring_E& b) const
+ {
+ Ring_E g; Ring_t::gcd(g,a,b);
+ // Ring_t::write(std::cerr << "a BEF: ", a) << std::endl;
+ // Ring_t::write(std::cerr << "b BEF: ", b) << std::endl;
+ // Ring_t::write(std::cerr << "g GCD: ", g) << std::endl;
+ if(! ( Ring_t::isOne(g) || Ring_t::isZero(g) ) ) {
+ Ring_t::divin(a,g);
+ Ring_t::divin(b,g);
+ }
+ // Ring_t::write(std::cerr << "a AFT: ", a) << std::endl;
+ // Ring_t::write(std::cerr << "b AFT: ", b) << std::endl;
+ }
+
+ Rep& reduce(Rep& r) const
+ {
+ reduce(r._num,r._den);
+ return r;
+ }
+
+
+ FracDom (const RingDom& R ) : Ring_t(R), zero(R.zero,R.one), one(R.one,R.one) {}
+ FracDom (const Self_t& F) : Ring_t(static_cast<const Ring_t&>(F)), zero(F.zero), one(F.one) {}
+ const Ring_t& getdomain() const
+ { return static_cast<const Ring_t&>(*this); }
+ const Ring_t& getring() const
+ { return static_cast<const Ring_t&>(*this); }
+
+ Rep& init(Rep& a) const
+ { Ring_t::init(a._num); Ring_t::init(a._den); return a; }
+
+ template<class XXX>
+ Rep& init(Rep& p, const XXX &cste ) const
+ {
+ Ring_t::init(p._num,cste); Ring_t::assign(p._den,Ring_t::one);
+ return p;
+ }
+
+
+ // -- Assignment p = q
+ Rep& assign( Rep& p, const Rep& q) const
+ {
+ Ring_t::assign(p._num,q._num); Ring_t::assign(p._den,q._den);
+ return p;
+ }
+ Rep& assign( Rep& p, const Ring_E& q) const
+ {
+ Ring_t::assign(p._num,q); Ring_t::assign(p._den,Ring_t::one);
+ return p;
+ }
+
+ // -- Comparaison operator
+ int isZero ( const Rep& P ) const
+ { return Ring_t::isZero(P._num); }
+ int isOne ( const Rep& P ) const
+ { return Ring_t::areEqual(P._num, P._den); }
+ int areEqual ( const Rep& P, const Rep& Q ) const
+ {
+ return Ring_t::areEqual(P._num, Q._num) && Ring_t::areEqual(P._den, Q._den) ; }
+ int areNEqual( const Rep& P, const Rep& Q ) const
+ {
+ return Ring_t::areNEqual(P._num, Q._num) || Ring_t::areNEqual(P._den, Q._den) ;
+ }
+
+ // --
+ std::istream& read ( std::istream& i ) {
+ char tmp; i >> tmp; // '('
+ Ring_t::read(i);
+ return i >> tmp; // ')'
+ }
+ std::ostream& write( std::ostream& o ) const
+ {
+ return Ring_t::write(o << '(') << ')';
+ }
+ std::istream& read ( std::istream& i, Rep& n) const
+ {
+ char tmp;
+ i >> tmp; GIVARO_ASSERT(tmp == '(', "Error in fraction read '(' not found");
+ Ring_t::read(i,n._num);
+ i >> tmp; GIVARO_ASSERT(tmp == ')', "Error in fraction read ')' not found");
+ i >> tmp; GIVARO_ASSERT(tmp == '/', "Error in fraction read '/' not found");
+ i >> tmp; GIVARO_ASSERT(tmp == '(', "Error in fraction read '(' not found");
+ Ring_t::read(i,n._den);
+ i >> tmp; GIVARO_ASSERT(tmp == ')', "Error in fraction read ')' not found");
+ return i;
+ }
+ std::ostream& write( std::ostream& o, const Rep& n) const
+ {
+ return Ring_t::write(Ring_t::write(o << '(',n._num) << ")/(", n._den) << ')';
+ }
+
+ // -- Arithmetics operators
+ Rep& mulin ( Rep& q, const Rep& a ) const
+ {
+ Ring_t::mulin(q._num,a._num);
+ Ring_t::mulin(q._den,a._den);
+ return reduce(q);
+ }
+ Rep& mulin ( Rep& q, const Ring_E& a ) const
+ {
+ Ring_E u(a);
+ reduce(u,q._den);
+ Ring_t::mulin(q._num,u);
+ return q;
+ }
+ Rep& mul ( Rep& q, const Rep& a, const Ring_E& b ) const
+ {
+ Ring_E u(b),v(a._den);
+ reduce(u,v);
+ Ring_t::mul(q._num,a._num,u);
+ Ring_t::assign(q._den,v);
+ return q;
+ }
+
+ Rep& mul ( Rep& q, const Ring_E& a, const Rep& b ) const
+ {
+ return mul(q,b,a);
+ }
+
+ Rep& mul ( Rep& q, const Rep& a, const Rep& b ) const
+ {
+ Ring_t::mul(q._num,a._num,b._num);
+ Ring_t::mul(q._den,a._den,b._den);
+ return reduce(q);
+ }
+
+
+ Rep& addin ( Rep& res, const Rep& u ) const
+ {
+ Ring_E g; Ring_t::gcd(g, res._den, u._den);
+ Ring_E ud; Ring_t::div(ud, u._den, g);
+ Ring_E vd; Ring_t::div(vd, res._den, g);
+ Ring_t::mulin(res._num, ud);
+ Ring_t::mulin(res._den, ud); // res *= uden/g
+ Ring_t::mulin(vd, u._num); // unum*= rden/g
+ Ring_t::addin(res._num,vd);
+ return reduce(res);
+ }
+
+ Rep& addin ( Rep& res, const Ring_E& a ) const
+ {
+ Ring_t::axpyin(res._num,res._den,a);
+ return reduce(res);
+ }
+
+ Rep& add ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ Ring_E g; Ring_t::gcd(g, u._den, v._den);
+ Ring_E ud; Ring_t::div(ud, u._den, g);
+ Ring_E vd; Ring_t::div(vd, v._den, g);
+ Ring_t::mul(res._num, u._num, vd);
+ Ring_t::mul(res._den, u._den, vd); // res = u * vden/g
+ Ring_t::mulin(ud, v._num); // vnum* uden/g
+ Ring_t::addin(res._num,ud);
+ return reduce(res);
+ }
+
+ Rep& add ( Rep& res, const Rep& u, const Ring_E& a) const
+ {
+ Ring_t::axpy(res._num,u._num,u._den,a);
+ Ring_t::assign(res._den,u._den);
+ return reduce(res);
+ }
+
+ Rep& add ( Rep& res, const Ring_E& a, const Rep& u) const
+ {
+ return add(res,u,a);
+ }
+
+ Rep& subin ( Rep& res, const Rep& u ) const
+ {
+ Ring_E g; Ring_t::gcd(g, res._den, u._den);
+ Ring_E ud; Ring_t::div(ud, u._den, g);
+ Ring_E vd; Ring_t::div(vd, res._den, g);
+ Ring_t::mulin(res._num, ud);
+ Ring_t::mulin(res._den, ud); // res *= uden/g
+ Ring_t::mulin(vd, u._num); // unum*= rden/g
+ Ring_t::subin(res._num,vd);
+ return reduce(res);
+ }
+
+ Rep& subin ( Rep& res, const Ring_E& a ) const
+ {
+ Ring_t::maxpyin(res._num,res._den,a);
+ return reduce(res);
+ }
+
+ Rep& sub ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ Ring_E g; Ring_t::gcd(g, u._den, v._den);
+ Ring_E ud; Ring_t::div(ud, u._den, g);
+ Ring_E vd; Ring_t::div(vd, v._den, g);
+ Ring_t::mul(res._num, u._num, vd);
+ Ring_t::mul(res._den, u._den, vd); // res = u * vden/g
+ Ring_t::mulin(ud, v._num); // vnum* uden/g
+ Ring_t::subin(res._num,ud);
+ return reduce(res);
+ }
+
+ Rep& sub ( Rep& res, const Rep& u, const Ring_E& a) const
+ {
+ Ring_t::maxpy(res._num,u._den,a,u._num);
+ Ring_t::assign(res._den,u._den);
+ return reduce(res);
+ }
+
+ Rep& sub ( Rep& res, const Ring_E& a, const Rep& u) const
+ {
+ Ring_t::axmy(res._num,a,u._den,u._num);
+ Ring_t::assign(res._den,u._den);
+ return reduce(res);
+ }
+
+ Rep& negin ( Rep& res ) const
+ { Ring_t::negin(res._num); return res; }
+ Rep& neg ( Rep& res, const Rep& u ) const
+ {
+ Ring_t::neg(res._num,u._num);
+ Ring_t::assign(res._den,u._den);
+ return res;
+ }
+
+ Rep& invin ( Rep& q) const
+ {
+ std::swap(q._num,q._den);
+ return q;
+ }
+
+ Rep& inv( Rep& r, const Rep& u) const
+ {
+ Ring_t::assign(r._num, u._den);
+ Ring_t::assign(r._den, u._num);
+ return r;
+ }
+ Rep& inv(Rep& r, const Ring_E& a) {
+ Ring_t::assign(r._den,a);
+ Ring_t::assign(r._num,Ring_t::one);
+ return r;
+ }
+
+ Rep& divin ( Rep& q, const Rep& a ) const
+ {
+ invin(q); mulin(q,a); return invin(q);
+ }
+
+ Rep& divin ( Rep& q, const Ring_E& a ) const
+ {
+ invin(q); mulin(q,a); return invin(q);
+ }
+
+ Rep& div ( Rep& q, const Rep& a, const Rep& b ) const
+ {
+ inv(q,b); return mulin(q,a);
+ }
+
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ mul(r,x,y);
+ return addin(r,a);
+ }
+ Rep& axpy (Rep& r, const Rep& a, const Ring_E& x, const Rep& y) const
+ {
+ mul(r,x,y);
+ return addin(r,a);
+ }
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Ring_E& y) const
+ {
+ mul(r,x,y);
+ return addin(r,a);
+ }
+ Rep& axpy (Rep& r, const Ring_E& a, const Rep& x, const Rep& y) const
+ {
+ mul(r,x,y);
+ return addin(r,a);
+ }
+ Rep& axpy (Rep& r, const Ring_E& a, const Ring_E& x, const Rep& y) const
+ {
+ mul(r,x,y);
+ return addin(r,a);
+ }
+ Rep& axpy (Rep& r, const Ring_E& a, const Rep& x, const Ring_E& y) const
+ {
+ mul(r,x,y);
+ return addin(r,a);
+ }
+ Rep& axpy (Rep& r, const Rep& a, const Ring_E& x, const Ring_E& y) const
+ {
+ Ring_E m;Ring_t::mul(m,x,y);
+ return add(r,a,m);
+ }
+
+ Rep& axpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ Rep m; mul(m,a,x);
+ return addin(r,m);
+ }
+ Rep& axpyin(Rep& r, const Ring_E& a, const Rep& x) const
+ {
+ Rep m; mul(m,a,x);
+ return addin(r,m);
+ }
+ Rep& axpyin(Rep& r, const Rep& a, const Ring_E& x) const
+ {
+ Rep m; mul(m,a,x);
+ return addin(r,m);
+ }
+ Rep& axpyin(Rep& r, const Ring_E& a, const Ring_E& x) const
+ {
+ Ring_E m; mul(m,a,x);
+ return addin(r,m);
+ }
+ // -- maxpy: r <- y - a * x
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ mul(r,x,a); negin(r);
+ return addin(r,y);
+ }
+ Rep& maxpy (Rep& r, const Rep& a, const Ring_E& x, const Rep& y) const
+ {
+ mul(r,x,a); negin(r);
+ return addin(r,y);
+ }
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Ring_E& y) const
+ {
+ mul(r,x,a); negin(r);
+ return addin(r,y);
+ }
+ Rep& maxpy (Rep& r, const Ring_E& a, const Rep& x, const Rep& y) const
+ {
+ mul(r,x,a); negin(r);
+ return addin(r,y);
+ }
+ Rep& maxpy (Rep& r, const Ring_E& a, const Ring_E& x, const Rep& y) const
+ {
+ Ring_E m;Ring_t::mul(m,x,a);
+ return sub(r,y,m);
+ }
+ Rep& maxpy (Rep& r, const Ring_E& a, const Rep& x, const Ring_E& y) const
+ {
+ mul(r,x,a); negin(r);
+ return addin(r,y);
+ }
+ Rep& maxpy (Rep& r, const Rep& a, const Ring_E& x, const Ring_E& y) const
+ {
+ mul(r,x,a); negin(r);
+ return addin(r,y);
+ }
+
+ // -- axmyin: r <- a * x - r
+ Rep& axmyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ maxpyin(r,a,x);
+ return negin(r);
+ }
+ Rep& axmyin(Rep& r, const Ring_E& a, const Rep& x) const
+ {
+ maxpyin(r,a,x);
+ return negin(r);
+ }
+ Rep& axmyin(Rep& r, const Rep& a, const Ring_E& x) const
+ {
+ maxpyin(r,a,x);
+ return negin(r);
+ }
+ Rep& axmyin(Rep& r, const Ring_E& a, const Ring_E& x) const
+ {
+ maxpyin(r,a,x);
+ return negin(r);
+ }
+ // -- maxpyin: r <- r - a * x
+ Rep& maxpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ Rep m; mul(m,a,x);
+ return subin(r,m);
+ }
+ Rep& maxpyin(Rep& r, const Ring_E& a, const Rep& x) const
+ {
+ Rep m; mul(m,a,x);
+ return subin(r,m);
+
+ }
+ Rep& maxpyin(Rep& r, const Rep& a, const Ring_E& x) const
+ {
+ Rep m; mul(m,a,x);
+ return subin(r,m);
+
+ }
+ Rep& maxpyin(Rep& r, const Ring_E& a, const Ring_E& x) const
+ {
+ Ring_E m; mul(m,a,x);
+ return subin(r,m);
+ }
+ // -- axmy: r <- a * x - y
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ mul(r,a,x);
+ return subin(r,y);
+ }
+ Rep& axmy (Rep& r, const Ring_E& a, const Rep& x, const Rep& y) const
+ {
+ mul(r,a,x);
+ return subin(r,y);
+ }
+ Rep& axmy (Rep& r, const Rep& a, const Ring_E& x, const Rep& y) const
+ {
+ mul(r,a,x);
+ return subin(r,y);
+ }
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Ring_E& y) const
+ {
+ mul(r,a,x);
+ return subin(r,y);
+ }
+ Rep& axmy (Rep& r, const Ring_E& a, const Ring_E& x, const Rep& y) const
+ {
+ Ring_E m; mul(m,a,x);
+ return sub(r,m,y);
+ }
+ Rep& axmy (Rep& r, const Ring_E& a, const Rep& x, const Ring_E& y) const
+ {
+ mul(r,a,x);
+ return subin(r,y);
+ }
+ Rep& axmy (Rep& r, const Rep& a, const Ring_E& x, const Ring_E& y) const
+ {
+ mul(r,a,x);
+ return subin(r,y);
+ }
+
+ // -- misc
+ // -- W <-- P^n
+ Rep& pow( Rep& W, const Rep& P, long n) const
+ {
+ unsigned long l = GIVABS(n);
+ if (n>0) {
+ dom_power(W._num,P._num,l,static_cast<Ring_t&>(*this));
+ dom_power(W._den,P._den,l,static_cast<Ring_t&>(*this));
+ } else {
+ dom_power(W._num,P._den,l,static_cast<Ring_t&>(*this));
+ dom_power(W._den,P._num,l,static_cast<Ring_t&>(*this));
+ }
+ return W;
+ }
+
+ // -- Random generators
+ template< class RandIter > Rep& random(RandIter& g, Rep& r) const
+ {
+ Ring_t::random(g, r._num);
+ Ring_t::nonzerorandom(g, r._den);
+ return r;
+ }
+
+ template< class RandIter, class XXX > Rep& random(RandIter& g, Rep& r, const XXX& s) const
+ {
+ Ring_t::random(g, r._num, s);
+ Ring_t::nonzerorandom(g, r._den, s);
+ return r;
+ }
+
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r) const
+ {
+ Ring_t::nonzerorandom(g, r._num);
+ Ring_t::nonzerorandom(g, r._den);
+ return r;
+ }
+ template< class RandIter, class XXX > Rep& nonzerorandom(RandIter& g, Rep& r, const XXX& s) const
+ {
+ Ring_t::nonzerorandom(g, r._num, s);
+ Ring_t::nonzerorandom(g, r._den, s);
+ return r;
+ }
+
+};
+
+} // Givaro
+
+#endif
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/tools/givhighorder.h b/src/library/tools/givhighorder.h
new file mode 100644
index 0000000..6502862
--- /dev/null
+++ b/src/library/tools/givhighorder.h
@@ -0,0 +1,446 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <15 Apr 11 16:37:12 Jean-Guillaume.Dumas at imag.fr>
+// Author: J-G. Dumas
+// Description: Storjohann's high-order lifting
+// Reference: A. Storjohann. High-order lifting. ISSAC 2002.
+// ===============================================================
+#ifndef __GIVARO_highorder_H
+#define __GIVARO_highorder_H
+
+#ifndef _GIVARO_HIGHORDER_THRESHOLD
+#define _GIVARO_HIGHORDER_THRESHOLD 30
+#endif
+
+
+#include <givaro/givpoly1.h>
+#include <givaro/givfractiondomain.h>
+#include <givaro/givtruncdomain.h>
+
+#include <givaro/givpower.h>
+#include <givaro/givquotientdomain.h>
+
+
+namespace Givaro {
+
+template<class Domain>
+struct HighOrder {
+
+ // -- Self_t
+ typedef HighOrder<Domain> Self_t;
+
+ // -- Exported types
+ typedef FracDom< Poly1Dom<Domain,Dense> > Father_t;
+ typedef FracDom< Poly1Dom<Domain,Dense> > Frac_t;
+
+ typedef Poly1Dom<Domain,Dense> Ring_t;
+ typedef Poly1Dom<Domain,Dense> Poly_t;
+ typedef TruncDom<Domain> Trunc_t;
+ typedef typename Trunc_t::Element Truncated;
+ typedef typename Ring_t::Element Ring_E;
+ typedef typename Ring_t::Element Polynomial;
+ typedef Frac<Ring_E, Ring_E> Element;
+ typedef Frac<Ring_E, Ring_E> Rep;
+
+ typedef Domain Domain_t;
+ typedef typename Domain::Element Type_t;
+
+ const Poly_t _poldom;
+ const Domain& _dom;
+ const Trunc_t _truncdom;
+
+ const Poly_t& getpoldom() const { return _poldom; }
+ const Domain& getdomain() const { return _dom; }
+ const Trunc_t& gettruncdom() const { return _truncdom; }
+
+
+
+ HighOrder(const Domain& d, const Indeter& Z = Indeter() ) : _poldom(d, Z), _dom(_poldom.getdomain()), _truncdom(_poldom) {}
+
+ Polynomial& taylor(Polynomial& Tay, const Rep& Fra, Degree order) const {
+ Degree d; _poldom.degree(d,Fra._den);
+ Tay.resize(order.value()+1);
+ size_t i = 0;
+ for( ; (i<Fra._num.size()) && (order>=i); ++i) {
+ _dom.assign(Tay[i],Fra._num[i]);
+ for(size_t j = 1; (j<Fra._den.size()) && (j<=i); ++j) {
+ _dom.maxpyin(Tay[i],Fra._den[j],Tay[i-j]);
+ }
+ _dom.divin(Tay[i], Fra._den.front());
+ }
+ for( ; (order>=i); ++i) {
+ _dom.assign(Tay[i], _dom.zero);
+ for(size_t j = 1; (j<Fra._den.size()) && (j<=i); ++j) {
+ _dom.maxpyin(Tay[i],Fra._den[j],Tay[i-j]);
+ }
+ _dom.divin(Tay[i], Fra._den.front());
+ }
+ return _poldom.setdegree(Tay);
+ }
+
+
+ Truncated& Fiduccia(Truncated& F, const Rep& Fra, Degree a, Degree b) const {
+ Polynomial Tay;
+ Degree dA; _poldom.degree(dA, Fra._den);
+ this->taylor(Tay, Fra, dA);
+ return Fiduccia(F, Tay, Fra._den, a, b);
+ }
+
+ Truncated& Fiduccia(Truncated& F, const Polynomial& Tay, const Polynomial& FraDen, Degree a, Degree b) const {
+ Degree dA; _poldom.degree(dA, FraDen);
+ Polynomial Rev; _poldom.init(Rev,dA);
+ for(int i=0;i<dA.value();++i)
+ _dom.div(Rev[i],(FraDen)[dA.value()-i],FraDen.front());
+ _dom.assign(Rev[dA.value()],_dom.one);
+ return FiducciaReversed(F, Tay, Rev, a, b);
+ }
+
+ Truncated& Fiduccia(Truncated& F, const Polynomial& Tay, const Polynomial& FraDen, Degree b) const {
+ return Fiduccia(F, Tay, FraDen, b, b);
+ }
+
+ Truncated& Fiduccia(Truncated& F, const Rep& Fra, Degree b) const {
+ return Fiduccia(F, Fra, b, b);
+ }
+
+
+ Type_t& shifteddotproduct(Type_t& dp, const Polynomial& P, const Polynomial& Q, const long shift) const {
+ Degree dl; _poldom.degree(dl, P);
+
+ GIVARO_STATE( Degree dq; _poldom.degree(dq, Q); );
+ GIVARO_ASSERT( (dl.value()+shift) <= (dq.value()+1), " in dotproduct HighOrder dP: " << dl << ", dQ: " << dq << ", shift: " << shift );
+
+ _dom.assign(dp,_dom.zero);
+ for(long i=0;i<=dl.value();++i)
+ _dom.axpyin(dp, P[i], Q[i+shift]);
+
+ return dp;
+ }
+
+
+
+ Truncated& FiducciaReversed(Truncated& F, const Polynomial& Tay, const Polynomial& FraDen, Degree a, Degree b) const {
+
+ Degree dT; _poldom.degree(dT, Tay);
+// std::cout << "a: " << a << ", b: " << b << ", dT: " << dT << std::endl;
+ if (b > dT) {
+ Degree dA; _poldom.degree(dA, FraDen);
+
+ Polynomial Xl; _poldom.init(Xl);
+ Polynomial Xone; _poldom.init(Xone,Degree(1));
+ QuotientDom<Poly_t> Qdom(_poldom, FraDen);
+ Qdom.assign(Xone);
+
+ const long bonus = dT.value()-dA.value()+1;
+
+ Degree dR(b-a);
+ Polynomial Res; _poldom.init(Res, dR);
+ long iterT=a.value();
+ long iterR=0;
+
+ for( ; iterT < dT.value(); ++iterR,++iterT)
+ _dom.assign(Res[iterR],Tay[iterT]);
+
+ dom_power(Xl, Xone, iterT-bonus, Qdom);
+
+ Degree dl; _poldom.degree(dl, Xl);
+ shifteddotproduct( Res[iterR], Xl, Tay, bonus);
+
+
+ for( ++iterR; iterR<=dR.value(); ++iterR) {
+ Qdom.mulin(Xl, Xone);
+ shifteddotproduct( Res[iterR], Xl, Tay, bonus);
+ }
+ _truncdom.assign(F, Res);
+ return _truncdom.mulin(F, a);
+ } else {
+ return _truncdom.assign(F, Tay, Degree(a), Degree(b));
+ }
+ }
+
+ Truncated& FiducciaReversed(Truncated& F, const Polynomial& Tay, const Polynomial& FraDen, Degree b) const {
+ return FiducciaReversed(F, Tay, FraDen, b, b);
+ }
+
+
+// Truncated& FiducciaReversed(Truncated& F, const Polynomial& Tay, const Polynomial& FraDen, Degree b) const {
+// Degree dT; _poldom.degree(dT, Tay);
+// if (b > dT) {
+// Degree dA; _poldom.degree(dA, FraDen);
+
+// Polynomial Xl; _poldom.init(Xl);
+// Polynomial Xone; _poldom.init(Xone,Degree(1));
+// QuotientDom<Poly_t> Qdom(_poldom, FraDen);
+// Qdom.assign(Xone);
+
+// const long bonus = dT.value()-dA.value()+1;
+
+// dom_power(Xl, Xone, b.value()-bonus, Qdom);
+
+// Degree dl; _poldom.degree(dl, Xl);
+
+// Type_t Tl; _dom.init(Tl);
+// shifteddotproduct( Tl, Xl, Tay, bonus);
+
+// return _truncdom.assign(F, Degree(b), Tl);
+// } else {
+// return _truncdom.assign(F, Degree(b), Tay[b.value()]);
+// }
+// }
+
+
+ Truncated& FracDevel(Truncated& F, const Rep& Fra, Degree a, Degree b) const {
+
+ // Precondition Degree(Fra._num)<Degree(Fra._den)
+ if (b < _GIVARO_HIGHORDER_THRESHOLD) {
+ Polynomial Tay;
+ this->taylor(Tay, Fra, b);
+ return _truncdom.assign(F, Tay, a, b);
+ } else {
+ std::vector<Truncated> Gam, T;
+ std::vector<Degree> Deg;
+ Polynomial Tay; Degree dT;
+ Degree dA; _poldom.degree(dA, Fra._den);
+
+#ifdef GIVARO_HIGHORDER_TIMER
+ Timer GivHOTimer; GivHOTimer.clear(); GivHOTimer.start();
+#endif
+ this->highorder(Gam, T, Deg, Tay, dT, a, b, Fra._den, dA);
+#ifdef GIVARO_HIGHORDER_TIMER
+ GivHOTimer.stop();
+ std::cerr << "HighOrder_" << a << '^' << b << " : " << GivHOTimer << std::endl;
+#endif
+
+ Truncated A, B;
+ _truncdom.assign(A, Fra._den);
+ _truncdom.assign(B, Fra._num);
+ return this->FracDevel(F, B, A, dA, a, b, Tay, dT, Gam, T, Deg);
+ }
+ }
+
+ Truncated& GammaId(Truncated& Gam, const Polynomial& Tay, const Degree dT, const Degree k0, const Polynomial& A, const Degree dA) const {
+ Truncated U0,TA,One;
+ _truncdom.assign(TA, A);
+ _truncdom.assign(One,_poldom.one );
+ _truncdom.assign(U0, Tay, k0-dA,k0-1);
+ _truncdom.maxpy(Gam, TA, U0, One, k0, k0+dA-1);
+ _truncdom.divin(Gam, k0);
+ return Gam;
+ }
+
+ Truncated& doubleorder(Truncated& Gam, Truncated& T, const Truncated& Gamp, const Truncated& Tp, const Truncated& S, const Truncated& TA, const Degree dA, const Degree ke) const {
+// std::cerr << "Double order: " << ke << std::endl;
+ // ke = 2^e
+ Truncated AL;
+ _truncdom.mul(AL, Tp, Gamp, ke-dA, ke-1);
+ _truncdom.mulin(AL, ke-dA);
+//write(std::cout << "AL" << ke.value() << ":=", AL) << ';' << std::endl;
+
+ _truncdom.mul(Gam, TA, AL, ke*2-dA, ke*2-1);
+ _truncdom.negin(Gam);
+ _truncdom.divin(Gam, ke*2-dA);
+// _truncdom.setval(Gam);
+// write(std::cout << "Gam" << (ke*2-dA) << ":=", Gam) << ';' << std::endl;
+// std::cerr << "[G]_" << (ke*2-dA) << std::endl;
+
+ Truncated AH;
+ _truncdom.mul(AH, Gam, S, 0, dA-1);
+ _truncdom.mulin(AH,ke*2-dA);
+//write(std::cout << "AH" << ke.value() << ":=", AH) << ';' << std::endl;
+
+ // Forget the last term
+ _truncdom.truncin(AL, ke*2-dA*2+1, ke*2-dA-1);
+ _truncdom.add(T, AL, AH);
+// std::cerr << "[I]_" << (ke*2-dA*2+1) << '^' << (ke*2-1) << std::endl;
+
+// write(std::cout << "T" << (ke*2-dA) << ":=", T) << ';' << std::endl;
+
+ return Gam;
+ }
+
+ std::vector<Truncated>& highorder(std::vector<Truncated>& Gam, std::vector<Truncated>& T, std::vector<Degree>& Deg, Polynomial& Tay, Degree& dT, Degree a, Degree order, const Polynomial& A, const Degree dA) const {
+ Gam.resize(0); T.resize(0); Deg.resize(0);
+ size_t e;
+ for(e=0; (1L<<e)<dA.value(); ++e) {}
+ ++e; // 2^{e-2} < d <= 2^{e-1}
+ int dt = int (1UL<<e);
+
+ Degree k0 = 1UL<<e;
+ Deg.push_back(k0-dA);
+
+ Degree dif = order-a;
+ dt = int(dif.value()>dt? dif.value() : dt);
+// std::cout << "BEG HighOrder" << std::endl;
+// std::cout << "d: " << dA << std::endl;
+// std::cout << "e: " << e << std::endl;
+// std::cout << "k0: " << k0 << std::endl;
+// std::cout << "k0-d: " << Deg.back() << std::endl;
+// std::cout << "a: " << a << std::endl;
+// std::cout << "b: " << order << std::endl;
+// std::cout << "dif: " << dif << std::endl;
+// std::cout << "dt: " << dt << std::endl;
+
+
+ Rep Fra; Fra._num=_poldom.one; Fra._den=A;
+ this->taylor(Tay, Fra, dt);
+// std::cerr << "[I]_" << 0 << '^' << dt << std::endl;
+// write(std::cout << "Tay" << dt << ":=", Tay) << ';' << std::endl;
+ dT = dt;
+
+ Truncated G0; this->GammaId(G0, Tay, dT, Deg.back(), A, dA);
+ Gam.push_back(G0);
+// std::cerr << "[G]_" << Deg.back() << std::endl;
+
+// write(std::cout << "Gam" << Deg.back() << ":=", G0) << ';' << std::endl;
+
+ Truncated S; _truncdom.assign(S, Tay, Degree(0), dA-1);
+// write(std::cout << "S:=", S) << ';' << std::endl;
+
+
+ Truncated T0; _truncdom.assign(T0,Tay, k0-dA*2+1,k0-1);
+ T.push_back(T0);
+// write(std::cout << "T" << e << ":=", T0) << ';' << std::endl;
+
+ Truncated TA; _truncdom.assign(TA, A);
+ size_t ordero2 = order.value()/2;
+
+
+ for( ; k0<ordero2; ) {
+#ifdef GIVARO_HIGHORDER_TIMER
+ Timer GivHOTimer; GivHOTimer.clear(); GivHOTimer.start();
+#endif
+ doubleorder(G0, T0, Gam.back(), T.back(), S, TA, dA, k0);
+ Gam.push_back(G0);
+ T.push_back(T0);
+ k0*=2; Deg.push_back(k0-dA);
+#ifdef GIVARO_HIGHORDER_TIMER
+ GivHOTimer.stop();
+ std::cerr << "DoubleOrder[" << dA << "]^" << k0 << " out of " << ordero2 << " : " << GivHOTimer << std::endl;
+#endif
+ }
+ return Gam;
+ }
+
+ Truncated& Betta(Truncated& B, const Truncated& TB, const Truncated& TA, const Degree dA, const Degree a, const Polynomial& Tay, const Degree dT, const std::vector<Truncated>& Gam, const std::vector<Truncated>& T, const std::vector<Degree>& Deg) const {
+// this->write(std::cerr << "BEG Betta" << a << "TB: [", TB) << "]_" << a << std::endl;
+#ifdef GIVARO_HIGHORDER_TIMER
+ Timer GivHOTimer; GivHOTimer.clear(); GivHOTimer.start();
+#endif
+
+ Degree a0=dA*2-1;
+ a0 = (a0>a? 0 : a-a0);
+ Truncated S;
+ this->Inverse(S, a0, a-1, TA, dA, Tay, dT, Gam, T, Deg);
+ Truncated U;
+ _truncdom.mul(U, S, TB, a-dA, a-1);
+// _truncdom.setval(U);
+
+ _truncdom.maxpy(B, TA, U, TB, a, a+dA-1);
+// this->write(std::cerr << "END Betta" << a << " B: [", B) << "]/" << a << std::endl;
+#ifdef GIVARO_HIGHORDER_TIMER
+ GivHOTimer.stop();
+ std::cerr << "Betta[" << dA << "]_" << a << " : " << GivHOTimer << std::endl;
+#endif
+ return _truncdom.divin(B, a);
+ }
+
+
+ Truncated& FracDevel(Truncated& F, const Truncated& TB, const Truncated& TA, const Degree dA, const Degree a, const Degree b, const Polynomial& Tay, const Degree dT, const std::vector<Truncated>& Gam, const std::vector<Truncated>& T, const std::vector<Degree>& Deg) const {
+// this->write(this->write(std::cerr << "BEG FracDevel" << a << '-' << b << ": [", TB) << " x ", TA)<< "]_" << a << '^' << b << std::endl;
+ if (b <= dT) {
+ Truncated tTay; _truncdom.assign(tTay, Tay, a-dA-1, b);
+// this->write(std::cerr << "END FracDevel" << a << '-' << b << " b<" << dT << ": ", _truncdom.mul(F, TB, tTay, a, b)) << std::endl;
+ return _truncdom.mul(F, TB, tTay, a, b);
+ } else if (a == 0) {
+ std::cerr << "ERROR: This should not happen" << std::endl;
+ std::cerr <<"[FracDevel" << a << '-' << b << "]_0^" << b.value() << " with degree(taylor)=" << dT << std::endl;
+ return _truncdom.assign(F,_poldom.zero );
+ } else {
+ Truncated Beta;
+ this->Betta(Beta, TB, TA, dA, a, Tay, dT, Gam, T, Deg);
+// _truncdom.setval(Beta);
+
+// this->FracDevel(F, Beta, TA, dA, Degree(0), b-a, Tay, dT, Gam, T, Deg);
+ Truncated tTay; _truncdom.assign(tTay, Tay, 0, b-a);
+ _truncdom.mul(F, Beta, tTay, 0, b-a);
+// _truncdom.setval(F);
+// this->write(std::cerr << "END FracDevel" << a << '-' << b << " : [", F) << "]/" << a << std::endl;
+ return _truncdom.mulin(F,a);
+ }
+ }
+
+
+ Truncated& Inverse(Truncated& I, const Degree a, const Degree b, const Truncated& TA, const Degree dA, const Polynomial& Tay, const Degree dT, const std::vector<Truncated>& Gam, const std::vector<Truncated>& T, const std::vector<Degree>& Deg) const {
+// std::cerr << "[I]_" << a << '^' << b << std::endl;
+
+// this->write(std::cerr << "BEG Inverse" << a << '-' << b << ": [", TA) << "]_" << a << '^' << b << std::endl;
+ if (b <= dT) {
+// this->write(std::cerr << "END Inverse" << a << '-' << b << " b<" << dT << ": ", _truncdom.assign(I, Tay, a, b) ) << std::endl;
+ return _truncdom.assign(I, Tay, a, b);
+ } else {
+ Truncated Gama;
+ this->Gamma(Gama, a, TA, dA, Tay, dT, Gam, T, Deg);
+// _truncdom.setval(Gama);
+// this->FracDevel(I, Gama, TA, dA, Degree(0), b-a, Tay, dT, Gam, T, Deg);
+ Truncated tTay; _truncdom.assign(tTay, Tay, 0, b-a);
+ _truncdom.mul(I, Gama, tTay, 0, b-a);
+
+// _truncdom.setval(I);
+// this->write(std::cerr << "END Inverse" << a << '-' << b << ": [", I ) << "]*" << a << std::endl;
+ return _truncdom.mulin(I, a);
+ }
+ }
+
+
+ Truncated& Gamma(Truncated& G, const Degree a, const Truncated& TA, const Degree dA, const Polynomial& Tay, const Degree dT, const std::vector<Truncated>& Gam, const std::vector<Truncated>& T, const std::vector<Degree>& Deg) const {
+// std::cerr << "[G]_" << a << std::endl;
+// this->write(std::cerr << "BEG Gamma" << a << ": [", TA) << "]_" << a << std::endl;
+// if ((a+dA)>dT) {
+ if (a>dT) {
+ size_t i=0;
+ for( ; i<Deg.size(); ++i) {
+ if (Deg[i] > a) { --i; break; }
+ }
+ if (i>=Deg.size()) --i;
+
+ this->Betta(G, Gam[i], TA, dA, a-Deg[i], Tay, dT, Gam, T, Deg);
+// this->write(std::cerr << "END Gamma" << a << " B: [", G) << "]" << std::endl;
+ return _truncdom.setval(G);
+ } else if (a == 0) {
+// this->write(std::cerr << "END Gamma" << a << " O: ", _truncdom.one) << std::endl;
+ return _truncdom.assign(G, _truncdom.one);
+ } else {
+ Truncated One; _truncdom.assign(One,_poldom.one );
+ Truncated tTay; _truncdom.assign(tTay, Tay, 0, a-1);
+ _truncdom.maxpy(G, TA, tTay, One,a,a+dA-1);
+// this->write(std::cerr << "END Gamma" << a << " D: [", G) << "]/" << a << std::endl;
+ return _truncdom.divin(G, a);
+ }
+ }
+
+
+
+ std::ostream& write( std::ostream& o) const {
+ return _truncdom.write(o << "HighOrder<") << '>';
+ }
+ std::ostream& write( std::ostream& o, const Truncated& n) const {
+ return _truncdom.write(o, n);
+ }
+ std::ostream& write( std::ostream& o, const Polynomial& n) const {
+ return _poldom.write(o, n);
+ }
+ std::ostream& write( std::ostream& o, const Rep& n) const {
+ return _poldom.write(_poldom.write(o << '(',n._num) << ")/(", n._den) << ')';
+ }
+
+
+
+};
+
+} // Givaro
+
+#endif
diff --git a/src/library/tools/giviterator.h b/src/library/tools/giviterator.h
index c5d633e..e3e8726 100644
--- a/src/library/tools/giviterator.h
+++ b/src/library/tools/giviterator.h
@@ -1,20 +1,23 @@
-#ifndef _GIV_ITERATOR_H_
-#define _GIV_ITERATOR_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/tools/giviterator.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// Description:
// - Definition of traits for iterators.
// - The purpose of this trait class is for specialization of some algorithms
// depending on the iteration mechanism provides by container.
-// $Id: giviterator.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: giviterator.h,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// It's a beta-beta version.
-//
+#ifndef __GIVARO_iterator_H
+#define __GIVARO_iterator_H
-// -- isUndefined trait iterator
+namespace Givaro {
+// -- isUndefined trait iterator
class isUndefinedIterator{};
// --
@@ -22,24 +25,24 @@ class isUndefinedIterator{};
// - operator++(), operator++(int), operator+=(int): increment
// - operator*(): deference
// --
-class isForwardIterator{};
+class isForwardIterator{};
// --
// -- BiDirectional iterator, should implement:
// - operator-- operator--int), operator-=(int): decrement
// --
-class isBidirectionalIterator: public isForwardIterator{};
+class isBidirectionalIterator: public isForwardIterator{};
// --
-// -- Random iterator, should implement:
+// -- Random iterator, should implement:
// - operator()(int), operator[](int): random access
// --
-class isRandomIterator: public isBidirectionalIterator{};
+class isRandomIterator: public isBidirectionalIterator{};
// --
-// -- Iterator trait: each iterator typename should provide its
-// -- categrory using this trait class.
+// -- Iterator trait: each iterator typename should provide its
+// -- categrory using this trait class.
// --
template<class Iterator>
struct IteratorTraits {
@@ -49,12 +52,12 @@ struct IteratorTraits {
// --
// -- A container of name OO should provide one of the previous iterators:
-// - * OO::Iterator: the name of the default iterator associated to OO.
-// - * OO::Iterator OO::begin():
+// - * OO::Iterator: the name of the default iterator associated to OO.
+// - * OO::Iterator OO::begin():
// -- Depending on the trait associated to OO::Iterator, OO class should
// -- also provides the following interface:
// - * [ForwardIteratorTrait, BidirectionalIteratorTrait]:
-// - - OO::Iterator OO::end():
+// - - OO::Iterator OO::end():
// - * [RandomIteratorTrait]:
// - - size_t OO::bound(): return the number of Elements in the sequence
// --
@@ -63,7 +66,7 @@ struct IteratorInterface {
typedef isUndefinedIterator Category_t; // - category of iterator
typedef typename Container::Iterator_t Iterator_t; // - type of iterator
typedef typename Container::constIterator_t constIterator_t;// - type of constiterator
- typedef typename Container::Type_t Type_t; // - type of Element
+ typedef typename Container::Type_t Type_t; // - type of Element
typedef typename Container::Indice_t Indice_t; // - type of indice for RndIter
// -- other operations that should be defined in specialized trait classes:
@@ -78,5 +81,6 @@ struct IteratorInterface {
// * static size_t bound(const Container& cc);
};
+} // Givaro
#endif
diff --git a/src/library/tools/givops.C b/src/library/tools/givops.C
index 98bc3cb..e69de29 100644
--- a/src/library/tools/givops.C
+++ b/src/library/tools/givops.C
@@ -1,2 +0,0 @@
-
-//#include "givaro/givops.h"
diff --git a/src/library/tools/givops.h b/src/library/tools/givops.h
index c08f510..7304cb9 100644
--- a/src/library/tools/givops.h
+++ b/src/library/tools/givops.h
@@ -1,24 +1,28 @@
-#ifndef _GIV_OPERATION_H_
-#define _GIV_OPERATION_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/tools/givops.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givops.h,v 1.2 2005/04/28 11:24:21 jgdumas Exp $
+// $Id: givops.h,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// Class version of operations on a group F. By default use arithmetic operator
-//
+#ifndef __GIVARO_operation_H
+#define __GIVARO_operation_H
+//
#include "givaro/givconfig.h"
#include "givaro/giviterator.h"
+namespace Givaro {
template<class Domain>
struct BaseOP {
typedef typename Domain::Rep Type_t;
typedef Domain Domain_t;
const Domain& _domain;
- BaseOP( const Domain& D ) : _domain(D) {}
+ BaseOP( const Domain& D ) : _domain(D) {}
};
template<class Domain>
@@ -26,8 +30,8 @@ struct CopyOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
CopyOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& v1, const Type_t& v2) const {
- BaseOP<Domain>::_domain.assign(v1, v2);
+ void operator() (Type_t& v1, const Type_t& v2) const {
+ BaseOP<Domain>::_domain.assign(v1, v2);
}
};
@@ -38,9 +42,9 @@ struct MulOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
MulOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
+ void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
{ BaseOP<Domain>::_domain.mul( res, v1, v2); }
- void operator() (Type_t& res, const Type_t& v1 ) const
+ void operator() (Type_t& res, const Type_t& v1 ) const
{ BaseOP<Domain>::_domain.mulin( res, v1 ); }
};
@@ -49,9 +53,9 @@ struct DivOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
DivOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
+ void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
{ BaseOP<Domain>::_domain.div( res, v1, v2); }
- void operator() (Type_t& res, const Type_t& v1) const
+ void operator() (Type_t& res, const Type_t& v1) const
{ BaseOP<Domain>::_domain.divin( res, v1 ); }
};
@@ -60,9 +64,9 @@ struct ModOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
ModOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
+ void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
{ BaseOP<Domain>::_domain.mod( res, v1, v2); }
- void operator() (Type_t& res, const Type_t& v1) const
+ void operator() (Type_t& res, const Type_t& v1) const
{ BaseOP<Domain>::_domain.modin( res, v1 ); }
};
@@ -71,9 +75,9 @@ struct AddOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
AddOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
+ void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
{ BaseOP<Domain>::_domain.add( res, v1, v2 ); }
- void operator() (Type_t& res, const Type_t& v1) const
+ void operator() (Type_t& res, const Type_t& v1) const
{ BaseOP<Domain>::_domain.addin( res, v1 ); }
};
@@ -82,9 +86,9 @@ struct SubOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
SubOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
+ void operator() (Type_t& res, const Type_t& v1, const Type_t& v2) const
{ BaseOP<Domain>::_domain.sub( res, v1, v2 ); }
- void operator() (Type_t& res, const Type_t& v1) const
+ void operator() (Type_t& res, const Type_t& v1) const
{ BaseOP<Domain>::_domain.subin( res, v1 ); }
};
@@ -93,9 +97,9 @@ struct NegOp : public BaseOP<Domain> {
typedef typename BaseOP<Domain>::Type_t Type_t;
typedef Domain Domain_t;
NegOp( const Domain& D ) : BaseOP<Domain>(D) {}
- void operator() (Type_t& res, const Type_t& v1) const
+ void operator() (Type_t& res, const Type_t& v1) const
{ BaseOP<Domain>::_domain.neg( res, v1 ); }
- void operator() (Type_t& res ) const
+ void operator() (Type_t& res ) const
{ BaseOP<Domain>::_domain.negin( res, res ); }
};
@@ -106,7 +110,7 @@ struct MulAddOp : public BaseOP<Domain> {
MulAddOp( const Domain& D ) : BaseOP<Domain>(D) {}
void operator()(Type_t& res, const Type_t& v1, const Type_t& v2, const Type_t& v3) const
{ BaseOP<Domain>::_domain.axpy( res, v1, v2, v3 ); }
- void operator() (Type_t& res, const Type_t& v1, const Type_t& v2 ) const
+ void operator() (Type_t& res, const Type_t& v1, const Type_t& v2 ) const
{ BaseOP<Domain>::_domain.axpyin( res, v1, v2 ); }
};
@@ -136,5 +140,6 @@ struct Curried2 : public OP {
void operator()(Type_t& v1) { OP::operator()(v1, _val); }
};
+} // Givaro
#endif
diff --git a/src/library/tools/givquotientdomain.h b/src/library/tools/givquotientdomain.h
new file mode 100644
index 0000000..1d6cc42
--- /dev/null
+++ b/src/library/tools/givquotientdomain.h
@@ -0,0 +1,209 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <19 Oct 10 18:35:20 Jean-Guillaume.Dumas at imag.fr>
+// Author: J-G. Dumas
+// Description: Quotients over a Ring domain
+// ===============================================================
+#ifndef __GIVARO_quotient_domain_H
+#define __GIVARO_quotient_domain_H
+#include <givaro/givpower.h>
+#ifndef GIVABS
+#define GIVABS(a) ((a)>0?(a):-(a))
+#endif
+
+namespace Givaro {
+template<class RingDom>
+struct QuotientDom : public RingDom {
+public :
+ // -- Self_t
+ typedef QuotientDom<RingDom> Self_t;
+
+ // -- Exported types
+ typedef RingDom Ring_t;
+ typedef typename RingDom::Element Ring_E;
+ typedef Ring_E Element;
+ typedef Ring_E Rep;
+protected :
+ Rep _modulo;
+
+public :
+ QuotientDom (const RingDom& R, const Element& Mod ) : Ring_t(R), _modulo(Mod) {}
+ QuotientDom (const Self_t& F) : Ring_t(static_cast<const Ring_t&>(F)), _modulo(F._modulo) {}
+
+ Rep& init(Rep& a) const
+ { return Ring_t::modin(Ring_t::init(a),_modulo); }
+
+ template<class XXX>
+ Rep& init(Rep& p, const XXX &cste ) const
+ {
+ return Ring_t::modin(Ring_t::init(p,cste),_modulo);
+ }
+
+ Rep& assign(Rep& p) const
+ {
+ return Ring_t::modin(p,_modulo);
+ }
+ Rep& assign(Rep& p, const Rep& Q) const
+ {
+ return Ring_t::modin(Ring_t::assign(p,Q),_modulo);
+ }
+
+ // -- Comparaison operator
+ int isZero ( const Rep& P ) const
+ { return Ring_t::isZero(P); }
+ int isOne ( const Rep& P ) const
+ { return Ring_t::isOne(P); }
+ int areEqual ( const Rep& P, const Rep& Q ) const
+ {
+ return Ring_t::areEqual(P, Q);
+ }
+ int areNEqual( const Rep& P, const Rep& Q ) const
+ {
+ return Ring_t::areNEqual(P, Q) ;
+ }
+
+ // --
+ std::istream& read ( std::istream& i ) {
+ char tmp;
+ return Ring_t::read(Ring_t::read(i) >> tmp);
+ }
+ std::ostream& write( std::ostream& o ) const
+ {
+ return Ring_t::write(
+ Ring_t::write(o) << '/', o);
+ }
+ std::istream& read ( std::istream& i, Rep& n) const
+ {
+ return Ring_t::read(i,n);
+ }
+ std::ostream& write( std::ostream& o, const Rep& n) const
+ {
+ return Ring_t::write(o,n);
+ }
+
+ // -- Arithmetics operators
+ Rep& mulin ( Rep& q, const Rep& a ) const
+ {
+ return Ring_t::modin(Ring_t::mulin(q,a), _modulo);
+ }
+ Rep& mul ( Rep& q, const Rep& a, const Rep& b ) const
+ {
+ return Ring_t::modin(Ring_t::mul(q,a,b), _modulo);
+ }
+ Rep& addin ( Rep& r, const Rep& u ) const
+ {
+ return Ring_t::modin(Ring_t::addin(r,u), _modulo);
+ }
+ Rep& add ( Rep& r, const Rep& u, const Rep& v ) const
+ {
+ return Ring_t::modin(Ring_t::add(r,u,v), _modulo);
+ }
+ Rep& subin ( Rep& r, const Rep& u ) const
+ {
+ return Ring_t::modin(Ring_t::subin(r,u), _modulo);
+ }
+ Rep& sub ( Rep& r, const Rep& u, const Rep& v ) const
+ {
+ return Ring_t::modin(Ring_t::sub(r,u,v), _modulo);
+ }
+ Rep& negin ( Rep& r ) const
+ {
+ return Ring_t::modin(Ring_t::negin(r),_modulo);
+ }
+ Rep& neg ( Rep& r, const Rep& u ) const
+ {
+ return Ring_t::modin(Ring_t::neg(r,u),_modulo);
+ }
+ Rep& invin ( Rep& q) const
+ {
+ Rep t; Ring_t::invmod(t,q,_modulo);
+ return Ring_t::assign(q,t);
+ }
+ Rep& inv( Rep& r, const Rep& u) const
+ {
+ return Ring_t::invmod(r,u,_modulo);
+ }
+
+ Rep& divin ( Rep& q, const Rep& a ) const
+ {
+ Rep t;
+ return this->mulin(q,this->inv(t,a));
+ }
+ Rep& div ( Rep& q, const Rep& a, const Rep& b ) const
+ {
+ return this->mulin(this->inv(q, b),a);
+ }
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return Ring_t::modin(Ring_t::axpy(r,a,x,y), _modulo);
+ }
+ Rep& axpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return Ring_t::modin(Ring_t::axpyin(r,a,x), _modulo);
+ }
+ // -- maxpy: r <- y - a * x
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return Ring_t::modin(Ring_t::maxpy(r,a,x,y), _modulo);
+ }
+ // -- axmyin: r <- a * x - r
+ Rep& axmyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return Ring_t::modin(Ring_t::axmyin(r,a,x), _modulo);
+ }
+ // -- maxpyin: r <- r - a * x
+ Rep& maxpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return Ring_t::modin(Ring_t::maxpyin(r,a,x), _modulo);
+ }
+ // -- axmy: r <- a * x - y
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return Ring_t::modin(Ring_t::axmy(r,a,x,y), _modulo);
+ }
+ // -- misc
+ // -- W <-- P^n
+ Rep& pow( Rep& W, const Rep& P, long n) const
+ {
+ unsigned long l = GIVABS(n);
+ if (n>0)
+ return dom_power(W, P, l, *this);
+ else {
+ Rep invP; this->inv(invP,P);
+ return dom_power(W, invP, l, *this);
+ }
+ }
+ // -- Random generators
+ template< class RandIter >
+ Rep& random(RandIter& g, Rep& r) const
+ {
+ return Ring_t::modin(Ring_t::random(g, r),_modulo);
+ }
+
+ template< class RandIter, class XXX >
+ Rep& random(RandIter& g, Rep& r, const XXX& s) const
+ {
+ return Ring_t::modin(Ring_t::random(g, r, s),_modulo);
+ }
+
+ template< class RandIter > Rep&
+ nonzerorandom(RandIter& g, Rep& r) const
+ {
+ return Ring_t::modin(Ring_t::nonzerorandom(g, r),_modulo);
+ }
+ template< class RandIter, class XXX >
+ Rep& nonzerorandom(RandIter& g, Rep& r, const XXX& s) const
+ {
+ return Ring_t::modin(Ring_t::nonzerorandom(g, r, s),_modulo);
+ }
+
+};
+
+} // Givaro
+
+#endif
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/tools/givtruncdomain.h b/src/library/tools/givtruncdomain.h
new file mode 100644
index 0000000..7d432f7
--- /dev/null
+++ b/src/library/tools/givtruncdomain.h
@@ -0,0 +1,425 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <18 Feb 11 16:04:19 Jean-Guillaume.Dumas at imag.fr>
+// Author: J-G. Dumas
+// Description: Pieces of polynomials as defined in
+// [Arne Storjohann, High-Order Lifting
+// ISSAC'2002, pp. 246-254, ACM Press, July 2002].
+// ===============================================================
+#ifndef __GIVARO_trunc_domain_H
+#define __GIVARO_trunc_domain_H
+#include <givaro/givpoly1dense.h>
+#include <bits/stl_pair.h>
+
+
+namespace Givaro {
+
+template <class Domain>
+class TruncDom : public Poly1Dom<Domain,Dense> {
+public :
+ // -- Self_t
+ typedef TruncDom<Domain> Self_t;
+ // -- Father_t
+ typedef Poly1Dom<Domain,Dense> Father_t;
+ // -- Exported types
+ typedef Domain Domain_t;
+ typedef typename Domain::Element Type_t;
+ typedef typename Father_t::Storage_t Polynomial_t;
+ typedef std::pair<Polynomial_t, Degree> Storage_t;
+ typedef Storage_t Rep;
+ typedef Storage_t Element;
+
+
+ Storage_t zero, one;
+
+ TruncDom (const Domain& d, const Indeter& X = Indeter() ) : Father_t(d,X) {
+ this->assign(zero,Father_t::zero);
+ this->assign(one,Father_t::one);
+ }
+ TruncDom (const Self_t& t) : Father_t(static_cast<const Father_t&>(t)) {
+ this->assign(zero,Father_t::zero);
+ this->assign(one,Father_t::one);
+ }
+ TruncDom (const Father_t& t) : Father_t(t) {
+ this->assign(zero,Father_t::zero);
+ this->assign(one,Father_t::one);
+ }
+
+ const Father_t& getpoldomain() const
+ {
+ return static_cast<const Father_t&>(*this);
+ }
+
+
+ Rep& init(Rep& p) const
+ { Father_t::init(p.first); p.second=0; return p; }
+
+ template<class XXX>
+ Rep& init(Rep& p, const XXX &cste ) const
+ {
+ Father_t::init(p.first,cste); p.second=0; return p;
+ }
+
+ // -- For polynomial = lcoeff X^deg
+ template<class XXX>
+ Rep& init (Rep& p, const Degree deg , const XXX& lcoeff) const
+ {
+ Father_t::init(p.first,Degree(0),lcoeff); p.second=deg; return p;
+ }
+
+ Polynomial_t& convert (Polynomial_t& r, const Rep& P) const
+ {
+ Father_t::assign(r, P.first);
+ Polynomial_t mon;
+ Father_t::init(mon, P.second);
+ return Father_t::mulin(r, mon);
+ }
+
+ template<class XXX>
+ XXX& convert (XXX& r, const Rep& P) const
+ {
+ Polynomial_t eP; Father_t::init(eP);
+ this->convert(eP, P);
+ return Father_t::convert(r, eP);
+ }
+
+ // F.assign(P[deg], lcoeff);
+ Rep& assign (Rep& p, const Degree deg , const Type_t& lcoeff) const
+ {
+ Father_t::assign(p.first,Degree(0),lcoeff);
+ Father_t::setdegree(p.first);
+ p.second=deg;
+ return setval(p);
+ }
+
+ // -- Assign polynomial with field value : F.assign(p[0],cste)
+ Rep& assign(Rep& p, const Type_t &cste ) const
+ {
+ return assign(p, Degree(0), cste);
+ }
+ // -- Assignment p = q
+ Rep& assign( Rep& p, const Rep& q) const
+ {
+ Father_t::assign(p.first, q.first);
+ p.second = q.second;
+ return p;
+ }
+
+ Rep& assign(Rep& p, const Polynomial_t& r ) const
+ {
+ Father_t::assign(p.first,r); p.second=0; return setval(p);
+ }
+
+ Rep& assign(Rep& p, const Polynomial_t& r, const Degree v, const Degree d) const
+ {
+ Father_t::assign(p.first,r); p.second=0; return truncin(p,v,d);
+ }
+
+
+ Rep& mulin(Rep& p, const Degree& s) const
+ {
+ p.second += s; return p;
+ }
+
+ Rep& divin(Rep& p, const Degree& s) const
+ {
+ p.second -= s; p.second=(p.second<0?0:p.second); return p;
+ }
+
+ // -- Compute the degree of P
+ Rep& setdegree( Rep& P ) const
+ {
+ Father_t::setdegree(P.first);
+ if (P.first.size() <= 0) P.second=0;
+ return P;
+ }
+
+ // -- Compute the valuation of P
+ Rep& setval( Rep& P ) const
+ {
+ setdegree(P);
+ if (P.first.size() <= 0) return P;
+ typename Polynomial_t::iterator it = P.first.begin();
+ if (! this->_domain.isZero(*it)) return P;
+ for(++it,++P.second; it != P.first.end(); ++it,++P.second) {
+ if (! this->_domain.isZero(*it)) {
+ P.first.erase(P.first.begin(),it);
+ return P;
+ }
+ }
+ P.first.reallocate(0); P.second=0;
+ return P;
+ }
+
+ // -- Returns the degree of polynomial
+ Degree& degree(Degree& d, const Rep& P) const
+ {
+ Father_t::degree(d, P.first);
+ return d+=P.second;
+ }
+
+ // -- Returns the valuation of polynomial
+ Degree& val(Degree& d, const Rep& P) const
+ {
+ this->setval(const_cast<Rep&>(P));
+ return d=P.second;
+ }
+
+
+ // -- Comparaison operator
+ int isZero ( const Rep& P ) const
+ { return Father_t::isZero(P.first); }
+ int isOne ( const Rep& P ) const
+ {
+ Degree vP;val(vP,P);
+ return ((vP == 0) && Father_t::isOne(P.first));
+ }
+
+
+ int areEqual ( const Rep& P, const Rep& Q ) const
+ {
+ Degree vP;val(vP,P);
+ Degree vQ;val(vQ,Q);
+ return (vP == vQ) && Father_t::areEqual(P.first,Q.first);
+ }
+
+ int areNEqual( const Rep& P, const Rep& Q ) const
+ {
+ Degree vP;val(vP,P);
+ Degree vQ;val(vQ,Q);
+ return (vP != vQ) || Father_t::areNEqual(P.first,Q.first);
+ }
+
+
+ Rep& shift(Rep& p, const Degree& s) const;
+ Rep& truncin(Rep& p, const Degree& v, const Degree& d) const;
+ Rep& trunc(Rep& p, const Rep& R, const Degree& v, const Degree& d) const
+ {
+ return this->truncin(this->assign(p,R),v,d);
+ }
+
+ // I/O
+ std::istream& read ( std::istream& i ) {
+ char tmp, t[5];
+ return Father_t::read(i>> tmp)>> t ;
+ }
+ std::ostream& write( std::ostream& o ) const
+ {
+ return Father_t::write(o << '[') << "]_i^j";
+ }
+ std::istream& read ( std::istream& i, Rep& n) const
+ {
+ char tmp;
+ return Father_t::read(i>>tmp,n.first)>>tmp>>tmp>>tmp>>tmp>> n.second;
+ }
+ std::ostream& write( std::ostream& o, const Rep& n) const
+ {
+
+ return Father_t::write(o<<'(',n.first)<<")*" << this->_x << '^' << n.second;
+ }
+
+ Rep& expand(Rep& P, const Degree& d) const
+ {
+ Degree vP; val(vP, P);
+ if (vP > d) {
+ P.first.insert(P.first.begin(),value(vP-d),this->_domain.zero);
+ P.second = d;
+ }
+ return P;
+ }
+
+
+ // -- Arithmetics operators
+ Rep& addin ( Rep& R, const Rep& P) const;
+ Rep& add ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ assign(res,u);
+ return addin(res,v);
+ }
+
+ Rep& addin ( Rep& R, const Rep& P, const Degree& v, const Degree& d) const;
+ Rep& add ( Rep& res, const Rep& u, const Rep& v, const Degree& Val, const Degree& deg) const
+ {
+ assign(res,u);
+ return addin(res,v,Val,deg);
+ }
+
+ Rep& neg(Rep& R, const Rep& P) const
+ {
+ Father_t::neg(R.first,P.first);
+ R.second = P.second;
+ return R;
+ }
+ Rep& negin(Rep& R) const
+ {
+ Father_t::negin(R.first);
+ return R;
+ }
+
+ Rep& sub ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ assign(res,u);
+ return this->subin(res,v);
+ }
+ Rep& subin ( Rep& R, const Rep& P) const ;
+ Rep& sub ( Rep& R, const Rep& P, const Rep& Q, const Degree& v, const Degree& d) const
+ {
+ return this->addin(this->neg(R,Q),P,v,d);
+
+ }
+
+ Rep& subin ( Rep& R, const Rep& P, const Degree& v, const Degree& d) const
+ {
+ return this->negin(this->addin(this->negin(R),P,v,d));
+ }
+ Rep& mul ( Rep& res, const Rep& u, const Rep& v ) const
+ {
+ Father_t::mul(res.first,u.first,v.first);
+ res.second = u.second+v.second;
+ return res;
+ }
+ Rep& mulin ( Rep& P, const Rep& Q ) const
+ {
+ Father_t::mulin(P.first,Q.first);
+ P.second += Q.second;
+ return P;
+ }
+
+
+ Rep& mul( Rep& r, const Rep& u, const Rep& v, const Degree& Val, const Degree& deg) const;
+ Rep& mulin( Rep& r, const Rep& v, const Degree& Val, const Degree& deg) const
+ {
+ Rep tmp(r);
+ return mul(r,tmp,v,Val,deg);
+ }
+
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return this->addin( this->mul(r,a,x), y);
+ }
+ Rep& axpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ Rep tmp; this->init(tmp);
+ return this->addin(r, this->mul(tmp,a,x));
+ }
+ Rep& axpy (Rep& r, const Rep& a, const Rep& x, const Rep& y, const Degree& Val, const Degree& deg) const
+ {
+ return this->addin(this->mul(r,a,x,Val,deg), y, Val, deg);
+ }
+ Rep& axpyin (Rep& r, const Rep& a, const Rep& x, const Degree& Val, const Degree& deg) const
+ {
+ Rep tmp; this->init(tmp);
+ return this->addin(r, this->mul(tmp,a,x,Val,deg), Val, deg);
+ }
+
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return this->subin( this->mul(r,a,x), y);
+ }
+ Rep& axmyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ return this->negin(this->maxpyin(r,a,x));
+ }
+ Rep& axmy (Rep& r, const Rep& a, const Rep& x, const Rep& y, const Degree& Val, const Degree& deg) const
+ {
+ return this->subin(this->mul(r,a,x,Val,deg), y, Val, deg);
+ }
+ Rep& axmyin (Rep& r, const Rep& a, const Rep& x, const Degree& Val, const Degree& deg) const
+ {
+ return this->negin(this->maxpyin(r,a,x,Val,deg));
+ }
+
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Rep& y) const
+ {
+ return this->addin( this->negin(this->mul(r,a,x)), y);
+ }
+ Rep& maxpyin(Rep& r, const Rep& a, const Rep& x) const
+ {
+ Rep tmp;
+ return this->subin(r, this->mul(tmp,a,x));
+ }
+ Rep& maxpy (Rep& r, const Rep& a, const Rep& x, const Rep& y, const Degree& Val, const Degree& deg) const
+ {
+ return this->addin( this->negin(this->mul(r,a,x,Val,deg)), y, Val, deg);
+ }
+ Rep& maxpyin (Rep& r, const Rep& a, const Rep& x, const Degree& Val, const Degree& deg) const
+ {
+ Rep tmp;
+ return this->subin(r, this->mul(tmp,a,x,Val,deg), Val, deg);
+ }
+
+ // -- Random generators
+ // -- Random dense polynomial of degree 0
+ template< class RandIter > Rep& random(RandIter& g, Rep& r) const
+ {
+ Father_t::random(g,r.first);
+ r.second = rand();
+ return r;
+ }
+
+ // -- Random dense polynomial of size s
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, long s) const
+ {
+ Father_t::random(g,r.first,s);
+ r.second = rand() % s;
+ return r;
+ }
+ // -- Random dense polynomial of degree d
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, Degree s) const
+ {
+ Father_t::random(g,r.first,s);
+ r.second = rand() % s.value();
+ return r;
+ }
+
+ Rep& random(GivRandom& g, Rep& r, Degree s) const
+ {
+ Father_t::random(g,r.first,s);
+ r.second = g() % ((s.value()<<1)|1);
+ return r;
+ }
+ // -- Random dense polynomial with same size as b.
+ template< class RandIter > Rep& random(RandIter& g, Rep& r, const Rep& b) const
+ {
+ Father_t::random(g,r.first,b);
+ r.second = b.second;
+ return r;
+ }
+
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r) const{
+ Father_t::nonzerorandom(g,r.first);
+ r.second = rand();
+ return r;
+ }
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, long s) const
+ {
+ Father_t::nonzerorandom(g,r.first,s);
+ r.second = rand() % s;
+ return r;
+ }
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, Degree s) const
+ {
+ Father_t::nonzerorandom(g,r.first,s);
+ r.second = rand() % s.value();
+ return r;
+ }
+ template< class RandIter > Rep& nonzerorandom(RandIter& g, Rep& r, const Rep& b) const
+ {
+ Father_t::random(g,r.first,b);
+ r.second = b.second;
+ return r;
+ }
+
+
+};
+
+} // Givaro
+
+#include "givaro/givtruncdomain.inl"
+
+#endif
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
diff --git a/src/library/tools/givtruncdomain.inl b/src/library/tools/givtruncdomain.inl
new file mode 100644
index 0000000..8335e33
--- /dev/null
+++ b/src/library/tools/givtruncdomain.inl
@@ -0,0 +1,366 @@
+// ===============================================================
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <05 May 10 09:02:07 Jean-Guillaume.Dumas at imag.fr>
+// Author: J-G. Dumas
+// Description: Pieces of polynomials as defined in
+// [Arne Storjohann, High-Order Lifting
+// ISSAC'2002, pp. 246-254, ACM Press, July 2002].
+// ===============================================================
+
+#ifndef __GIVARO_trunc_domain_INL
+#define __GIVARO_trunc_domain_INL
+
+#include <givaro/givtruncdomain.h>
+
+namespace Givaro {
+
+template <class Domain>
+inline typename TruncDom<Domain>::Rep& TruncDom<Domain>::truncin(Rep& p, const Degree& v, const Degree& d) const {
+ Degree dP;degree(dP,p);
+ Degree vP;val(vP,p);
+ if (vP<v) {
+ if (dP<v) {
+ p.first.reallocate(0);
+ p.second = 0;
+ dP=Degree::deginfty;
+ } else {
+ size_t diVV=value(v-vP);
+ p.first.erase(p.first.begin(),p.first.begin()+diVV);
+ p.second = v;
+ }
+ vP=v;
+ }
+ if (d<dP) {
+ if (d<vP) {
+ p.first.reallocate(0);
+ p.second = 0;
+ } else {
+ p.first.resize(value(d-vP)+1);
+ }
+ }
+ return p;
+}
+
+
+template <class Domain>
+inline typename TruncDom<Domain>::Rep& TruncDom<Domain>::addin ( Rep& R, const Rep& P) const {
+ size_t sP = P.first.size();
+ if (sP == 0) return R;
+ size_t sR = R.first.size();
+ if (sR == 0) { return assign(R,P); }
+ Degree vP; val(vP, P);
+ Degree vR; val(vR, R);
+
+
+ if (vR > vP) {
+ expand(R, vP);
+ sR = R.first.size();
+ size_t diRP = value(vR-vP);
+ size_t i=0;
+ for( ; (i<diRP) && (i<sP); ++i)
+ this->_domain.assign(R.first[i],P.first[i]);
+ if(sR < sP) {
+ for(i=diRP; i<sR; ++i)
+ this->_domain.addin(R.first[i], P.first[i]);
+ R.first.resize(sP);
+ for(; i<sP; ++i)
+ this->_domain.assign(R.first[i],P.first[i]);
+ } else {
+ for(i=diRP; i<sP; ++i)
+ this->_domain.addin(R.first[i], P.first[i]);
+ }
+ } else {
+ size_t diRP = value(vP-vR);
+ size_t newS = sP+diRP;
+ if (newS>sR) R.first.resize(newS);
+ size_t i = diRP, j=0;
+ for( ; (i<sR) && (j<sP); ++i, ++j)
+ this->_domain.addin(R.first[i], P.first[j]);
+ for( ; (j<sP); ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ return R;
+}
+
+template <class Domain>
+inline typename TruncDom<Domain>::Rep& TruncDom<Domain>::addin ( Rep& R, const Rep& P, const Degree& v, const Degree& d) const {
+ Degree vP; val(vP, P);
+ Degree vR; val(vR, R);
+ size_t sP = P.first.size();
+ if (sP == 0) return this->truncin(R,v,d);
+ size_t sR = R.first.size();
+ if (sR == 0) { return this->trunc(R,P,v,d); }
+// Degree dP; degree(dP, P); Degree dR; degree(dR, R); std::cout << "vR: " << vR << ", dR: "<< dR << ",sR: " << sR << ", vP: "<< vP << ", dP: "<< dP << ", sP: " << sP << ", v: "<< v << ", d: "<< d << std::endl;
+ if (vP<=d) {
+ if (vR<=d) {
+ if (v<=vP) {
+ if (vP < vR) {
+ // v <= vP <= d && v <= vP < vR
+ // v < vP <= vR
+ expand(R, vP);
+ // v < vP = vR
+ sR = R.first.size();
+ size_t diDV=value(d-vP)+1;
+ sR = (sR>diDV?diDV:sR);
+ R.first.resize(sR);
+ size_t diDVP=value(d-vP)+1;
+ sP=(sP>diDVP?diDVP:sP);
+ size_t i=0;
+ size_t diRP = value(vR-vP);
+ if (sR < sP) R.first.resize(sP);
+ for( ; (i<diRP) && (i<sP); ++i)
+ this->_domain.assign(R.first[i],P.first[i]);
+ for( ; (i<sR) && (i<sP); ++i)
+ this->_domain.addin(R.first[i], P.first[i]);
+ for(; i<sP; ++i)
+ this->_domain.assign(R.first[i],P.first[i]);
+ } else {
+ // v <= vP <= d && vR <= vP
+ if (vR < v) {
+ // vR < v <= vP <= d
+ if (static_cast<size_t>(value(v-vR))<sR) {
+ R.first.erase(R.first.begin(),R.first.begin()+value(v-vR));
+ sR = R.first.size();
+ } else {
+ R.first.reallocate(0);
+ sR = 0;
+ }
+ R.second = v;
+ vR=v;
+ }
+ // v = vR <= vP <= d
+ long diRP = value(vP-vR);
+ size_t diDV=value(d-vP)+1;
+ sP=(sP>diDV?diDV:sP);
+ long newS = sP+diRP;
+ long newsR = R.first.size();
+ Degree dR(vR+newsR-1);
+ newsR = (dR>d?value(d-vR)+1:newsR);
+ newS = (newsR>newS?newsR:newS);
+ R.first.resize(newS);
+ size_t i = diRP, j=0;
+ for( ; (i<sR) && (j<sP); ++i, ++j)
+ this->_domain.addin(R.first[i], P.first[j]);
+ for( ; (j<sP); ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ } else {
+ // vP < v <= d
+ if (vP < vR) {
+ // vP < vR && vP < v
+ if (vR < v) {
+ // vP < vR < v
+ Degree lastR(vR+sR-1);
+ if (lastR < v) {
+ // vP <= vR < lastR < v
+ Degree lastP(vP+sP-1);
+ if (lastP<v) {
+ R.first.reallocate(0);
+ R.second = 0;
+ } else {
+ // vP < vR < lastR < v <= lastP
+ lastP=(lastP>d?d:lastP);
+ R.first.resize(value(lastP-v)+1);
+ R.second = v;
+ size_t i=0;
+ size_t j=value(v-vP);
+ for( ;(j<sP) && (i<R.first.size());++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ }
+ else {
+ // vP <= vR < v <= lastR
+ R.first.erase(R.first.begin(),R.first.begin()+value(v-vR));
+ R.second = v;
+ sR=R.first.size();
+ size_t i = 0;
+ size_t j = value(v-vP);
+ Degree lastP(vP+sP-1);
+ lastP = (lastP>d?d:lastP);
+ Degree lastRR(v+sR-1);
+ lastRR = (lastRR>d?d:lastRR);
+ size_t endi=value(lastRR-v)+1;
+ size_t endj=value(lastP-vP)+1;
+ lastRR = (lastP>lastRR?lastP:lastRR);
+ R.first.resize(value(lastRR-v)+1);
+ for( ; (j<endj) && (i<endi); ++i,++j)
+ this->_domain.addin(R.first[i], P.first[j]);
+ for( ; j<endj; ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ } else {
+ // vP < v <= vR <= d
+ if ((vP+sP-1)<v) {
+ size_t diRD = value(d-vR)+1;
+ if (diRD<sR) R.first.resize(diRD);
+ } else {
+ expand(R, v);
+ // vP < v = vR
+ sR = R.first.size();
+ size_t diDV=value(d-v)+1;
+ sR = (sR>diDV?diDV:sR);
+ R.first.resize(sR);
+ size_t diDVP=value(d-vP)+1;
+ sP=(sP>diDVP?diDVP:sP);
+ size_t diRP = value(vR-v);
+ size_t i=0;
+ size_t j=value(v-vP);
+ if (sR < (sP-j)) R.first.resize(sP-j);
+ for( ; (i<diRP) && (j<sP); ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ for( ; (i<sR) && (j<sP); ++i,++j)
+ this->_domain.addin(R.first[i], P.first[j]);
+ for(; j<sP; ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ }
+ } else {
+ // vR <= vP < v <= d
+ Degree lastR(vR+sR-1);
+ if (lastR < v) {
+ // vR <= vP < lastR < v
+ Degree lastP(vP+sP-1);
+ if (lastP<v) {
+ R.first.reallocate(0);
+ R.second = 0;
+ } else {
+ // vR <= vP < lastR < v <= lastP
+ lastP=(lastP>d?d:lastP);
+ R.first.resize(value(lastP-v)+1);
+ R.second = v;
+ size_t i=0;
+ size_t j=value(v-vP);
+ for( ;(j<sP) && (i<R.first.size());++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ } else {
+ // vR <= vP < v <= lastR
+ R.first.erase(R.first.begin(),R.first.begin()+value(v-vR));
+ R.second = v;
+ sR=R.first.size();
+ size_t i = 0;
+ size_t j = value(v-vP);
+ Degree lastP(vP+sP-1);
+ lastP = (lastP>d?d:lastP);
+ Degree lastRR(v+sR-1);
+ lastRR = (lastRR>d?d:lastRR);
+ size_t endi=value(lastRR-v)+1;
+ size_t endj=value(lastP-vP)+1;
+ lastRR=(lastP>lastRR?lastP:lastRR);
+ R.first.resize(value(lastRR-v)+1);
+ for( ; (j<endj) && (i<endi); ++i,++j)
+ this->_domain.addin(R.first[i], P.first[j]);
+ for( ; j<endj; ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ }
+ }
+ }
+ } else {
+ // vP <= d < vR
+ size_t j=0;
+ if (vP<v) {
+ size_t diPV = value(v-vP)+1;
+ if (sP<diPV) {
+ R.first.resize(0);
+ R.second = 0;
+ return R;
+ }
+ j+=value(v-vP);
+ vP=v;
+ }
+ size_t i=0;
+ sR=value(d-vP)+1;
+ size_t inP = sP-j;
+ sR=(inP>sR?sR:inP);
+ R.first.resize(sR);
+ for( ; i<sR; ++i,++j)
+ this->_domain.assign(R.first[i],P.first[j]);
+ R.second = vP;
+ }
+ } else {
+ if (d<vR) {
+ // d < vR,vP
+ R.first.reallocate(0);
+ R.second = 0;
+ } else {
+ // vR <= d < vP
+ if (vR<v) {
+ if (static_cast<size_t>(value(v-vR))<sR) {
+ R.first.erase(R.first.begin(),R.first.begin()+value(v-vR));
+ R.second = v;
+ R.first.resize(value(d-v)+1);
+ } else {
+ R.first.reallocate(0);
+ R.second = 0;
+ }
+ } else {
+ R.first.resize(value(d-vR)+1);
+ }
+ }
+ }
+ return R;
+}
+
+template <class Domain>
+inline typename TruncDom<Domain>::Rep& TruncDom<Domain>::subin ( Rep& R, const Rep& P) const {
+ size_t sP = P.first.size();
+ if (sP == 0) return R;
+ size_t sR = R.first.size();
+ if (sR == 0) { return assign(R,P); }
+ Degree vP; val(vP, P);
+ Degree vR; val(vR, R);
+ if (vR > vP) {
+ expand(R, vP);
+ sR = R.first.size();
+ size_t diRP = value(vR-vP);
+ size_t i=0;
+ for( ; (i<diRP) && (i<sP); ++i)
+ this->_domain.neg(R.first[i],P.first[i]);
+ if(sR < sP) {
+ for(i=diRP; i<sR; ++i)
+ this->_domain.subin(R.first[i], P.first[i]);
+ R.first.resize(sP);
+ for(; i<sP; ++i)
+ this->_domain.neg(R.first[i],P.first[i]);
+ } else {
+ for(i=diRP; i<sP; ++i)
+ this->_domain.subin(R.first[i], P.first[i]);
+ }
+ } else {
+ size_t diRP = value(vP-vR);
+ size_t newS = sP+diRP;
+ if (newS>sR) R.first.resize(newS);
+ size_t i = diRP, j=0;
+ for( ; (i<sR) && (j<sP); ++i, ++j)
+ this->_domain.subin(R.first[i], P.first[j]);
+ for( ; (j<sP); ++i,++j)
+ this->_domain.neg(R.first[i],P.first[j]);
+ }
+ return R;
+}
+
+template <class Domain>
+inline typename TruncDom<Domain>::Rep& TruncDom<Domain>::mul( Rep& r, const Rep& u, const Rep& v, const Degree& Val, const Degree& deg) const {
+ Degree vU; this->val(vU, u);
+ Degree vV; this->val(vV, v);
+ r.second = u.second+v.second;
+ if (Val >= r.second) {
+ Father_t::mul(r.first,u.first,v.first,Val-r.second,deg-r.second);
+ r.second=Val.value();
+ } else if (deg >= r.second) {
+ Father_t::mul(r.first,u.first,v.first,Degree(0),deg-r.second);
+ } else {
+// r.first=this->zero;
+// r.second=0;
+ r=this->zero;
+ }
+ return r;
+}
+
+} // Givaro
+
+#endif
diff --git a/src/library/vector/Makefile.am b/src/library/vector/Makefile.am
index c00dd4e..03ba3b7 100644
--- a/src/library/vector/Makefile.am
+++ b/src/library/vector/Makefile.am
@@ -1,14 +1,21 @@
-INCLUDES=-I$(top_srcdir)
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
-AM_CPPFLAGS= -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS=-I$(top_srcdir)
-pkginclude_HEADERS=\
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
+AM_CPPFLAGS+= -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+
+pkginclude_HEADERS= \
givstorage.h \
- givvectorsparse.h \
+ givvectorsparse.h \
givstoragedense.h \
- givvector.h \
+ givvector.h \
givvectorsparse.inl \
- givvectsparseops.inl \
+ givvectsparseops.inl\
givvectdensespe.inl \
givvectordense.inl \
givvectdenseops.inl
diff --git a/src/library/vector/Makefile.in b/src/library/vector/Makefile.in
index 6a6f6ca..243aee7 100644
--- a/src/library/vector/Makefile.in
+++ b/src/library/vector/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,12 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -38,12 +45,21 @@ DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -66,26 +82,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -95,40 +112,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -168,17 +195,20 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-AM_CPPFLAGS = -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory
+AM_CXXFLAGS = @DEFAULT_CFLAGS@
pkginclude_HEADERS = \
givstorage.h \
- givvectorsparse.h \
+ givvectorsparse.h \
givstoragedense.h \
- givvector.h \
+ givvector.h \
givvectorsparse.inl \
- givvectsparseops.inl \
+ givvectsparseops.inl\
givvectdensespe.inl \
givvectordense.inl \
givvectdenseops.inl
@@ -190,14 +220,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/library/vector/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/library/vector/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/library/vector/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps src/library/vector/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -244,7 +274,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -357,6 +387,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -365,18 +397,28 @@ install-data-am: install-pkgincludeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
diff --git a/src/library/vector/givstorage.h b/src/library/vector/givstorage.h
index 5f0ee9e..c70d9c6 100644
--- a/src/library/vector/givstorage.h
+++ b/src/library/vector/givstorage.h
@@ -1,15 +1,21 @@
-#ifndef _GIV_VECTOR_STORAGE_H_
-#define _GIV_VECTOR_STORAGE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/vector/givstorage.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givstorage.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givstorage.h,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
+#ifndef _GIV_VECTOR_STORAGE_H_
+#define _GIV_VECTOR_STORAGE_H_
#include "givaro/givcategory.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
// ==========================================================================
// --
@@ -17,7 +23,7 @@
// -- return the storage type Storage_t associated with the
// -- StorageTag
// ==========================================================================
-template<class T, class StorageTag >
+template<class T, class StorageTag >
struct RetVectorStorage {
typedef T Type_t;
typedef Undefined Storage_t;
@@ -30,12 +36,12 @@ struct RetVectorStorage {
// -- return the storage type associated with a view of the storage
// -- associated with StorageTag.
// ==========================================================================
-template<class StorageTag, class ViewTag>
+template<class StorageTag, class ViewTag>
struct RetVector2Storage {
typedef Undefined Storage_t;
- typedef Undefined ViewTag_t;
+ typedef Undefined ViewTag_t;
};
-
+} // Givaro
#endif
diff --git a/src/library/vector/givstoragedense.h b/src/library/vector/givstoragedense.h
index 277efe5..6d71d1a 100644
--- a/src/library/vector/givstoragedense.h
+++ b/src/library/vector/givstoragedense.h
@@ -1,28 +1,33 @@
-#ifndef _GIV_VECTOR_STORAGE_DENSE_H_
-#define _GIV_VECTOR_STORAGE_DENSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/vector/givstoragedense.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givstoragedense.h,v 1.1.1.1 2004/05/12 16:08:24 jgdumas Exp $
+// $Id: givstoragedense.h,v 1.2 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
+#ifndef _GIV_VECTOR_STORAGE_DENSE_H_
+#define _GIV_VECTOR_STORAGE_DENSE_H_
#include "givaro/givstorage.h"
+namespace Givaro {
+#warning "this file will probably not compile"
// ==========================================================================
// --
// -- Specialization for dense representation, using Array0 of givaro
// --
// ==========================================================================
-template<class T>
+template<class T>
struct RetVectorStorage<T,Dense> {
- typedef T Type_t;
+ typedef T Type_t;
// --
- // -- Iterators
+ // -- Iterators
// --
typedef typename Array0<T>::Indice_t Indice_t;
typedef typename Array0<T>::Iterator_t Iterator_t;
@@ -51,5 +56,5 @@ struct RetVectorStorage<T,Dense> {
};
};
-
+} // Givaro
#endif
diff --git a/src/library/vector/givvectdenseops.inl b/src/library/vector/givvectdenseops.inl
index 78e40d2..9f3863b 100644
--- a/src/library/vector/givvectdenseops.inl
+++ b/src/library/vector/givvectdenseops.inl
@@ -1,10 +1,16 @@
// ==========================================================================
// $Source
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// $Id
// ==========================================================================
+namespace Givaro {
+#warning "this file will probably not compile"
+
// -- map of a unary operator, with operator()( Type_t& res )
// res and u could be aliases if OP permits it
@@ -22,7 +28,7 @@ template<class Domain>
template<class BINOP>
inline void VectorDom<Domain,Dense>::
map( Rep& res, const BINOP& OP, const Rep& u, const Rep& v ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)) && (dim(u) == dim(v)), "Bad size");
size_t sz = dim(res);
for (size_t i=0; i<sz; ++i)
@@ -33,7 +39,7 @@ template<class Domain>
template<class UNOP>
inline void VectorDom<Domain,Dense>::
map( Rep& res, UNOP& OP, const Rep& u ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)), "Bad size");
size_t sz = dim(u);
for (size_t i=0; i<sz; ++i)
@@ -72,7 +78,7 @@ inline void VectorDom<Domain,Dense>::mul
// --- add
template<class Domain>
inline void VectorDom<Domain,Dense>::addin( Rep& res, const Rep& u ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)), "Bad size");
AddOp<Domain> opcode( _domain );
map( res, opcode, u );
@@ -81,7 +87,7 @@ inline void VectorDom<Domain,Dense>::addin( Rep& res, const Rep& u ) const
template<class Domain>
inline void VectorDom<Domain,Dense>::add
( Rep& res, const Rep& u, const Rep& v ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)) && (dim(u) == dim(v)), "Bad size");
AddOp<Domain> opcode (_domain);
map( res, opcode, u, v);
@@ -90,7 +96,7 @@ inline void VectorDom<Domain,Dense>::add
template<class Domain>
inline void VectorDom<Domain,Dense>::add
( Rep& res, const Rep& u, const Type_t& val ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)), "Bad size");
Curried2<AddOp<Domain> > opcode(_domain, (Type_t&)val);
map( res, opcode, u);
@@ -99,14 +105,14 @@ inline void VectorDom<Domain,Dense>::add
template<class Domain>
inline void VectorDom<Domain,Dense>::add
( Rep& res, const Type_t& val, const Rep& v ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(v)), "Bad size");
Curried1<AddOp<Domain> > opcode(_domain, val);
map( res, opcode, v);
}
template<class Domain>
-inline void VectorDom<Domain,Dense>::add
+inline void VectorDom<Domain,Dense>::add
( Rep& res, const VectorDom<Domain,Sparse>::Rep& u, const Rep& v ) const
{
GIVARO_ASSERT((dim(res) == dim(v)) && (dim(v) == u.dim()), "Bad size");
@@ -116,7 +122,7 @@ inline void VectorDom<Domain,Dense>::add
}
template<class Domain>
-inline void VectorDom<Domain,Dense>::add
+inline void VectorDom<Domain,Dense>::add
( Rep& res, const Rep& v, const VectorDom<Domain,Sparse>::Rep& u ) const
{
GIVARO_ASSERT((dim(res) == dim(v)) && (dim(v) == u.dim()), "Bad size");
@@ -126,7 +132,7 @@ inline void VectorDom<Domain,Dense>::add
}
template<class Domain>
-inline void VectorDom<Domain,Dense>::addin
+inline void VectorDom<Domain,Dense>::addin
( Rep& res, const VectorDom<Domain,Sparse>::Rep& u ) const
{
GIVARO_ASSERT((dim(res) == u.dim()), "Bad size");
@@ -146,7 +152,7 @@ inline void VectorDom<Domain,Dense>::addin
// --- sub
template<class Domain>
inline void VectorDom<Domain,Dense>::subin( Rep& res, const Rep& u ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)), "Bad size");
SubOp<Domain> opcode ( _domain );
map( res, opcode, u );
@@ -154,7 +160,7 @@ inline void VectorDom<Domain,Dense>::subin( Rep& res, const Rep& u ) const
template<class Domain>
inline void VectorDom<Domain,Dense>::sub( Rep& res, const Rep& u, const Rep& v ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(v)) && (dim(v) == dim(u)), "Bad size");
SubOp<Domain> opcode ( _domain );
map( res, opcode, u, v);
@@ -162,7 +168,7 @@ inline void VectorDom<Domain,Dense>::sub( Rep& res, const Rep& u, const Rep& v )
template<class Domain>
inline void VectorDom<Domain,Dense>::sub( Rep& res, const Rep& u, const Type_t& val ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)), "Bad size");
Curried2<SubOp<Domain> > opcode( _domain, (Type_t&)val);
map( res, opcode, u);
@@ -170,14 +176,14 @@ inline void VectorDom<Domain,Dense>::sub( Rep& res, const Rep& u, const Type_t&
template<class Domain>
inline void VectorDom<Domain,Dense>::sub( Rep& res, const Type_t& val, const Rep& v ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(v)), "Bad size");
Curried1<SubOp<Domain> > opcode( _domain, val);
map( res, opcode, v);
}
template<class Domain>
-inline void VectorDom<Domain,Dense>::subin
+inline void VectorDom<Domain,Dense>::subin
( Rep& res, const VectorDom<Domain,Sparse>::Rep& u ) const
{
GIVARO_ASSERT((dim(res) == u.dim()), "Bad size");
@@ -193,17 +199,17 @@ inline void VectorDom<Domain,Dense>::subin
}
template<class Domain>
-inline void VectorDom<Domain,Dense>::sub
+inline void VectorDom<Domain,Dense>::sub
( Rep& res, const VectorDom<Domain,Sparse>::Rep& u, const Rep& v ) const
{
GIVARO_ASSERT((dim(res) == dim(v)) && (dim(v) == u.dim()), "Bad size");
// -- here assume : subdomains of res, u and v are equal
- neg(res, v);
+ neg(res, v);
addin(res, u);
}
template<class Domain>
-inline void VectorDom<Domain,Dense>::sub
+inline void VectorDom<Domain,Dense>::sub
( Rep& res, const Rep& v, const VectorDom<Domain,Sparse>::Rep& u ) const
{
GIVARO_ASSERT((dim(res) == dim(v)) && (dim(v) == u.dim()), "Bad size");
@@ -218,56 +224,56 @@ inline void VectorDom<Domain,Dense>::sub
// --- neg
template<class Domain>
inline void VectorDom<Domain,Dense>::negin( Rep& res ) const
-{
+{
NegOp<Domain> opcode ( _domain );
map( res, opcode, res );
}
template<class Domain>
inline void VectorDom<Domain,Dense>::neg( Rep& res, const Rep& u ) const
-{
+{
GIVARO_ASSERT((dim(res) == dim(u)), "Bad size");
NegOp<Domain> opcode ( _domain );
map( res, opcode, u );
}
template<class Domain>
-void VectorDom<Domain,Dense>::axpy
+void VectorDom<Domain,Dense>::axpy
( Rep& res, const Type_t& a, const Rep& x, const Rep& y ) const
{
GIVARO_ASSERT((dim(res) == dim(x)) && (dim(x) == dim(y)), "Bad size");
size_t sz = dim(res);
- for ( size_t i=0; i<sz; ++i )
+ for ( size_t i=0; i<sz; ++i )
_domain.axpy(res[i], a, x[i], y[i]);
}
template<class Domain>
-void VectorDom<Domain,Dense>::axpyin
+void VectorDom<Domain,Dense>::axpyin
( Rep& res, const Type_t& a, const Rep& x ) const
{
GIVARO_ASSERT((dim(res) == dim(x)), "Bad size");
size_t sz = dim(res);
- for ( size_t i=0; i<sz; ++i )
+ for ( size_t i=0; i<sz; ++i )
_domain.axpyin(res[i], a, x[i]);
}
template<class Domain>
-void VectorDom<Domain,Dense>::axmy
+void VectorDom<Domain,Dense>::axmy
( Rep& res, const Type_t& a, const Rep& x, const Rep& y ) const
{
GIVARO_ASSERT((dim(res) == dim(x)) && (dim(x) == dim(y)), "Bad size");
size_t sz = dim(res);
- for ( size_t i=0; i<sz; ++i )
+ for ( size_t i=0; i<sz; ++i )
_domain.axmy(res[i], a, x[i], y[i]);
}
template<class Domain>
-void VectorDom<Domain,Dense>::axmyin
+void VectorDom<Domain,Dense>::axmyin
( Rep& res, const Type_t& a, const Rep& x ) const
{
GIVARO_ASSERT((dim(res) == dim(x)), "Bad size");
size_t sz = dim(res);
- for ( size_t i=0; i<sz; ++i )
+ for ( size_t i=0; i<sz; ++i )
_domain.axmyin(res[i], a, x[i]);
}
@@ -328,7 +334,7 @@ inline void VectorDom<Domain,Dense>::dot
// ==========================================================================
//
-// -- Write the domain
+// -- Write the domain
//
template<class Domain>
ostream& VectorDom<Domain, Dense>::write( ostream& o ) const
@@ -336,11 +342,11 @@ ostream& VectorDom<Domain, Dense>::write( ostream& o ) const
return _domain.write(o << "(") << ",Dense)";
}
-// -- read the domain
+// -- read the domain
template<class Domain>
istream& VectorDom<Domain, Dense>::read( istream& sin )
{
- char ch;
+ char ch;
sin >> std::ws >> ch;
if (ch != '(')
GivError::throw_error(
@@ -403,7 +409,7 @@ istream& VectorDom<Domain,Dense>::read (istream& fin, Rep& A) const
// -- Skip the first "white":
fin >> std::ws; fin.get(ch);
- if (ch != '[')
+ if (ch != '[')
GivError::throw_error(
GivBadFormat("VectorDom<Domain,Dense>::read: syntax error no '['"));
@@ -417,7 +423,7 @@ istream& VectorDom<Domain,Dense>::read (istream& fin, Rep& A) const
rep[0] = Tmp;
while (ch != ']')
{
- if (ch != ',')
+ if (ch != ',')
GivError::throw_error(
GivBadFormat("VectorDom<T,Dense>::read: syntax error no ','"));
i++;
@@ -431,5 +437,5 @@ istream& VectorDom<Domain,Dense>::read (istream& fin, Rep& A) const
A.logcopy( rep );
return fin;
}
-
+} // Givaro
#include "givaro/givvectdensespe.inl"
diff --git a/src/library/vector/givvectdensespe.inl b/src/library/vector/givvectdensespe.inl
index b81f6ba..8b833b1 100644
--- a/src/library/vector/givvectdensespe.inl
+++ b/src/library/vector/givvectdensespe.inl
@@ -1,10 +1,16 @@
// ==========================================================================
// $Source
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// $Id
// ==========================================================================
+namespace Givaro {
+#warning "this file will probably not compile"
+
template<>
@@ -16,3 +22,5 @@ inline void VectorDom<ZpzDom<Std16>,Dense>::dot
domain.dotprod( res, sz, op1.baseptr(), op2.baseptr() );
}
+
+} // Givaro
diff --git a/src/library/vector/givvector.h b/src/library/vector/givvector.h
index b7b4b9d..268bd79 100644
--- a/src/library/vector/givvector.h
+++ b/src/library/vector/givvector.h
@@ -1,17 +1,20 @@
-#ifndef _GIV_VECTOR_H_
-#define _GIV_VECTOR_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/vector/givvector.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givvector.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: givvector.h,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// Description of dense vector over T with classic arithmetic operations
// over T (vector x vector, vector x T, scalar product, shift)
// Vector handle computation over sub part of continuous Elements of
// a vector as well as stride.
+#ifndef _GIV_VECTOR_H_
+#define _GIV_VECTOR_H_
#include "givaro/giverror.h"
#include "givaro/givarray0.h"
@@ -19,6 +22,10 @@
#include "givaro/giviterator.h"
#include "givaro/givops.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
+
// ==========================================================================
// --
@@ -32,6 +39,8 @@ template<class Domain, class StorageTag> class VectorDom {};
template<class Domain> class VectorDom<Domain,Dense>;
template<class Domain> class VectorDom<Domain,Sparse>;
+} // Givaro
+
#include "givaro/givvectorsparse.h"
#include "givaro/givvectordense.h"
// -- should be included in specialized class #include "givaro/givvectops.inl"
diff --git a/src/library/vector/givvectordense.inl b/src/library/vector/givvectordense.inl
index 9d767f5..b7f2c30 100644
--- a/src/library/vector/givvectordense.inl
+++ b/src/library/vector/givvectordense.inl
@@ -1,9 +1,16 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/vector/givvectordense.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givvectordense.inl,v 1.2 2005/05/03 13:21:22 jgdumas Exp $
+// $Id: givvectordense.inl,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
+namespace Givaro {
+#warning "this file will probably not compile"
+
+}// Givaro
diff --git a/src/library/vector/givvectorsparse.h b/src/library/vector/givvectorsparse.h
index e63d034..5b9a993 100644
--- a/src/library/vector/givvectorsparse.h
+++ b/src/library/vector/givvectorsparse.h
@@ -1,28 +1,34 @@
-#ifndef _GIV_VECTOR_SPARSE_H_
-#define _GIV_VECTOR_SPARSE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/vector/givvectorsparse.h,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givvectorsparse.h,v 1.2 2005/06/14 14:53:14 pernet Exp $
+// $Id: givvectorsparse.h,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
// Description:
// Description of sparse vector over T with classic arithmetic operations
// over T (vector x vector, vector x T, scalar product).
-// The storage for sparse vector are returned by
+// The storage for sparse vector are returned by
// - RetVectorStorage<T,Sparse>::Storage_t: that provide following
// properties:
// - iterator on the index domain iterates on increasing value
-// -
+// -
+#ifndef _GIV_VECTOR_SPARSE_H_
+#define _GIV_VECTOR_SPARSE_H_
#include "givaro/givvector.h"
#include "givaro/givstoragesparse.h"
#include "givaro/givelem.h"
+namespace Givaro {
+#warning "this file will probably not compile"
+
template<class Domain>
-class VectorDom<Domain, Sparse> {
+class VectorDom<Domain, Sparse> {
Domain _domain; // domain of the entries
public :
// -- Exported types
@@ -37,27 +43,27 @@ public :
// -- Self_t
typedef VectorDom<Domain, Sparse> Self_t;
-
- // -- Dstor
+
+ // -- Dstor
~VectorDom() {}
- // -- Cstor of a new vector of size s Elements
+ // -- Cstor of a new vector of size s Elements
VectorDom( const Domain& D = Domain() ) : _domain(D) {}
// -- Cstor of recopy
VectorDom(const Self_t& V) : _domain(V._domain) {}
-
- int operator==( const VectorDom<Domain,Sparse>& BC) const
+
+ int operator==( const VectorDom<Domain,Sparse>& BC) const
{ return _domain == BC._domain;}
- int operator!=( const VectorDom<Domain,Sparse>& BC) const
+ int operator!=( const VectorDom<Domain,Sparse>& BC) const
{ return _domain != BC._domain;}
- // -- assignment operator: from a vector
+ // -- assignment operator: from a vector
void init ( Rep& r, size_t dim =0) const
{ r.allocate(dim,0); }
- // -- assignment operator: from a vector
- void assign (Rep& r, const Rep& v)
+ // -- assignment operator: from a vector
+ void assign (Rep& r, const Rep& v)
{
r.copy(v);
}
@@ -89,13 +95,13 @@ public :
void neg ( Rep& res, const Rep& u ) const;
// -- Compression method to compact a dense vector
- void compact( Rep& u, const VectorDom<Domain, Dense>& VDom,
+ void compact( Rep& u, const VectorDom<Domain, Dense>& VDom,
const typename VectorDom<Domain, Dense>::Rep& v ) const;
// -- Compression method to compact a sparse vector
- void compact( Rep& u, const VectorDom<Domain, Sparse>& VDom,
+ void compact( Rep& u, const VectorDom<Domain, Sparse>& VDom,
const typename VectorDom<Domain, Sparse>::Rep& v ) const;
-
+
template<class UNOP>
void map( Rep& r, const UNOP& op, const Rep& u) const;
@@ -111,7 +117,7 @@ public :
istream& read ( istream& i, Rep& r ) const;
- // -- Iteration over a sparse vector:
+ // -- Iteration over a sparse vector:
typedef typename RetVectorStorage<Type_t,Sparse>::Iterator_t Iterator_t;
typedef typename RetVectorStorage<Type_t,Sparse>::constIterator_t constIterator_t;
typedef typename RetVectorStorage<Type_t,Sparse>::IndiceIterator_t IndiceIterator_t;
@@ -124,4 +130,5 @@ public :
IndiceIterator_t end_indice ( const Rep& U ) const { return U.end_indice(); }
};
+} //Givaro
#endif
diff --git a/src/library/vector/givvectorsparse.inl b/src/library/vector/givvectorsparse.inl
index 37fbdca..5d03db6 100644
--- a/src/library/vector/givvectorsparse.inl
+++ b/src/library/vector/givvectorsparse.inl
@@ -1,9 +1,16 @@
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/vector/givvectorsparse.inl,v $
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
-// $Id: givvectorsparse.inl,v 1.2 2005/05/03 13:21:22 jgdumas Exp $
+// $Id: givvectorsparse.inl,v 1.3 2009-09-17 14:28:23 jgdumas Exp $
// ==========================================================================
+namespace Givaro {
+#warning "this file will probably not compile"
+
+} //Givaro
diff --git a/src/library/vector/givvectsparseops.inl b/src/library/vector/givvectsparseops.inl
index 573e516..24a8c7f 100644
--- a/src/library/vector/givvectsparseops.inl
+++ b/src/library/vector/givvectsparseops.inl
@@ -1,18 +1,24 @@
// ==========================================================================
// $Source
-// Copyright(c)'94-97 by Givaro Team
-// see the copyright file.
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
// Authors: T. Gautier
// $Id
// ==========================================================================
+namespace Givaro {
+#warning "this file will probably not compile"
+
template<class Domain>
template<class UNOP>
inline void VectorDom<Domain,Sparse>::
map( Rep& res, const UNOP& OP, const Rep& u ) const
-{
+{
res.copy(u);
size_t sz = res.size();
for (size_t i=0; i<sz; ++i)
@@ -54,7 +60,7 @@ int VectorDom<Domain,Sparse>::iszero ( const Rep& P ) const
{
size_t d;
if ((d =dim(P)) == 0) return 1;
- for (size_t i=0; i<d; ++i)
+ for (size_t i=0; i<d; ++i)
if (!_domain.iszero(P._data[i])) return 0;
return 1;
}
@@ -64,19 +70,19 @@ int VectorDom<Domain,Sparse>::iszero ( const Rep& P ) const
// -- Compression method to compact a dense vector
// --
template<class Domain>
-void VectorDom<Domain,Sparse>::compact (
- Rep& u,
- const VectorDom<Domain, Dense>& VDom,
+void VectorDom<Domain,Sparse>::compact (
+ Rep& u,
+ const VectorDom<Domain, Dense>& VDom,
const typename VectorDom<Domain, Dense>::Rep& v ) const
{
size_t dim = VDom.dim(v);
- u.allocate(dim, 0);
+ u.allocate(dim, 0);
Indice_t pos_next =0;
for (size_t i=0; i< dim; ++i)
{
if ( !_domain.iszero(v[i]) ) {
u.reallocate( dim, pos_next + 1 );
- u._index[pos_next] = i;
+ u._index[pos_next] = i;
_domain.assign(u._data[pos_next], v[i]);
++pos_next;
}
@@ -87,12 +93,12 @@ void VectorDom<Domain,Sparse>::compact (
// -- Compression method to compact a sparse vector
// --
template<class Domain>
-void VectorDom<Domain,Sparse>::compact (
- Rep& u,
- const VectorDom<Domain, Sparse>& VDom,
+void VectorDom<Domain,Sparse>::compact (
+ Rep& u,
+ const VectorDom<Domain, Sparse>& VDom,
const typename VectorDom<Domain, Sparse>::Rep& v ) const
{
- u.copy(v);
+ u.copy(v);
}
@@ -106,9 +112,9 @@ inline void VectorDom<Domain,Sparse>::dot
for ( long i =op1size-1, j=op2size-1; (i >=0) && (j >=0); ) {
long diff = op1._index[i] - op2._index[j];
if (diff >0) --i;
- else if (diff <0) --j;
+ else if (diff <0) --j;
else domain.axpy(res, op1._data[i--], op2._data[j--], res );
- }
+ }
}
template<class Domain>
@@ -124,19 +130,19 @@ inline void VectorDom<Domain,Sparse>::add
if (diff <0) {
res._index[curr] = op1._index[i];
_domain.assign(res._data[curr],op1._data[i]);
- ++i;
+ ++i;
if (!_domain.iszero(res._data[curr])) ++curr;
}
else if (diff >0) {
res._index[curr] = op2._index[j];
_domain.assign(res._data[curr],op2._data[j]);
- ++j;
+ ++j;
if (!_domain.iszero(res._data[curr])) ++curr;
}
else {
res._index[curr] = op1._index[i];
_domain.add(res._data[curr], op1._data[i], op2._data[j]);
- ++i; ++j;
+ ++i; ++j;
if (!_domain.iszero(res._data[curr])) ++curr;
}
}
@@ -206,40 +212,40 @@ inline void VectorDom<Domain,Sparse>::sub
template<class Domain>
-inline void VectorDom<Domain,Sparse>::addin
+inline void VectorDom<Domain,Sparse>::addin
( Rep& res, const Rep& u ) const
-{ Rep tmp; init( tmp ); add(tmp, res, u); assign(res, tmp); }
+{ Rep tmp; init( tmp ); add(tmp, res, u); assign(res, tmp); }
template<class Domain>
-inline void VectorDom<Domain,Sparse>::add
+inline void VectorDom<Domain,Sparse>::add
( Rep& res, const Rep& u, const Type_t& val ) const
-{
+{
Curried2<AddOp<Domain> > opcode(_domain, val);
map( res, opcode, u);
}
template<class Domain>
inline void VectorDom<Domain,Sparse>::add ( Rep& res, const Type_t& val, const Rep& v ) const
-{
+{
Curried1<AddOp<Domain> > opcode(_domain, val);
map( res, opcode, u);
}
template<class Domain>
-inline void VectorDom<Domain,Sparse>::subin
+inline void VectorDom<Domain,Sparse>::subin
( Rep& res, const Rep& u ) const
-{ Rep tmp; init( tmp ); sub(tmp, res, u); assign(res, tmp); }
+{ Rep tmp; init( tmp ); sub(tmp, res, u); assign(res, tmp); }
template<class Domain>
inline void VectorDom<Domain,Sparse>::sub ( Rep& res, const Rep& u, const Type_t& val ) const
-{
+{
Curried2<SubOp<Domain> > opcode(_domain, val);
map( res, opcode, u);
}
template<class Domain>
inline void VectorDom<Domain,Sparse>::sub ( Rep& res, const Type_t& val, const Rep& v ) const
-{
+{
Curried2<SubOp<Domain> > opcode(_domain, val);
map( res, opcode, u);
}
@@ -260,21 +266,21 @@ inline void VectorDom<Domain,Sparse>::neg ( Rep& res, const Rep& u ) const
-
+
// ==========================================================================
//
-// -- Write the domain
+// -- Write the domain
template<class Domain>
ostream& VectorDom<Domain, Sparse>::write( ostream& o ) const
{
return _domain.write(o << '(') << ",Sparse)";
}
-// -- read the domain
+// -- read the domain
template<class Domain>
istream& VectorDom<Domain, Sparse>::read( istream& sin )
{
- char ch;
+ char ch;
sin >> std::ws >> ch;
if (ch != '(')
GivError::throw_error(
@@ -346,30 +352,30 @@ istream& VectorDom<Domain,Sparse>::read (istream& fin, Rep& V) const
// -- Skip the first blanks:
fin >> std::ws; fin.get(ch);
- if (ch != '[')
+ if (ch != '[')
GivError::throw_error(
GivBadFormat("VectorDom<Domain,Sparse>::read: syntax error no '['"));
// -- Read the size of != 0 Element of the rep
- size_t size;
+ size_t size;
fin >> std::ws >> size;
// -- read ,
fin >> std::ws; fin.get(ch);
- if (ch != ',')
+ if (ch != ',')
GivError::throw_error(
GivBadFormat("VectorDom<Domain,Sparse>::read: syntax error no ','"));
// -- read [
fin >> std::ws; fin.get(ch);
- if (ch != '[')
+ if (ch != '[')
GivError::throw_error(
GivBadFormat("VectorDom<Domain,Sparse>::read: syntax error no ']'"));
// -- read the size pairs
- size_t i;
+ size_t i;
V.allocate(size, size);
- for (i=0; i<size-1; ++i)
+ for (i=0; i<size-1; ++i)
{
Pair<Indice_t, Type_t> p;
fin >> p;
@@ -378,7 +384,7 @@ istream& VectorDom<Domain,Sparse>::read (istream& fin, Rep& V) const
// -- read ,
fin >> std::ws; fin.get(ch);
- if (ch != ',')
+ if (ch != ',')
GivError::throw_error(
GivBadFormat("VectorDom<Domain,Sparse>::read: syntax error no ','"));
}
@@ -392,16 +398,18 @@ istream& VectorDom<Domain,Sparse>::read (istream& fin, Rep& V) const
// -- read ]
fin >> std::ws; fin.get(ch);
- if (ch != ']')
+ if (ch != ']')
GivError::throw_error(
GivBadFormat("VectorDom<Domain,Sparse>::read: syntax error no ']'"));
// -- read ]
- // - read the last characters:
+ // - read the last characters:
fin >> std::ws; fin.get(ch);
- if (ch != ']')
+ if (ch != ']')
GivError::throw_error(
GivBadFormat("operator>><Vector<T,Sparse> >: syntax error no ']'"));
return fin;
}
+
+} // Givaro
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..9b86bfd
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,56 @@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
+
+SUBDIRS =
+check: $(BASE_TESTS)
+
+AM_CPPFLAGS=-I$(top_srcdir)
+AM_CXXFLAGS = @TESTS_CFLAGS@
+AM_CPPFLAGS += $(OPTFLAGS) $(GMP_CFLAGS) -I$(top_srcdir)/src/kernel/system -I$(top_srcdir)/src/kernel/memory -I$(top_srcdir)/src/kernel/zpz -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel -I$(top_srcdir)/src/library/poly1 -I$(top_srcdir)/src/kernel/bstruct -I$(top_srcdir)/src/library/tools
+
+LDADD = $(OPTLINKS) -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS=-static
+
+BASIC_TESTS = \
+ test-random \
+ test-ifactor \
+ test-ffarith \
+ test-ringarith \
+ test-mod \
+ test-modsqroot \
+ test-trunc \
+ test-crt \
+ test-geom \
+ test-integer \
+ test-ratrecon
+
+CLEANFILES = \
+ $(BASIC_TESTS)
+
+EXTRA_PROGRAMS = \
+ $(BASIC_TESTS)
+
+TESTS = \
+ $(BASIC_TESTS)
+
+
+test_random_SOURCES = test-random.C
+test_ifactor_SOURCES = test-ifactor.C
+test_ffarith_SOURCES = test-ffarith.C
+test_ringarith_SOURCES= test-ringarith.C
+test_mod_SOURCES = test-mod.C
+test_modsqroot_SOURCES= test-modsqroot.C
+test_trunc_SOURCES = test-trunc.C
+test_crt_SOURCES = test-crt.C
+test_geom_SOURCES = test-geom.C
+test_integer_SOURCES = test-integer.C
+test_ratrecon_SOURCES = test-ratrecon.C
+
+
+# for compilation of new tests
+GIVARO_BIN=@bindir@
+%:%.C
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
diff --git a/src/Makefile.in b/tests/Makefile.in
similarity index 54%
copy from src/Makefile.in
copy to tests/Makefile.in
index 074ceb0..f488245 100644
--- a/src/Makefile.in
+++ b/tests/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.3 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.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -14,6 +15,11 @@
@SET_MAKE@
+# Copyright(c)'1994-2009 by The Givaro group
+# This file is part of Givaro.
+# Givaro is governed by the CeCILL-B license under French law
+# and abiding by the rules of distribution of free software.
+# see the COPYRIGHT file for more details.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -32,40 +38,79 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-subdir = src
+EXTRA_PROGRAMS = $(am__EXEEXT_1)
+TESTS = $(am__EXEEXT_1)
+subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \
$(top_srcdir)/macros/config-header.m4 \
- $(top_srcdir)/macros/gmp-check.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/macros/debug.m4 \
+ $(top_srcdir)/macros/givaro-doc.m4 \
+ $(top_srcdir)/macros/gmp-check.m4 \
+ $(top_srcdir)/macros/libtool.m4 \
+ $(top_srcdir)/macros/ltoptions.m4 \
+ $(top_srcdir)/macros/ltsugar.m4 \
+ $(top_srcdir)/macros/ltversion.m4 \
+ $(top_srcdir)/macros/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-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)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libgivaro_la_DEPENDENCIES = kernel/gmp++/libgmppp.la \
- kernel/bstruct/libgivbstruct.la \
- kernel/integer/libgivinteger.la kernel/memory/libgivmemory.la \
- kernel/rational/libgivrational.la \
- kernel/system/libgivsystem.la kernel/zpz/libgivzpz.la \
- library/tools/libgivtools.la library/poly1/libgivpoly1.la
-am_libgivaro_la_OBJECTS = dummy.lo
-libgivaro_la_OBJECTS = $(am_libgivaro_la_OBJECTS)
-libgivaro_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(libgivaro_la_LDFLAGS) $(LDFLAGS) -o $@
+am__EXEEXT_1 = test-random$(EXEEXT) test-ifactor$(EXEEXT) \
+ test-ffarith$(EXEEXT) test-ringarith$(EXEEXT) \
+ test-mod$(EXEEXT) test-modsqroot$(EXEEXT) test-trunc$(EXEEXT) \
+ test-crt$(EXEEXT) test-geom$(EXEEXT) test-integer$(EXEEXT) \
+ test-ratrecon$(EXEEXT)
+am_test_crt_OBJECTS = test-crt.$(OBJEXT)
+test_crt_OBJECTS = $(am_test_crt_OBJECTS)
+test_crt_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+test_crt_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_ffarith_OBJECTS = test-ffarith.$(OBJEXT)
+test_ffarith_OBJECTS = $(am_test_ffarith_OBJECTS)
+test_ffarith_LDADD = $(LDADD)
+test_ffarith_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_geom_OBJECTS = test-geom.$(OBJEXT)
+test_geom_OBJECTS = $(am_test_geom_OBJECTS)
+test_geom_LDADD = $(LDADD)
+test_geom_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_ifactor_OBJECTS = test-ifactor.$(OBJEXT)
+test_ifactor_OBJECTS = $(am_test_ifactor_OBJECTS)
+test_ifactor_LDADD = $(LDADD)
+test_ifactor_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_integer_OBJECTS = test-integer.$(OBJEXT)
+test_integer_OBJECTS = $(am_test_integer_OBJECTS)
+test_integer_LDADD = $(LDADD)
+test_integer_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_mod_OBJECTS = test-mod.$(OBJEXT)
+test_mod_OBJECTS = $(am_test_mod_OBJECTS)
+test_mod_LDADD = $(LDADD)
+test_mod_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_modsqroot_OBJECTS = test-modsqroot.$(OBJEXT)
+test_modsqroot_OBJECTS = $(am_test_modsqroot_OBJECTS)
+test_modsqroot_LDADD = $(LDADD)
+test_modsqroot_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_random_OBJECTS = test-random.$(OBJEXT)
+test_random_OBJECTS = $(am_test_random_OBJECTS)
+test_random_LDADD = $(LDADD)
+test_random_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_ratrecon_OBJECTS = test-ratrecon.$(OBJEXT)
+test_ratrecon_OBJECTS = $(am_test_ratrecon_OBJECTS)
+test_ratrecon_LDADD = $(LDADD)
+test_ratrecon_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_ringarith_OBJECTS = test-ringarith.$(OBJEXT)
+test_ringarith_OBJECTS = $(am_test_ringarith_OBJECTS)
+test_ringarith_LDADD = $(LDADD)
+test_ringarith_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_test_trunc_OBJECTS = test-trunc.$(OBJEXT)
+test_trunc_OBJECTS = $(am_test_trunc_OBJECTS)
+test_trunc_LDADD = $(LDADD)
+test_trunc_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+depcomp =
+am__depfiles_maybe =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -75,8 +120,18 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(libgivaro_la_SOURCES)
-DIST_SOURCES = $(libgivaro_la_SOURCES)
+SOURCES = $(test_crt_SOURCES) $(test_ffarith_SOURCES) \
+ $(test_geom_SOURCES) $(test_ifactor_SOURCES) \
+ $(test_integer_SOURCES) $(test_mod_SOURCES) \
+ $(test_modsqroot_SOURCES) $(test_random_SOURCES) \
+ $(test_ratrecon_SOURCES) $(test_ringarith_SOURCES) \
+ $(test_trunc_SOURCES)
+DIST_SOURCES = $(test_crt_SOURCES) $(test_ffarith_SOURCES) \
+ $(test_geom_SOURCES) $(test_ifactor_SOURCES) \
+ $(test_integer_SOURCES) $(test_mod_SOURCES) \
+ $(test_modsqroot_SOURCES) $(test_random_SOURCES) \
+ $(test_ratrecon_SOURCES) $(test_ringarith_SOURCES) \
+ $(test_trunc_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -98,26 +153,27 @@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
-CCDEPMODE = @CCDEPMODE@
+CCNAM = @CCNAM@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
+DBG = @DBG@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
DEFS = @DEFS@
-DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GIVARO_DOC_PATH = @GIVARO_DOC_PATH@
GMP_CFLAGS = @GMP_CFLAGS@
GMP_LIBS = @GMP_LIBS@
GMP_VERSION = @GMP_VERSION@
@@ -127,40 +183,50 @@ 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@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+TESTS_CFLAGS = @TESTS_CFLAGS@
VERSION = @VERSION@
+WARN = @WARN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
@@ -200,18 +266,51 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)
-SUBDIRS = kernel library
-lib_LTLIBRARIES = libgivaro.la
-libgivaro_la_SOURCES = dummy.C
-libgivaro_la_LIBADD = \
- kernel/gmp++/libgmppp.la kernel/bstruct/libgivbstruct.la kernel/integer/libgivinteger.la kernel/memory/libgivmemory.la kernel/rational/libgivrational.la kernel/system/libgivsystem.la kernel/zpz/libgivzpz.la library/tools/libgivtools.la library/poly1/libgivpoly1.la
-
-
-# soname of libgivaro
-libgivaro_la_LDFLAGS = -version-info 0:2:0
+SUBDIRS =
+AM_CPPFLAGS = -I$(top_srcdir) $(OPTFLAGS) $(GMP_CFLAGS) \
+ -I$(top_srcdir)/src/kernel/system \
+ -I$(top_srcdir)/src/kernel/memory \
+ -I$(top_srcdir)/src/kernel/zpz \
+ -I$(top_srcdir)/src/kernel/integer -I$(top_srcdir)/src/kernel \
+ -I$(top_srcdir)/src/library/poly1 \
+ -I$(top_srcdir)/src/kernel/bstruct \
+ -I$(top_srcdir)/src/library/tools
+AM_CXXFLAGS = @TESTS_CFLAGS@
+LDADD = $(OPTLINKS) -L${top_srcdir}/src -L${top_srcdir}/src/.libs -lgivaro $(GMP_LIBS)
+AM_LDFLAGS = -static
+BASIC_TESTS = \
+ test-random \
+ test-ifactor \
+ test-ffarith \
+ test-ringarith \
+ test-mod \
+ test-modsqroot \
+ test-trunc \
+ test-crt \
+ test-geom \
+ test-integer \
+ test-ratrecon
+
+CLEANFILES = \
+ $(BASIC_TESTS)
+
+test_random_SOURCES = test-random.C
+test_ifactor_SOURCES = test-ifactor.C
+test_ffarith_SOURCES = test-ffarith.C
+test_ringarith_SOURCES = test-ringarith.C
+test_mod_SOURCES = test-mod.C
+test_modsqroot_SOURCES = test-modsqroot.C
+test_trunc_SOURCES = test-trunc.C
+test_crt_SOURCES = test-crt.C
+test_geom_SOURCES = test-geom.C
+test_integer_SOURCES = test-integer.C
+test_ratrecon_SOURCES = test-ratrecon.C
+
+# for compilation of new tests
+GIVARO_BIN = @bindir@
all: all-recursive
.SUFFIXES:
@@ -220,14 +319,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps tests/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
+ $(AUTOMAKE) --gnu --ignore-deps tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -245,35 +344,39 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-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
-libgivaro.la: $(libgivaro_la_OBJECTS) $(libgivaro_la_DEPENDENCIES)
- $(libgivaro_la_LINK) -rpath $(libdir) $(libgivaro_la_OBJECTS) $(libgivaro_la_LIBADD) $(LIBS)
+test-crt$(EXEEXT): $(test_crt_OBJECTS) $(test_crt_DEPENDENCIES)
+ @rm -f test-crt$(EXEEXT)
+ $(CXXLINK) $(test_crt_OBJECTS) $(test_crt_LDADD) $(LIBS)
+test-ffarith$(EXEEXT): $(test_ffarith_OBJECTS) $(test_ffarith_DEPENDENCIES)
+ @rm -f test-ffarith$(EXEEXT)
+ $(CXXLINK) $(test_ffarith_OBJECTS) $(test_ffarith_LDADD) $(LIBS)
+test-geom$(EXEEXT): $(test_geom_OBJECTS) $(test_geom_DEPENDENCIES)
+ @rm -f test-geom$(EXEEXT)
+ $(CXXLINK) $(test_geom_OBJECTS) $(test_geom_LDADD) $(LIBS)
+test-ifactor$(EXEEXT): $(test_ifactor_OBJECTS) $(test_ifactor_DEPENDENCIES)
+ @rm -f test-ifactor$(EXEEXT)
+ $(CXXLINK) $(test_ifactor_OBJECTS) $(test_ifactor_LDADD) $(LIBS)
+test-integer$(EXEEXT): $(test_integer_OBJECTS) $(test_integer_DEPENDENCIES)
+ @rm -f test-integer$(EXEEXT)
+ $(CXXLINK) $(test_integer_OBJECTS) $(test_integer_LDADD) $(LIBS)
+test-mod$(EXEEXT): $(test_mod_OBJECTS) $(test_mod_DEPENDENCIES)
+ @rm -f test-mod$(EXEEXT)
+ $(CXXLINK) $(test_mod_OBJECTS) $(test_mod_LDADD) $(LIBS)
+test-modsqroot$(EXEEXT): $(test_modsqroot_OBJECTS) $(test_modsqroot_DEPENDENCIES)
+ @rm -f test-modsqroot$(EXEEXT)
+ $(CXXLINK) $(test_modsqroot_OBJECTS) $(test_modsqroot_LDADD) $(LIBS)
+test-random$(EXEEXT): $(test_random_OBJECTS) $(test_random_DEPENDENCIES)
+ @rm -f test-random$(EXEEXT)
+ $(CXXLINK) $(test_random_OBJECTS) $(test_random_LDADD) $(LIBS)
+test-ratrecon$(EXEEXT): $(test_ratrecon_OBJECTS) $(test_ratrecon_DEPENDENCIES)
+ @rm -f test-ratrecon$(EXEEXT)
+ $(CXXLINK) $(test_ratrecon_OBJECTS) $(test_ratrecon_LDADD) $(LIBS)
+test-ringarith$(EXEEXT): $(test_ringarith_OBJECTS) $(test_ringarith_DEPENDENCIES)
+ @rm -f test-ringarith$(EXEEXT)
+ $(CXXLINK) $(test_ringarith_OBJECTS) $(test_ringarith_LDADD) $(LIBS)
+test-trunc$(EXEEXT): $(test_trunc_OBJECTS) $(test_trunc_DEPENDENCIES)
+ @rm -f test-trunc$(EXEEXT)
+ $(CXXLINK) $(test_trunc_OBJECTS) $(test_trunc_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -281,28 +384,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dummy.Plo at am__quote@
-
.C.o:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+ $(CXXCOMPILE) -c -o $@ $<
.C.obj:
- at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.C.lo:
- at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -317,7 +406,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -342,7 +431,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -385,7 +474,7 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -440,6 +529,92 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -484,13 +659,11 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-recursive
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(libdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
@@ -508,6 +681,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -517,11 +691,9 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -532,6 +704,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -540,22 +714,31 @@ install-data-am:
install-dvi: install-dvi-recursive
-install-exec-am: install-libLTLIBRARIES
+install-dvi-am:
+
+install-exec-am:
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -572,27 +755,29 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-libLTLIBRARIES
+uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \
- distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-libLTLIBRARIES install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-libLTLIBRARIES
-
+ all all-am check check-TESTS check-am clean clean-generic \
+ clean-libtool ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+check: $(BASE_TESTS)
+%:%.C
+ $(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $*.C -o $* `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD) `$(GIVARO_BIN)/givaro-config --libs`
# 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/tests/test-crt.C b/tests/test-crt.C
new file mode 100644
index 0000000..0684364
--- /dev/null
+++ b/tests/test-crt.C
@@ -0,0 +1,195 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+/*! @file tests/test-crt.C
+ * @ingroup tests
+ * @brief NO DOC
+ */
+
+#include <iostream>
+#include <givaro/givintprime.h>
+#include <givaro/givmontg32.h>
+#include <givaro/givzpz.h>
+#include <givaro/givgfq.h>
+#include <givaro/givcra.h> // Chinese Remainder of two elements
+#include <givaro/givrns.h> // Chinese Remainder of an array of elements
+#include <givaro/givrnsfixed.h> // Chinese Remainder with fixed primes
+#include <givaro/givtimer.h>
+#include <givaro/givrandom.h>
+
+using namespace Givaro;
+
+typedef GFqDom<long> Field1;
+typedef ZpzDom<Std16> Field2;
+typedef ZpzDom<Log16> Field3;
+typedef ZpzDom<Std32> Field4;
+typedef ZpzDom<Std64> Field5;
+typedef ZpzDom<Unsigned32> Field6;
+typedef Montgomery<Std32> Field7;
+typedef ZpzDom<Integer> Field8;
+
+template <typename Field>
+Integer tmain(int argc, char ** argv, const GivRandom& generator)
+{
+ typedef RNSsystem<Integer, Field > CRTSystem;
+ typedef typename CRTSystem::domains Domains;
+ typedef typename CRTSystem::array Elements;
+ typedef typename CRTSystem::ring Ring;
+
+ typedef RNSsystemFixed<Integer> CRTSystemFixed;
+ typedef CRTSystemFixed::array Prime_t;
+
+ IntPrimeDom ID;
+ Integer a( generator() >>(argc>2?atoi(argv[2]):17) ), M(1), b;
+
+ Prime_t Primes( argc>1 ? atoi(argv[1]):15);
+ Domains PrimeDoms( Primes.size() );
+ Elements Moduli( Primes.size() );
+ Prime_t ModuliInts( Primes.size() );
+
+ typename Prime_t::iterator p = Primes.begin();
+ typename Domains::iterator i = PrimeDoms.begin();
+ typename Elements::iterator e = Moduli.begin();
+ typename Prime_t::iterator m = ModuliInts.begin();
+ for(; i != PrimeDoms.end(); ++i, ++e, ++p, ++m) {
+ *i = Field( ID.nextprimein( a ) );
+ *p = a;
+ // i->random( generator, *e );
+ i->init(*e, generator() );
+ i->convert(*m,*e);
+ M *= a;
+ }
+
+ CRTSystem CRT( PrimeDoms );
+
+ Timer tim; tim.clear(); tim.start();
+ CRT.RnsToRing( a, Moduli );
+ tim.stop();
+#ifdef GIVARO_DEBUG
+ Field(PrimeDoms.front()).write( std::cerr << tim << " using ") << std::endl;
+#endif
+
+#ifdef GIVARO_DEBUG
+ if (PrimeDoms.size() < 50) {
+ i = PrimeDoms.begin();
+ e = Moduli.begin();
+ for( ; i != PrimeDoms.end(); ++i, ++e)
+ i->write(std::cout << a << " mod " << i->characteristic() << " = ", *e) << ";" << std::endl;
+ }
+#endif
+
+ Timer timf;
+ timf.clear(); timf.start();
+ CRTSystemFixed CRTFixed( Primes );
+ timf.stop();
+#ifdef GIVARO_DEBUG
+ std::cerr << "CRTFixed init : " << timf << std::endl;
+#endif
+
+ timf.clear(); timf.start();
+ CRTFixed.RnsToRing( b, ModuliInts );
+ timf.stop();
+#ifdef GIVARO_DEBUG
+ std::cerr << "CRTFixed : " << timf << std::endl;
+#endif
+
+ // #ifdef GIVARO_DEBUG
+ if (a != b) {
+ std::cerr << "incoherency between normal : " << a
+ << " and fixed : " << b << std::endl;
+ return 0 ; // très peu probable que res=0 pour de vrai.
+ }
+ // #endif
+
+ Elements Verifs( Primes.size() );
+ CRT.RingToRns( Verifs, a );
+
+#ifdef GIVARO_DEBUG
+ typename Elements::const_iterator v = Verifs.begin();
+ i = PrimeDoms.begin();
+ e = Moduli.begin();
+ for( ; i != PrimeDoms.end(); ++i, ++e, ++v)
+ if (! i->areEqual(*e, *v) ) {
+ i->write( std::cerr << "incoherency within ") << std::endl;
+ break;
+ }
+#endif
+
+
+ Integer pr( generator() >>(argc>2?atoi(argv[2]):17) ), res;
+ Field F( ID.nextprimein(pr) );
+ typename Field::Element el;
+ F.init(el, generator() );
+
+ ChineseRemainder<IntPrimeDom, Field> CRA(ID, M, F);
+ CRA( res, a, el);
+
+#ifdef GIVARO_DEBUG
+ std::cout << res << " mod " << M << " = " << a << ";" << std::endl;
+ std::cout << res << " mod " << F.characteristic() << " = " << F.convert(a, el) << ";" << std::endl;
+#endif
+
+ return res;
+}
+
+
+
+int main(int argc, char ** argv)
+{
+ ::Givaro::GivaroMain::Init();
+ // argv[1] : number of primes
+ // argv[2] : 2^{32-j} is size of primes
+ // argv[3] : seed for generator
+
+ GivRandom seedor( argc>3 ? atoi(argv[3]): BaseTimer::seed() );
+ unsigned long seed = seedor.seed();
+
+
+ Integer a1 = tmain<Field1>(argc, argv, GivRandom(seed));
+ Integer a2 = tmain<Field2>(argc, argv, GivRandom(seed));
+ Integer a3 = tmain<Field3>(argc, argv, GivRandom(seed));
+ Integer a4 = tmain<Field4>(argc, argv, GivRandom(seed));
+ Integer a5 = tmain<Field5>(argc, argv, GivRandom(seed));
+ Integer a6 = tmain<Field6>(argc, argv, GivRandom(seed));
+ Integer a7 = tmain<Field7>(argc, argv, GivRandom(seed));
+ Integer a8 = tmain<Field8>(argc, argv, GivRandom(seed));
+
+ if (!(a1 & a2 & a3 & a4 & a5 & a6 & a7 & a8)) {
+#ifdef GIVARO_DEBUG
+ std::cerr << "one test failed" << std::endl;
+#endif
+ return false ;
+ }
+
+ bool success = true;
+ success &= (a1 == a2);
+ if (! success) std::cerr << "ERROR a1 != a2" << std::endl;
+ success &= (a3 == a4);
+ if (! success) std::cerr << "ERROR a3 != a4" << std::endl;
+ success &= (a6 == a5);
+ if (! success) std::cerr << "ERROR a5 != a6" << std::endl;
+ success &= (a7 == a8);
+ if (! success) std::cerr << "ERROR a7 != a8" << std::endl;
+ success &= (a1 == a3);
+ if (! success) std::cerr << "ERROR a1 != a3" << std::endl;
+ success &= (a5 == a7);
+ if (! success) std::cerr << "ERROR a5 != a7" << std::endl;
+ success &= (a1 == a5);
+ if (! success) std::cerr << "ERROR a1 != a5" << std::endl;
+
+
+
+#ifdef GIVARO_DEBUG
+ if (! success)
+ std::cerr << "Error: " << seed << std::endl;
+#endif
+
+ ::Givaro::GivaroMain::End();
+ return (! success);
+}
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/tests/test-ffarith.C b/tests/test-ffarith.C
new file mode 100644
index 0000000..fc26c57
--- /dev/null
+++ b/tests/test-ffarith.C
@@ -0,0 +1,398 @@
+// Copyright(c)'1994-2009,2010 by The Givaro group
+// This file is part of Givaro.
+// BB: adapted,enhanced from examples/FiniteFields/ff-arith.C
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#include <iostream>
+#include <givaro/givzpz64std.h>
+#include <givaro/givzpz.h>
+#include <givaro/givgfq.h>
+#include <givaro/givmontg32.h>
+#include <givaro/givgfqext.h>
+#include <givaro/givextension.h>
+
+using namespace Givaro;
+
+#define TESTE_EG( a, b ) \
+if (!F.areEqual((a),(b))) {\
+ std::cout << F.write(std::cout,a) << "!=" << F.write(std::cout,b) << " failed (at line " << __LINE__ << ")" << std::endl; \
+ return(-1); \
+}
+
+#define JETESTE( a, s ) \
+if (TestField( (a), int(s)) ) {\
+ std::cout << #a << " failed !" << std::endl;\
+ return -1 ; \
+}
+
+#define JEONETESTE( F, a, x ) \
+if (TestOneField(F,(int)a,(float)x)) {\
+ std::cout << #a << " failed !" << std::endl;\
+ return -1 ; \
+}
+
+template<class Field>
+int TestOneField(const Field& F, const int FIRSTINT, const float FIRSTFLOAT)
+{/*{{{*/
+#ifdef GIVARO_DEBUG
+ std::cerr << "testing " ;
+ F.write(std::cerr );
+ std::cerr << " (" << FIRSTINT << ',' << FIRSTFLOAT << ')';
+ std::cerr << " : " << std::flush;
+
+#endif
+
+
+
+ typename Field::Element a, b, c, d,a_,b_,c_,d_;
+ typename Field::Element e,e_;
+
+ F.init(a, 0UL);
+ TESTE_EG(a, F.zero);
+ F.init(a, 1UL);
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a: ", a) << std::endl;
+// F.write(std::cerr << "1: ", F.one) << std::endl;
+ TESTE_EG(a, F.one);
+
+ F.init(a, FIRSTINT);
+ F.init(b, FIRSTFLOAT);
+
+ F.init(c); // empty constructor
+ F.init(d); // empty constructor
+
+ F.add(c, a, b); // c = a+b
+ F.init(c_); //! @warning F.init(c_,c); ne marche pas !
+ F.assign(c_,c); // c_ <- c
+
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a: ", a) << std::endl;
+// F.write(std::cerr << "b: ", b) << std::endl;
+// F.write(std::cerr << "c: ", c) << std::endl;
+// F.write(std::cerr << "c_: ", c_) << std::endl;
+
+ TESTE_EG(c,c_);
+ F.subin(c_,a);
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a: ", a) << std::endl;
+// F.write(std::cerr << "b: ", b) << std::endl;
+// F.write(std::cerr << "c: ", c) << std::endl;
+// F.write(std::cerr << "c_: ", c_) << std::endl;
+
+ TESTE_EG(b,c_);
+
+ F.mul(c, a, b); // c = a*b
+ F.assign(c_,c); // c_ <- c
+ F.divin(c_,b); // c_ == a ?
+
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a: ", a) << std::endl;
+// F.write(std::cerr << "b: ", b) << std::endl;
+// F.write(std::cerr << "c: ", c) << std::endl;
+// F.write(std::cerr << "c_: ", c_) << std::endl;
+ TESTE_EG(a,c_);
+
+ F.axpy(d, a, b, c); // d = a*b + c;
+ F.init(d_);
+ F.axmy(d_,a,b,c); // d_ = a*b - c
+ F.addin(d_,c);
+ F.subin(d,c);
+
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a:=", a) << ';' << std::endl;
+// F.write(std::cerr << "b:=", b) << ';' << std::endl;
+// F.write(std::cerr << "c:=", c) << ';' << std::endl;
+// F.write(std::cerr << "d:=", d) << ';' << std::endl;
+// F.write(std::cerr << "d_:=", d_) << ';' << std::endl;
+ TESTE_EG(d_,d);
+
+ F.sub(d,a,b); // d = a -b
+ F.add(c,a,b); // c = a+b
+ F.init(e);
+ F.init(e_);
+ F.mul(e,d,c); // e = d*c;
+ F.mul(a_,a,a); // a_ = a*a
+ F.mul(b_,b,b); // b_ = b*b
+ F.sub(e_,a_,b_); // e_ = a_ - b_
+
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a:=", a) << ';' << std::endl;
+// F.write(std::cerr << "b:=", b) << ';' << std::endl;
+// F.write(std::cerr << "c:=", c) << ';' << std::endl;
+// F.write(std::cerr << "d:=", d) << ';' << std::endl;
+// F.write(std::cerr << "e:=", e) << ';' << std::endl;
+// F.write(std::cerr << "e_:=", e_) << ';' << std::endl;
+// F.write(std::cerr << "a_:=", a_) << ';' << std::endl;
+// F.write(std::cerr << "b_:=", b_) << ';' << std::endl;
+ TESTE_EG(e,e_) // a^2 - b^2 = (a-b)(a+b) ;)
+
+ // Four operations
+ F.init(a_);
+ F.assign(a_,a);
+ F.addin(a, b) ;
+ F.subin(a, b) ;
+ F.mulin(a, b) ;
+ F.divin(a, b) ;
+
+ TESTE_EG(a_,a);
+
+
+ F.maxpy(e, a, b, d); // e = d-a*b
+ F.assign(e_,d);
+ F.maxpyin(e_, a, b); // e = d - a*b;
+
+// F.write(std::cerr << "a:=", a) << ';' << std::endl;
+// F.write(std::cerr << "b:=", b) << ';' << std::endl;
+// F.write(std::cerr << "d:=", d) << ';' << std::endl;
+// F.write(std::cerr << "e:=", e) << ';' << std::endl;
+// F.write(std::cerr << "e_:=", e_) << ';' << std::endl;
+ TESTE_EG(e,e_);
+
+
+ F.axmy(e, a, b, d); // e = a*b -d;
+
+ F.assign(e_,d);
+ F.maxpyin(e_, a, b); // e = d - a*b;
+
+ F.negin(e_);
+
+ TESTE_EG(e,e_);
+
+
+ if ((unsigned) F.characteristic() != (unsigned)2) {
+ F.init(e,1);
+ F.init(a,22996);
+ F.inv(b,a);
+ F.mul(c,b,a);
+
+ TESTE_EG(e,c);
+
+ F.init(a,22996);
+ F.init(b,22996);
+ F.invin(a);
+ F.mulin(a,b);
+ }
+
+ TESTE_EG(e,a);
+
+ F.init(a,37403);
+ F.inv(b,a);
+ F.mul(c,b,a);
+
+ TESTE_EG(e,c);
+
+ F.init(a,37403);
+ F.init(b,37403);
+ F.invin(a);
+ F.mulin(a,b);
+
+ TESTE_EG(e,a);
+
+#ifdef GIVARO_DEBUG
+ F.write(std::cerr );
+ std::cerr << " done." << std::endl;
+#endif
+ return 0 ;
+
+}/*}}}*/
+
+#define NBITER 50
+
+template<class Field>
+int TestField(const Field& F, const int seed)
+{/*{{{*/
+ long ch = F.characteristic();
+ JEONETESTE(F,7UL,-29.3);
+ srand48(seed);
+ for(size_t i=0; i< NBITER; ++i) {
+ typename Field::Element x;
+ float d;
+ do {
+ d = float((double)ch*drand48());
+ F.init(x,d );
+ } while(F.isZero(x));
+ int a; do {
+ F.init(x, a = (int)lrand48());
+ } while(F.isZero(x));
+ JEONETESTE(F,a,d);
+ }
+ return 0;
+}/*}}}*/
+
+
+
+int main(int argc, char ** argv)
+{/*{{{*/
+ int seed = int (argc>1?atoi(argv[1]):BaseTimer::seed());
+#ifdef GIVARO_DEBUG
+ std::cerr << "seed: " << seed << std::endl;
+#endif
+ Integer::seeding(seed);
+
+
+#ifdef NDEBUG
+ assert(0);
+#endif
+
+ // modulo 13 over 16 bits
+ ZpzDom<Std16> C13(13);
+ JETESTE(C13,seed);
+
+ // modulo 13 over 32 bits
+ ZpzDom<Std32> Z13(13);
+ JETESTE(Z13,seed);
+
+ // modulo 13 over unsigned 32 bits
+ ZpzDom<Unsigned32> U13(13);
+ JETESTE(U13,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // modulo 13 over 64 bits
+ ZpzDom<Std64> LL13(13UL);
+ JETESTE(LL13,seed);
+#endif
+
+ // modulo 13 fully tabulated
+ ZpzDom<Log16> L13(13);
+ JETESTE(L13,seed);
+
+ // modulo 13 over 32 bits with Montgomery reduction
+ Montgomery<Std32> M13(13);
+ JETESTE(M13,seed);
+
+
+// Maximal values
+
+ // prime modulo max over 15 bits
+ ZpzDom<Std16> CUmax(16381);
+ JETESTE(CUmax,seed);
+
+ // prime modulo max fully tabulated
+ ZpzDom<Log16> Lmax(16381);
+ JETESTE(Lmax,seed);
+
+ // prime modulo max over 31 bits
+ ZpzDom<Std32> Zmax(46337);
+ JETESTE(Zmax,seed);
+
+ // prime modulo max over 32 bits
+ ZpzDom<Unsigned32> Umax(65521);
+ JETESTE(Umax,seed);
+
+ // prime modulo max over 32 bits with Montgomery reduction
+ Montgomery<Std32> Mmax(40499);
+ JETESTE(Mmax,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // prime modulo max over 63 bits
+ ZpzDom<Std64> LLmax(3037000493ULL);
+ JETESTE(LLmax,seed);
+#endif
+
+ // Zech log prime field with prime max
+ GFqDom<int> GFmax( 65521UL );
+ JETESTE(GFmax,seed);
+
+ // Zech log prime field with prime max (memory limited)
+ GFqDom<long long> GFLLmax( 4194301ULL );
+ JETESTE(GFLLmax,seed);
+
+
+// Characteristic 2
+
+
+ // modulo 2 over 16 bits
+ ZpzDom<Std16> C2(2);
+ JETESTE(C2,seed);
+
+ // modulo 2 over 32 bits
+ ZpzDom<Std32> Z2(2);
+ JETESTE(Z2,seed);
+
+ // modulo 2 over unsigned 32 bits
+ ZpzDom<Unsigned32> U2(2);
+ JETESTE(U2,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // modulo 2 over 64 bits
+ ZpzDom<Std64> LL2(2UL);
+ JETESTE(LL2,seed);
+#endif
+
+ // modulo 2 fully tabulated
+ ZpzDom<Log16> L2(2);
+ JETESTE(L2,seed);
+
+ ZpzDom<Log16> L2b( L2 );
+ JETESTE(L2b,seed);
+
+// Other Characteristics
+
+
+ // modulo 3 over 32 bits with Montgomery reduction
+ Montgomery<Std32> M2(3);
+ JETESTE(M2,seed);
+
+ Montgomery<Std32> M3(39989);
+ JETESTE(M3,seed);
+
+ // modulo 13 with primitive root representation
+ GFqDom<int> GF13( 13 );
+ JETESTE(GF13,seed);
+
+ // modulo 13 over arbitrary size
+ ZpzDom<Integer> IntZ13(13);
+ JETESTE(IntZ13,seed);
+
+ // Zech log finite field with 5^4 elements
+ GFqDom<int> GF625( 5, 4 );
+ JETESTE(GF625,seed);
+
+ // Zech log finite field with 3^4 elements
+ // Using the Q-adic Transform
+ GFqExt<int> GF81( 3, 4 );
+ JETESTE(GF81,seed);
+
+ // Zech log finite field with 2Mb tables
+#ifndef __GIVARO__DONOTUSE_longlong__
+ GFqDom<long long> GF2M( 2, 20 );
+#else
+ GFqDom<long> GF2M( 2, 20) ;
+#endif
+ JETESTE(GF2M,seed);
+
+#ifndef __GIVARO__DONOTUSE_longlong__
+ GFqDom<long long> GF2M1( 2, 2 );
+#else
+ GFqDom<long> GF2M1( 2, 2) ;
+#endif
+ JETESTE(GF2M1,seed);
+
+
+ Extension<> GF13E8(13,8);
+ JETESTE(GF13E8,seed);
+
+#ifndef __GIVARO__DONOTUSE_longlong__
+ GFqDom<long long> GF11e3( 11, 3 );
+ JETESTE(GF11e3,seed);
+ Extension<GFqDom<long long> > GF11e9(GF11e3,3);
+ JETESTE(GF11e9,seed);
+#else
+ GFqDom<long> GF11e3( 11, 3) ;
+ JETESTE(GF11e3,seed);
+ Extension<> GF11e9(GF11e3,3);
+ JETESTE(GF11e9,seed);
+#endif
+
+#ifdef GIVARO_DEBUG
+ std::cerr << std::endl ;
+#endif
+
+
+ return 0;
+}/*}}}*/
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/tests/test-geom.C b/tests/test-geom.C
new file mode 100644
index 0000000..f950ddc
--- /dev/null
+++ b/tests/test-geom.C
@@ -0,0 +1,196 @@
+// Copyright(c)'1994-2011 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// -------------------------------------------------------------
+// Time-stamp: <06 Apr 11 17:42:23 Jean-Guillaume.Dumas at imag.fr>
+//
+// Interpolation at geometric points
+// see: Polynomial evaluation and interpolation on special sets
+// of points,
+// A. Bostan and E. Schost,
+// Journal of Complexity 21(4): 420-446, 2005.
+// -------------------------------------------------------------
+
+#include <iostream>
+#include <givaro/givrandom.h>
+#include <givaro/givtimer.h>
+#include <givaro/givgfq.h>
+#include <givaro/givpoly1.h>
+#include <givaro/givinterpgeom.h>
+#include <givaro/givinterpgeom-multip.h>
+
+
+using namespace Givaro;
+
+#ifdef GIVARO_DEBUG
+long long TTcount = 0;
+#endif
+
+struct BlackBoxPolynomial {
+ typedef Poly1Dom<GFqDom<long>,Dense > PolDom_t;
+ typedef PolDom_t::Element Polynomial;
+ typedef PolDom_t::Type_t Type_t;
+
+ const PolDom_t& _PD;
+ Polynomial _func;
+
+
+ BlackBoxPolynomial(const PolDom_t& pold, Polynomial& P)
+ : _PD(pold), _func(P)
+ {}
+
+ Type_t& operator()(Type_t& vi, const Type_t& xi) const {
+ return _PD.eval(vi, _func, xi);
+ }
+
+};
+
+
+struct BlackBoxVectorOfPolynomial {
+ typedef Poly1Dom<GFqDom<long>,Dense > PolDom_t;
+ typedef PolDom_t::Element Polynomial;
+ typedef PolDom_t::Type_t Type_t;
+ typedef std::vector< Type_t > Vect_t;
+ typedef std::vector< Polynomial > VectPoly_t;
+
+ const PolDom_t& _PD;
+ VectPoly_t _func;
+
+
+ BlackBoxVectorOfPolynomial(const PolDom_t& pold, VectPoly_t& P)
+ : _PD(pold), _func(P)
+ {}
+
+ Vect_t& operator()(Vect_t& vi, const Type_t& xi) const {
+ vi.resize(_func.size());
+ Vect_t::iterator iter_vi = vi.begin();
+ VectPoly_t::const_iterator iter_func = _func.begin();
+ for( ; iter_func != _func.end(); ++iter_func, ++iter_vi)
+ _PD.eval(*iter_vi, *iter_func, xi);
+ return vi;
+ }
+
+};
+
+
+template<class Interp, class RandIter>
+bool TestOneField(Interp& FD, RandIter& generator, size_t degmax) {
+
+ typename Interp::Polynomial_t nouv, prec;
+ FD.getpoldomain().random(generator, prec, Degree(degmax) );
+
+#ifdef GIVARO_DEBUG
+ FD.getpoldomain().write(std::cout << "Precedent: ", prec) << std::endl;
+#endif
+
+ BlackBoxPolynomial TestBB(FD.getpoldomain(), prec);
+
+ FD.initialize(TestBB);
+ for(size_t i=1; i<=degmax; ++i)
+ FD(TestBB);
+
+
+ FD.interpolator(nouv);
+#ifdef GIVARO_DEBUG
+ FD.getpoldomain().write(std::cout << "Nouveau: ", nouv) << std::endl;
+#endif
+
+ if (! FD.getpoldomain().areEqual(prec,nouv)) {
+#ifdef GIVARO_DEBUG
+ std::cout << "ERREUR: Precedent != Nouveau" << std::endl;
+#endif
+ return false;
+ }
+
+#ifdef GIVARO_DEBUG
+ ++TTcount;
+#endif
+ return true;
+}
+
+
+template<class Interp, class RandIter>
+bool TestOneFieldVect(Interp& FD, RandIter& generator, size_t degmax, size_t numpol) {
+
+ std::vector<typename Interp::Polynomial_t> nouv(numpol), prec(numpol);
+ for(size_t i=0; i< numpol; ++i) {
+ FD.getpoldomain().random(generator, prec[i], Degree(degmax) );
+#ifdef GIVARO_DEBUG
+ FD.getpoldomain().write(std::cout << "Precedent[" << i << "]: ", prec[i]) << std::endl;
+#endif
+ }
+
+ BlackBoxVectorOfPolynomial TestBB(FD.getpoldomain(), prec);
+
+ FD.initialize(TestBB);
+ for(size_t i=1; i<=degmax; ++i)
+ FD(TestBB);
+
+
+ FD.interpolator(nouv);
+
+#ifdef GIVARO_DEBUG
+ for(size_t i=0; i< numpol; ++i)
+ FD.getpoldomain().write(std::cout << "Nouveau[" << i << "]: ", nouv[i]) << std::endl;
+#endif
+
+
+
+ for(size_t i=0; i< numpol; ++i)
+ if (! FD.getpoldomain().areEqual(prec[i],nouv[i])) {
+#ifdef GIVARO_DEBUG
+ std::cout << "ERREUR: Precedent[" << i << "] != Nouveau[" << i << ']' << std::endl;
+#endif
+ return false;
+ }
+
+#ifdef GIVARO_DEBUG
+ ++TTcount;
+#endif
+ return true;
+}
+
+
+int main(int argc, char ** argv) {
+ // argv[1] : modulo
+ // argv[2] : deg max
+ // argv[3] : num poly max
+ // argv[4] : seed
+
+ GFqDom<long>::Residu_t MOD = (argc>1 ? atoi(argv[1]) : 101);
+ size_t degmax = (argc>2 ? atoi(argv[2]) : 20);
+ size_t numpolmax = (argc>3 ? atoi(argv[3]) : 15);
+
+ size_t seed = (argc>4?atoi(argv[4]):BaseTimer::seed());
+#ifdef GIVARO_DEBUG
+ std::cerr << "seed: " << seed << std::endl;
+#endif
+ GivRandom generator(seed);
+
+ GFqDom<long> F(MOD);
+ NewtonInterpGeom< GFqDom<long> > FD(F, Indeter("X"));
+ NewtonInterpGeomMultip< GFqDom<long> > FDM(F, Indeter("X"));
+
+ bool success = true;
+
+ for(size_t d=1; d<degmax ; ++d)
+ for(size_t i=0; i<50; ++i)
+ success &= TestOneField(FD, generator, d);
+
+ for(size_t p=1; p<numpolmax ; ++p)
+ for(size_t d=1; d<degmax ; ++d)
+ for(size_t i=0; i<5; ++i)
+ success &= TestOneFieldVect(FDM, generator, d, p);
+
+#ifdef GIVARO_DEBUG
+ if (! success) {
+ std::cerr << "Error: " << seed << std::endl;
+ } else {
+ std::cerr << "Success:" << TTcount << std::endl;
+ }
+#endif
+
+ return (! success);
+}
diff --git a/tests/test-ifactor.C b/tests/test-ifactor.C
new file mode 100644
index 0000000..6e8bc97
--- /dev/null
+++ b/tests/test-ifactor.C
@@ -0,0 +1,122 @@
+// Copyright(c)'1994-2010, 2011 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// written by BB
+// see the COPYRIGHT file for more details.
+
+//#include <iostream>
+//#include <givaro/givinit.h>
+#include <givaro/givintfactor.h>
+//#include <givaro/givintprime.h>
+
+#define NB_ITERS 15
+//#define LOOPS 0
+
+using namespace Givaro;
+
+int test(const IntFactorDom<> & IP, const Integer & m)
+{
+
+ Integer f = 1 ;
+ Integer r = 1 ;
+
+ //IP.factor(f,m,LOOPS);
+ IP.factor(f,m) ; // ne teste que Lenstra ou Pollard selon que que GIVARO_LENSTRA est définie ou non
+
+ Integer::mod(r,m,f);
+ if (r || ((f==1 || f==m) && !probab_prime(f)))
+ {
+#ifdef GIVARO_DEBUG
+ if (r)
+ std::cout << "error : factor does not divide integer" << std::endl;
+ else
+ std::cout << "error : " << f << " is no good..." << std::endl;
+#endif
+ return -1 ;
+ }
+
+
+ IP.primefactor(f,m) ; // ne teste que Lenstra ou Pollard selon que que GIVARO_LENSTRA est définie ou non
+ if (r || !probab_prime(f))
+ {
+#ifdef GIVARO_DEBUG
+ if (r)
+ std::cout << "error : factor does not divide integer" << std::endl;
+ else
+ std::cout << "error : " << f << " is no good..." << std::endl;
+#endif
+ return -1 ;
+ }
+
+ return 0 ;
+}
+
+int main()
+{
+ IntFactorDom<> IP;
+ Integer m;
+ m.seeding();
+ int err = 0 ;
+
+ long int a = 3;
+ long int b = 50 ;
+ for (size_t i = 0 ; i < NB_ITERS ; ++i)
+ {
+ //if (!(i%25)) std::cout << i << "..." ;
+ m = Integer::random_between(a,b);
+ err = test(IP,m);
+ if (err) break ;
+ }
+ if (err) return err ;
+
+ a = 1;
+ b = 30 ;
+ for (size_t i = 0 ; i < NB_ITERS ; ++i)
+ {
+ m = Integer::random_between(a,b);
+ err = test(IP,m);
+ if (err) break ;
+ }
+ if (err) return err ;
+
+ // harder :
+ Integer p,q ;
+ a = 19 ;
+ b = 20 ;
+ for (size_t i = 0 ; i < NB_ITERS/2 ; ++i)
+ {
+ p = Integer::random_between(a,b);
+ IP.nextprimein(p);
+ q = Integer::random_between(a,b);
+ IP.nextprimein(q);
+
+ m = p*q ;
+ err = test(IP,m);
+ if (err) break ;
+ }
+ if (err) return err ;
+
+ a = 25 ;
+ b = 26 ;
+ for (size_t i = 0 ; i < NB_ITERS/2 ; ++i)
+ {
+ p = Integer::random_between(a,b);
+ IP.nextprimein(p);
+ q = Integer::random_between(a,b);
+ IP.nextprimein(q);
+
+ m = p*q ;
+ err = test(IP,m);
+ if (err) break ;
+ }
+ if (err) return err ;
+
+#ifdef GIVARO_DEBUG
+ std::cout << "success" <<std::endl;
+#endif
+ return 0;
+}
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/tests/test-integer.C b/tests/test-integer.C
new file mode 100644
index 0000000..62acc81
--- /dev/null
+++ b/tests/test-integer.C
@@ -0,0 +1,187 @@
+// Copyright(c)'1994-2011 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// written by BB
+// see the COPYRIGHT file for more details.
+
+/*! @file tests/test-integer.h
+ * @ingroup tests
+ * tests integer.h fucntions not tested elsewhere.
+ * @test tests integer.h fucntions not tested elsewhere.
+ */
+
+#include "gmp++/gmp++.h"
+
+using namespace Givaro;
+#define _GIV_REPET 10
+
+int test_axpy_unit(const Integer & a, const Integer & b, const Integer & x)
+{
+ Integer y,z ;
+ /* axpy */
+ z = a*x + b ;
+ Integer::axpy(y,a,x,b);
+ if (y != z)
+ return -1 ;
+
+ y = b ;
+ Integer::axpyin(y,a,x);
+ if (y != z)
+ return -2 ;
+
+ y = b ;
+ Integer::axpy(y,a,x,y);
+ if (y != z)
+ return -3 ;
+
+ /* axmy */
+ z = a*x - b ;
+ Integer::axmy(y,a,x,b);
+ if (y != z)
+ return -4 ;
+
+ y = b ;
+ Integer::axmyin(y,a,x);
+ if (y != z)
+ return -5 ;
+
+ y = b ;
+ Integer::axmy(y,a,x,y);
+ if (y != z)
+ return -6 ;
+
+ /* maxpy */
+ z = b - a * x ;
+ Integer::maxpy(y,a,x,b);
+ if (y != z)
+ return -7 ;
+
+ y = b ;
+ Integer::maxpyin(y,a,x);
+ if (y != z)
+ return -8 ;
+
+ y = b ;
+ Integer::maxpy(y,a,x,y);
+ if (y != z)
+ return -9 ;
+
+ return 0 ;
+
+}
+
+int test_axpy()
+{
+ Integer a,x,b ;
+ int res = 0 ;
+ int repet = _GIV_REPET ;
+ while (--repet) {
+ /* axpy */
+ a = Integer::random<false>();
+ b = Integer::random<false>();
+ x = Integer::random<false>();
+ res = test_axpy_unit(a,b,x);
+ if (res)
+ return res ;
+
+ a = 0 ;
+ res = test_axpy_unit(a,b,x);
+ if (res)
+ return res ;
+
+ a = Integer::random<false>();
+ b = 0 ;
+ res = test_axpy_unit(a,b,x);
+ if (res)
+ return res ;
+
+ b = Integer::random<false>();
+ x = 0 ;
+ res = test_axpy_unit(a,b,x);
+ if (res)
+ return res ;
+ }
+
+ return res ;
+}
+
+int test_mul_unit(const Integer & a, const Integer & b)
+{
+ Integer y,z ;
+ /* axpy */
+ z = a*b ;
+ Integer::mul(y,a,b);
+ if (y != z)
+ return -1 ;
+
+ y = b ;
+ Integer::mulin(y,a);
+ if (y != z)
+ return -2 ;
+
+ y = a ;
+ Integer::mul(y,y,b);
+ if (y != z)
+ return -3 ;
+
+ y = b ;
+ Integer::mul(y,a,y);
+ if (y != z)
+ return -3 ;
+
+ z = b * b ;
+ y = b ;
+ Integer::mulin(y,y);
+ if (y != z)
+ return -5 ;
+
+ return 0 ;
+
+}
+
+int test_mul()
+{
+ Integer a,b ;
+ int res = 0 ;
+ int repet = _GIV_REPET ;
+ while (--repet) {
+ /* axpy */
+ a = Integer::random<false>();
+ b = Integer::random<false>();
+ res = test_mul_unit(a,b);
+ if (res)
+ return res ;
+
+ a = 0 ;
+ res = test_mul_unit(a,b);
+ if (res)
+ return res ;
+
+ a = Integer::random<false>();
+ b = 0 ;
+ res = test_mul_unit(a,b);
+ if (res)
+ return res ;
+
+ }
+
+ return res ;
+}
+
+//! @todo test gcd...
+
+int main ()
+{
+ int res = 0 ;
+ res = test_axpy();
+ if (res)
+ return res ;
+
+ res = test_mul();
+ if (res)
+ return res ;
+
+
+ return res ;
+}
diff --git a/tests/test-mod.C b/tests/test-mod.C
new file mode 100644
index 0000000..4cdb9a6
--- /dev/null
+++ b/tests/test-mod.C
@@ -0,0 +1,410 @@
+// Copyright(c)'2010 by The Givaro group
+// This file is part of Givaro.
+// written by BB
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#include <iostream>
+
+#include <givaro/givinteger.h>
+
+using namespace Givaro;
+
+#define SONT_EQ(a,b)\
+ if ( (a) != (b) ) { \
+ std::cout << "erreur à la ligne " << __LINE__ << std::endl; \
+ std::cout << a << "!=" << b << std::endl; \
+ return -1 ; \
+ }
+
+#define NB_ITERS 40
+
+#include <cmath>
+
+template<class U> inline bool IsNeg(const U p) { return (p<0); }
+template<> inline bool IsNeg<unsigned long>(const unsigned long p) { return false; }
+
+template<class T, class U>
+long int ref_modulo(const T m, const U p)
+{
+ Integer M(m);
+ Integer P(p);
+ Integer R ;
+ mpz_mod(R.get_mpz() ,M.get_mpz() ,P.get_mpz());
+ // if (R<0) R+=(P<0)?(-P):(P);
+#if 0
+ Integer Q = M/P ;
+
+ if (Q*P+R != M){
+ bool pass = false ;
+ std::cout << Q << " * " << P << " + " << R << " != " << M << std::endl;
+ std::cout << "ref is no good..." << std::endl ;
+ if (Q<0){
+ if ((Q-1)*P+R != M)
+ pass = true ;
+ } else {
+ if((Q+1)*P+R != M) pass = true ;
+ }
+ }
+ if (R < 0 || R >= GMP__ABS(P)){
+ std::cout << R << " _ " << P << std::endl;
+ std::cout << "ref is no good..." << std::endl ;
+ }
+#endif
+ return R ;
+
+}
+
+template<class T, class U>
+long int ref_modulobis(const T m, const U p)
+{
+ Integer M(m);
+ Integer P(p);
+ Integer R ;
+ mpz_tdiv_r(R.get_mpz() ,M.get_mpz() ,P.get_mpz());
+ return R ;
+
+}
+
+
+// m and p should not be too large
+template< class T, class U>
+int test1( const T m, const U p)
+{/*{{{*/
+ // double pi (p);
+ long int r = ref_modulo(m, p);
+
+ const Integer M(m);
+ const Integer P(p);
+ Integer R ;
+
+ Integer::mod(R,M,P);
+ SONT_EQ(r,R);
+
+ Integer::mod(R,M,p);
+ SONT_EQ(r,R);
+
+
+ Integer R1 = M ;
+ Integer::modin(R1,P);
+ SONT_EQ(R,R1);
+
+ R1 = M ;
+ Integer::modin(R1,p);
+ SONT_EQ(R,R1);
+
+
+ return 0;
+}/*}}}*/
+
+// m and p should not be too large
+template< class T, class U>
+int test1bis( const T m, const U p)
+{/*{{{*/
+ double pi = (double) p;
+ long int r = ref_modulobis(m, p);
+ // if (r<0) r += (IsNeg(p) )?(-p):(p); // r est dans [[0,p-1]]
+ const Integer M(m);
+ const Integer P(p);
+ Integer R =r ;
+
+ Integer R1 = M%p ;
+ SONT_EQ(R,R1);
+
+ Integer R2 = M%P ;
+ SONT_EQ(R,R2);
+
+ Integer R3 = M%pi ;
+ SONT_EQ(R,R3);
+
+
+ R2 = M ;
+ R2 %= P ;
+ SONT_EQ(R,R2);
+
+ return 0;
+}/*}}}*/
+
+int test2(Integer & M, Integer & P)
+{/*{{{*/
+ Integer RR ;
+ Integer MM = M ;
+ Integer PP = P ;
+ // reference
+ mpz_mod(RR.get_mpz() ,MM.get_mpz() ,PP.get_mpz());
+
+ Integer R = 0 ;
+
+ //!@todo existe pas !
+ //R = Integer:: imod(M,P) ;
+ Integer:: mod(R,M,P) ;
+ SONT_EQ(RR,R);
+
+ R = M ;
+ Integer::modin(R,P);
+ SONT_EQ(RR,R);
+
+ return 0;
+}/*}}}*/
+
+int test2bis(Integer & M, Integer & P)
+{/*{{{*/
+ Integer RR ;
+ Integer MM = M ;
+ Integer PP = P ;
+ // reference
+ mpz_tdiv_r(RR.get_mpz() ,MM.get_mpz() ,PP.get_mpz());
+
+ Integer R = 0 ;
+
+ R = M ;
+ R %= P;
+ SONT_EQ(RR,R);
+
+ R = M ;
+ R = M%P;
+ SONT_EQ(RR,R);
+
+ return 0;
+}/*}}}*/
+
+template< class T, class U>
+int test3( const T m, const U p)
+{/*{{{*/
+ int pi = int(p);
+ long int q = m / p;
+ const Integer M(m);
+ const Integer P(p);
+ Integer Q ;
+
+ Integer::div(Q,M,P);
+ SONT_EQ(q,Q);
+
+ Integer Q1 = M/p ;
+ SONT_EQ(Q,Q1);
+
+ Integer Q2 = M/P ;
+ SONT_EQ(Q,Q2);
+
+ Integer Q3 = M/pi ;
+ SONT_EQ(Q,Q3);
+
+ Q1 = M ;
+ Integer::divin(Q1,P);
+ SONT_EQ(Q,Q1);
+
+
+ Q2 = M ;
+ Q2 /= P ;
+ SONT_EQ(Q,Q2);
+
+ return 0;
+}/*}}}*/
+
+#include <cassert>
+
+int main()
+{/*{{{*/
+#if (SIZEOF_LONG==8)
+ long int m = 1253345363665346363;
+#else
+ long int m = 1665346363;
+#endif
+
+ long int p = 78678675;
+ unsigned long int M(m);
+ unsigned long int P(p);
+
+ Integer mone(-1);
+ // CONDITION: mpz_tdiv_ui does NOT consider the sign of gmp_rep
+ assert(mpz_tdiv_ui( (mpz_ptr)&mone, 3) == 1);
+
+ // Integer r ;
+ // Integer a = -6 ;
+ // Integer b = 7 ;
+ // mpz_tdiv_r( (mpz_ptr)&r, (mpz_ptr)&a,(mpz_ptr)&b) ;
+ // std::cout << r << std::endl;
+#if 0
+ for (long i = -11 ; i < 11 ; ++i){
+ long j = 2 ;
+ std::cout << i/j << '=';
+ Integer I = i;
+ Integer J = j ;
+ Integer::divin(I,j);
+ std::cout << I << '=' ;
+ I = i ;
+ std::cout << I/J << '=' ;
+ I /= J ;
+ std::cout << I << " # " ;
+
+ I = i;
+ j = -j ;
+ J = j ;
+ std::cout << i/j << '=';
+ I = i;
+ Integer::divin(I,j);
+ I = i ;
+ std::cout << I/J << "=" ;
+ I /= J ;
+ std::cout << I << "| @" ;
+
+
+
+
+ std::cout << i << std::endl ;
+
+
+ }
+#endif
+
+ int rez = 0;
+
+ rez = test1(m,p); if (rez) return 1 ;
+ rez = test1(-m,p); if (rez) return 2 ;
+ rez = test1(m,-p); if (rez) return 3 ;
+ rez = test1(-m,-p); if (rez) return 4 ;
+
+ rez = test1(m,P); if (rez) return 5 ;
+ rez = test1(m,-P); if (rez) return 6 ; //
+ rez = test1(-m,P); if (rez) return 7 ;
+ // rez = test1(-m,-P); if (rez) return 8 ;
+
+ rez = test1(M,P); if (rez) return 9 ;
+ rez = test1(M,-P); if (rez) return 10 ; //
+ rez = test1(-M,P); if (rez) return 11 ; //
+ // rez = test1(-M,-P); if (rez) return 12 ;
+
+ rez = test1(-M,p); if (rez) return 13 ; //
+ rez = test1(M,-p); if (rez) return 14 ;
+ rez = test1(M,p); if (rez) return 15 ;
+ rez = test1(-M,-p); if (rez) return 16 ; //
+
+ rez = test1(m,m); if (rez) return 16 ;
+ rez = test1(-m,m); if (rez) return 18 ;
+ rez = test1(m,-m); if (rez) return 19 ;
+ rez = test1(-m,-m); if (rez) return 20 ;
+
+ rez = test1(P,P); if (rez) return 21 ;
+ rez = test1(P,-P); if (rez) return 22 ; //
+ rez = test1(-P,P); if (rez) return 23 ; //
+ // rez = test1(-P,-P); if (rez) return 24 ;
+
+
+////////////////////////////////////////
+ rez = test1bis(m,p); if (rez) return 1 ;
+ rez = test1bis(-m,p); if (rez) return 2 ;
+ rez = test1bis(m,-p); if (rez) return 3 ;
+ rez = test1bis(-m,-p); if (rez) return 4 ;
+
+ rez = test1bis(m,P); if (rez) return 5 ;
+ rez = test1bis(m,-P); if (rez) return 6 ; //
+ rez = test1bis(-m,P); if (rez) return 7 ;
+ // rez = test1bis(-m,-P); if (rez) return 8 ;
+
+ rez = test1bis(M,P); if (rez) return 9 ;
+ rez = test1bis(M,-P); if (rez) return 10 ; //
+ rez = test1bis(-M,P); if (rez) return 11 ; //
+ // rez = test1bis(-M,-P); if (rez) return 12 ;
+
+ rez = test1bis(-M,p); if (rez) return 13 ; //
+ rez = test1bis(M,-p); if (rez) return 14 ;
+ rez = test1bis(M,p); if (rez) return 15 ;
+ rez = test1bis(-M,-p); if (rez) return 16 ; //
+
+ rez = test1bis(m,m); if (rez) return 16 ;
+ rez = test1bis(-m,m); if (rez) return 18 ;
+ rez = test1bis(m,-m); if (rez) return 19 ;
+ rez = test1bis(-m,-m); if (rez) return 20 ;
+
+ rez = test1bis(P,P); if (rez) return 21 ;
+ rez = test1bis(P,-P); if (rez) return 22 ; //
+ rez = test1bis(-P,P); if (rez) return 23 ; //
+ // rez = test1bis(-P,-P); if (rez) return 24 ;
+
+
+////////////////////////////////////////
+
+
+ rez = test3(p,m); if (rez) return 11 ;
+ rez = test3(-p,m); if (rez) return 12 ;
+ rez = test3(p,-m); if (rez) return 13 ;
+ rez = test3(-p,-m); if (rez) return 14 ;
+
+ rez = test3(m,p); if (rez) return 11 ;
+ rez = test3(-m,p); if (rez) return 12 ;
+ rez = test3(m,-p); if (rez) return 13 ;
+ rez = test3(-m,-p); if (rez) return 14 ;
+
+ rez = test3(m,P); if (rez) return 15 ;
+ // rez = test3(m,-P); if (rez) return 16 ;
+ // rez = test3(-m,P); if (rez) return 17 ;
+ // rez = test3(-m,-P); if (rez) return 18 ;
+
+ rez = test3(M,P); if (rez) return 19 ;
+ // rez = test3(M,-P); if (rez) return 110 ;
+ rez = test3(-M,P); if (rez) return 111 ;
+ // rez = test3(-M,-P); if (rez) return 112 ;
+
+ rez = test3(-M,p); if (rez) return 113 ;
+ // rez = test3(M,-p); if (rez) return 114 ;
+ rez = test3(M,p); if (rez) return 115 ;
+ // rez = test3(-M,-p); if (rez) return 116 ;
+
+ rez = test3(m,m); if (rez) return 116 ;
+ rez = test3(-m,m); if (rez) return 118 ;
+ rez = test3(m,-m); if (rez) return 119 ;
+ rez = test3(-m,-m); if (rez) return 120 ;
+
+ rez = test3(P,P); if (rez) return 121 ;
+ // rez = test3(P,-P); if (rez) return 122 ;
+ rez = test3(-P,P); if (rez) return 123 ;
+ // rez = test3(-P,-P); if (rez) return 124 ;
+
+
+
+ for (unsigned i = 0 ; i < NB_ITERS ; ++i)
+ {
+ Integer Mint = Integer::random_between(680,700);
+ Integer Pint = Integer::random_between(134,198);
+ rez = test2(Mint,Pint); if (rez) return 7 ;
+ Integer::negin(Mint);
+ rez = test2(Mint,Pint); if (rez) return 8 ;
+ Integer::negin(Pint);
+ rez = test2(Mint,Pint); if (rez) return 9 ;
+ Integer::negin(Mint);
+ rez = test2(Mint,Pint); if (rez) return 10 ;
+ }
+ for (unsigned i = 0 ; i < NB_ITERS ; ++i)
+ {
+ Integer Mint = Integer::random_between(680,700);
+ Integer Pint = Integer::random_between(134,198);
+ rez = test2bis(Mint,Pint); if (rez) return 7 ;
+ Integer::negin(Mint);
+ rez = test2bis(Mint,Pint); if (rez) return 8 ;
+ Integer::negin(Pint);
+ rez = test2bis(Mint,Pint); if (rez) return 9 ;
+ Integer::negin(Mint);
+ rez = test2bis(Mint,Pint); if (rez) return 10 ;
+ }
+
+ //std::cout << "ok6" << std::endl;
+
+ rez = test1(0,p); if (rez) return 21 ;
+ rez = test1(0,-p); if (rez) return 22 ;
+ rez = test1bis(0,p); if (rez) return 21 ;
+ rez = test1bis(0,-p); if (rez) return 22 ;
+
+
+ rez = test3(0,p); if (rez) return 23 ;
+ rez = test3(0,-p); if (rez) return 24 ;
+
+ //std::cout << "ok7" << std::endl;
+
+
+
+ return 0;
+}/*}}}*/
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/tests/test-modsqroot.C b/tests/test-modsqroot.C
new file mode 100644
index 0000000..fb20021
--- /dev/null
+++ b/tests/test-modsqroot.C
@@ -0,0 +1,75 @@
+// =================================================================== //
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// Time-stamp: <20 Jan 11 11:04:19 Jean-Guillaume.Dumas at imag.fr>
+// Givaro : Modular square roots
+// =================================================================== //
+
+/*! @file examples/Integer/ModularSquareRoot.C
+ * @ingroup examples
+ * @ingroup integers
+ * @example examples/Integer/ModularSquareRoot.C
+ * @brief NO DOC
+ */
+#include <iostream>
+#include <stdlib.h>
+#include <givaro/givintsqrootmod.h>
+#include <givaro/givtimer.h>
+
+using namespace Givaro;
+IntSqrtModDom<> ISM;
+
+bool TestSrqtMod(const Integer& z, const Integer& n) {
+ Integer a(z),b,x,r;
+ ISM.modin(a,n);
+ ISM.modin(ISM.mul(b,a,a),n); // b is now a square mod n
+ ISM.sqrootmod(x,b,n);
+ if (ISM.areEqual( ISM.modin(ISM.mul(r,x,x),n), b) ) {
+ return true;
+ } else {
+ std::cerr << "TestSrqtMod ERROR" << std::endl;
+ std::cerr << "n:= " << n << ';' << std::endl;
+ std::cerr << "a:= " << a << ';' << std::endl;
+ std::cerr << "x:= " << x << ';' << std::endl;
+ std::cerr << "r:= " << r << ';' << std::endl;
+
+ return false;
+ }
+}
+
+int main(int argc, char** argv) {
+ int nbtests = (argc>1?atoi(argv[1]):100);
+ int sizes = (argc>2?atoi(argv[2]):10);
+ unsigned long seed = (argc>3?atoi(argv[3]):BaseTimer::seed ());
+ int failures = 0;
+// std::cerr << "Seed: " << seed << std::endl;
+ Integer::seeding (seed);
+ Integer a,n;
+ Integer ThreeToHundred;
+ pow(ThreeToHundred,Integer(3),100UL);
+
+ for(int i=0; i<nbtests; ++i) {
+
+ Integer::random(a,sizes);
+ Integer::nonzerorandom(n,sizes);
+ while(n<=1) Integer::nonzerorandom(n,sizes);
+
+ if (! TestSrqtMod(a,n)) ++failures;
+
+ n <<= (129);
+ n *= ThreeToHundred;
+
+// ISM.write(std::cerr, n) << std::endl;
+
+ if (! TestSrqtMod(a,n)) ++failures;
+
+
+ }
+
+ if (failures > 0) std::cerr << "test-modsqroot: " << failures << " failures." << std::endl;
+
+ return failures;
+}
diff --git a/tests/test-random.C b/tests/test-random.C
new file mode 100644
index 0000000..d356399
--- /dev/null
+++ b/tests/test-random.C
@@ -0,0 +1,560 @@
+// Copyright(c)'2010 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+// written by BB.
+
+/** @file tests/test-random.C
+ * @ingroup tests
+ * @brief we test bounds for random Integers
+ * @test we test bounds for random Integers
+ */
+
+#include <iostream>
+#include <givaro/givinteger.h>
+
+using namespace Givaro;
+//#define GIVARO_DEBUG
+using std::cout ; using std::endl;
+
+//! tests <code>ret= .func(arg,arg);</code> ...
+int test1()
+{/*{{{*/
+ Integer toto ;
+ toto.seeding((long unsigned int)0);
+#ifdef GIVARO_DEBUG
+ cout << "this is a random() number : " << toto.random() << endl;
+#else
+ toto.random();
+#endif
+
+ Integer un(26);
+ Integer autre(511);
+#ifdef GIVARO_DEBUG
+ cout << "random...............OK" << endl;
+#endif
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = toto.random_between(un,autre);
+ //cout << tata << endl;
+ if (tata < un || tata >= autre) {
+ cout << "random_between failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_between.......OK" << endl;
+#endif
+
+ unsigned long trois = 3 ;
+ unsigned long petits = 6 ;
+ //std::vector<int> T(1<<petits) ;
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = toto.random_between(trois,petits);
+ //cout << tata << endl;
+ //T[tata] += 1 ;
+ if (tata < (1<<trois) || tata >= (1<<petits) ) {
+ cout << "random_between_exp failed" << endl;
+ return -1 ;
+ }
+ }
+ // for (size_t i = 0 ; i < 1<<petits ; ++i) cout << T[i] << " " ;
+#ifdef GIVARO_DEBUG
+ cout << "random_between_exp...OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = toto.random_exact(petits);
+ if ( tata.bitsize() != petits ) {
+ // cout << tata << endl;
+ cout << "random_exact_exp failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact_exp.....OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = toto.random_exact(autre);
+ // cout << tata << endl;
+ if ( tata.bitsize() != autre.bitsize() ){
+ cout << "random_exact failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact.........OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = toto.nonzerorandom(petits);
+ if (tata == 0 || tata >= 1<<petits) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom_exp....OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = toto.nonzerorandom(autre);
+ if (tata == 0 || tata >= autre) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom........OK" << endl;
+#endif
+
+ return 0;
+
+}/*}}}*/
+
+//! tests <code>ret= ::func(arg,arg);</code>
+int test2()
+{/*{{{*/
+ Integer un(26);
+ Integer autre(511);
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = Integer::random_between(un,autre);
+ //cout << tata << endl;
+ if (tata < un || tata >= autre) {
+ cout << "random_between failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_between.......OK" << endl;
+#endif
+
+ unsigned long trois = 3 ;
+ unsigned long petits = 6 ;
+ //std::vector<int> T(1<<petits) ;
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = Integer::random_between(trois,petits);
+ //cout << tata << endl;
+ //T[tata] += 1 ;
+ if (tata < (1<<trois) || tata >= (1<<petits) ) {
+ cout << "random_between_exp failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ // for (size_t i = 0 ; i < 1<<petits ; ++i) cout << T[i] << " " ;
+ cout << "random_between_exp...OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = Integer::random_exact(petits);
+ if ( tata.bitsize() != petits ) {
+ // cout << tata << endl;
+ cout << "random_exact_exp failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact_exp.....OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = Integer::random_exact(autre);
+ // cout << tata << endl;
+ if ( tata.bitsize() != autre.bitsize() ){
+ cout << "random_exact failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact.........OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = Integer::nonzerorandom(petits);
+ if (tata == 0 || tata >= 1<<petits) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom_exp....OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer tata = Integer::nonzerorandom(autre);
+ if (tata == 0 || tata >= autre) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom........OK" << endl;
+#endif
+
+ return 0;
+
+}/*}}}*/
+
+//! tests <code>::func(ret,arg,arg);</code>
+int test3()
+{/*{{{*/
+ Integer un(26);
+ Integer autre(511);
+ Integer tata ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_between(tata,un,autre);
+ //cout << tata << endl;
+ if (tata < un || tata >= autre) {
+ cout << "random_between failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_between.......OK" << endl;
+#endif
+
+ unsigned long trois = 3 ;
+ unsigned long petits = 6 ;
+ //std::vector<int> T(1<<petits) ;
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_between(tata,trois,petits);
+ //cout << tata << endl;
+ //T[tata] += 1 ;
+ if (tata < (1<<trois) || tata >= (1<<petits) ) {
+ cout << "random_between_exp failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ // for (size_t i = 0 ; i < 1<<petits ; ++i) cout << T[i] << " " ;
+ cout << "random_between_exp...OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_exact(tata,petits);
+ if ( tata.bitsize() != petits ) {
+ // cout << tata << endl;
+ cout << "random_exact_exp failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact_exp.....OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_exact(tata,autre);
+ // cout << tata << endl;
+ if ( tata.bitsize() != autre.bitsize() ){
+ cout << "random_exact failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact.........OK" << endl;
+#endif
+ const Integer tutu(autre);
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_exact(tata,tutu);
+ // cout << tata << endl;
+ if ( tata.bitsize() != tutu.bitsize() ){
+ cout << "random_exact failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random_exact.........OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::nonzerorandom(tata,petits);
+ if (tata == 0 || tata >= 1<<petits) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom_exp....OK" << endl;
+#endif
+
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::nonzerorandom(tata,autre);
+ if (tata == 0 || tata >= autre) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom........OK" << endl;
+#endif
+
+ return 0;
+
+}/*}}}*/
+
+//! test possibly <0 random numbers
+int test4()
+{/*{{{*/
+ Integer un(26);
+ Integer autre(511);
+ Integer tata ;
+ int count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ if (Integer::RandBool()) Integer::negin(un) ;
+ if (Integer::RandBool()) Integer::negin(autre) ;
+ if (un>autre) std::swap(un,autre); // un < autre
+ Integer::random_between(tata,un,autre);
+ //cout << tata << endl;
+ if (tata < un || tata >= autre) {
+ cout << "random_between failed" << endl;
+ return -1 ;
+ }
+ if (tata<0) ++count;
+ }
+ if ( !count ) {
+ cout << "random_between failed" << endl;
+ return -1 ;
+ }
+
+#ifdef GIVARO_DEBUG
+ cout << "random_between.......OK" << endl;
+#endif
+
+ unsigned long petits = 6 ;
+ //std::vector<int> T(1<<petits) ;
+
+ count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_exact<false>(tata,petits);
+ if (tata<0) ++count ;
+ if ( tata.bitsize() != petits) {
+ //cout << tata << endl;
+ cout << "random_exact_exp failed" << endl;
+ return -1 ;
+ }
+ }
+ if ( !count ) {
+ cout << "random_exact_exp failed" << endl;
+ return -1 ;
+ }
+
+#ifdef GIVARO_DEBUG
+ cout << "random_exact_exp.....OK" << endl;
+#endif
+
+ count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::random_exact<false>(tata,autre);
+ // cout << tata << endl;
+ if (tata<0) ++count ;
+ if ( tata.bitsize() != autre.bitsize() ){
+ cout << "random_exact failed" << endl;
+ return -1 ;
+ }
+ }
+ if ( ! count ){
+ cout << "random_exact failed" << endl;
+ return -1 ;
+ }
+
+#ifdef GIVARO_DEBUG
+ cout << "random_exact.........OK" << endl;
+#endif
+
+ count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::nonzerorandom<false>(tata,petits);
+ if (tata<0) count ++ ;
+ if (tata == 0 || tata >= 1<<petits) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count){
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom_exp....OK" << endl;
+#endif
+
+ count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ Integer::nonzerorandom<false>(tata,autre);
+ if (tata<0) ++ count ;
+ if (tata == 0 || tata >= autre) {
+ // cout << tata << endl;
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "nonzerorandom failed" << endl;
+ return -1 ;
+ }
+#ifdef GIVARO_DEBUG
+ cout << "nonzerorandom........OK" << endl;
+#endif
+
+ return 0;
+
+}/*}}}*/
+
+//! tests standard interface
+int test5()
+{
+ Integer tata = 0 ;
+ size_t count = 0 ;
+#if (__GIVARO_SIZEOF_LONG==8) // BB : todo init to int64_t (either 'long' (64) or 'long long' (32))
+ Integer toto(int64_t(15615486489765487));
+#else
+ Integer toto(15615486);
+#endif
+ unsigned long l = 5 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ tata = Integer::random<false>() ;
+ if (tata<0) ++ count ;
+ if (tata.bitsize() > 8*sizeof(mp_limb_t)) {
+ //cout << tata << endl;
+ cout << "random() failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "random() failed" << endl;
+ return -1 ;
+ }
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ tata = Integer::random() ;
+ if (tata<0 || tata.bitsize() > 8*sizeof(mp_limb_t)) {
+ //cout << tata << endl;
+ cout << "random() failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "random() failed" << endl;
+ return -1 ;
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random().............OK" << endl;
+#endif
+
+ count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ tata = Integer::random<false>(l) ;
+ if (tata<0) ++ count ;
+ if (tata.bitsize() > l) {
+ //cout << tata << endl;
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "random() failed" << endl;
+ return -1 ;
+ }
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ tata = Integer::random(l) ;
+ if (tata<0 || tata.bitsize() > l) {
+ //cout << tata << endl;
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random...............OK" << endl;
+#endif
+
+ count = 0 ;
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ tata = Integer::random<false>(toto) ;
+ if (tata<0) ++ count ;
+ if (tata>toto || tata < -toto) {
+ //cout << tata << endl;
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+ for (size_t i = 0 ; i < 5000 ; ++i) {
+ tata = Integer::random(toto) ;
+ if (tata<0 || tata>toto) {
+ //cout << tata << endl;
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+ }
+ if (!count)
+ {
+ cout << "random failed" << endl;
+ return -1 ;
+ }
+#ifdef GIVARO_DEBUG
+ cout << "random...............OK" << endl;
+#endif
+ return 0 ;
+
+}
+
+int main()
+{/*{{{*/
+#ifdef GIVARO_DEBUG
+ std::cout << "T1" << std::endl;
+ if (test1()) return -1;
+ std::cout << "T2" << std::endl;
+ if (test2()) return -1;
+ std::cout << "T3" << std::endl;
+ if (test3()) return -1;
+ std::cout << "T4" << std::endl;
+ if (test4()) return -1;
+ std::cout << "T5" << std::endl;
+ if (test5()) return -1;
+#else
+ if (test1()) return -1;
+ if (test2()) return -1;
+ if (test3()) return -1;
+ if (test4()) return -1;
+ if (test5()) return -1;
+#endif
+
+ /* check seeding */
+ Integer toto, tata ;
+ Integer::seeding(3);
+ toto = Integer::random();
+ Integer::seeding(3);
+ tata = Integer::random();
+ if (toto != tata) return -1 ;
+
+ return 0 ;
+
+}/*}}}*/
+
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
diff --git a/tests/test-ratrecon.C b/tests/test-ratrecon.C
new file mode 100644
index 0000000..9c5fdde
--- /dev/null
+++ b/tests/test-ratrecon.C
@@ -0,0 +1,164 @@
+// Copyright(c)'1994-2009,2010 by The Givaro group
+// This file is part of Givaro.
+// BB: adapted,enhanced from examples/FiniteFields/ff-arith.C
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#include <iostream>
+#include <givaro/givpoly1.h>
+#include <givaro/givfractiondomain.h>
+#include <givaro/givzpz64std.h>
+
+#ifdef GIVARO_DEBUG
+long long TTcount = 0;
+#endif
+
+using namespace Givaro;
+
+#define TEST_EQ( F, a, b ) \
+if (!F.areEqual((a),(b))) {\
+ F.write( F.write(std::cout,a) << "!=",b) << " failed (at line " << __LINE__ << ')' << std::endl; \
+ return(-1); \
+}
+
+template<class PDomain>
+int TestRR(PDomain& PolDom, GivRandom& generator, const Degree d) {
+
+// std::cout << "Start: " << d << std::endl;
+
+
+ typename PDomain::Element P,Q,R,S,M,A,B, G;
+ PolDom.random(generator, M, (d << 1) + 2);
+
+ Degree dG;
+ do {
+ PolDom.random(generator, Q, d);
+ PolDom.getdomain().assign(Q[Q.size()-1], PolDom.getdomain().one);
+ PolDom.gcd(G, M, Q);
+ PolDom.degree(dG, G);
+ } while( dG > 0);
+ do {
+ PolDom.random(generator, P, d-1);
+ PolDom.gcd(G, P, Q);
+ PolDom.degree(dG, G);
+ } while( dG > 0);
+
+
+ PolDom.invmod(R,Q,M);
+// PolDom.write(std::cout << "R1:= ", R) << ';' << std::endl;
+ PolDom.mulin(R, P);
+// PolDom.write(std::cout << "R2:= ", R) << ';' << std::endl;
+ PolDom.modin(R, M);
+// PolDom.write(std::cout << "R3:= ", R) << ';' << std::endl;
+ PolDom.ratrecon(A,B,R,M,d);
+
+ typename PDomain::Type_t lc;
+ PolDom.leadcoef(lc, B);
+ PolDom.divin(A, lc);
+ PolDom.divin(B, lc);
+
+ PolDom.invmod(S,B,M);
+// PolDom.write(std::cout << "S1:= ", S) << ';' << std::endl;
+ PolDom.mulin(S, A);
+// PolDom.write(std::cout << "S2:= ", S) << ';' << std::endl;
+ PolDom.modin(S, M);
+// PolDom.write(std::cout << "S3:= ", S) << ';' << std::endl;
+
+
+// PolDom.write(std::cout << "M:= ", M) << ';' << std::endl;
+// PolDom.write(std::cout << "P:= ", P) << ';' << std::endl;
+// PolDom.write(std::cout << "Q:= ", Q) << ';' << std::endl;
+// PolDom.write(std::cout << "R:= ", R) << ';' << std::endl;
+// PolDom.write(std::cout << "A:= ", A) << ';' << std::endl;
+// PolDom.write(std::cout << "B:= ", B) << ';' << std::endl;
+// PolDom.write( PolDom.write(std::cout << "P/Q: ", P) << "/", Q) << std::endl;
+// PolDom.write( PolDom.write(std::cout << "A/B: ", A) << "/", B) << std::endl;
+
+
+// TEST_EQ(PolDom, A, P);
+// TEST_EQ(PolDom, B, Q);
+ TEST_EQ(PolDom, S, R);
+
+#ifdef GIVARO_DEBUG
+ ++TTcount;
+#endif
+ return 0;
+
+}
+
+
+
+
+int main(int argc, char ** argv)
+{
+
+ int seed = int(argc>1?atoi(argv[1]):BaseTimer::seed());
+#ifdef GIVARO_DEBUG
+ std::cerr << "seed: " << seed << std::endl;
+#endif
+ Integer::seeding(seed);
+ GivRandom generator(seed);
+
+ typedef ZpzDom<Std64> Field;
+ typedef Poly1Dom< Field, Dense > PolyZpz;
+ typedef FracDom<PolyZpz> FracZpz;
+ typedef Poly1Dom< FracZpz, Dense > PolyFracZpz;
+
+ Field F101(101);
+ Field F2(2);
+ Field F65521(65521);
+ bool success = true;
+
+ {
+ PolyZpz PZ(F101,"X");
+ for(size_t j=0; j<4; ++j)
+ for(Degree i=1; i<Degree(30); ++i)
+ success &= (! TestRR(PZ, generator, i) );
+
+ PolyFracZpz PFZ(PZ,"Y");
+ for(size_t j=0; j<2; ++j)
+ for(Degree i=2; i<Degree(5); ++i)
+ success &= (! TestRR(PFZ, generator, i) );
+
+ }
+
+ {
+ PolyZpz PZ(F2,"X");
+ for(size_t j=0; j<4; ++j)
+ for(Degree i=5; i<Degree(50); ++i)
+ success &= (! TestRR(PZ, generator, i) );
+
+ PolyFracZpz PFZ(PZ,"Y");
+ for(size_t j=0; j<3; ++j)
+ for(Degree i=7; i<Degree(15); ++i)
+ success &= (! TestRR(PFZ, generator, i) );
+
+ }
+
+ {
+ PolyZpz PZ(F65521,"X");
+ for(size_t j=0; j<5; ++j)
+ for(Degree i=1; i<Degree(30); ++i)
+ success &= (! TestRR(PZ, generator, i) );
+ PolyFracZpz PFZ(PZ,"Y");
+ for(size_t j=0; j<2; ++j)
+ for(Degree i=2; i<Degree(5); ++i)
+ success &= (! TestRR(PFZ, generator, i) );
+
+ }
+
+
+
+
+
+#ifdef GIVARO_DEBUG
+ if (! success) {
+ std::cerr << "Error: " << seed << std::endl;
+ } else {
+ std::cerr << "Success:" << TTcount << std::endl;
+ }
+#endif
+
+ return (! success);
+}
diff --git a/tests/test-ringarith.C b/tests/test-ringarith.C
new file mode 100644
index 0000000..94de5bc
--- /dev/null
+++ b/tests/test-ringarith.C
@@ -0,0 +1,377 @@
+// Copyright(c)'1994-2009,2010 by The Givaro group
+// This file is part of Givaro.
+// BB: adapted,enhanced from examples/FiniteFields/ff-arith.C
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#include <iostream>
+#include "givaro/givzpz16std.h"
+#include "givaro/givzpz16table1.h"
+#include "givaro/givzpz32std.h"
+#include "givaro/givzpz32uns.h"
+#include <givaro/givzpzInt.h>
+#include <givaro/givzpz64std.h>
+#include <givaro/givzpz.h>
+#include <givaro/givpoly1.h>
+
+#include <givaro/givinteger.h>
+using namespace Givaro;
+
+#ifdef GIVARO_DEBUG
+long long TTcount = 0;
+#endif
+
+
+#define TESTE_EG( a, b ) \
+if (!F.areEqual((a),(b))) {\
+ F.write( F.write(std::cout,a) << "!=",b) << " failed (at line " << __LINE__ << ")" << std::endl; \
+ return(-1); \
+}
+
+#define JETESTE( a, s ) \
+if (TestRing( (a), (s)) ) {\
+ std::cout << #a << " failed !" << std::endl;\
+ return -1 ; \
+}
+
+#define JEPOLTESTE( a, s ) \
+if (TestPolRing( (a), (s) ) ) {\
+ std::cout << #a << " failed !" << std::endl;\
+ return -1 ; \
+}
+
+#define JEONETESTE( F, a, x ) \
+if (TestOneRing(F,a,x)) {\
+ std::cout << #a << " failed !" << std::endl;\
+ return -1 ; \
+}
+
+
+template<class R, class T1, class T2>
+struct InitOrAssign {
+ void operator()(const R& r, T1& t1, const T2& t2) {
+ r.init(t1,t2);
+ }
+};
+
+
+template<class R, class T>
+struct InitOrAssign<R,T,T> {
+ void operator()(const R& r, T& t1, const T& t2) {
+ r.assign(t1,t2);
+ }
+};
+
+
+
+
+template<class Ring, class T1, class T2>
+int TestOneRing(const Ring& F, const T1 FIRSTINT, const T2 FIRSTFLOAT)
+{/*{{{*/
+#ifdef GIVARO_DEBUG
+ std::cerr << "testing " ;
+ F.write(std::cerr );
+ std::cerr << " : " << std::flush;
+#endif
+
+ typename Ring::Element a, b, c, d,a_,b_,c_,d_;
+ typename Ring::Element e,e_;
+
+ F.init(a, 0UL);
+ TESTE_EG(a, F.zero);
+ F.init(a, 1UL);
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a: ", a) << std::endl;
+// F.write(std::cerr << "1: ", F.one) << std::endl;
+ TESTE_EG(a, F.one);
+
+ InitOrAssign<Ring,typename Ring::Element,T1>()(F, a, FIRSTINT);
+ InitOrAssign<Ring,typename Ring::Element,T2>()(F, b, FIRSTFLOAT);
+// F.init(a, FIRSTINT);
+// F.init(b, FIRSTFLOAT);
+
+ F.init(c); // empty constructor
+ F.init(d); // empty constructor
+
+ F.add(c, a, b); // c = a+b
+ F.init(c_); //! @warning F.init(c_,c); ne marche pas !
+ F.assign(c_,c); // c_ <- c
+ TESTE_EG(c,c_);
+ F.subin(c_,a);
+// F.write(std::cerr) << std::endl;
+// F.write(std::cerr << "a: ", a) << std::endl;
+// F.write(std::cerr << "b: ", b) << std::endl;
+// F.write(std::cerr << "c: ", c) << std::endl;
+// F.write(std::cerr << "c_: ", c_) << std::endl;
+
+ TESTE_EG(b,c_);
+
+ F.axpy(d, a, b, c); // d = a*b + c;
+ F.init(d_);
+ F.axmy(d_,a,b,c); // d_ = a*b - c
+ F.addin(d_,c);
+ F.subin(d,c);
+
+ TESTE_EG(d_,d);
+
+ F.axpy(d, a, b, c); // d = a*b + c;
+ F.init(d_);
+ F.assign(d_,c);
+ F.axpyin(d_,a,b);
+ TESTE_EG(d_, d);
+
+
+ F.sub(d,a,b); // d = a -b
+ F.add(c,a,b); // c = a+b
+ F.init(e);
+ F.init(e_);
+ F.mul(e,d,c); // e = d*c;
+ F.mul(a_,a,a); // a_ = a*a
+ F.mul(b_,b,b); // b_ = b*b
+ F.sub(e_,a_,b_); // e_ = a_ - b_
+
+ TESTE_EG(e,e_) // a^2 - b^2 = (a-b)(a+b) ;
+
+
+
+ F.maxpy(e, a, b, d); // e = d-a*b
+
+ F.assign(e_,d);
+ F.maxpyin(e_, a, b); // e = d - a*b;
+
+ TESTE_EG(e,e_);
+
+
+ F.axmy(e, a, b, d); // e = a*b -d;
+
+ F.assign(e_,d);
+ F.maxpyin(e_, a, b); // e = d - a*b;
+
+ F.negin(e_);
+
+ TESTE_EG(e,e_);
+
+ F.maxpy(e, a, b, d); // e = d-a*b;
+
+ F.assign(e_,d);
+ F.axmyin(e_, a, b); // e = a*b-e=a*b-d;
+
+ F.negin(e_);
+
+ TESTE_EG(e,e_);
+
+
+
+#ifdef GIVARO_DEBUG
+ F.write(std::cerr );
+ std::cerr << " done." << std::endl;
+ ++TTcount;
+#endif
+ return 0 ;
+
+}/*}}}*/
+
+#define NBITER 50
+
+template<class Ring>
+int TestRing(const Ring& F, const int seed)
+{/*{{{*/
+ long ch = F.characteristic();
+ JEONETESTE(F,7UL,-29.3);
+ srand48(seed);
+ for(size_t i=0; i< NBITER; ++i) {
+ typename Ring::Element x;
+ float d;
+ do {
+ d = float((double)ch*drand48()) ;
+ F.init(x,d );
+ } while(F.isZero(x));
+ int a; do {
+ F.init(x, a = (int)lrand48());
+ } while(F.isZero(x));
+ JEONETESTE(F,x,d);
+ }
+ return 0;
+}/*}}}*/
+
+#define DEGMAX 75
+#define NBITERD 10
+
+template<class Ring>
+int TestPolRing(const Ring& F, const int seed)
+{/*{{{*/
+ GivRandom generator(seed);
+ srand48(seed);
+
+ for(size_t i=0; i< NBITERD; ++i) {
+ int d1 = int (lrand48() % DEGMAX);
+ int d2 = int (lrand48() % DEGMAX);
+#ifdef GIVARO_DEBUG
+ std::cout << d1 << ' ' << d2 << ' ';
+#endif
+ typename Ring::Element x, d;
+ do {
+ F.random(generator, x, Degree(d1));
+ } while(F.isZero(x));
+ do {
+ F.random(generator, d, Degree(d2));
+ } while(F.isZero(x));
+ JEONETESTE(F,x,d);
+ }
+ return 0;
+}/*}}}*/
+
+int main(int argc, char ** argv)
+{/*{{{*/
+ int seed = int(argc>1?atoi(argv[1]):BaseTimer::seed());
+#ifdef GIVARO_DEBUG
+ std::cerr << "seed: " << seed << std::endl;
+#endif
+ Integer::seeding(seed);
+
+
+ // modulo 13 over 16 bits
+ ZpzDom<Std16> C13(13);
+ JETESTE(C13,seed);
+
+ // modulo 13 over 32 bits
+ ZpzDom<Std32> Z13(13);
+ JETESTE(Z13,seed);
+
+ // modulo 13 over unsigned 32 bits
+ ZpzDom<Unsigned32> U13(13);
+ JETESTE(U13,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // modulo 13 over 64 bits
+ ZpzDom<Std64> LL13(13UL);
+ JETESTE(LL13,seed);
+#endif
+
+ // modulo 13 over arbitrary size
+ ZpzDom<Integer> IntZ13(13);
+ JETESTE(IntZ13,seed);
+
+
+ // modulo 2 over 16 bits
+ ZpzDom<Std16> C2(2);
+ JETESTE(C2,seed);
+
+ // modulo 2 over 32 bits
+ ZpzDom<Std32> Z2(2);
+ JETESTE(Z2,seed);
+
+ // modulo 2 over unsigned 32 bits
+ ZpzDom<Unsigned32> U2(2);
+ JETESTE(U2,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // modulo 2 over 64 bits
+ ZpzDom<Std64> LL2(2UL);
+ JETESTE(LL2,seed);
+#endif
+
+ // modulo 2 fully tabulated
+ ZpzDom<Log16> L2(2);
+ JETESTE(L2,seed);
+
+ // modulo 13 over arbitrary size
+ ZpzDom<Integer> IntZ2(2);
+ JETESTE(IntZ2,seed);
+
+// --------------------------------------------
+ // modulo 4 over 16 bits
+ ZpzDom<Std16> C4(4);
+ JETESTE(C4,seed);
+
+ // modulo 4 over 32 bits
+ ZpzDom<Std32> Z4(4);
+ JETESTE(Z4,seed);
+
+ // modulo 4 over unsigned 32 bits
+ ZpzDom<Unsigned32> U4(4);
+ JETESTE(U4,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // modulo 2 over 64 bits
+ ZpzDom<Std64> LL4(4UL);
+ JETESTE(LL4,seed);
+#endif
+
+ // modulo 13 over arbitrary size
+ ZpzDom<Integer> IntZ4(4);
+ JETESTE(IntZ4,seed);
+
+// --------------------------------------------
+ // modulo 75 over 16 bits
+ ZpzDom<Std16> C75(75);
+ JETESTE(C75,seed);
+
+ // modulo 75 over 32 bits
+ ZpzDom<Std32> Z75(75);
+ JETESTE(Z75,seed);
+
+ // modulo 75 over unsigned 32 bits
+ ZpzDom<Unsigned32> U75(75);
+ JETESTE(U75,seed);
+
+#ifdef __USE_Givaro_SIXTYFOUR__
+ // modulo 2 over 675 bits
+ ZpzDom<Std64> LL75(75UL);
+ JETESTE(LL75,seed);
+#endif
+
+ // modulo 13 over arbitrary size
+ ZpzDom<Integer> IntZ75(75);
+ JETESTE(IntZ75,seed);
+
+
+ Poly1Dom< ZpzDom<Std16>, Dense > CP13(C13, "X");
+ JETESTE(CP13,seed); JEPOLTESTE(CP13,seed);
+ Poly1Dom< ZpzDom<Std32>, Dense > ZP13(Z13, "X");
+ JETESTE(ZP13,seed); JEPOLTESTE(ZP13,seed);
+
+ Poly1Dom< ZpzDom<Unsigned32>, Dense > UP13(U13, "X");
+ JETESTE(UP13,seed); JEPOLTESTE(UP13,seed);
+
+ Poly1Dom< ZpzDom<Std64>, Dense > LLP13(LL13, "X");
+ JETESTE(LLP13,seed); JEPOLTESTE(LLP13,seed);
+
+ Poly1Dom< ZpzDom<Integer>, Dense > IntZP13(IntZ13, "X");
+ JETESTE(IntZP13,seed); JEPOLTESTE(IntZP13,seed);
+
+
+
+ Poly1Dom< ZpzDom<Std16>, Dense > CP75(C75, "X");
+ JEPOLTESTE(CP75,seed);
+
+ Poly1Dom< ZpzDom<Std32>, Dense > ZP75(Z75, "X");
+ JEPOLTESTE(ZP75,seed);
+
+ Poly1Dom< ZpzDom<Unsigned32>, Dense > UP75(U75, "X");
+ JEPOLTESTE(UP75,seed);
+
+ Poly1Dom< ZpzDom<Std64>, Dense > LLP75(LL75, "X");
+ JEPOLTESTE(LLP75,seed);
+
+ Poly1Dom< ZpzDom<Integer>, Dense > IntZP75(IntZ75, "X");
+ JEPOLTESTE(IntZP75,seed);
+
+
+
+ Poly1Dom< Poly1Dom< ZpzDom<Integer>, Dense >, Dense> IntZPP75(IntZP75, "Y");
+ JEPOLTESTE(IntZPP75,seed);
+
+ Poly1Dom< Poly1Dom< Poly1Dom< ZpzDom<Integer>, Dense >, Dense>, Dense > IntZPPP75(IntZPP75, "Z");
+ JEPOLTESTE(IntZPPP75,seed);
+
+#ifdef GIVARO_DEBUG
+ std::cerr << std::endl << "Success:" << TTcount << std::endl;
+#endif
+
+ return 0;
+}/*}}}*/
+
+/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen
diff --git a/tests/test-trunc.C b/tests/test-trunc.C
new file mode 100644
index 0000000..f610649
--- /dev/null
+++ b/tests/test-trunc.C
@@ -0,0 +1,418 @@
+// Copyright(c)'1994-2009 by The Givaro group
+// This file is part of Givaro.
+// Givaro is governed by the CeCILL-B license under French law
+// and abiding by the rules of distribution of free software.
+// see the COPYRIGHT file for more details.
+
+#include <iostream>
+#include <givaro/givrandom.h>
+#include <givaro/givtimer.h>
+#include <givaro/givgfq.h>
+#include <givaro/givpoly1.h>
+#include <givaro/givtruncdomain.h>
+
+using namespace Givaro;
+
+long long TTcount = 0;
+
+bool TestAdd(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V, S, U, W;
+ DP.add ( R, P, Q, d1, d2); // R = P+Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.add (T, P, Q);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ S = P; U = P;
+ DP.addin(S,Q,d1,d2);
+ DP.addin(U,Q);
+ W=U;
+ DP.truncin(W,d1,d2);
+
+ if( DP.areNEqual( V, R) || DP.areNEqual(W, S) || DP.areNEqual(V, W) ) {
+ std::cerr << "ERROR ADD:" << TTcount << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestSub(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V, S, U, W;
+ DP.sub ( R, P, Q, d1, d2); // R = P-Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.sub (T, P, Q);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ S = P; U = P;
+ DP.subin(S,Q,d1,d2);
+ DP.subin(U,Q);
+ W=U;
+ DP.truncin(W,d1,d2);
+
+ if( DP.areNEqual( V, R) || DP.areNEqual(W, S) || DP.areNEqual(V, W) ) {
+ std::cerr << "ERROR SUB:" << TTcount << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestMul(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V, S, U, W;
+ DP.mul ( R, P, Q, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.mul (T, P, Q);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ S = P; U = P;
+ DP.mulin(S,Q,d1,d2);
+ DP.mulin(U,Q);
+ W=U;
+ DP.truncin(W,d1,d2);
+
+ if( DP.areNEqual( V, R) || DP.areNEqual(W, S) || DP.areNEqual(V, W) ) {
+ std::cerr << "ERROR MUL:" << TTcount << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestAxpy(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, const TruncDom< GFqDom<int> >::Element& G, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V, S, U, W;
+ DP.axpy ( R, P, Q, G, d1, d2); // R = P*Q+G;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") * (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.axpy (T, P, Q, G);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ S = G; U = G;
+ DP.axpyin(S,P,Q,d1,d2);
+ DP.axpyin(U,P,Q);
+ W=U;
+ DP.truncin(W,d1,d2);
+
+ if( DP.areNEqual( V, R) || DP.areNEqual(W, S) || DP.areNEqual(V, W) ) {
+ DP.write(std::cerr << "ERROR Axpy: ") << std::endl;
+ std::cout << " d1:= " << d1 << ';' << std::endl;
+ std::cout << " d2:= " << d2 << ';' << std::endl;
+ DP.write(std::cout << " P:= " , P) << ';' << std::endl;
+ DP.write(std::cout << " Q:= " , Q) << ';' << std::endl;
+ DP.write(std::cout << " G:= " , G) << ';' << std::endl;
+ DP.write(std::cout << " R:= " , R) << ';' << std::endl;
+ DP.write(std::cout << " T:= " , T) << ';' << std::endl;
+ DP.write(std::cout << " V:= " , V) << ';' << std::endl;
+ DP.write(std::cout << " S:= " , S) << ';' << std::endl;
+ DP.write(std::cout << " U:= " , U) << ';' << std::endl;
+ DP.write(std::cout << " W:= " , W) << ';' << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree dG; DP.degree(dG,G);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ Degree vG; DP.val(vG,G);
+ std::cerr << "vP: " << vP << ", dP: " << dP << ", vQ: " << vQ << ", dQ: " << dQ << ", vG: " << vG << ", dG: " << dG << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestAxmy(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, const TruncDom< GFqDom<int> >::Element& G, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V, S, U, W;
+ DP.axmy ( R, P, Q, G, d1, d2); // R = P*Q-G;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.axmy (T, P, Q, G);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ S = G; U = G;
+ DP.axmyin(S,P,Q,d1,d2);
+ DP.axmyin(U,P,Q);
+ W=U;
+ DP.truncin(W,d1,d2);
+
+ if( DP.areNEqual( V, R) || DP.areNEqual(W, S) || DP.areNEqual(V, W) ) {
+ std::cerr << "ERROR Axmy:" << std::endl;
+ std::cout << " d1:= " << d1 << ';' << std::endl;
+ std::cout << " d2:= " << d2 << ';' << std::endl;
+ DP.write(std::cout << " P:= " , P) << ';' << std::endl;
+ DP.write(std::cout << " Q:= " , Q) << ';' << std::endl;
+ DP.write(std::cout << " G:= " , G) << ';' << std::endl;
+ DP.write(std::cout << " R:= " , R) << ';' << std::endl;
+ DP.write(std::cout << " T:= " , T) << ';' << std::endl;
+ DP.write(std::cout << " V:= " , V) << ';' << std::endl;
+ DP.write(std::cout << " S:= " , S) << ';' << std::endl;
+ DP.write(std::cout << " U:= " , U) << ';' << std::endl;
+ DP.write(std::cout << " W:= " , W) << ';' << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+bool TestMaxpy(const TruncDom< GFqDom<int> >& DP, const TruncDom< GFqDom<int> >::Element& P, const TruncDom< GFqDom<int> >::Element& Q, const TruncDom< GFqDom<int> >::Element& G, size_t d1, size_t d2)
+{
+ ++TTcount;
+ TruncDom< GFqDom<int> >::Element R, T, V, S, U, W;
+ DP.maxpy ( R, P, Q, G, d1, d2); // R = P*Q;
+// DP.write( DP.write(
+// std::cout << "[(" , P ) << ") + (", Q) << ")]_" << d1 << '^' << d2 ;
+// DP.write(std::cout << " = " , R) << std::endl;
+
+ DP.maxpy (T, P, Q, G);
+ V=T;
+ DP.truncin(V,d1,d2);
+
+ S = G; U = G;
+ DP.maxpyin(S,P,Q,d1,d2);
+ DP.maxpyin(U,P,Q);
+ W=U;
+ DP.truncin(W,d1,d2);
+
+ if( DP.areNEqual( V, R) || DP.areNEqual(W, S) || DP.areNEqual(V, W) ) {
+ std::cerr << "ERROR Maxpy:" << std::endl;
+ DP.write(std::cout << " R: " , R) << std::endl;
+ DP.write(std::cout << " T: " , T) << std::endl;
+ DP.write(std::cout << " V: " , V) << std::endl;
+ Degree dP; DP.degree(dP,P);
+ Degree dQ; DP.degree(dQ,Q);
+ Degree vP; DP.val(vP,P);
+ Degree vQ; DP.val(vQ,Q);
+ std::cerr << "vR: " << vP << ", dR: " << dP << ", vP: " << vQ << ", dP: " << dQ << ", v: " << d1 << ", d: " << d2 << std::endl;
+ return false;
+ }
+ return true;
+}
+
+
+int main(int argc, char ** argv) {
+
+ long seed = (argc>1?atoi(argv[1]):BaseTimer::seed());
+#ifdef GIVARO_DEBUG
+ std::cerr << "seed: " << seed << std::endl;
+#endif
+
+ GFqDom<int> Z101( 101, 1 ); // integers modulo 101
+
+ // Polynomials over Z101, with X as indeterminate
+ TruncDom< GFqDom<int> > DP101( Z101, Indeter("X") );
+ TruncDom< GFqDom<int> >::Element P, Q, R, monomial;
+ GFqDom<int>::Element tmp;
+
+ DP101.assign( P, Z101.init(tmp,5) ); // P is degree 0 polynomial : 5 modulo 101
+ DP101.init( monomial, Degree(1), 33UL) ; // -33 X
+ Degree deg,val;
+ DP101.degree(deg,monomial);
+ DP101.val(val,monomial);
+ DP101.addin( P, monomial ); // P += monomial
+ DP101.init( monomial, Degree(2), 12UL) ; // 12 X^2
+ DP101.addin( P, monomial ); // P is now 5-33*X+12*X^2
+
+// // DP101.read( std::cin, P); // would read P as a succession of integers :
+// // deg leadcoeff (lead-1)coeff ... unitcoeff
+ Q = P;
+
+ DP101.init( Q, Degree(0), 6UL );
+ DP101.init( monomial, Degree(4), 3UL);
+ DP101.addin( Q, monomial) ;
+ DP101.init( monomial, Degree(1), 75UL);
+ DP101.addin( Q, monomial) ;
+ DP101.init( monomial, Degree(3), 45UL);
+ DP101.subin( Q, monomial) ;
+ // Q is now 3*X^4+75*X-45*X^3+6
+
+ DP101.mulin( Q, Degree(15) ) ;
+ DP101.mulin( monomial, Degree(32));
+ DP101.addin( Q, monomial) ;
+ DP101.subin( Q, monomial) ;
+
+ DP101.divin( Q, Degree(5) ) ;
+ DP101.divin( monomial, Degree(12));
+ DP101.addin( Q, monomial) ;
+ DP101.subin( Q, monomial) ;
+
+ DP101.divin( monomial, Degree(10));
+ DP101.addin( Q, monomial) ;
+ DP101.subin( Q, monomial) ;
+
+ DP101.divin( monomial, Degree(10));
+ DP101.addin( Q, monomial) ;
+ DP101.subin( Q, monomial) ;
+ DP101.setval(Q);
+
+ DP101.mulin( P, Degree(15) ) ;
+
+ DP101.mul ( R, P, Q); // R = P*Q;
+ DP101.mul ( R, P, Q, Degree(28), Degree(30)); // R = P*Q;
+ DP101.mul ( R, P, Q, Degree(0), Degree(30)); // R = P*Q;
+ DP101.mul ( R, P, Q, Degree(28), Degree(100)); // R = P*Q;
+ DP101.mul ( R, P, Q, Degree(4), Degree(10)); // R = P*Q;
+ DP101.mul ( R, P, Q, Degree(75), Degree(100)); // R = P*Q;
+ DP101.setval(R);
+ DP101.mulin( Q, Degree(3) ) ;
+
+ DP101.add ( R, P, Q); // R = P*Q;
+
+
+
+
+ bool success;
+
+ success = TestAdd(DP101, P, Q, 28, 30);
+ success &= TestAdd(DP101, P, Q, 0, 30);
+ success &= TestAdd(DP101, P, Q, 28, 100);
+ success &= TestAdd(DP101, P, Q, 4, 10);
+ success &= TestAdd(DP101, P, Q, 75, 100);
+ success &= TestAdd(DP101, P, Q, 12, 18);
+ success &= TestAdd(DP101, P, Q, 13, 18);
+ success &= TestAdd(DP101, P, Q, 14, 18);
+ success &= TestAdd(DP101, P, Q, 15, 18);
+ success &= TestAdd(DP101, P, Q, 16, 18);
+ success &= TestAdd(DP101, P, Q, 17, 18);
+ success &= TestAdd(DP101, P, Q, 18, 18);
+ success &= TestAdd(DP101, P, Q, 12, 17);
+ success &= TestAdd(DP101, P, Q, 13, 17);
+ success &= TestAdd(DP101, P, Q, 14, 17);
+ success &= TestAdd(DP101, P, Q, 15, 17);
+ success &= TestAdd(DP101, P, Q, 16, 17);
+ success &= TestAdd(DP101, P, Q, 17, 17);
+ success &= TestAdd(DP101, P, Q, 12, 16);
+ success &= TestAdd(DP101, P, Q, 13, 16);
+ success &= TestAdd(DP101, P, Q, 14, 16);
+ success &= TestAdd(DP101, P, Q, 15, 16);
+ success &= TestAdd(DP101, P, Q, 16, 16);
+ success &= TestAdd(DP101, P, Q, 12, 15);
+ success &= TestAdd(DP101, P, Q, 13, 15);
+ success &= TestAdd(DP101, P, Q, 14, 15);
+ success &= TestAdd(DP101, P, Q, 15, 15);
+ success &= TestAdd(DP101, P, Q, 12, 14);
+ success &= TestAdd(DP101, P, Q, 13, 14);
+ success &= TestAdd(DP101, P, Q, 14, 14);
+ success &= TestAdd(DP101, P, Q, 12, 13);
+ success &= TestAdd(DP101, P, Q, 13, 13);
+ success &= TestAdd(DP101, P, Q, 12, 12);
+
+ success &= TestAdd(DP101, Q, P, 12, 18);
+ success &= TestAdd(DP101, Q, P, 13, 18);
+ success &= TestAdd(DP101, Q, P, 14, 18);
+ success &= TestAdd(DP101, Q, P, 15, 18);
+ success &= TestAdd(DP101, Q, P, 16, 18);
+ success &= TestAdd(DP101, Q, P, 17, 18);
+ success &= TestAdd(DP101, Q, P, 18, 18);
+ success &= TestAdd(DP101, Q, P, 12, 17);
+ success &= TestAdd(DP101, Q, P, 13, 17);
+ success &= TestAdd(DP101, Q, P, 14, 17);
+ success &= TestAdd(DP101, Q, P, 15, 17);
+ success &= TestAdd(DP101, Q, P, 16, 17);
+ success &= TestAdd(DP101, Q, P, 17, 17);
+ success &= TestAdd(DP101, Q, P, 12, 16);
+ success &= TestAdd(DP101, Q, P, 13, 16);
+ success &= TestAdd(DP101, Q, P, 14, 16);
+ success &= TestAdd(DP101, Q, P, 15, 16);
+ success &= TestAdd(DP101, Q, P, 16, 16);
+ success &= TestAdd(DP101, Q, P, 12, 15);
+ success &= TestAdd(DP101, Q, P, 13, 15);
+ success &= TestAdd(DP101, Q, P, 14, 15);
+ success &= TestAdd(DP101, Q, P, 15, 15);
+ success &= TestAdd(DP101, Q, P, 12, 14);
+ success &= TestAdd(DP101, Q, P, 13, 14);
+ success &= TestAdd(DP101, Q, P, 14, 14);
+ success &= TestAdd(DP101, Q, P, 12, 13);
+ success &= TestAdd(DP101, Q, P, 13, 13);
+ success &= TestAdd(DP101, Q, P, 12, 12);
+
+ success &= TestAxpy(DP101, P,Q,R, 1, 2);
+ success &= TestAxmy(DP101, P,Q,R, 1, 2);
+ success &= TestMaxpy(DP101, P,Q,R, 1, 2);
+
+
+ GivRandom generator(seed);
+
+ for(size_t i=0; i<100; ++i) {
+ long deg1 = generator() % 75;
+ long deg2 = generator() % 85;
+ long deg3 = generator() % 155;
+ long v1 = generator() % 195;
+ long v2 = v1 + (generator() % 5);
+ DP101.random(generator, P, Degree(deg1) );
+ DP101.random(generator, Q, Degree(deg2) );
+ DP101.random(generator, R, Degree(deg3) );
+ Degree dP; DP101.degree(dP,P);
+ Degree dQ; DP101.degree(dQ,Q);
+ Degree dR; DP101.degree(dR,R);
+ Degree vP; DP101.val(vP,P);
+ Degree vQ; DP101.val(vQ,Q);
+ Degree vR; DP101.val(vR,R);
+ success &= TestAdd(DP101, P, Q, v1, v2 );
+ success &= TestSub(DP101, P, Q, v1, v2 );
+ success &= TestMul(DP101, P, Q, v1, v2 );
+ success &= TestAxpy(DP101, P, Q, R, v1, v2 );
+ success &= TestAxmy(DP101, P, Q, R, v1, v2 );
+ success &= TestMaxpy(DP101, P, Q, R, v1, v2 );
+ }
+
+ success &= TestAxpy(DP101, P, Q, monomial, 11, 11);
+
+#ifdef GIVARO_DEBUG
+ if (! success) {
+ std::cerr << "Error: " << seed << std::endl;
+ } else {
+ std::cerr << "Success:" << TTcount << std::endl;
+ }
+#endif
+
+ return (! success);
+}
--
givaro: library for arithmetic and algebraic computations
More information about the debian-science-commits
mailing list